IncidentSupply chain
chalk and debug: phished maintainer pushes crypto-stealing code to 18 packages
Highnpm maintainers
A phishing email posing as npm support fooled the maintainer of some of npm's most downloaded packages. The attacker published versions that redirected cryptocurrency payments in web browsers to the attacker's wallets.
Replay the attack step by step in the Learning Center
How it happened
- The attacker registered the look-alike domain npmjs.help and emailed the maintainer about 'outdated 2FA'.
- The maintainer entered his details, handing over his npm account.
- Malicious versions of 18 packages with more than 2 billion weekly downloads were published.
- The code hooked browser APIs and swapped wallet addresses in crypto transactions.
Impact
Web apps that bundled the poisoned versions could send users' crypto payments to the attacker.
The fix
npm removed the versions within hours and clean releases followed; rebuild any browser bundles made during the window.
Lessons
- Require phishing-resistant MFA, such as security keys, for publishing accounts.
- Wait before adopting brand-new releases so a short-lived malicious version never reaches production.
- After a dependency compromise, rebuild front-end bundles, not only servers.