CVE-2026-140099
### Summary `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. ### Details 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. For a signature s made this way, s^e equals the encoded message modulo p*q but not modulo n, so gcd(s^e - EM, n) = p*q, where EM is the PKCS#1 encoding of the signed message, which a verifier can compute. One signature therefore splits n into p*q and the product of the other primes. For a three-prime key (the usual case; OpenSSL with `rsa_keygen_primes:3`) this reveals the third prime and leaves a two-prime modulus of about two thirds of the size: for a 2048-bit key, a 1366-bit RSA modulus instead of 2048 bits. Decryption with such a key fails, and the signatures don't verify, so applications that use a multi-prime key with forge see errors immediately. Keys generated by forge, by OpenSSL by default, by Node.js and by most other tools are two-prime and not affected. The fix rejects RSAPrivateKeys with a version other than 0 or with otherPrimeInfos ("Only two-prime RSAPrivateKey version 0 is supported."). This also rejects two-prime keys with an invalid version, as reported in https://github.com/digitalbazaar/forge/is
Properties
- Severity
- low
- Summary
- Forge: RSA multi-prime private keys are read as two-prime keys, and signatures leak a factor of the modulus
- Nvd fetched at
- 2026-12-02T06:37:54.190518+00:00
- Epss score
- 0.00281
- Cvss severity
- LOW
- Cvss score
- 3.7
- Retrieved at
- 2026-12-02T06:40:14+00:00
- Ghsa published
- 2026-12-01T18:42:05Z
- Source url
- https://github.com/advisories/GHSA-w73w-hhm4-q25p
- Ghsa updated
- 2026-12-01T18:42:06Z
- Ghsa id
- GHSA-w73w-hhm4-q25p
- Last source
- FIRST EPSS
- Score
- 3.7
- Cvss version
- 3.1
- Cve id
- CVE-2026-140099
- Cvss vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
- First seen by Signal
- 2026-12-01T02:29:47+00:00
- Name
- CVE-2026-140099
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
Related Entities (4)
HAS_WEAKNESS (2)
AFFECTS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph