News · 18 September 2025

The September 2025 npm compromise: phishing a maintainer, poisoning thousands of projects

On 8 September 2025 the maintainer of several very widely used JavaScript packages, including chalk and debug, was phished through a fake security email that appeared to come from the npm registry. Attackers used the stolen access to publish malicious versions. The injected code was designed to alter cryptocurrency transactions in the browser. The malicious releases were identified and removed within hours, but the packages are downloaded in enormous numbers, so the exposure window mattered. About a week later, a self-propagating worm that stole developer tokens and republished infected packages spread through the same ecosystem.

Why a single phishing email scales so badly

Modern applications are assembled from hundreds or thousands of third-party packages. The trust relationship is inherited: you trust your direct dependency, which trusts its dependencies, and so on. One compromised maintainer account is therefore a route into every project that updates automatically.

Defences that actually help

  • Lock and pin. Commit lockfiles and install from them in CI, so a new malicious version cannot slip in unseen.
  • Delay updates. A cooldown of a few days before adopting new releases gives the community time to spot problems. Most malicious versions are found quickly.
  • Reduce the dependency tree. Every package you can remove is attack surface you no longer carry.
  • Scope secrets. Build systems should not hold long-lived tokens with broad rights. Short-lived, narrowly scoped credentials limit what a worm can steal.
  • Use phishing-resistant authentication for maintainers and for your own publishing accounts.
  • Maintain an SBOM so that, when an advisory lands, you can answer "are we affected?" in minutes.

Include the pipeline in scope

Security reviews often focus on the deployed application. This incident was about the build and dependency pipeline. A good assessment asks what happens if a dependency is compromised, what secrets the CI system can reach and whether builds are reproducible.

One-hour action list

  1. Check that lockfiles are committed and used in CI.
  2. Search your repositories for long-lived publishing tokens.
  3. Enable two-factor authentication, ideally with hardware keys, on registries and source hosts.
  4. Decide how quickly you will adopt new dependency releases, and write it down.

None of this is exotic. The incident was a reminder that the cheapest attack is often the one aimed at a person.

Written in September 2025; details reflect the situation at that time.

All news