Vulnerabilities/

bn.js affected by an infinite loop

Severity:
Medium

Description

This affects versions of the package bn.js before 4.12.3 and 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.

Recommendation

Update the bn.js package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
bn.js
Anything's wrong? Let us know Last updated on February 24, 2026