VDB
Sign up
MEDIUM5.3

GHSA-378v-28hj-76wf

bn.js affected by an infinite loop

Quick fix

GHSA-378v-28hj-76wf — bn.js: upgrade to the fixed version with the command below.

npm install bn.js@4.12.3

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm/bn.js
Introduced in: 0Fixed in: 4.12.3
Fixnpm install bn.js@4.12.3
npm/bn.js
Introduced in: 5.0.0Fixed in: 5.2.3
Fixnpm install bn.js@5.2.3

References