ChainDrop: The keyv npm Worm That Shipped With Valid Provenance
A hijacked maintainer account, a legitimate release pipeline, and a self-propagating "Mini Shai-Hulud" payload that poisoned hundreds of npm packages in hours
Date: August 4, 2026 Primary Source: Microsoft Security Blog · Datadog Security Labs

Executive Summary
- What: On August 4, 2026, an attacker used a compromised GitHub maintainer account to push malicious code into the keyv repository. The project's own GitHub Actions workflow then built and published poisoned releases with legitimate provenance attestations. The payload, which Microsoft tracks as ChainDrop and describes as a "Mini Shai-Hulud" variant, steals developer and cloud credentials and republishes itself using stolen npm tokens. (Microsoft) (Snyk)
- Who is affected: Developers and build systems that installed affected versions of keyv, cacheable, flat-cache, file-entry-cache, cache-manager, ecto, and hundreds of downstream packages from other publishers. Estimates differ by source. Microsoft and Elastic say 400+ packages. Aikido counts 444 packages across 1,381 versions. Singapore's CSA reports more than 1,300 compromised versions with about 2 billion combined monthly downloads. (Microsoft) (Elastic) (Aikido) (CSA Singapore)
- Severity: Critical for any host where an affected version was installed with lifecycle scripts enabled. That includes developer laptops and CI/CD runners that hold publishing and cloud credentials.
- Action required: Find affected versions in lockfiles and caches. Rebuild exposed hosts, rotate every credential they could reach, and search repositories for injected
.claude/and.vscode/hooks. (Microsoft) (CSA Singapore) - The honest scope note: White Cloud Security does not stop a malicious
preinstallscript. That script runs inside an approvednodeprocess. What White Cloud Security governs is the next step: whether the Bun runtime the dropper downloads into a temp folder is allowed to run, along with any other unapproved executable that follows. On ephemeral cloud CI runners where no endpoint agent is installed, it governs nothing.
Overview
The keyv library is a small key-value storage abstraction. It is also a dependency of dependencies across the JavaScript ecosystem. Aikido puts keyv at roughly 127 million weekly npm downloads. flat-cache and file-entry-cache, which share its maintainer ecosystem, each see more than 550 million downloads a month. (Infosecurity Magazine) (Aikido)
The attack did not rely on a typosquat or a stolen npm token at the start. Datadog's timeline shows the earliest malicious commit landing at 09:02:37 UTC on August 4. The commit added payload files and preinstall hooks. GitHub Actions bot commits followed across several branches. At 09:12:13 UTC the release branch was reset to hide the visible hooks while keeping the npm loader. Between 09:29:50 and 09:35:01 UTC, legitimate SLSA provenance was generated and [email protected] was published. Nine more compromised Cacheable and Ecto releases followed within the hour. (Datadog)
Snyk's summary of the provenance problem is the most important sentence in the incident: "The malicious source was present in the tagged repository state, so the legitimate workflow built and attested the malicious artifact." (Snyk) The attestation was accurate. It proved the package came from that repository and that workflow. It could not prove the repository was clean.
From there the payload behaved like a worm. On every host where it ran, it collected npm publishing tokens. It used those tokens to inject itself into other packages the victim could publish, then republished them. Within hours the infection had reached packages from organizations with no connection to keyv, including scoped packages from Deliveroo, Ornikar, OneReach, Picsart, and Qlik. (Infosecurity Magazine) (Wiz)
No threat actor has been attributed. The Hacker News reports that neither the initial access path into the maintainer's account nor the operator has been identified. (The Hacker News)
Threat Summary
| Field | Detail |
|---|---|
| Campaign name | ChainDrop, a "Mini Shai-Hulud" variant (Microsoft); linked by Aikido to the Shai-Hulud family (The Hacker News) |
| CVE ID(s) | None. This is a malicious-package compromise, not a software vulnerability |
| CVSS Score | Not applicable |
| Initial access | Compromised GitHub maintainer account for keyv. The method has not been disclosed (Snyk) (The Hacker News) |
| First-wave packages | [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], @cacheable/[email protected], @cacheable/[email protected], @cacheable/[email protected], @cacheable/[email protected], [email protected] (Datadog) |
| Total scope | 400+ packages (Microsoft, Elastic); 444 packages / 1,381 versions (Aikido); 1,684 versions across 420 names (SafeDep, via The Hacker News); 1,300+ versions (CSA Singapore). Counts are of package artifacts, not infected machines (Microsoft) (Aikido) (The Hacker News) (CSA Singapore) |
| Attack vector | Software supply chain. Code runs at npm install through a preinstall lifecycle script |
| Exploited in the wild | Yes. Actively self-propagating on August 4, 2026 |
| Attribution | Unattributed (The Hacker News) |
| Remediation | Remove affected versions, rebuild exposed hosts, and rotate credentials. See the Wiz package list linked in the IOC section (Wiz) |
A note on dates: vendor reporting from Microsoft, Wiz, Datadog, Snyk, Elastic, and Aikido is dated August 4, 2026. Singapore's Cyber Security Agency advisory AD-2026-009 is dated August 6, 2026. (CSA Singapore)
Technical Analysis
How the Attack Works
- Take over the maintainer's GitHub account (MITRE ATT&CK T1078, Valid Accounts). How this happened has not been disclosed. (Snyk)
- Push malicious files to the repository (T1195.002, Compromise Software Supply Chain). The commits added
setup.mjs, a large obfuscatedMath_Symbol.jsbundle (727,680 bytes), and"preinstall": "node setup.mjs"inpackage.json. (Snyk) - Let the real pipeline publish it. The legitimate GitHub Actions release workflow built, signed, and attested the poisoned code. The npm provenance was valid. (Snyk) (Datadog)
- Run on install. When a developer or CI job runs
npm install, npm runs thepreinstallhook.setup.mjsdownloads Bun v1.3.13 from Bun's official GitHub releases into a temporarybun-dl-*directory and does not verify it cryptographically. (Aikido) (Datadog) (Wiz) - Execute the real payload under Bun, not Node (T1059.007, JavaScript). The obfuscated second stage runs inside the Bun runtime. Outside CI it re-spawns itself detached, so it keeps running after the install finishes. (Datadog)
- Harvest credentials (T1552, Unsecured Credentials). Datadog counted 290 Linux, 129 macOS, and 50 Windows file patterns. Targets include SSH keys, Git and npm tokens, AWS credentials, Kubernetes secrets, and crypto wallets, plus the full
process.envandgh auth tokenoutput. The payload queries AWS Secrets Manager and Parameter Store, in-cluster Kubernetes secrets, and HashiCorp Vault. On Linux GitHub Actions runners withsudo, it reads secret values fromRunner.Workermemory. (Datadog) - Exfiltrate and take instructions. C2 domains are resolved from an Ethereum smart contract. Data is sent AES-256-GCM encrypted to
/routerendpoints. C2 responses containing code are passed toeval(). (Datadog) - Propagate (T1195.002). With a stolen npm token, the worm downloads the victim's current tarballs and injects the loader. It replaces the whole
scriptsobject with thepreinstallhook, increments the patch version, and republishes. (Datadog) - Persist in repositories and on the host (T1546, Event Triggered Execution). The worm writes files to up to 50 branches.
.claude/settings.jsonadds aSessionStarthook that runs.claude/setup.mjs..vscode/tasks.jsonadds afolderOpentask. Both relaunch the chain when a developer opens the project. On the host, it installs agh-token-monitorscript with a systemd user service or macOS LaunchAgent. (Datadog) (Snyk) (Elastic)
Payload and Impact
The damage is credential exposure, and it compounds. One developer laptop or CI runner that installs an affected version can expose that organization's npm publishing rights, GitHub tokens, cloud keys, and cluster secrets. Stolen npm tokens then carry the infection into packages owned by someone else. Stolen material was also pushed to public GitHub repositories with the description "Shai-Hulud: Here We Go Again." (Microsoft) (Wiz)
The IDE hooks deserve particular attention. Removing the bad package version does not remove a .vscode/tasks.json or .claude/settings.json that was committed to a branch. The next person who opens that repository in a trusted workspace runs the loader again.
Why Traditional Defenses Struggle
- Provenance said yes. Signed attestations proved build origin, and the origin was compromised. Controls that treat "has valid provenance" as "is safe" approved this release. (Snyk)
- The first stage is a script run by a trusted interpreter.
node setup.mjsis a normal thing to see duringnpm install. There is no new executable at that moment, only JavaScript inside a process that runs thousands of times a day. - The runtime is legitimate software. Bun is a genuine, widely used tool, downloaded from its official release location. (Aikido) Reputation checks see a known-good file.
- Heavy obfuscation. Datadog found a Base91 string table with 4,613 entries and 73 alphabet permutations, which makes static signatures fragile. (Datadog)
- The C2 address can be changed. Resolving domains from a blockchain contract means blocking today's domains does not block tomorrow's. (Datadog)
- Detection arrives after collection. By the time behavioral analytics flag an unusual child process, the environment variables and token files may already have been read.
How White Cloud Security Trust Lockdown Stops This
Two points are true at once, and leaving out either would be misleading.
White Cloud Security would not have prevented the compromise or the first stage. The maintainer account, the release pipeline, and the npm registry are outside the endpoint. The preinstall script is JavaScript run by a node binary your developers need.
What White Cloud Security governs is the handoff to new executables, and ChainDrop makes one early in its chain.
Least-Privilege Zero-Trust App Firewall
White Cloud Security (WCS) Trust Lockdown™ enforces Default-Deny Zero-Trust Application Control over applications, libraries, and scripts. Only software that has been explicitly approved is permitted to execute. Here is how that maps to the chain:
| Attack step | White Cloud Security control |
|---|---|
| 1–3. Maintainer account takeover, malicious commits, pipeline publishes with valid provenance | Not covered. These happen on GitHub and npm, not on your endpoints. |
4a. npm install runs node setup.mjs |
Not covered. The script runs inside an approved node process. |
4b. Downloaded Bun binary in a bun-dl-* temp directory tries to launch |
Denied at execution on protected hosts where Bun is not already approved. The new file has no approved handprint, so it does not run. |
5–7. Obfuscated payload, credential harvesting, C2 eval() |
Not reached on that host if the Bun launch was denied. Not covered if Bun is already approved there, or if the code runs inside another approved interpreter. |
| 8. Republishing with stolen tokens | Not covered. This uses legitimate registry APIs with credentials already stolen from somewhere. |
9a. .claude / .vscode hooks relaunch node .../setup.mjs |
Not covered for the Node step. The Bun download it triggers meets the same deny as step 4b. |
9b. Host persistence (gh-token-monitor script and service) and any later unapproved tools |
Denied at execution where scripts and binaries without an approved handprint are enforced. |
| GitHub-hosted or other ephemeral CI runners | Not covered. No endpoint agent runs there, so no execution policy applies. |
This amounts to partial containment, and the value depends on one condition: Bun must not be broadly approved on your developer and build hosts. Where Bun is not approved, the Bun download in step 4b is the point where the attack stops on that machine. If your teams already use Bun and it is approved, that official binary is an approved binary, and this control does not engage for the payload.
Handprint Identity
WCS identifies files by handprint: SHA-1, SHA-256, SHA-512, MD5, CRC32, and file length. It does not use names or paths. A randomly named bun-dl-* directory in /tmp does not change the file's identity, and renaming the runtime does not help an attacker. Trust Profiles built on administrator-approved code-signing certificates let genuinely vendor-signed updates flow without approving every build by hand. A code-signing certificate you have not approved grants nothing.
At White Cloud Security, we continue to track and report new hacking methods and tools — not just because of its immediate threat, but because patterns of reuse often expose the playbooks of these cybercriminal groups.
To state the limit plainly: application control does not inspect JavaScript running inside approved node, does not stop credentials being read by an approved interpreter, and does not protect CI runners it is not installed on. It does not replace dependency pinning, release-age delays, credential rotation, MFA on maintainer accounts, EDR, backups, or network segmentation. It complements them by denying the unapproved executables this worm depends on.
Recommended Mitigations
- Check your lockfiles and caches for the affected versions, including transitive dependencies. Purge npm and yarn caches on developer endpoints and build hosts. (Microsoft)
- Treat exposed hosts as breached. Rebuild them rather than cleaning them in place. Rebuild base images and golden build runners too. (CSA Singapore) (Microsoft)
- Rotate credentials from a clean system. That means npm tokens, GitHub PATs, cloud keys, SSH keys, Kubernetes and Vault credentials, and database secrets. Snyk advises hunting for
gh-token-monitorpersistence before revoking GitHub credentials. (Snyk) - Search every branch for injected
.claude/settings.json,.claude/setup.mjs,.vscode/tasks.json, and.vscode/setup.mjs. Look for commits with the messagechore: update config. (Wiz) (Elastic) - Limit lifecycle scripts. Install with
--ignore-scriptswhere you can. Microsoft recommends npm CLI 12 withmin-release-age, and Elastic notes that npm 12 blockspreinstallhooks by default. (Microsoft) (Elastic) - Harden publishing. Require MFA on maintainer accounts, avoid automation tokens that bypass 2FA, use protected environments and workflow approvals for releases, and keep token scopes narrow. (Elastic) (Microsoft)
- Enforce Default-Deny application control on developer workstations and self-hosted build agents, and do not broadly approve runtimes your teams do not use.
Indicators of Compromise
These are reproduced from the cited vendors. Check the original posts for updates.
| Type | Indicator | Source |
|---|---|---|
| SHA-256 | 54dc7ea54a1317cca0e890a2770630cf7fa6c97813e0cb9d2caa93012b350668 (setup.mjs, npm tarball preinstall loader) |
Microsoft, Snyk |
| SHA-256 | fd3ca4007b225fdf8de7af4345a19179d5efa8c4bb9205f88cda806e5684b1eb (setup.mjs, .claude/.vscode loader) |
Microsoft, Datadog |
| SHA-256 | 9fc2570b7cef51c1b8df116d144d11ff4096357be7d2c4c6367cfc2509cf1bcc (Math_Symbol.js / math_init.js) |
Microsoft, Snyk |
| SHA-256 | 927387d0cfac1118df4b383decc2ea6ba49c9d2f98b47098bcbcba1efc026e1f (.vscode/tasks.json) |
Datadog |
| SHA-1 | 35a672cf34b996b91f3e1c28cbf3a05a37e036e4 (Math_Symbol.js / math_init.js) |
Wiz |
| SHA-1 | 686aa40d0fc22c8d569494543a0f891f359f2f99 (setup.mjs, .claude) |
Wiz |
| SHA-1 | f525d52ceb966516686b482d3dc0137028cc6a63 (setup.mjs, .vscode) |
Wiz |
| C2 domains | npm-cache[.]com, pypi-get[.]com, js-mirror[.]com, awqhnjewqjkl[.]icu |
Microsoft, Datadog |
| C2 URL | hxxps://npm-cache[.]com:443/router |
Microsoft |
| Ethereum contract | 0xE1f2395ee43e45A1556EC6438a88c31B83493103 (selector 0x53ed5143) |
Microsoft, Datadog |
| User-Agent | Bun/1.3.13 |
Wiz |
| Paths | /tmp/bun-dl-*/, node_modules/keyv/Math_Symbol.js, tmp.dpkg_14527.lock |
Wiz, Datadog |
| Persistence | ~/.local/bin/gh-token-monitor.sh, gh-token-monitor.service, com.user.gh-token-monitor.plist |
Datadog |
| Markers | Repo description Shai-Hulud: Here We Go Again; commit search marker thebeautifulmarchoftime; env var _NODE_RUNTIME_INIT=1 |
Microsoft, Datadog |
Wiz publishes the full affected-package list at github.com/wiz-sec-public/wiz-research-iocs (reports/keyv-packages.csv). (Wiz)
Key Takeaways
- Valid provenance proves where a package came from, not that it is safe. ChainDrop was built and attested by keyv's own release pipeline. (Snyk)
- Scope estimates differ widely. Credible sources put it between 400 and roughly 450 packages and 1,300 to 1,700 versions. All of them count artifacts, not victims. (Microsoft) (The Hacker News) (CSA Singapore)
- Removing the package does not end the incident. Injected
.claudeand.vscodehooks in your repositories, plus host-level token monitors, can relaunch the chain. - Credential rotation is the real cleanup. Assume anything a compromised host could read has been taken.
- White Cloud Security helps partially here, and we want to be clear about which part. It would help deny the downloaded Bun runtime and later unapproved executables on protected endpoints. It does not stop the
preinstallJavaScript, and it does not cover ephemeral CI runners.
References
- Microsoft Security Blog — "ChainDrop supply chain compromise: Anatomy of a self-propagating worm," August 4, 2026
- Wiz — "keyv and cacheable npm Package Hijacked in Supply Chain Attack," August 4, 2026
- Datadog Security Labs — "'ChainDrop' worm compromises hundreds of popular npm packages," August 4, 2026
- Snyk — "Inside the keyv npm compromise: preinstall malware, trusted provenance, and IDE hooks"
- Elastic Security Labs — "Shai-Hulud strikes again: CHAINDROP worm hits 400+ npm packages"
- Aikido — "keyv and friends compromised in npm supply chain attack"
- The Hacker News — "Keyv-Linked npm Worm Poisons Hundreds of Packages, Plants Claude Code and VS Code Hooks"
- Infosecurity Magazine — "ChainDrop Worm Hits 400 npm Packages with Two Billion Monthly Installs"
- Cyber Security Agency of Singapore — Advisory AD-2026-009, August 6, 2026
Further Reading
- AsyncAPI CI/CD Compromise: Malware Signed by the Project's Own Release Pipeline
- jscrambler npm Compromise: A Rust Infostealer That Went Looking for Your AI Assistant's Credentials
- Miasma npm Supply-Chain Attack Shows Why Trusted Software Must Be Continuously Verified
- Mastra npm Compromise: How WCS Blocks Malicious Payloads Even After a Poisoned Dependency Is Installed
- Axios npm Supply Chain Attack: Why Default-Deny Execution Control Matters
npm is a trademark of npm, Inc. GitHub and Visual Studio Code are trademarks of GitHub, Inc. and Microsoft Corporation, respectively. Claude is a trademark of Anthropic PBC. None of these organizations, and none of the maintainers of the affected packages, is affiliated with or endorses White Cloud Security, Inc. All technical details are drawn from the sources linked above. Trust Lockdown™ is a trademark of White Cloud Security, Inc.