CVE-2026-140099: Forge: RSA multi-prime private keys are read as two-prime keys, and signatures leak a factor of the modulus
Forge, also called node-forge, is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.4, pki.privateKeyFromPem() and pki.privateKeyFromAsn1() ignore the RSAPrivateKey version and otherPrimeInfos fields and interpret a multi-prime RSA private key as a two-prime key. Signing then uses CRT values for only the first two primes, producing an invalid signature from which an observer can recover a factor of the modulus and reduce the effective strength of the key; two-prime keys are not affected. This issue is fixed in 1.4.4.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
node-forgeto a version that resolves this vulnerability.Fixed in 1.4.4
Event History
Frequently Asked Questions
Which deployments are affected?
Deployments using node-forge versions prior to 1.4.4 are affected only if they load and use multi-prime RSA private keys through pki.privateKeyFromPem() or pki.privateKeyFromAsn1(). Standard two-prime RSA keys are not affected.
What does an attacker need to exploit this issue?
An attacker needs to observe a signature generated after a multi-prime RSA key has been parsed as a two-prime key. The malformed signature can reveal a factor of the RSA modulus, reducing the key's effective strength.
How can I determine whether I am exposed?
Check whether your application uses node-forge before version 1.4.4 and imports RSA private keys with pki.privateKeyFromPem() or pki.privateKeyFromAsn1(). Exposure requires those imported keys to be multi-prime RSA keys rather than ordinary two-prime keys.
What should be done if affected?
Update node-forge to version 1.4.4. If a vulnerable deployment has generated signatures using a multi-prime key, treat that key as potentially weakened because observers may have recovered a modulus factor.