Advisory

GHSA-378v-28hj-76wf

Also known as: CVE-2026-2739

Summary

bn.js affected by an infinite loop

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-02-20 06:30 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

bn.js

npm · All systems

Affected

  • introduced 0, fixed 4.12.3 (semver)

Fixed versions

4.12.3

Fix

bn.js

npm · All systems

Affected

  • introduced 5.0.0, fixed 5.2.3 (semver)

Fixed versions

5.2.3

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences