Missing Cryptographic Step Affecting node-forge package, versions <1.4.4


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.28% (23rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-NODEFORGE-23188830
  • published1 Dec 2026
  • disclosed30 Nov 2026
  • creditUnknown

Introduced: 30 Nov 2026

NewCVE-2026-140099  (opens in a new tab)
CWE-325  (opens in a new tab)
CWE-347  (opens in a new tab)

How to fix?

Upgrade node-forge to version 1.4.4 or higher.

Overview

node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.

Affected versions of this package are vulnerable to Missing Cryptographic Step via pki.privateKeyFromPem() and pki.privateKeyFromAsn1() in lib/rsa.js, which ignore the RSAPrivateKey version field and the otherPrimeInfos field, causing a multi-prime RSA private key (RFC 8017 A.1.2, version 1) to be silently loaded as a two-prime key. Signing with the resulting key uses CRT values for only the first two primes, producing an invalid signature from which any observer can compute gcd(s^e - EM, n) to recover a factor of the modulus, reducing the effective security of a 2048-bit three-prime key to approximately that of a 1366-bit RSA key.

Note: This is only exploitable when a multi-prime RSA private key (generated with, for example, openssl genpkey -pkeyopt rsa_keygen_primes:3) is loaded and used for signing. Two-prime keys, which are the default output of OpenSSL, Node.js, and most other tools, are not affected.

Workaround

Avoid loading multi-prime RSA private keys with node-forge. Before loading a key from an untrusted or unknown source, verify that its RSAPrivateKey version field is 0. Any multi-prime key that was already used to sign with node-forge should be replaced, as its signatures have revealed a factor of the modulus.

CVSS Base Scores

version 4.0
version 3.1