What’s Vulnerable › Vulnerabilities

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

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 products

How to fix

Upgrade to a fixed version: Npm Bn.Js 4.12.3, 5.2.3; bn.js 5.2.3. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2026-2739 or the next vulnerability affects your stack