Security

Keyv worm in npm registry steals credentials from AI tools

3 min read

TL;DR Too Long; Didn’t read

A compromised maintenance account spread a worm through 444 npm packages with over two billion monthly downloads on August 4, 2026. The malware specifically searches for credentials from AI programming tools like Claude Code and Cursor. Security researchers removed the manipulated versions within two hours, according to their statements.

A digital worm with an npm logo sticker winds through stacked shipping boxes, golden keys spilling from a torn-open box onto an open laptop Image generated with GPT Image 2

Key takeaways

  • Attackers compromised the GitHub account of Keyv maintainer Jared Wray and released version 6.0.0 with malicious code.
  • Within four hours, the worm spread to 2,212 versions across 444 npm packages.
  • The new target list, according to Wiz, specifically captures configuration files from Claude Code, Cursor, Gemini, and OpenAI's Codex for the first time.
  • The malware embeds itself permanently through hooks in Claude Code settings and the VS Code file tasks.json.
  • The command server addresses are dynamically obtained by the malware via an Ethereum smart contract instead of fixed domains.
  • Wray publicly confirmed the incident and announced a complete audit of his accounts.

A compromised developer account injected a worm into the programming library Keyv on August 4, 2026, which spread to 444 packages in the npm registry within a few hours. The affected packages account for more than two billion monthly downloads combined. The malware specifically searches infected machines for credentials of AI programming tools such as Claude Code and Cursor.

Compromised maintenance account spreads malicious code within hours

According to the security company Wiz, the attack began around 9 AM UTC. Unknown attackers injected malicious code directly into the main branch of the repository via the compromised GitHub account of Keyv maintainer Jared Wray and published the manipulated version 6.0.0.

From there, the worm spread automatically. Using stolen credentials, it published 2,212 manipulated versions across 444 packages within four hours, including cache-manager, flat-cache, and file-entry-cache, as well as packages from large companies like Qlik. Keyv itself accounts for more than 150 million weekly downloads. A prepared installation command downloaded the JavaScript runtime Bun and launched a roughly 710-kilobyte obfuscated second-stage payload.

Malware specifically targets credentials of AI tools

The second stage searches infected systems for classic targets such as npm and GitHub tokens, cloud credentials for AWS and Google Cloud, and Kubernetes and HashiCorp Vault secrets. According to Wiz, the malware belongs to the Shai-Hulud family and carries a target list roughly 70 percent larger than earlier variants. It now explicitly includes configuration files from Claude Code, Cursor, Gemini, and OpenAI’s Codex.

For persistence, the malware also writes its own hooks into Claude Code settings and the VS Code file tasks.json, so it runs again at the start of every new session. Already in July, a similar case involving the package Jscrambler harvested credentials from Claude Desktop and other AI tools. The new campaign, however, far exceeds that case in reach and automated self-propagation.

Command infrastructure runs through an Ethereum smart contract

Instead of fixed servers, the malware uses a smart contract on the Ethereum blockchain to dynamically retrieve the addresses of its control servers, according to analyses by StepSecurity. Security researchers call this technique EtherHiding. The malware additionally encrypts stolen data before exfiltrating it via the domain npm-cache.com.

Wray confirmed the account compromise and stated he had used OpenID Connect rather than permanent access tokens for npm. He also announced a full audit of his accounts. According to CSO Online, the manipulated versions were removed within two hours of discovery, and Wray regained access to his account around 8 PM UTC. Security teams advise development teams to remove affected packages, rotate npm, GitHub, cloud, and Kubernetes credentials, and specifically check systems for persistence files in the .claude and .vscode folders.

It remains unclear how many of the installations downloaded worldwide actually received a manipulated version – this is independently unverified, as the security firms involved have so far only disclosed the number of published malicious versions, not infection counts. The incident does show, however, that credentials for AI coding assistants now count as a standalone attack target, no longer just collateral alongside cloud and crypto credentials.

Frequently asked questions

Are users of Claude Code or Cursor automatically affected if they have installed one of the npm packages?

Only those who installed one of the manipulated versions released after August 4 are affected; older and subsequently cleaned versions are considered safe.

How can development teams recognize if their systems are affected?

Security firms recommend checking node_modules for the affected package versions and project folders for unknown files in .claude and .vscode; corresponding checklists have been published by Wiz and StepSecurity.

Has the security vulnerability been closed yet?

The manipulated versions have been removed from npm, but a complete, independently verified confirmation of all affected accounts is still pending, according to Wray.

Is this incident different from the Jscrambler case from July?

Yes: while Jscrambler affected a single package via a stolen access token, the Keyv worm spread independently to hundreds of other packages through compromised credentials.

Has a CVE entry been assigned for the vulnerability yet?

No, it is an account takeover rather than a classic software vulnerability, which is why no CVE number exists so far.

Sources (4)
  1. Keyv and cacheable npm Supply Chain Attack – Wiz Research
  2. ChainDrop npm Worm: Bun-loaded CI/CD credential harvester with Ethereum dead-drop C2 – StepSecurity
  3. ChainDrop credential stealing worm infects over 400 npm packages – CSO Online
  4. Jared Wray (@jaredwray) – statement on X

Your AI update for the work week

Once a week, the most important AI news – plus one practical tip to try right away. No spam, unsubscribe anytime.

← Back to the blog