# CVE-2026-2739: bn.js affected by an infinite loop

- Severity: Medium 6.9 (CVSS:4.0, scored by snyk) `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:P`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.52%, higher than 45% of CVEs (2026-12-01)
- Published: 2026-02-20T05:00:08.253Z
- Modified: 2026-09-10T03:50:33.815Z
- Also known as: GHSA-378v-28hj-76wf
- Weaknesses: CWE-835
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: snyk

## 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.

(As written by CVE List.)

## Affected

- bn.js: before 5.2.3
- bn.js (npm): before 4.12.3; from 5.0.0 before 5.2.3

## Every score

- snyk: CVSS:4.0 6.9 Medium `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:P`
- snyk: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:P`
- GitHub: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- GitHub: CVSS:4.0 Medium `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:P`

## References

- <https://security.snyk.io/vuln/SNYK-JS-BNJS-15274301> (web)
- <https://github.com/indutny/bn.js/issues/316> (web)
- <https://github.com/indutny/bn.js/issues/186> (web)
- <https://gist.github.com/Kr0emer/02370d18328c28b5dd7f9ac880d22a91> (web)
- <https://github.com/indutny/bn.js/pull/317> (web)
- <https://github.com/indutny/bn.js/commit/33df26b5771e824f303a79ec6407409376baa64b> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-2739> (advisory)
- <https://github.com/indutny/bn.js/issues/316#issuecomment-3924217358> (web)
- <https://github.com/indutny/bn.js> (package)
- <https://github.com/indutny/bn.js/releases/tag/v5.2.3> (web)

## Sources

- CVE List: [CVE-2026-2739](https://www.cve.org/CVERecord?id=CVE-2026-2739), CVE Terms of Use, modified 2026-02-20
- GitHub Advisory Database: [GHSA-378v-28hj-76wf](https://github.com/advisories/GHSA-378v-28hj-76wf), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-2739](https://nvd.nist.gov/vuln/detail/CVE-2026-2739), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-2739 · Whole record: https://cve.day/CVE-2026-2739.json · Rebuilt by cve.day 2026-11-25T22:59:14.332Z
