Skip to main content

The keyv and cacheable npm Worm: Valid Provenance, Poisoned Source

· 9 min read
Ankush K
Co-founder and CTO, Dwaar
The keyv and cacheable npm Worm: Valid Provenance, Poisoned Source

If any machine or build job of yours ran an npm install on or after August 4, you have a question to answer today, even if you never chose keyv: did that install resolve one of the versions below? The malware runs at install time, steals credentials and republishes itself. Its first release carried valid provenance, so an attestation check would have passed it.

FieldDetail
IdentifierNo CVE. GHSA-3p9h-f68w-m6fx and MAL-2026-11524. Press label: ChainDrop
Affectedkeyv 6.0.0, the Cacheable family, and hundreds of other packages
Fixed inNone listed by the advisory, so remove it and return to the prior version. Reported restored as latest on August 4: keyv 5.6.0, flat-cache 6.1.23, cache-manager 7.2.9
SeverityNo CVSS, nobody scored it. GitHub classifies it as Malware, CWE-506
Exploited as of 2026-08-06Yes. Self-propagating malware, not a vulnerability
Disclosed2026-08-04

What happened​

A commit titled chore: update config landed on keyv at 09:04:30 UTC, authored as github-actions[bot] and shown as verified. npm timestamps keyv@6.0.0 at 09:35:00 UTC. Registry timestamps then show the spread: cacheable 2.5.1 at 10:10:44, flat-cache 6.1.24 at 10:10:55, cache-manager 7.2.10 at 10:14:41, ecto 5.0.1 at 10:28:01.

The counts disagree, and they count artifacts, not victims. The Hacker News carries 420 names and 1,684 versions from one research team, and CSA Singapore says over 1,300 versions. CSO Online quotes 444 packages and 2,212 versions as of 18:10 UTC, with more than 2 billion combined monthly downloads. That measures package reach, not bad installs.

The root cause​

Getting in. Infosecurity Magazine and CSO Online report that the maintainer's GitHub account was compromised. The Hacker News says the initiating credential was not established, and that neither the verified badge nor the bot author identifies who held it. No source says how it happened. CSO paraphrases maintainer Jared Wray as saying he uses OIDC with npm and one-time codes on GitHub.

Infosecurity quotes researchers describing a direct push to main followed by an immediate release. The Hacker News adds that the commit planting the hooks carried a verified badge and a bot author. Either way, the release went through the project's real workflow.

Why the provenance was valid. That workflow built already trojanized source, and npm attached valid OIDC and SLSA provenance. As the OSV record puts it, "provenance attests build integrity, not source integrity".

What runs. package.json gains "preinstall": "node setup.mjs". The compiled library is untouched, so the package still works. setup.mjs downloads a Bun runtime and uses it to run Math_Symbol.js, an obfuscated bundle of about 728 KB. It goes after cloud metadata endpoints and keys, Vault tokens, Kubernetes service-account tokens, GitHub Actions OIDC and secrets, and npm tokens, then sweeps for other secrets. With the stolen npm identity, including trusted publishing, it republishes whatever that identity can reach. Stolen data is encrypted, and Elastic Security Labs describes the route out. The worm asks an Ethereum smart contract for the current exfiltration endpoint at runtime, and Elastic observed the dead-drop domains awqhnjewqjkl[.]icu and npm-cache[.]com. If that lookup fails, it searches GitHub commit history for a signed marker that yields a domain. Only if both paths fail does it use a public GitHub repository described as "Shai-Hulud: Here We Go Again".

The path with no install. Hooks in .claude/settings.json (SessionStart) and .vscode/tasks.json (a task named Environment Setup, run on folder open) call the same loader when a developer or coding agent opens a clone. They fire only if the workspace is trusted or project configuration is permitted. Treat those files as code.

What to check and do now​

Search for these exact versions, from the CSA Singapore advisory. The list is partial:

  • keyv 6.0.0, ecto 5.0.1
  • cacheable 2.5.1, cacheable-request 13.0.20, cache-manager 7.2.10
  • flat-cache 6.1.24, file-entry-cache 11.1.6
  • @cacheable/memory 2.2.1, @cacheable/utils 2.5.1, @cacheable/net 2.1.1, @cacheable/node-cache 3.1.2
  1. Search lockfiles, not package.json, and not latest. Tags moved during the incident. The Hacker News: "Upgrading alone may therefore preserve the exposure."
  2. Treat a match as a breach, even for an unused transitive dependency. A preinstall hook does not care whether you import the package. The GitHub advisory says such a machine "should be considered fully compromised". Rebuild it, as CSA advises.
  3. Do not rotate first. The payload installs a token-revocation watcher, and The Hacker News warns that rotating first "can run an attacker-supplied local handler." Take the host out of service, remove the watcher or rebuild, then rotate from a different, clean machine: cloud, GitHub, SSH, Kubernetes, Terraform and npm credentials.
  4. Hunt the indicators. Look for an install process fetching Bun 1.3.13 from GitHub releases, the file hashes in the OSV record, .claude/setup.mjs and .vscode/setup.mjs, and npm versions you did not publish. Check network logs for npm-cache[.]com and awqhnjewqjkl[.]icu, and for Bun reaching Ethereum RPC endpoints such as eth-mainnet.nodereal[.]io, because updating the contract rotates the domains. Search for public GitHub repositories with that Shai-Hulud description too, and not only in your organization: one advisory says they are created under compromised identities, so include the personal accounts of your developers and CI identities. Finding no repository does not clear a host, since data may have left over the primary channel. Maintainers should treat publish credentials as exposed.
  5. Change the default. Use npm's --ignore-scripts in CI and set a minimum release age of 3 to 7 days, which CSO says npm, pnpm, Yarn and Bun support.

The Hacker News cites researchers who found the keyv 5.x line and the published @keyv/* adapters clean. Given the reported compromise of the maintainer's account, I would still check any @keyv/* entry in your lockfile against its published tarball.

What repeats, and what changes​

Researchers place this in the Shai-Hulud family, and CSA uses the name. The Hacker News cautions that the overlap "does not establish who operated the August activity". So say same playbook, operator unknown.

The playbook is what stays: steal from developer machines and CI, republish with the stolen identity, and keep public GitHub repositories as one place to drop the loot. The Hacker News reports that researchers documented the same hooks, filename and Bun download in an April compromise of lightning on PyPI. A researcher quoted by Infosecurity says the worm "keeps moving through trusted publishing workflows".

The trigger is what changes. June's Miasma packages used a preinstall hook and wrote a SessionStart hook and a folderOpen task as persistence. Three weeks ago, trojaned AsyncAPI packages also shipped with valid provenance, but with no install script: the payload ran when the module loaded. This one is back to a preinstall hook, with that editor and agent config planted in the repository as a second door. Detection pinned to one trigger ages fast, so build on what recurs: what a build job's identity can read and publish, and what a tarball does when installed or loaded.

Keep verifying provenance, but know where it stops. Reading the tarball is what shows a preinstall hook calling a file the library never references. And with no CVE and no CVSS, a queue sorted by severity has nothing to sort.

Pick one job that installed npm packages on August 4. List the exact versions it resolved, then every secret it could read. Shrink that second list this week, whether or not the first one has a match.

References​