What happened
Microsoft reported a supply-chain attack it calls ChainDrop, a variant of the Shai-Hulud worm. Malicious versions of more than 400 npm packages from unrelated publishers, including keyv, flat-cache and cache-manager, added a preinstall script (setup.mjs) that ran when the package was installed.
The script collected npm, GitHub, cloud, Kubernetes and Vault credentials from developer machines and CI runners, then used stolen npm tokens to publish infected versions of other packages, sometimes with valid provenance. It also planted files in editor and AI-assistant configuration folders.
What to do
- Search your lockfiles and CI caches for the affected package versions listed by Microsoft.
- Pin known-good versions and clear npm and yarn caches before the next install.
- Treat any developer machine or CI runner that installed an affected version as compromised: rotate every credential it could reach from a clean machine, and rebuild it.
- Make it harder next time: install with scripts disabled where you can, and use a minimum package age before new versions are installed.
