Skip to content

Tech StacksNews take7 min read

The keyv npm Worm: What Happened and What to Check Now

An attacker took over the GitHub account behind keyv, a popular Node.js caching library, and shipped a worm through npm with valid provenance. Installing an affected version was enough to hand over a machine's secrets.

By ·

Source: github.com

On August 4, 2026, an attacker took over the GitHub account behind keyv, a widely used Node.js caching library, and published a poisoned keyv 6.0.0 to npm. Within an hour the same credential-stealing payload reached the Cacheable family and ecto, then spread further as the worm republished packages with stolen npm tokens. It matters because simply installing an affected version was enough to hand over a machine’s secrets.

I build with Node.js, TypeScript, Astro and Next.js, and this site’s own lockfile pulls keyv in through ESLint, so I checked it. This take is part of my Tech Stacks writing, and the build behind this site is described in my post on Astro 7 for content sites.

What happened?

The attacker pushed malicious files to the keyv repository and let the project’s own GitHub Actions workflow publish them. According to Datadog Security Labs, the resulting keyv 6.0.0 had genuine SLSA provenance bound to the malicious commit. GitHub published the malware advisory GHSA-3p9h-f68w-m6fx the same day, listing keyv 6.0.0 as affected with no patched version. Security vendors tie the payload to the Shai-Hulud worm family, and Datadog calls this wave ChainDrop.

A small red worm on a white wall

A worm is malware that spreads by itself; this one moved through npm packages. Photo: Gannu03, CC BY-SA 4.0.

Time (UTC)EventSource
Aug 4, 09:02Earliest recovered malicious commit adds a loader, a payload and a preinstall script to keyvDatadog
Aug 4, 09:04A commit adds Claude Code and VS Code execution hooksSnyk
Aug 4, 09:35Malicious keyv 6.0.0 is published to npmDatadog
Aug 4, 09:49 to 09:51GitHub issues report the incidentSnyk
Aug 4, 10:09 to 10:14Nine Cacheable-family releases publish with the payloadSnyk
Aug 4, 10:28ecto 5.0.1 publishes with the same filesSnyk
Aug 4, 10:39 to 11:11npm removes cacheable-request, flat-cache and cache-manager releasesSnyk
Aug 5Aikido counts at least 444 packages across 1,381 versionsAikido
Aug 6Singapore’s CSA issues advisory AD-2026-009CSA
Oct 7 to 8The same worm family hits tensorlake 0.5.144The Hacker News

Who is affected?

Anyone whose install resolved one of the bad versions is affected. Importing the package is not required, because npm runs preinstall scripts automatically during installation. Snyk lists 11 original releases and the last clean version of each:

PackageMalicious versionLast known good (per Snyk)
keyv6.0.05.6.0
flat-cache6.1.246.1.23
file-entry-cache11.1.611.1.5
cacheable2.5.12.5.0
cacheable-request13.0.2013.0.19
cache-manager7.2.107.2.9
@cacheable/memory2.2.12.2.0
@cacheable/utils2.5.12.5.0
@cacheable/net2.1.12.1.0
@cacheable/node-cache3.1.23.1.1
ecto5.0.15.0.0

Container cranes at the port of Bremerhaven

A software supply chain works like a port: one tampered container reaches everyone downstream. Photo: H. Zell, CC BY-SA 3.0.

Snyk notes that flat-cache and file-entry-cache often arrive through development tools such as ESLint. The worm-spread packages are a much longer list, which CSA says Socket.dev maintains. As of October 22, 2026, keyv 6.0.0 is gone from the npm version list for keyv, and registry data shows the same for the other ten, but internal mirrors and caches can still hold copies.

How serious is it?

The keyv compromise is as serious as a supply-chain incident gets. The GitHub advisory says an affected computer “should be considered fully compromised.” Datadog reports the payload checks hundreds of file patterns for secrets and targets GitHub, npm, AWS, Kubernetes and HashiCorp Vault credentials. With a GitHub token that has workflow scope, it can also dump a repository’s Actions secrets.

