CVE-2026-2739: bn.js · Infinite Loop
Affects bn.jsSource CVE Database V5
Public exploit available · CVSS 6.9 Medium : upgrade to 5.2.3 as a priority.
Data as of 26 Oct 2026, 10:12 UTC
- EPSS
- 0.5% chance of exploitation in 30 days – higher than 44% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 5.2.3
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:PExploitation evidence
Disclosed: evidence found.
CVE published 20 Feb 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: evidence found.
CVSS exploit maturity: proof of concept public
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), CVSS vector, the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade bn.js to 5.2.3.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| bn.js | Affected
| Fixed in
|
AI-suggested
To mitigate CVE-2026-2739, organizations should immediately upgrade all instances of bn.js to version 5.2.3 or later, where the issue is resolved. Code audits should be conducted to identify any direct or transitive dependencies on vulnerable bn.js versions, especially in critical systems handling untrusted inputs. Implement input validation and sanitization to prevent unexpected calls to maskn(0) where possible. Employ runtime monitoring and alerting to detect abnormal CPU usage or process hangs indicative of infinite loops. For environments where immediate upgrade is not feasible, consider isolating or sandboxing components using bn.js to limit the impact of potential hangs. Additionally, incorporate automated dependency scanning tools in CI/CD pipelines to catch vulnerable versions early. Maintain awareness of updates from bn.js maintainers and the broader JavaScript security community for any further advisories.
Description
This affects versions of the package bn.js before 5.2.3. Calling maskn(0) on any BN instance corrupts the internal state, causing toString(), divmod(), and other methods to enter an infinite loop, hanging the process indefinitely.
References
- security.snyk.io/vuln/SNYK-JS-BNJS-15274301 (opens in a new tab)
- github.com/indutny/bn.js/issues/316 (opens in a new tab)
- github.com/indutny/bn.js/issues/186 (opens in a new tab)
- gist.github.com/Kr0emer/02370d18328c28b5dd7f9ac880d22a91 (opens in a new tab)
- github.com/indutny/bn.js/pull/317 (opens in a new tab)
- github.com/indutny/bn.js/commit/33df26b5771e824f303a79ec6407409376baa64b (opens in a new tab)