Skip to main content

node-forge CVE-2026-118781

| EUVDEUVD-2026-113339 LOW
Loop with Unreachable Exit Condition (Infinite Loop) (CWE-835)
2026-10-29 GitHub_M GHSA-h6cr-wjv9-3cpp
2.9
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach app endpoint that builds RSA keys
  2. Delivery
    Submit negative/invalid public exponent e
  3. Exploit
    Value reaches BigInteger.modInverse() in jsbn
  4. Execution
    Binary extended Euclidean loop never terminates
  5. Persist
    Thread spins at 100% CPU, event loop blocked
  6. Impact
    Service-wide denial of service

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Loop termination conditions
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitable only when the application passes an attacker-controlled RSA public exponent 'e' into forge.pki.rsa.generateKeyPair(), forge.pki.rsa.createKeyPairGenerationState(), or forge.pki.rsa.stepKeyPairGenerationState(), or calls forge.jsbn.BigInteger#modInverse() directly with a negative value or modulus derived from untrusted input. A negative (or otherwise sign-negative) operand is required; RFC 8017 requires e >= 3, so compliant exponents like 65537 never trigger it. Key limiting factors: the trigger is reachable only through the pure-JavaScript code path (any exponent other than 3 or 65537), it requires the application to forward untrusted input to key generation (a non-default, application-specific code path), and values node-forge parses from DER, PEM, JWK, PKCS#12, X.509, and TLS are always unsigned and CANNOT reach this bug. Impact is limited to CPU exhaustion / event-loop blocking; there is no confidentiality or integrity effect and memory does not grow.

Impact

This is a genuinely low-priority issue, and the available signals agree. The CVSS 3.1 base score is 2.9 (Low) with vector CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L - local attack vector, high complexity, no privileges, no user interaction, and availability-only impact (no confidentiality or integrity loss). The vuln.today decision label is 'monitor', consistent with the low score. No EPSS score was provided in the input, and there is no CISA KEV listing, so there is no evidence of active exploitation. A public proof-of-concept does exist inside the GHSA-h6cr-wjv9-3cpp advisory (a three-line snippet that hangs the process), but this demonstrates only the denial-of-service hang, not code execution or data compromise. The practical risk is tightly bounded by the trigger condition: the flaw is only reachable when an application passes an attacker-controlled RSA public exponent to node-forge key generation, or calls BigInteger#modInverse() directly with negative untrusted operands. The advisory explicitly states that all values node-forge parses (DER, PEM, JWK, PKCS#12, X.509, TLS) are read as unsigned and cannot trigger the issue, and that documented key-generation usage passes a constant exponent (65537). Note a minor cross-signal nuance: the vendor CVSS 3.1 vector uses AC:H while the informational CVSS 4.0 vector uses AC:L with AT:P (present attack requirement); both rate the issue Low and the vendor states the 3.1 rating governs. The realistic worst case is a single-threaded Node.js process spinning at 100% CPU with its event loop blocked; memory does not grow.

Exploit ScenarioDerived

An application exposes RSA key generation and forwards a user-supplied public exponent directly into forge.pki.rsa.generateKeyPair({e: ...}) (or the createKeyPairGenerationState/stepKeyPairGenerationState variants). An attacker submits a negative exponent such as e = -1, which reaches BigInteger.modInverse() and enters an infinite loop, pinning the CPU and blocking the Node.js event loop so the service stops handling all other requests. A public proof-of-concept demonstrating the hang is included in the GHSA advisory.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 29, 2026

Node-forge versions through 1.4.0 hang indefinitely at 100% CPU when BigInteger.prototype.modInverse() receives a negative value or negative modulus, and in forge this is reachable by passing a negative RSA public exponent e to forge.pki.rsa.generateKeyPair() or the stateful key-generation APIs. The flaw is an incomplete fix of CVE-2026-33891, which only guarded against a zero operand; only applications that forward untrusted input as the RSA exponent, or call modInverse() directly with negative operands, are affected, while keys parsed from DER, PEM, JWK, PKCS#12, X.509 and TLS are unsigned and cannot trigger it. No public exploit code or active exploitation is identified, the vendor rates it Low (CVSS 3.1: 2.9), and a documented proof of concept shows a single call blocking the Node.js event loop; version 1.4.1 resolves it.

RemediationAI