The attacker also kept remote control. Datadog found that commands from the control server run without signing or sandboxing, so the operator could do more than steal. This was exploited in the wild, not a lab finding: CSA says the campaign reached the software supply chains of several organizations. No CVE applies, because this is planted malware rather than a coding flaw.

What does it mean for small businesses and founders?

The real target is the developer’s machine and the CI runner, not your app. Those hold your cloud keys, GitHub tokens and npm publishing rights, so one install by a freelancer or a build job can expose everything they touch. A small team rarely has a security person watching for this.

The exposure window was short, but short is not the same as safe. npm removed some of the bad releases within about an hour, yet Snyk’s 11:16 UTC snapshot still showed eight malicious releases tagged latest. A fresh project, a CI job with no lockfile or a developer running an upgrade that morning could have pulled one. If you hired a contractor for a Node.js project in August, it is fair to ask whether they checked.

The trust signals failed too. The keyv release had valid provenance and GitHub-verified commits from a bot account, as Snyk documents. The worm also wrote .claude/settings.json and .vscode/tasks.json files so it would run again when someone opened the project. Claude Code is part of my own stack, so I now review those folders in every diff like any other code.

What should you do now?

  1. Search your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock) for the 11 versions above and the Socket.dev list. Check CI caches and private registries too (Snyk).
  2. If you find one, treat the machine as compromised. Isolate it, and rebuild if the package was installed (CSA). Snyk advises checking for a gh-token-monitor persistence file before revoking GitHub tokens.
  3. Rotate secrets from a clean computer: GitHub, npm, cloud, SSH, Kubernetes and Vault credentials (GitHub advisory).
  4. Look for persistence in your repositories: unexpected .claude/ or .vscode/ files, commits titled “chore: update config,” and new public repositories described as “Shai-Hulud: Here We Go Again” (Aikido).
  5. Pin known-good versions with overrides, rebuild the lockfile and reinstall with install scripts disabled (Snyk).
  6. Block install scripts by default (standard practice). In pnpm, packages not listed in allowBuilds cannot run scripts; with npm, use --ignore-scripts where your build allows it.
  7. If you publish packages, lock down publishing (standard practice). npm’s trusted publishing docs recommend requiring 2FA and disallowing tokens, and offer staged publishing that needs a 2FA approval per release.
  8. Update Node.js while you are at it (separate issue). The October 21, 2026 security release ships v22.23.4, v24.22.1 and v26.12.1, fixing four high-severity issues.

HTML and JavaScript code with highlighted functions

Check your lockfiles for affected keyv versions and rotate any secrets on machines that installed them. Photo: Martin Vorel, CC BY-SA 4.0.

Better Stack’s general npm and pnpm hardening guide, not specific to keyv, shows how to disable install scripts and hold back brand-new versions:

npm installs can hack your laptop (Here's how to stop it), a video by Better Stack
Video: npm installs can hack your laptop (Here's how to stop it) by Better Stack, on YouTube.

What can we learn from it?

Provenance answers “where was this built?” and not “is this safe?” The attacker controlled the source, so the honest pipeline signed a malicious package. Account 2FA alone is not enough either: Datadog found the worm used stolen npm tokens that could bypass 2FA.

The campaign is also not over. In October, the same worm family reached tensorlake, a TypeScript SDK, through a rogue commit on October 7. The Hacker News reports that this version adds a monitor that wipes the home directory if the stolen GitHub token is revoked. That is why the order of cleanup now matters: find and remove persistence first, then rotate.

Boring defaults helped this site. The lockfile pins keyv 4.5.4 and flat-cache 4.0.1 through ESLint 10.6.0, far from the poisoned versions. The pnpm config also allows build scripts for only two packages, esbuild and sharp. That combination does not stop every attack, but it turns “install the latest” into a reviewed change.

Where can you learn more?

Share

Keep reading

More in Tech Stacks.

Get new posts by email

One email every two weeks: new posts, news takes and one personal note, so you keep up with AI, automation and SEO without checking the site.

No spam. Unsubscribe any time. By subscribing you agree to the privacy policy.

Prefer a feed? Follow by RSS. About the newsletter.

It’s Showtime, folks! · All That Jazz (1979)