The package you installed yesterday has an owner you have never met
One npm install, and you have handed a stranger – and every stranger that stranger trusts – execution rights inside your system. The open source supply chain is an experiment in trust at industry scale, and the attackers have noticed.
The trust experiment
Stop for a second and consider what one npm install actually is:
You pull code from a person you have never met, maintained in their spare time, published through an account secured by a password whose strength you know nothing about. And with that one package come its dependencies: hundreds of them, each with its own unknown owner, its own account, its own risk.
All of that code runs with your rights, in your build and in your production.
The remarkable thing is not that the supply chain gets attacked. It is how long it stayed an afterthought for the attackers.
Sonatype, which runs Maven Central, has logged more than 1.2 million malicious packages in the open source registries since 2019. It is no afterthought now.
What the attacks look like
The patterns are established by now:
The taken-over package. A tired maintainer hands the project to a “helpful contributor”, or has their account phished. The next version of a package thousands rely on carries an extra function. The update is installed voluntarily and automatically, everywhere.
This has become routine. Three recent incidents anyone who looks after a dependency list should know by heart:
chalk and debug, npm, September 2025. The maintainer of some of the most-installed packages on npm got an email that looked like it came from npm, asking for a two-factor reset. One click, one login, and the attacker had the account. Malicious versions of at least 18 packages were live for under two hours, rewriting cryptocurrency addresses in the browser of everyone who ran them. In that window they were downloaded more than 2.5 million times. The thief made about $500. The reach was the lesson.
Shai-Hulud, npm, September and November 2025. A worm: steal every npm token on the machine, use each one to publish infected versions of the packages it can reach – up to a hundred per account – repeat. The second wave took 796 packages, 1,092 versions, in one November day, over 20 million weekly downloads between them, including code from Zapier, PostHog and Postman. In August 2026 a descendant did it again, starting from one compromised keyv maintainer account and reaching packages with over 150 million weekly downloads. The malicious release carried a genuine build attestation: it had been built by the maintainer’s own pipeline.
axios, npm, March 2026. Over 100 million weekly downloads and 174,000 dependent packages. The maintainer was targeted personally – someone posing as a founder, a fake Slack workspace, a Teams meeting that ended with malware on their machine – and two releases appeared with a new dependency that installs a remote-access trojan on macOS, Windows and Linux the moment you run npm install. It was live for about three hours, and that was enough.
Then the other way in: patience. xz-utils, found March 2024 (CVE-2024-3094). The attacker contributed usefully and credibly to the project for more than two years, became a co-maintainer after about one, and only then – in February 2024 – planted a backdoor in liblzma that granted remote access over OpenSSH. It was found because Andres Freund, a Postgres developer at Microsoft, thought his SSH logins were taking 500 milliseconds too long, and dug into it instead of shrugging.
Dwell on that last one. One of the world’s most sophisticated supply chain attacks was stopped by one person who investigated a performance anomaly nobody had asked him to look at. No scanner found it.
The name twin. request-utils instead of requests-utils. One typo, or one hallucinated package name from a model, and the attacker’s package is in.
The install script. Many ecosystems let packages run code at install time, before you have used them for anything. Shai-Hulud and axios both came in through that hook. Since npm 12 (July 2026), dependency install scripts are blocked by default and must be approved per package; on older npm, --ignore-scripts in CI does the same job, as long as you run the few scripts you actually need explicitly afterwards. Several other ecosystems still run them.
The common thread: you invited the code in, through entirely ordinary workflows.
The line between paranoia and naivety
Auditing every line of every dependency is impossible. Trusting blindly is indefensible. The sensible line runs here:
Fewer dependencies is the best control there is. Before every new package: are fifty lines of your own code a better trade than one more stranger in the chain? Often yes. And the zombie dependencies, the ones nobody remembers the reason for, get removed. Keeping them updated is looking after a stranger nobody needs.
Pin versions, and update with your eyes open. Lock files everywhere, so your build is reproducible and a new malicious version cannot slide in on its own. Updates happen deliberately, on a rhythm, with an extra look at packages that just changed hands or suddenly changed behavior. And never on release day: every npm incident above was found and pulled within hours. A cooldown of a few days before you adopt a new version – the package managers have it as a setting now, and the source recommends a week – turns most of them into news you read, not incidents you clean up. The exception is an update that closes a hole you are actually exposed to; take that one the same day, with your eyes open.
Tighten what the build can reach. CI environments with least privilege and restricted networking: a compromised package in a build that cannot reach secrets or production becomes an incident you can handle. That protects the build machine; the code you ship on to your users is what the cooldown above protects. And the same goes for the laptop: npm tokens and cloud keys in the home directory are what the worm is looking for, so keep them short-lived and off the machine. The same assumption as everywhere else: something gets through one day; limit what it can do when it does.
And know what you have. An up-to-date inventory of dependencies – an SBOM – is the difference between “we are affected, here” and three days of frantic searching when the next big incident hits the news. Two established formats: SPDX (standardized as ISO/IEC 5962) and CycloneDX (from OWASP, standardized as ECMA-424). Your build tooling can usually generate one in a single pipeline step.
From trust to boundaries
Open source is a gift the industry is built on, and a supply chain nobody owns.
You cannot verify every stranger. But you can invite fewer of them in, lock the door behind them, and limit which rooms they reach.
The package you installed yesterday was probably completely fine. The work is turning that into a claim you can afford to be wrong about.