CVE-2026-2739
bn.js affected by an infinite loop
Also known as GHSA-378v-28hj-76wf
Mitigation
- Upgrade bn.js to one of 4.12.3, 5.2.3 (or later in the same release line).
Who should check
- Projects that depend on npm package bn.js (< 4.12.3)
- Anyone running bn.js < 5.2.3
Vulnerability facts
- Affected
- bn.js < 4.12.3
- Fixed in
- 4.12.3, 5.2.3
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 6.9 (v4.0, CNA)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:POpen in CVSS calculator
Show all 12 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Attack requirements: None
- Privileges required: None
- User interaction: None
- Confidentiality impact: None
- Integrity impact: None
- Availability impact: Low
- Confidentiality impact on other systems: None
- Integrity impact on other systems: None
- Availability impact on other systems: None
- Exploit maturity: Proof of concept
- EPSS
- 0.71% chance of exploitation in 30 days (percentile 49, 2026-11-26)
- CWE
- CWE-835
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| npm bn.js | < 4.12.3 | 4.12.3, 5.2.3 | osv |
| bn.js | < 5.2.3 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-2739. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-2739.md Affected: bn.js < 4.12.3 Fixed in: 4.12.3, 5.2.3 Steps: 1. Search this machine and project for bn.js (npm), bn.js: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
Other
- https://security.snyk.io/vuln/SNYK-JS-BNJS-15274301
- https://github.com/indutny/bn.js/issues/316
- https://github.com/indutny/bn.js/issues/186
- https://gist.github.com/Kr0emer/02370d18328c28b5dd7f9ac880d22a91
- https://github.com/indutny/bn.js/issues/316#issuecomment-3924217358
- https://github.com/indutny/bn.js
- https://github.com/indutny/bn.js/releases/tag/v5.2.3
FAQ
Is CVE-2026-2739 being exploited?
There is no confirmed exploitation: CVE-2026-2739 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.71% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-2739?
Medium: CVSS 6.9 (v4.0, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2026-2739?
bn.js < 4.12.3.
Is there a fix for CVE-2026-2739?
Yes. Fixed in 4.12.3, 5.2.3. Upgrade bn.js to one of 4.12.3, 5.2.3 (or later in the same release line).
How do I check if I'm affected by CVE-2026-2739?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.