Illustration for: NPM Worm Steals Credentials, Hits Claude Code Hooks

NPM Worm Steals Credentials, Hits Claude Code Hooks

A compromised maintainer account let attackers plant a credential-stealing worm across the keyv, cacheable and related npm packages -- some with 500M+ monthly downloads -- hitting Claude Code and VS Code hooks.

By the Numbers

2,234
Poisoned versions
444
Package names hit
09:35-13:18
Attack window (UTC)
~127M
keyv weekly downloads
TC
By the Markets Desk
Edited by Trace Cohen · Early-stage VC & angel · Founder, New York Venture Partners
1 min read
ShareXLinkedInEmail

THE RUNDOWN

1

One compromised maintainer account produced 2,234 poisoned versions across 444 package names inside a roughly four-hour window -- no zero-day involved, just the single credential that owns keyv, cacheable, flat-cache and file-entry-cache.

2

The stealer reached past developer logins into infrastructure: .npmrc and GitHub CLI tokens, AWS credentials, Vault tokens, Kubernetes configs and crypto wallets, all pulled by a preinstall hook that runs on npm install before anyone reads the code.

3

Hooks aimed specifically at Claude Code and VS Code make this the first major supply-chain attack built for AI coding-agent environments as a named target rather than as collateral from hitting developer machines generally.

4

npm has absorbed multiple worm-style incidents this year and contained each within roughly a day, so the structural fix is the thing still missing -- watch for mandatory hardware-key two-factor on maintainers of packages above a download threshold.

TC

The VC Read · Trace's Take

Trace Cohen

The detail that should worry every AI-coding-tool investor isn't the credential count, it's that this worm specifically targeted Claude Code and VS Code hooks -- attackers are now building for AI-agent dev environments as a named target, not an afterthought. If you're diligencing a dev-tools or AI-coding portfolio company, the question just changed from 'do you have SSO' to 'what happens when a transitive dependency four layers down gets a maintainer account compromised' -- because that's exactly what happened here to code nobody at the affected companies had ever heard of.

Analysis

A Maintainer Account, Not a Zero-Day

Attackers compromised the GitHub account of the maintainer behind keyv, a key-value caching library with roughly 127 million weekly npm downloads, and used that access to push a credential-stealing worm across keyv's entire package family, according to The Hacker News. The same maintainer also owns cacheable, flat-cache and file-entry-cache -- some individually pulling more than 500 million downloads a month -- all swept into the same compromise.

Twelve unrelated organizations were confirmed compromised within a roughly four-hour window on August 4, with 2,234 poisoned versions found across 444 package names.

Every poisoned package received a preinstall hook that ran automatically on npm install, downloading the Bun runtime and executing a roughly 728 KB obfuscated stealer targeting .npmrc tokens, GitHub CLI tokens, AWS credentials, Vault tokens, Kubernetes configs and crypto wallets, per Socket's technical writeup. The worm also planted hooks targeting Claude Code and VS Code specifically -- a detail that makes this the first major supply-chain attack aimed explicitly at AI coding-agent environments rather than generic developer credentials. Twelve unrelated organizations were confirmed compromised within a roughly four-hour window on August 4, with 2,234 poisoned versions found across 444 package names.

This follows the same self-propagating pattern that hit npm earlier this year: one compromised maintainer account cascades into hundreds of downstream packages within hours, because modern JavaScript projects routinely depend on caching utilities several layers deep without anyone auditing them individually.

The counterweight worth noting: npm's ecosystem has had multiple worm-style incidents this year, and each one has been caught and contained within roughly a day -- this is a real, costly incident, not evidence the entire package ecosystem is unusable. What to watch: whether npm or GitHub ships mandatory hardware-key two-factor authentication for maintainers of packages above a download threshold, the structural fix security researchers have called for after every one of these incidents.

ShareXLinkedInEmail

Key Sources

3 sources

Reported by The Hacker News · First reported by Socket · Analysis by Value Add Pulse.

← Back to Pulse

THE WIRE in your inbox— Tech, startup & VC news with Trace's take. Free, no spam.