CVE-2026-2739 bn.js affected by an infinite loop
Calling maskn(0) on a BN instance corrupts internal state, causing infinite loops in methods like toString and divmod, leading to process hangs.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-2739?
CVE-2026-2739 is a medium-severity denial of service vulnerability in bn.js, published on 20 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-835
Which versions are affected by CVE-2026-2739?
4 open source packages ship an affected version, including bn.js.
| Package | Affected | Fixed in |
|---|---|---|
bn.js npm | All versions | 4.12.3 |
bn.js npm | All versions | 4.12.3 |
bn.js npm | From 5.0.0 | 5.2.3 |
bn.js npm | From 5.0.0 | 5.2.3 |
How do I fix CVE-2026-2739?
Upgrade bn.js to a fixed version for your release line: 4.12.3 or 5.2.3.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2026-2739 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-2739 exists.
Sources
Also known as AZL-78290, CLEANSTART-2026-JE33645, CLEANSTART-2026-ZJ10074, CLSA-2026-1779065199, CLSA-2026-1779065201, CLSA-2026-1782176259 and 27 more.