
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-2739 is a Denial of Service vulnerability in the bn.js npm package caused by an infinite loop triggered by calling maskn(0) on any BN instance. The flaw affects bn.js versions before 4.12.3 and versions 5.0.0 through 5.2.2; patched versions are 4.12.3 and 5.2.3. It was discovered on February 8, 2026 via fuzz testing and publicly disclosed on February 20, 2026. The vulnerability carries a CVSS v3.1 base score of 5.3 (Medium) and a CVSS v4.0 base score of 5.5 (Medium) (GitHub Advisory).
The root cause is classified as CWE-835 (Loop with Unreachable Exit Condition). In BN.prototype.imaskn, when bits = 0, the computation s = (bits - r) / 26 yields s = 0, causing this.length to be set to Math.min(0, this.length) = 0. This violates bn.js's internal invariant that this.length >= 1; the subsequent _strip() call does not correct a length of 0. Any method that loops until isZero() returns true (which checks this.length === 1 && this.words[0] === 0) will loop forever because the condition is never satisfied with length = 0, consuming 100% CPU on the affected thread. A public proof-of-concept demonstrating the hang via new BN('1', 10).maskn(0) followed by toString() was published by the discoverer (PoC Gist, GitHub Advisory).
Successful exploitation causes the affected Node.js process to hang indefinitely, resulting in a complete denial of service for any application relying on bn.js for cryptographic operations. Because bn.js has over 5,670 npm dependents — including widely used libraries such as elliptic, browserify-sign, and create-ecdh — the blast radius extends to blockchain/Web3 applications, TLS/SSL implementations, and any service where an attacker can influence the bits parameter passed to maskn(). There is no confidentiality or integrity impact; the sole consequence is availability loss (PoC Gist, GitHub Advisory).
A public proof-of-concept has been available since February 8, 2026, when the vulnerability was discovered through fuzz testing and submitted to Snyk's disclosure program. No evidence of in-the-wild exploitation or threat actor attribution has been reported. The EPSS score is approximately 0.015–0.022% (7th percentile), indicating low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. The CVSS v4.0 exploit maturity is rated "Proof of Concept" (GitHub Advisory).
maskn()).maskn(0) on a BN instance — for example, by supplying a bit-length value of 0 to a cryptographic operation that internally invokes maskn.new BN(value).maskn(0) sets this.length = 0, corrupting the internal state of the BN object (x.isZero() returns false despite the corrupted length).toString(), divmod(), or similar methods will enter an infinite loop, consuming 100% CPU and hanging the process indefinitely.Upgrade bn.js to version 4.12.3 (for the 4.x branch) or 5.2.3 (for the 5.x branch), which includes the fix that adds a guard restoring this.length = 1 and this.words[0] = 0 when length reaches 0 after imaskn (bn.js fix commit, GitHub Advisory). As a short-term workaround where upgrading is not immediately possible, validate and reject any user-supplied bits parameter equal to 0 before it reaches maskn(). IBM has also released patches for affected products including API Connect, QRadar Suite Software, watsonx Orchestrate, Cloud Pak for Business Automation, and Business Automation Insights (IBM API Connect, IBM QRadar).
The vulnerability was discovered by researcher Kr0emer through fuzz testing of cryptographic JavaScript libraries and responsibly disclosed to Snyk on February 8, 2026. The GitHub Advisory was reviewed and published on February 20, 2026. Multiple downstream vendors including IBM and Microsoft acknowledged the vulnerability and issued security bulletins for their affected products. The issue highlights a longstanding class of bn.js internal-state bugs, as a related infinite loop from new BN(null).toString() was reported as early as June 2018 (Issue #186) but remained unaddressed until this disclosure prompted the fix (GitHub Issue #186, GitHub Advisory).
Fix availability across major Linux distributions and their releases.
bionic (esm-apps)
node-bn.js
devel
node-bn.js
focal (esm-apps)
node-bn.js
jammy
node-bn.js
jammy (esm-apps)
node-bn.js
noble
node-bn.js
noble (esm-apps)
node-bn.js
resolute
node-bn.js
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."