bn.js affected by an infinite loop
Moderate severity
GitHub Reviewed
Published
Feb 20, 2026
to the GitHub Advisory Database
•
Updated Feb 20, 2026
Description
Published by the National Vulnerability Database
Feb 20, 2026
Published to the GitHub Advisory Database
Feb 20, 2026
Reviewed
Feb 20, 2026
Last updated
Feb 20, 2026
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