Skip to content
RCE Write-up Advanced

How A Single Npm Possibly Compromised 100 Million Weekly Downloads

An attacker compromised the npm account of the lead maintainer of axios and published two malicious versions that added a dependency containing a postinstall script. That script downloaded and executed a remote access trojan on macOS, Windows and Linux, allowing arbitrary command execution and file browsing on affected machines.

Hafiq Iqmal Follow

Published on systemweakness.com

On March 30, 2026, a new npm package called [email protected] was published. It had no README, no repository link and no reason to exist.

Hafiq Iqmal, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the maintainer's npm account was taken over and a long-lived publish token remained active even though OIDC trusted publishing was configured, so the attacker could publish directly to npm without going through the project's CI/CD pipeline.

Impact

Anyone who installed either compromised version during the window before takedown may have had a remote access trojan executed on their machine, giving the attacker arbitrary command execution, file browsing and the ability to inject further binaries.

What the attacker needed

Installing [redacted] or [redacted]; Running npm install with scripts enabled

The fix

The compromised tokens were revoked and the malicious versions were pulled from npm; the report recommends removing legacy npm tokens and using OIDC-based trusted publishing.

How it was found

  1. The attacker compromised the npm credentials of the lead maintainer.
  2. The attacker changed the account's registered email address.
  3. The attacker published two malicious axios versions directly via the npm CLI, bypassing the CI/CD pipeline.
  4. The malicious versions added a new dependency, plain-crypto-js, which was never imported in the source code.
  5. The dependency's postinstall script ran a dropper that contacted a command-and-control server and downloaded a platform-specific RAT.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A popular code library called axios was published to npm (a public package registry) by someone who had stolen the maintainer's login. The new versions quietly added a helper package that ran a hidden program during installation. That program let the attacker control the computer remotely.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Hafiq Iqmal

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.