Axios, TanStack, ChainDrop: 2026 Is the Year npm install Became a Security Decision
• 3 min read • Ahmed Daoudi
If you write JavaScript, 2026 has been an uncomfortable year. Some of the most installed packages in the ecosystem shipped malware, and in most cases the maintainers did nothing wrong except have an account someone else could take over.
Three incidents, one pattern
March: Axios
On March 31, two malicious versions of Axios were published. According to Microsoft's security team, they contacted infrastructure tied to a threat actor it tracks as Sapphire Sleet and pulled down a remote access trojan. Because so many projects accept automatic minor updates, a loose version range was enough to be exposed.
May: Mini Shai-Hulud and TanStack
Attackers pushed 84 malicious versions across 42 TanStack packages in a window of about six minutes. The campaign then spread to more than 170 packages on npm and PyPI, including namespaces belonging to Mistral AI, UiPath and OpenSearch, according to OPSWAT's analysis.
August: ChainDrop
On August 4, an attacker took over a maintainer's GitHub account and committed a backdoor to projects including keyv, flat-cache and file-entry-cache. Some of these see over 150 million weekly downloads. The nasty detail: the malicious releases were published through the projects' own legitimate GitHub Actions workflows, and the payload could spread on its own, worm-style.
Why the old advice is not enough
"Check the package before you install it" does not work when the package is one you have trusted for years and the bad version was published by the real CI pipeline. Provenance tells you a release came from the expected repository. It cannot tell you the repository itself was not compromised that morning.
What to change in your projects this week
- Commit your lockfile and install with
npm ciin CI, so a build never silently picks up a version you did not review. - Disable install scripts by default. Most worms run from
postinstall. Setignore-scripts=truein.npmrcand allow the few packages that genuinely need a build step. - Add a cooling-off period. pnpm's
minimumReleaseAgesetting refuses versions younger than a threshold you choose. Most malicious releases are pulled within hours, so waiting a day or two filters out a large share of them. - Pin GitHub Actions to a commit SHA, not a tag, and give
GITHUB_TOKENread-only permissions unless a job needs more. - Use trusted publishing and short-lived tokens if you maintain packages, and enable phishing-resistant 2FA on GitHub and npm.
- Watch for advisories with
npm audit, Dependabot or Socket, and rotate any credentials on machines that installed a compromised version.
The uncomfortable conclusion
A modern frontend pulls in hundreds of transitive dependencies, each maintained by someone with a laptop and a GitHub password. That is the deal we accepted for free, fast tooling. The deal still holds, but npm install is no longer a neutral command. It is a decision to run strangers' code with your credentials, and it deserves the same care as merging a pull request.