Largest NPM Compromise in History - Supply Chain Attack

Posted by Advocatemack@reddit | programming | View on Reddit | 587 comments

Hey Everyone

We just discovered that around 1 hour ago packages with a total of 2 billion weekly downloads on npm were compromised all belonging to one developer https://www.npmjs.com/\~qix

ansi-styles (371.41m downloads per week)
debug (357.6m downloads per week)
backslash (0.26m downloads per week)
chalk-template (3.9m downloads per week)
supports-hyperlinks (19.2m downloads per week)
has-ansi (12.1m downloads per week)
simple-swizzle (26.26m downloads per week)
color-string (27.48m downloads per week)
error-ex (47.17m downloads per week)
color-name (191.71m downloads per week)
is-arrayish (73.8m downloads per week)
slice-ansi (59.8m downloads per week)
color-convert (193.5m downloads per week)
wrap-ansi (197.99m downloads per week)
ansi-regex (243.64m downloads per week)
supports-color (287.1m downloads per week)
strip-ansi (261.17m downloads per week)
chalk (299.99m downloads per week)

The compromises all stem from a core developers NPM account getting taken over from a phishing campaign

The malware itself, luckily, looks like its mostly intrested in crypto at the moment so its impact is smaller than if they had installed a backdoor for example.

How the Malware Works (Step by Step)

  1. Injects itself into the browser
  2. Hooks core functions like fetchXMLHttpRequest, and wallet APIs (window.ethereum, Solana, etc.).
  3. Ensures it can intercept both web traffic and wallet activity.
  4. Watches for sensitive data
  5. Scans network responses and transaction payloads for anything that looks like a wallet address or transfer.
  6. Recognizes multiple formats across Ethereum, Bitcoin, Solana, Tron, Litecoin, and Bitcoin Cash.
  7. Rewrites the targets
  8. Replaces the legitimate destination with an attacker-controlled address.
  9. Uses “lookalike” addresses (via string-matching) to make swaps less obvious.
  10. Hijacks transactions before they’re signed
  11. Alters Ethereum and Solana transaction parameters (e.g., recipients, approvals, allowances).
  12. Even if the UI looks correct, the signed transaction routes funds to the attacker.
  13. Stays stealthy
  14. If a crypto wallet is detected, it avoids obvious swaps in the UI to reduce suspicion.
  15. Keeps silent hooks running in the background to capture and alter real transactions

Our blog is being dynamically updated - https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised