ctipilot.ch
← Back to the live brief
HIGHexploitedNATOB1threatdeep dive

CHAINDROP — the Shai-Hulud npm worm returns through the keyv maintainer, backdoors 400+ packages, and resolves its exfiltration endpoint from an Ethereum smart contract

discovered 2026-08-06 04:11 UTCrun 2026-08-06T0411Z-intel2 sourcesmulti-source

Elastic Security Labs identified a new Shai-Hulud campaign on 2026-08-04 that began by trojanising the monorepo of keyv, a widely used key-value storage library, and embedding a self-propagating worm it names CHAINDROP (Elastic Security Labs, 2026-08-06). Elastic reports over 400 unique npm packages compromised at the time of writing, and quantifies the blast radius through download volume: keyv alone received over 600 million downloads in the preceding month, with flat-cache near 580 million, cacheable-request over 137 million, cacheable over 30 million and cache-manager over 16 million (Elastic Security Labs, 2026-08-06). OX Security published its own first-hand analysis two days earlier and describes a massive Shai-Hulud campaign against npm on its own larger package and download counts (OX Security, 2026-08-04). Elastic frames the wave explicitly as the return of Shai-Hulud rather than a new family, and points to the Dune-derived naming the payload reuses as the similarity to previous Shai-Hulud campaigns (Elastic Security Labs, 2026-08-06).

Execution. The chain starts at a preinstall hook in package.json, abusing a legitimate npm feature that runs arbitrary commands before a package is installed and therefore needs no interaction from the victim beyond the install itself (Elastic Security Labs, 2026-08-06). Every subpackage in the keyv repository was backdoored with a dropper that checks whether the Bun JavaScript runtime is present and, if not, detects the host platform and architecture and downloads Bun directly from its official release page before using it to execute the payload; the temporary Bun directory is deleted afterwards (Elastic Security Labs, 2026-08-06). The payload is cross-platform across Linux, macOS and Windows, and is heavily obfuscated at 711 kilobytes using control-flow flattening (Elastic Security Labs, 2026-08-06). It appears under two filenames — one in packages compromised directly from the keyv monorepo, another in packages trojanised during worm propagation — which share the same hash, so the filename indicates which generation of the infection a defender is looking at (Elastic Security Labs, 2026-08-06).

A second infection route that does not involve installing anything. In Visual Studio Code a folderOpen task under tasks.json runs the dropper when an infected repository is merely opened, and where the stolen credential set includes a GitHub App token the worm commits malicious hooks to up to 50 branches per accessible repository, injecting both a .claude/settings.json and a .vscode/tasks.json into each — so a developer can be infected by opening the repository (Elastic Security Labs, 2026-08-06). That is the operationally important departure: an organisation that responds to a supply-chain wave purely by pinning or freezing dependency installs has not closed the path that fires when an engineer clones and opens the repository, and the AI-assistant configuration file is a trust surface most repository review does not read.

Collection and exfiltration. A collector component scans over 300 unique patterns across credential stores on a developer machine, with notable targeting of AI-tooling credentials for Anthropic, Claude, Codex, Cursor, OpenAI and Gemini, alongside AWS, GCP, Azure and Alibaba Cloud credentials, GitHub personal-access tokens, JWTs and session tokens, HashiCorp Vault tokens, SSH private keys, Kubernetes service-account tokens and npm tokens (Elastic Security Labs, 2026-08-06). Harvested material is gzip-compressed, encrypted under a randomly generated AES-256-GCM key, and that key is in turn RSA-encrypted to the attacker's hardcoded public key (Elastic Security Labs, 2026-08-06). For delivery, CHAINDROP does not hardcode a command-and-control domain: it queries an Ethereum smart contract at runtime to retrieve the current exfiltration endpoint, using multiple RPC providers as fallbacks, so the operator can rotate infrastructure by updating the contract rather than by shipping a new payload (Elastic Security Labs, 2026-08-06). If that path and its successor fail, it falls back to exfiltrating through a public GitHub repository created under the victim's own account with a fixed Shai-Hulud description string (Elastic Security Labs, 2026-08-06).

A containment-sequencing warning the two reports do not agree on. OX Security states the malware carries a dead man's switch that deletes the current machine if the stolen GitHub token is revoked (OX Security, 2026-08-04). Elastic's own guidance is to revoke all GitHub tokens for impacted machines and does not mention any such trigger (Elastic Security Labs, 2026-08-06). Only one vendor reports it and the other does not corroborate it, so treat it as an unconfirmed claim from a first-hand analysis rather than an established property — but sequence around it, because the cost of being wrong is asymmetric. Isolating and imaging a suspected host before revoking its GitHub token loses nothing if the switch does not exist, while revoking first loses the host and its evidence if it does.

Propagation gate. The worm activates only when the credential sweep turns up an npm token meeting two conditions together: package-write permission, and the ability to publish without two-factor authentication (Elastic Security Labs, 2026-08-06). Given a qualifying token it enumerates every package the victim can publish to, downloads each latest tarball from the registry, and republishes it trojanised (Elastic Security Labs, 2026-08-06). That gate is the single most useful fact in the report for a defender, because it converts an unbounded ecosystem-wide risk into a property you can audit on your own accounts.

Triage: developer and CI hosts legitimately run script interpreters from package-manager parents on every build, and legitimately download toolchains, so neither alone discriminates. The separating features are that the runtime is fetched mid-install rather than during provisioning and its directory is removed immediately afterwards; that the process reads credential stores belonging to unrelated tools — cloud CLIs, SSH, Kubernetes, AI assistants — in one burst, which no ordinary build step does; and that outbound blockchain RPC follows the credential reads in the same process tree. Any one of these is weak on its own; the sequence is the signal.

keyv alone received over 600 million downloads last month

Execution is triggered via a preinstall hook in package.json.

package write permissions and the ability to publish without two-factor authentication (bypass_2fa)

CHAINDROP does not hardcode a C2 domain; instead, it queries an Ethereum smart contract

Elastic Security Labs 2026-08-06

A massive Shai-Hulud campaign hit npm

OX Security 2026-08-04

Defender actions

  • Audit every npm publish token your organisation and its maintainers hold and revoke any that can publish without two-factor authentication — that exact token property, not package popularity, is what decides whether the worm spreads from a compromised developer to your packages.
  • On any developer workstation or build agent that installed a package from the keyv family since 2026-08-04, treat the AI-assistant, cloud, GitHub, Vault, SSH and Kubernetes credentials present on that host as disclosed and rotate them; the collector sweeps over 300 credential patterns in one pass, so partial rotation leaves the operator a working set. Isolate and image the host before revoking its GitHub token — OX Security reports a trigger that wipes the machine when that token is revoked, so revocation-first destroys the forensic evidence you would need.

ATT&CK mapping

8 techniques mapped from the cited reporting · MITRE ATT&CK v19.1

Initial Access TA0001
T1195.002Supply Chain Compromise: Compromise Software Supply Chain

Adversaries may manipulate application software prior to receipt by a final consumer for the purpose of data or system compromise. Supply chain compromise of software can take place in a number of ways, including manipulation of the application source code, manipulation of the update/distribution mechanism for that software, or replacing compiled releases with a modified version.

overlap matrix · ATT&CK page ↗

Execution TA0002
T1059.007Command and Scripting Interpreter: JavaScript

Adversaries may abuse various implementations of JavaScript for execution. JavaScript (JS) is a platform-independent scripting language (compiled just-in-time at runtime) commonly associated with scripts in webpages, though JS can be executed in runtime environments outside the browser.

overlap matrix · ATT&CK page ↗

Persistence TA0003
T1546Event Triggered Execution

Adversaries may establish persistence and/or elevate privileges using system mechanisms that trigger execution based on specific events. Various operating systems have means to monitor and subscribe to events such as logons or other user activity such as running specific applications/binaries. Cloud environments may also support various functions and services that monitor and can be invoked in response to specific cloud events.

overlap matrix · ATT&CK page ↗

Privilege Escalation TA0004
T1546Event Triggered Execution

Adversaries may establish persistence and/or elevate privileges using system mechanisms that trigger execution based on specific events. Various operating systems have means to monitor and subscribe to events such as logons or other user activity such as running specific applications/binaries. Cloud environments may also support various functions and services that monitor and can be invoked in response to specific cloud events.

overlap matrix · ATT&CK page ↗

Stealth TA0005
T1027Obfuscated Files or Information

Adversaries may attempt to make an executable or file difficult to discover or analyze by encrypting, encoding, or otherwise obfuscating its contents on the system or in transit. This is common behavior that can be used across different platforms and the network to evade defenses.

overlap matrix · ATT&CK page ↗

Credential Access TA0006
T1552.001Unsecured Credentials: Credentials In Files

Adversaries may search local file systems and remote file shares for files containing insecurely stored credentials. These can be files created by users to store their own credentials, shared credential stores for a group of individuals, configuration files containing passwords for a system or service, or source code/binary files containing embedded passwords.

overlap matrix · ATT&CK page ↗

Collection TA0009
T1119Automated Collection

Once established within a system or network, an adversary may use automated techniques for collecting internal data. Methods for performing this technique could include use of a Command and Scripting Interpreter to search for and copy information fitting set criteria such as file type, location, or name at specific time intervals.

overlap matrix · ATT&CK page ↗

Command and Control TA0011
T1568Dynamic Resolution

Adversaries may dynamically establish connections to command and control infrastructure to evade common detections and remediations. This may be achieved by using malware that shares a common algorithm with the infrastructure the adversary uses to receive the malware's communications. These calculations can be used to dynamically adjust parameters such as the domain name, IP address, or port number the malware uses for command and control.

overlap matrix · ATT&CK page ↗

Exfiltration TA0010
T1567.001Exfiltration Over Web Service: Exfiltration to Code Repository

Adversaries may exfiltrate data to a code repository rather than over their primary command and control channel. Code repositories are often accessible via an API (ex: https://api.github.com). Access to these APIs are often over HTTPS, which gives the adversary an additional level of protection.

overlap matrix · ATT&CK page ↗

PROVENANCE

AI-generated · no human review · this permalink is the shareable record for the finding · verify operationally critical claims against the linked primary source.