Skip to main content
VulnerabilityPublished

CVE-2026-2739: bn.js · Infinite Loop

Affects bn.jsSource CVE Database V5

0

Public exploit available · CVSS 6.9 Medium : upgrade to 5.2.3 as a priority.

Data as of 26 Oct 2026, 10:12 UTC

CVSS 4.0 base score
6.9Medium
How severe the flaw is on the 0–10 CVSS scale.
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:P

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 20 Feb 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: evidence found.

    CVSS exploit maturity: proof of concept public

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
bn.jsAffected
  • <5.2.3
Fixed in
  • 5.2.3

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

Community reviews

Loading reviews…