CVE-2026-33891: Digital Bazaar node-forge infinite loop in BigInteger.modInverse

CVE-2026-33891 · Severity: high · CVSS 7.5 · Published 2026-03-27

node-forge is a widely-used JavaScript cryptography library that provides TLS and other cryptographic tools. A flaw in its BigInteger modular inverse calculation causes an infinite loop when processing zero values, allowing an attacker to crash applications by supplying crafted cryptographic parameters (such as a zero signature value) that trigger the vulnerable function. A single malicious request can hang the entire application indefinitely.

Technologies: node-forge (npm), Red Hat Developer Hub. Vendors: npm, Red Hat.

Quick answers

Is CVE-2026-33891 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-33891 being exploited in the wild.
How severe is CVE-2026-33891?
High severity, with a CVSS score of 7.5, published 27 March 2026.
Which products and versions are affected?
node-forge (npm) SEMVER:introduced=0,fixed=1.4.0; Red Hat Developer Hub 1.8, 1.9.
Is there a fix for CVE-2026-33891?
Yes. node-forge (npm): upgrade to 1.4.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-33891 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-33891?
Check whether you run node-forge (npm) or Red Hat Developer Hub at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • node-forge (npm): upgrade to 1.4.0 or later
    npm install node-forge@1.4.0

Technical details

The vulnerability is a denial-of-service flaw in the BigInteger.modInverse() function (CWE-835: Loop with Unreachable Exit Condition) inherited from the bundled jsbn library. The Extended Euclidean Algorithm implementation lacks input validation for zero values; when modInverse(0) is called, the loop condition is never satisfied and the process enters an infinite loop, consuming 100% CPU and blocking the Node.js event loop. The vulnerability is reachable via network if an application processes untrusted cryptographic parameters—for example, a DSA/ECDSA signature with s=0 would trigger s.modInverse(q), or any custom RSA/Diffie-Hellman implementation handling user-supplied modular arithmetic. No privileges or user interaction are required. The fix (patch in version 1.4.0+) adds a zero-value check that throws an error before entering the algorithm.

Affected products

  • Digital Bazaar node-forge <= 1.3.1

Identifiers

  • CVE-2026-33891
  • GHSA-5m6q-g25r-mvwx

Timeline

  • 2026-03-26: disclosed: Public advisory published
  • 2026-03-24: patched: Patch available in version 1.4.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.