cd /news/ai-safety/a-supply-chain-worm-wrote-itself-int… Β· home β€Ί topics β€Ί ai-safety β€Ί article
[ARTICLE Β· art-107813] src=dev.to β†— pub= topic=ai-safety verified=true sentiment=↓ negative

A Supply-Chain Worm Wrote Itself Into Claude Code's Hook Files to Survive Credential Rotation

Microsoft's security research team tracked a campaign called 'ChainDrop' that took over an npm maintainer account and published trojanized releases across more than 400 packages, harvesting credentials from developer and CI/CD environments. The worm used stolen GitHub credentials to commit malicious hook files into victims' repositories, enabling it to survive credential rotation by auto-executing in Claude Code and VS Code sessions.

read2 min views1 publishedAug 23, 2026

Rotating your credentials and removing a poisoned package is supposed to end an npm supply-chain compromise. In early August 2026, one worm made sure it didn't have to.

Microsoft's security research team tracked a campaign it calls "ChainDrop" β€” reported elsewhere as the keyv/cacheable compromise, or "Mini Shai-Hulud" β€” that took over an npm maintainer account and published trojanized releases across more than 400 packages from unrelated publishers, starting around August 4, 2026. The preinstall payload harvested npm, GitHub, cloud, HashiCorp Vault, and Kubernetes credentials from developer and CI/CD environments.

That alone is a bad week. What makes it a StupidLLM incident is what the worm did with the GitHub credentials it stole: it used them to commit .claude/settings.json

and .claude/setup.mjs

directly into victims' repository branches β€” plus matching .vscode/tasks.json

and .vscode/setup.mjs

files for VS Code's task runner. No developer action triggered this. It happened to repos the worm already had write access to, independent of anyone running npm install

again.

Claude Code executes hooks declared in .claude/settings.json

automatically whenever it starts a session in that repository β€” no separate prompt confirming the hook file exists or asking whether you trust its contents. So a developer who did everything right β€” rotated every credential, pinned a clean package version, ran their normal incident response β€” could still have the malware fire again the moment they next opened the same repository in Claude Code.

The mechanism isn't a bug in Claude Code's code. It's a legitimate feature (automatic hook execution on session start) built on an assumption β€” that anything committed to a repo's .claude/

directory is trustworthy β€” that a worm with write access to that repo is specifically positioned to defeat. The same trick against .vscode/tasks.json

says this wasn't a Claude-Code-specific idea; it's a generalizable technique against any tool that auto-executes config from a repo it's opened in.

Microsoft's writeup is a firsthand technical analysis: it names the affected package count, the credential categories targeted, and the specific hook/config file paths and persistence logic used against Claude Code and VS Code. It does not publish a per-victim or per-organization casualty count, and StupidLLM's incident record does not repeat the "294,842 secrets from 6,943 machines" figure that circulated elsewhere β€” that number could not be corroborated against a primary source, so it's left out.

Full incident record, severity scoring, and source: STUPID-2026-0085 This is one of 85+ verified, severity-scored AI agent incidents documented at StupidLLM, an open incident database for AI coding agent failures.

── more in #ai-safety 4 stories Β· sorted by recency
── more on @microsoft 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/a-supply-chain-worm-…] indexed:0 read:2min 2026-08-23 Β· β€”