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

Source: https://junglewise.ai/threats/cve-2026-33891-digital-bazaar-node-forge-infinite-loop-in-biginteger-modinverse  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-27. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/node-forge), [Red Hat Developer Hub](https://junglewise.ai/threats/technologies/developer-hub). Vendors: [npm](https://junglewise.ai/threats/vendors/npm), [Red Hat](https://junglewise.ai/threats/vendors/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

  ```sh
  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

- [https://github.com/digitalbazaar/forge/security/advisories/GHSA-5m6q-g25r-mvwx](https://github.com/digitalbazaar/forge/security/advisories/GHSA-5m6q-g25r-mvwx)
- [https://github.com/digitalbazaar/forge/commit/9bb8d67b99d17e4ebb5fd7596cd699e11f25d023](https://github.com/digitalbazaar/forge/commit/9bb8d67b99d17e4ebb5fd7596cd699e11f25d023)
- [https://github.com/digitalbazaar/forge](https://github.com/digitalbazaar/forge)

## Related threats

- [Forge: Ed25519 signature verification accepts small-order public keys](https://junglewise.ai/threats/cve-2026-125335-forge-also-called-node-forge-is-a-native-implementation-of)
- [Forge TLS client crash on handshake record without session](https://junglewise.ai/threats/cve-2026-125334-forge-also-called-node-forge-is-a-native-implementation-of)
- [Forge HTTP ReDoS in response header parsing](https://junglewise.ai/threats/cve-2026-125333-forge-also-called-node-forge-is-a-native-implementation-of)
- [Forge TLS client crash on unsupported ServerHello compression](https://junglewise.ai/threats/cve-2026-125332-forge-also-called-node-forge-is-a-native-implementation-of)
- [Forge RSA PKCS#1 v1.5 signature forgery via non-canonical DigestInfo encoding](https://junglewise.ai/threats/cve-2026-119192-forge-rsa-pkcs-1-v1-5-signature-forgery-via-non-canonical)
