CVE-2026-140099 — Node-forge — CWE-20 · CWE-325
### 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
### 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
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-140099
CVSS 3.7/10 · LOW · 30.11.2026
CWE: CWE-20, CWE-325
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Summary: ### 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.
Affected: node-forge
⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · no user interaction (UI:N).
🌍 REAL WORLD IMPACT
All confidential data readable/stealable.
🛡️ REMEDIATION
→ Apply vendor security update for node-forge.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
📌 Low priority — routine update sufficient.
────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]
FOFA Query