Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Malicious code in ether-bn.js (npm)

0
Critical
Published: 05/26/2026 (05/26/2026, 06:25:09 UTC)
Source: GCVE Database
Product: ether-bn.js

Description

--- _-= 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.

Affected software

npmghsa
ether-bn.js
Affected versions
=1.4.0=1.4.1=1.3.4=1.3.3=1.3.1=1.2.1=1.1.1=1.0.3=1.0.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/07/2026, 00:23:02 UTC

Technical Analysis

The 'ether-bn.js' npm package impersonates the legitimate 'bn.js' library by copying its code and metadata but adds a malicious dependency 'unique-id-64'. This dependency is unpinned and executed on every BN clone operation, allowing arbitrary code execution controlled by the attacker. The package misleads users by referencing the legitimate 'bn.js' repository while injecting unauthorized code. Installation of this package results in silent runtime execution of malicious code, compromising the host system.

Potential Impact

Any system with 'ether-bn.js' installed is considered fully compromised due to the execution of attacker-controlled code via the injected 'unique-id-64' dependency. All secrets and keys stored on the affected system should be rotated immediately from a trusted environment. Removing the package alone does not guarantee removal of all malicious artifacts or backdoors introduced by this compromise.

Mitigation Recommendations

No official patch or fix is available for 'ether-bn.js' as it is a malicious package impersonating a legitimate library. The recommended mitigation is to immediately remove 'ether-bn.js' from all systems and rotate all secrets and keys that may have been exposed. Avoid installing packages with names similar to well-known libraries without verifying their authenticity. Use trusted package sources and verify package integrity before installation.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-4779
Osv Schema Version
1.7.4
Aliases
["GHSA-v3j8-x82x-chvr"]
Ecosystems
["npm"]
Database Specific Severity
null
Cvss Version
null

Threat ID: 6a4c341727e9c797195f80f9

Added to database: 07/06/2026, 23:02:47 UTC

Last enriched: 07/07/2026, 00:23:02 UTC

Last updated: 07/31/2026, 08:36:13 UTC

Views: 8

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses