Future TechnologyFuture Technology
Tech

"Self-Spreading Worms Are Now Loose Inside the npm Registry"

· By Future Technology

Software supply chain attacks used to mean one bad package sitting quietly in a dependency tree, waiting to be pulled into someone's build. This month's npm incident is a different animal. Two self-propagating worms, tracked as Shai-Hulud and ChainDrop, have been tearing through the npm registry by stealing maintainer credentials, republishing infected versions of legitimate packages automatically, and repeating the process on every account they compromise.

How the worms spread

Both worms work on the same basic loop. A developer's machine or CI pipeline gets compromised, often through a phishing email or a malicious dependency already sitting in a project. The worm then scans for npm publish tokens, GitHub credentials, and cloud API keys stored locally. Once it finds valid maintainer credentials, it uses them to push a new, infected version of every package that developer controls, straight to the public registry. Anyone who installs or updates those packages inherits the infection, and the cycle starts again on their machine.

This is what makes it a worm rather than a conventional supply chain compromise: no human attacker needs to manually select the next target. The malicious code does the targeting itself, at internet speed, across a registry that hundreds of thousands of projects pull from every single day.

Why npm specifically

npm's ecosystem is built on radical interdependency. A single project can pull in hundreds of transitive dependencies without a developer ever reviewing most of them directly. That's efficient for building software fast. It is also exactly the kind of environment a self-propagating credential-stealing worm thrives in, because trust flows automatically through the dependency tree with no friction and, in many pipelines, no human review at all.

Security researchers tracking the campaign describe it as one of the most consequential software supply chain events of the year, on par with prior incidents that forced the npm and open source security communities to rethink credential hygiene. Corporate engineering teams that treat "it's just a small utility package" as low risk are the ones getting hit hardest, because small utility packages are exactly what ends up buried three or four layers deep in everyone else's dependency tree, trusted by default.

What developers and companies should do now

Rotate npm publish tokens and enable two-factor authentication with a hardware key on every maintainer account, not just SMS or app-based codes, since those can be phished in real time. Audit CI/CD pipelines for any stored credentials that don't need to be there, and move to short-lived, scoped tokens wherever npm and your CI provider support them. Run npm audit and cross-check package-lock files against known indicators of compromise being published by the npm security team and independent researchers tracking Shai-Hulud and ChainDrop specifically.

For everyday consumers, the practical exposure is indirect: apps and services you use may ship updates faster than usual right now as vendors patch affected dependencies, and unusual login prompts or password reset emails tied to services you use could be a downstream sign that a vendor's build pipeline was touched. It's not a reason to panic. It is a reason to keep an eye on account activity for anything you use that ships frequent software updates, and to make sure your own accounts are protected with a password manager and two-factor authentication rather than reused passwords.

Browse all Space stories →