Infinite loop Affecting node-forge package, versions <1.4.1


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.12% (2nd 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-22113958
  • published1 Nov 2026
  • disclosed30 Oct 2026
  • creditwzc

Introduced: 30 Oct 2026

NewCVE-2026-118781  (opens in a new tab)
CWE-835  (opens in a new tab)

How to fix?

Upgrade node-forge to version 1.4.1 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 Infinite loop in the BigInteger.prototype.modInverse method in the bundled jsbn library (lib/jsbn.js). An attacker can spin the calling thread at 100% CPU and block the Node.js event loop by supplying a negative operand or negative modulus to modInverse, whose binary extended Euclidean algorithm is defined only for positive integers and so never reaches its loop exit condition. This is reachable only when an application passes an untrusted RSA public exponent to forge.pki.rsa.generateKeyPair(), createKeyPairGenerationState(), or stepKeyPairGenerationState() (any exponent other than 3 or 65537 takes the pure-JavaScript path), or calls modInverse() directly on negative values derived from untrusted input, while data parsed by node-forge such as DER, PEM, JWK, PKCS#12, X.509, and TLS is read as unsigned and cannot trigger it.

Note: This is a bypass of the fix for the vulnerability described in CVE-2026-33891.

CVSS Base Scores

version 4.0
version 3.1