npm
CVE-2026-140099
Forge: RSA multi-prime private keys are read as two-prime keys, and signatures leak a factor of the modulus
- Severity
- Low 3.7
- Published
- 1 Dec 2026
- Last changed
- 1 Dec 2026
- Added to UpHeron
- 1 Dec 2026
- Fixed in
- 1.4.4
- Exploit chance
- 0.3% in the next 30 daysHigher than 22% of CVEs. EPSS by FIRST, 1 Dec 2026
- Attack
- Over the network · Only under certain conditions · No login needed · No user action needed
- Attacker can
- Read some data
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N- Also known as
- GHSA-w73w-hhm4-q25p
- Sources
- OSV.dev and GitHub
Description
pki.privateKeyFromPem() and pki.privateKeyFromAsn1() ignore the RSAPrivateKey version and the otherPrimeInfos field, so a multi-prime RSA key is read with only its first two primes. Signatures made with such a key are invalid, and each one reveals a factor of the modulus to anyone who sees it. Fixed in node-forge 1.4.4.
RFC 8017 (A.1.2) allows RSA private keys with more than two primes: version 1, with the extra primes in otherPrimeInfos. node-forge only supports two-prime keys, but pki.privateKeyFromAsn1() in lib/rsa.js (used by pki.privateKeyFromPem(), PKCS#8 and PKCS#12 key parsing) never checked the version, and ASN.1 validation ignores the extra field. A multi-prime key is therefore read as if it were a two-prime key with modulus n, primes p and q, and the CRT values for p and q.
forge's private-key operation uses the CRT with p and q, so its result is correct modulo p*q but not modulo the remaining primes.
Workarounds
Don't use multi-prime RSA keys with node-forge. Before loading a key from an untrusted or unknown source, check that its RSAPrivateKey version is 0. Multi-prime keys that were used to sign with node-forge should be replaced, since their signatures reveal a factor of the modulus.
Affected software
| Software | Affected versions |
|---|---|
node-forgenpm · osv:npm:node-forge |
|
About node-forge
- Weekly downloads (npm)
- 52,415,507npm, 1 Dec 2026
Vulnerabilities in node-forge
- In our list
- 22
- Published in the last 12 months
- 22
- Critical, last 12 months
- 0
- High, last 12 months
- 8
- Known exploited
- 0
- CVE-2026-85393node-forge: RSA PKCS#1 v1.5 signature forgery via extra elements in nested DigestAlgorithmHigh 7.5 1 Dec 2026
- CVE-2026-125335Forge: Ed25519 signature verification accepts small-order public keysLow 3.7 10 Nov 2026
- CVE-2026-125332Forge: TLS client crash on an unsupported ServerHello compression methodMedium 5.9 10 Nov 2026
- CVE-2026-125333Forge: ReDoS in forge.http response header and cookie trimmingMedium 5.9 10 Nov 2026
- CVE-2026-125334Forge: TLS client crash on a handshake record received without a sessionMedium 5.9 10 Nov 2026
- CVE-2026-118774Forge: Certificate signature verified with the issuer's RSA signature schemeLow 3.7 10 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-140099
- GitHub Advisory Database https://github.com/advisories/GHSA-w73w-hhm4-q25p