STUPID-2026-0085
Self-propagating npm worm plants persistence in Claude Code's hook files to survive credential rotation (ChainDrop / keyv supply-chain attack)
Instruction given
None from the affected developer — the trigger was installing (or having already installed) one of the compromised npm packages, or simply opening a repository an attacker had already written to using stolen GitHub credentials. No action targeted Claude Code specifically.
Expected behavior
A compromised package's install-time payload should be contained to that npm install. An agent's own hook and config files should not become a standing malware persistence mechanism that outlives the original compromise — rotating credentials and removing the poisoned package version should end the infection.
Actual behavior
Using credentials stolen during the initial npm compromise, the worm wrote .claude/settings.json and .claude/setup.mjs (alongside matching .vscode/tasks.json and .vscode/setup.mjs files) directly into victims' repository branches on GitHub. Because Claude Code runs hooks declared in .claude/settings.json automatically whenever it starts a session in that repository, simply opening the repo and starting Claude Code again was enough to re-launch the credential-stealing payload — independent of npm, and after the original malicious package version had already been removed.
Damage
Microsoft tracked the campaign (dubbed "ChainDrop," reported elsewhere as the keyv/cacheable or "Mini Shai-Hulud" incident) as compromising more than 400 npm packages across multiple unrelated publishers beginning around August 4, 2026, after an attacker took over a maintainer account and published trojanized releases. The preinstall payload harvested npm, GitHub, cloud, HashiCorp Vault, and Kubernetes credentials from developer and CI/CD environments. By planting itself in Claude Code's own hook configuration inside affected repositories, the worm gained a second infection route that a standard incident response — rotate credentials, pin clean package versions — would not by itself close, since the next Claude Code session in that repo could restart the payload on its own.
Classification
- Agent
- Claude Code
- Failure mode
- Security Vulnerability
- Root cause
- Other
- Domain
- Security
- Source
- Security Research
Related incidents
Get told when an agent breaks something
We document AI agent failures daily, severity-scored against a published scale. When one lands at 7.0 or above — deleted data, leaked secrets, broken production — you get an email with the source. When nothing does, you get nothing.
This database is callable over MCP — query it from inside your agent.