Advisory

MAL-2026-4779

Also known as: GHSA-v3j8-x82x-chvr

Malicious package Its source marks this package as malicious: it is not a vulnerability in a legitimate one.

Summary

Malicious code in ether-bn.js (npm)

Details

---
_-= Per source details. Do not edit below this line.=-_

Source: amazon-inspector (4cc5567869e3d616af151887f680ef13bf23f8a19fe5978343254b921c1c7c73)
Package name 'ether-bn.js' resembles the widely-used 'bn.js' big-number library, and the README directs users to install yet another name ('buffernumber.js'). The repository and homepage fields point at the legitimate indutny/bn.js project while the author field is unrelated. The shipped lib/bn.js is a near-verbatim copy of upstream bn.js with two non-upstream additions: a top-level const uniqueString = require('unique-id-64'); (lib/bn.js:38) and a check if (BN.isBN(number) && uniqueString(64)) { return number; } inside the BN constructor (lib/bn.js:20). package.json adds unique-id-64: ^1.0.0 to dependencies. The injected require is unconditionally evaluated when the module is loaded, and uniqueString(64) is invoked on every BN clone path, so any consumer that does new BN(existingBn) executes the third-party unique-id-64 package's code. The injected dependency is unpinned (^1.0.0) and is not a legitimate transitive of bn.js — it is the payload-delivery vehicle for whatever the third-party package contains now or in the future. Installers expecting bn.js semantics silently take a runtime dependency on attacker-selected code reached through a confusingly-named lookalike package.

Source: ghsa-malware (7a4eeb107d1aebff802622b91caa1ef499047d41bd732883f86dbf0401f0eb32)
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Severity

Not rated by the source.

Dates

Published
2026-05-26 06:25 UTC
Modified
2026-07-06 20:01 UTC

Affected packages and fixes

ether-bn.js

npm · All systems

Affected

  • Versions: 1.0.0, 1.0.3, 1.1.1, 1.2.1, 1.3.1, 1.3.3, 1.3.4, 1.4.0, 1.4.1

Fixed versions

None listed

Fix

No fixed version is listed.

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: OpenSSF Malicious Packages · Apache-2.0

Sources & licences