npm

The keyv and cacheable npm Supply Chain Worm

Updated 21 Oct 2026 · Incident date 4 Aug 2026

keyv 6.0.0, cacheable 2.5.1, cacheable-request 13.0.20, flat-cache 6.1.24 and file-entry-cache 11.1.7 on npm ran hidden code that gathered keys on 4 August 2026.

Aikido calls this a Shai-Hulud style worm. It also spread to hundreds of other packages.

What happened

Attackers took over a maintainer account and published poisoned versions to npm.

  • Each package added setup.mjs, Math_Symbol.js and a preinstall hook that runs node setup.mjs.
  • The script downloads a Bun runtime from GitHub and runs an obfuscated second stage.
  • The second stage steals cloud, Vault, Kubernetes, GitHub Actions OIDC and npm tokens, plus .env files, SSH keys, Terraform state and Docker configs.
  • The worm adds the same hook to packages the victim can publish and republishes them with stolen npm tokens.
  • It writes persistence into .claude/settings.json and .vscode/tasks.json.

Socket reports keyv 6.0.0 at 09:35 UTC on 4 August 2026 and the cacheable packages between 10:09 and 10:14 UTC. Aikido counts more than 440 packages and 1,381 versions in the secondary spread.

Affected versions

  • keyv@6.0.0
  • cacheable@2.5.1
  • cacheable-request@13.0.20
  • flat-cache@6.1.24
  • file-entry-cache@11.1.7 (Socket). Aikido lists 11.1.6, so check both.
  • @cacheable/memory@2.2.1, @cacheable/utils@2.5.1, @cacheable/net@2.1.1, @cacheable/node-cache@3.1.2
  • cache-manager@7.2.10
  • Scoped @keyv/* packages such as @keyv/redis, @keyv/sqlite and @keyv/mongo
  • The full list is longer. Wiz publishes it in its IOC repository.

Indicators of compromise

  • Files: setup.mjs and Math_Symbol.js or math_init.js inside node_modules.
  • Hook in package.json: "preinstall": "node setup.mjs".
  • SHA-256 of setup.mjs: 54dc7ea54a1317cca0e890a2770630cf7fa6c97813e0cb9d2caa93012b350668.
  • SHA-256 of the community-spread setup.mjs: fd3ca4007b225fdf8de7af4345a19179d5efa8c4bb9205f88cda806e5684b1eb.
  • SHA-256 of Math_Symbol.js: 9fc2570b7cef51c1b8df116d144d11ff4096357be7d2c4c6367cfc2509cf1bcc.
  • Temporary folders /tmp/bun-dl-*/.
  • Persistence: ~/.local/bin/gh-token-monitor.sh, ~/.config/gh-token-monitor/, ~/Library/LaunchAgents/com.user.gh-token-monitor.plist, ~/.config/systemd/user/gh-token-monitor.service.
  • Unexpected hooks in ~/.claude/settings.json and .vscode/tasks.json.
  • Network: npm-cache[.]com and eth-mainnet.nodereal[.]io, plus the user agent Bun/1.3.13.
  • GitHub: public repositories with the description "Shai-Hulud: Here We Go Again", and commits by claude with the message "chore: update config".

How to check

List the bad versions in your projects. The command does not run any package.

npm ls keyv cacheable cacheable-request flat-cache file-entry-cache cache-manager

Look for the dropped files.

find . -path "*/node_modules/*" \( -name Math_Symbol.js -o -name math_init.js \) 2>/dev/null; ls -d /tmp/bun-dl-* 2>/dev/null

What to do now

  1. Remove the poisoned versions from developer machines, build agents and CI. Pin to the version before the bad one.
  2. If a bad version was installed, treat the machine as compromised. Remove the persistence files and the bun-dl-* folders first. Socket warns that a dead-man trigger watches your GitHub token.
  3. Then revoke and replace npm, GitHub, cloud, Vault and Kubernetes tokens.
  4. Check your npm account for versions you did not publish on 4 August 2026. Check your GitHub account for new repositories.

What Vigilance would show

These examples show an install hold and the corresponding owner report.

Example install message

Vigilance blocked `keyv` 6.0.0. This version is too new or changed in a way Vigilance must check first.

Example owner report

Bad update

keyv 6.0.0

Installing the library now ran hidden code first that gathered cloud and login keys and re-published poisoned copies of other libraries.

See what to do now.

No security team? See who reads the alert.

Frequently asked questions

Which keyv versions are clean?

The 5.x releases and 6.0.0-rc.1 were clean.

Which malware family is this?

Wiz says it belongs to the "Mini" Shai-Hulud family.

Did the bad releases carry valid signatures?

Yes. Aikido reports the attacker pushed files to the main branch, so the releases carried valid GitHub Actions signatures.

Sources

  1. socket.dev/blog/popular-npm-packages-in-the-keyv-and-cacheable-namespaces-compromised-in-active-supply-chain
  2. wiz.io/blog/keyv-and-cacheable-npm-supply-chain-attack
  3. aikido.dev/blog/keyv-and-friends-compromised-in-npm-supply-chain-attack

Send this page to the person who looks after AI at your company.

Email it

More supply chain attacks

All 172 attacks in the library · npm supply chain attacks · How to prevent supply chain attacks

Check the next update before you install it

Vigilance compares the version you trust with the new one. It names the one file that gained a power the old version did not have.

Start the free 14-day trialBrowse the attack library