ChainDrop: the npm worm that started in keyv and reached hundreds of packages
On 4 August 2026, a self-spreading worm Microsoft named “ChainDrop” turned popular caching libraries into credential stealers. Some of the affected packages have more than 150 million weekly downloads, and the first malicious release carried genuine build provenance.
What happened
Datadog traced the first malicious release to keyv@6.0.0, published from the project’s own release workflow at 09:35 UTC. The same day, malicious versions appeared across the related “cacheable” family, including cache-manager@7.2.10, flat-cache@6.1.24, file-entry-cache@11.1.6 and cacheable-request@13.0.20. Microsoft counted more than 400 affected packages across unrelated publishers.
How it worked
- Install-time execution. Infected versions replaced the package’s scripts with a single
"preinstall": "node setup.mjs". The loader downloaded the Bun runtime if needed and started a large obfuscated second stage. - Credential theft. It read hundreds of credential file locations (SSH keys, cloud, npm, PyPI and Docker credentials, shell histories, crypto wallets), the process environment and
gh auth token. On GitHub Actions runners it also tried to read secrets from runner memory, and it pulled values from AWS Secrets Manager, Kubernetes and Vault when it found access. - Hidden command and control. It looked up its server address in an Ethereum smart contract, so the operators could change it without republishing. Stolen data was encrypted before upload, with GitHub repositories as a fallback channel.
- Self-propagation. With a stolen npm token that could bypass 2FA, it listed packages the victim could publish, injected itself, bumped the patch version and republished. With stolen GitHub credentials it committed editor and AI-assistant configuration (a VS Code task and a Claude Code hook) to up to 50 branches, so that opening the repository ran the malware again.
Because keyv@6.0.0 was built by the project’s real workflow from a malicious commit, its SLSA provenance was valid. Provenance proves where a package was built, not that the source was safe.
What to do
- Check lockfiles, CI caches and artifact stores, including transitive dependencies, for the versions in Datadog’s and Microsoft’s lists.
- Treat any workstation or runner that installed an affected version with install scripts enabled as compromised. Rotate credentials from a clean machine and rebuild.
- Review recent commits for unexpected
.vscode/tasks.jsonor.claude/files. - Update to npm 12, which no longer runs dependency install scripts unless you approve them, and consider a minimum release age for new versions.
Where DepSentinel fits. A patch release that suddenly adds a preinstall script is the pattern DepSentinel’s install-script-added signal looks for, and it marks the package SUSPICIOUS on its own. The fresh-release signal adds to it during the first 72 hours. Because keyv@6.0.0 had valid provenance, the provenance-dropped signal would not have fired for it. DepSentinel scans dependencies, not the editor configuration files the worm planted in repositories, so review those separately.
Am I affected?
See which versions of the first affected packages you have, then compare them with Datadog’s and Microsoft’s lists. Infected packages also have "preinstall": "node setup.mjs" in their package.json:
npm ls keyv cache-manager flat-cache file-entry-cache cacheable-request cacheable ecto --all
grep -l '"preinstall": "node setup.mjs"' node_modules/*/package.json node_modules/@*/*/package.json 2>/dev/null
For other package managers, and what to do if you find a match, see how to check your project for malicious or compromised packages.
Sources
- Microsoft Security Blog: ChainDrop supply chain compromise, anatomy of a self-propagating worm
- Datadog Security Labs: npm worm compromises popular npm packages
- GitHub changelog: upcoming breaking changes for npm v12
Details come from the public reports above and may change as investigations continue. Package names and versions are listed so you can check your own projects; verify them against the original sources before acting.
Related
- Shai-Hulud: from the first npm worm to the TanStack compromise
- Red Hat’s npm packages backdoored: how the “Miasma” worm got in
- Fake Paysafe, Skrill and Neteller SDKs: a credential stealer that looks like a payment library
Catch the next one in your editor. DepSentinel is a free VS Code extension that checks every dependency, including sub-dependencies, for known vulnerabilities and signs of a supply-chain attack. No account, no API key.