Vendor-released patch: node-forge 1.4.1, which changes the guard in lib/jsbn.js bnpModInverse to return zero when either the value or the modulus is negative (commit e96c47b7f006dec66fb7bb1934e7375498b04a72, release https://github.com/digitalbazaar/forge/releases/tag/v1.4.1, advisory https://github.com/digitalbazaar/forge/security/advisories/GHSA-h6cr-wjv9-3cpp); upgrade from any version <= 1.4.0 to 1.4.1. Where upgrading is not immediately possible, the vendor workarounds apply: pass only fixed, valid RSA public exponents such as 65537 to key generation rather than caller-supplied values, or validate any caller-supplied exponent first as an odd integer >= 3 per RFC 8017 Section 3.1 - trade-off is that any application legitimately accepting variable exponents loses that flexibility - and never call BigInteger#modInverse() with negative operands, reducing the value modulo a positive modulus first with x.mod(m).modInverse(m). Because triggering requires forwarding untrusted input into key generation or modInverse(), such call paths should also be treated as untrusted input boundaries until the patched version is deployed.

Affected VersionsENISA

forge < 1.4.1

Affected Packages

npm node-forge fix: 1.4.1
euvd forge fix: 1.4.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in npm, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

node-forge bundles the jsbn big-integer library, and its bnModInverse() in lib/jsbn.js implements the binary extended Euclidean algorithm (Handbook of Applied Cryptography, Algorithm 14.61), which is only defined for positive integers. Because rShiftTo performs an arithmetic shift, a negative operand never migrates toward zero, so the loop's exit condition (u reaching zero) is never satisfied - the defining characteristic of the CWE-835 infinite loop class. Within forge, the only path to a negative operand is RSA key generation: the caller's public exponent e becomes BigInteger.fromInt(e) and is passed to state.e.modInverse(state.phi), where gcd() compares absolute values so the coprimality checks pass and the loop is entered; any exponent other than 3 or 65537 uses the pure-JavaScript implementation even when forge.options.usePureJavaScript is not set. The 1.4.0 fix returned early only when this.signum() == 0, leaving negative values and negative moduli unhandled; the 1.4.1 change broadens the guard to this.signum() <= 0 || m.signum() <= 0, returning zero exactly as it already does when no inverse exists, with results for positive inputs unchanged.

Know when Forge gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 2.9 LOW
AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
vuln.today AI 2.9 LOW

Vector is an application API operand not a network/parse path (AV:L); reachable only via a non-default code path forwarding untrusted exponents (AC:H); availability-only hang (A:L, C/I:N).

3.1 AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
4.0 AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

Lifecycle Timeline

2
Patch available
Oct 29, 2026 - 19:18 EUVD
CVE Published
Oct 29, 2026 - 18:49 cve.org
LOW 2.9

DescriptionCVE.org

Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.1, the affected implementation used BigInteger.prototype.modInverse(), bnModInverse(), lib/jsbn.js, RSA public exponent e to process the relevant input or security decision. node-forge's bundled jsbn implementation entered an infinite loop when BigInteger.prototype.modInverse() received a negative value or modulus. An attacker who could control the RSA public exponent passed to key generation, or a direct modInverse() operand, could block the Node.js event loop at full CPU. Parsed DER, PEM, JWK, PKCS#12, X.509, and TLS values are unsigned and cannot trigger this issue. This issue is fixed in version 1.4.1.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 6 npm packages depend on node-forge (3 direct, 3 indirect)

Ecosystem-wide dependent count for version 1.4.1.

Threat Intelligence Overview

EPSS Score
0.1%
Top 98% exploitable
Prevalence
High
node-forge is a heavily depended-on JavaScript/npm TLS and crypto library
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

14
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +14
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Forge

View all
CVE-2025-12816 HIGH POC
8.6 Nov 25

An interpretation-conflict (CWE-436) vulnerability in node-forge versions 1.3.1 and earlier enables unauthenticated atta

CVE-2020-7720 HIGH POC
7.3 Sep 01

The package node-forge before 0.10.0 is vulnerable to Prototype Pollution via the util.setPath function. Rated high seve

CVE-2026-85393 HIGH
8.7 Sep 03

RSA PKCS#1 v1.5 signature forgery in node-forge through v1.4.0 enables unauthenticated network attackers to craft signat

CVE-2025-66031 HIGH
8.7 Nov 26

Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Rated high severi

CVE-2026-118779 HIGH
7.5 Oct 29

Regular expression denial of service in node-forge's pem.decode() allows remote, unauthenticated attackers to block the

CVE-2026-119191 HIGH
7.5 Oct 29

Denial of service in node-forge (Forge) 1.3.2 through 1.4.0 lets remote, unauthenticated attackers exhaust CPU time and

CVE-2026-119188 HIGH
7.5 Oct 29

Denial of service in node-forge's JavaScript TLS implementation: a connection created with forge.tls.createConnection()

CVE-2026-119187 HIGH
7.5 Oct 29

Call stack exhaustion in node-forge's TLS record processing (all versions through 1.4.0) allows a remote peer to crash o

CVE-2026-118782 HIGH
7.5 Oct 29

PKCS#12 MAC forgery and constant-key password-based decryption in node-forge 1.4.0 and earlier let anyone who does not k

CVE-2022-24772 HIGH
7.5 Mar 18

Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Rated high severi

CVE-2022-24771 HIGH
7.5 Mar 18

Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Rated high severi

CVE-2026-119190 HIGH
7.4 Oct 29

Certificate chain validation in node-forge (Forge) through version 1.4.0 can be bypassed because the parser maps the dep

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy