# MAL-2026-4779: Malicious code in ether-bn.js (npm)


- **Type:** Malicious package
- **Package:** `ether-bn.js` (npm)
- **Published:** 26 May 2026
- **Also known as:** GHSA-v3j8-x82x-chvr

## What is MAL-2026-4779?

MAL-2026-4779 is a malicious package in ether-bn.js, published on 26 May 2026. 

### Official description

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.

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.

## What should I do about MAL-2026-4779?

Remove the package from your dependencies and lockfiles, then rotate any secrets on machines where it was installed.

## Fix prompt for AI coding agents

```text
MAL-2026-4779 is a malicious package: ether-bn.js (npm). Every version was published to cause harm.

Task:
1. Search this repository's dependency manifests and lockfiles for the package, including transitive dependencies.
2. If it is present, remove it, regenerate the lockfile with the project's package manager, and replace whatever it was used for.
3. List any CI runners, developer machines or containers that installed it, so their secrets can be rotated.
4. If the package is not used anywhere, say so and change nothing.

Reference: https://insights.sbomify.com/MAL-2026-4779/ (Markdown: https://insights.sbomify.com/MAL-2026-4779/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/MAL-2026-4779

---
From sbomify Insights: https://insights.sbomify.com/MAL-2026-4779/
Summaries are generated and may contain mistakes; the official description above is the record.
