← Lab /Security & privacy

CHAINDROP worm compromises 400+ npm packages, including keyv and its dependents

The CHAINDROP worm has infected over 400 npm packages by stealing credentials and self-propagating via preinstall hooks.

Security & privacy Elastic Security Labs 6 Aug 2026 Attack Real-world evidence

Published as “Shai-Hulud strikes again: CHAINDROP worm hits 400+ npm packages”

Why it matters

The worm shows that npm preinstall hooks can be weaponized for large-scale supply-chain attacks, prompting the need for stricter package vetting and token hygiene.

Summary

Elastic Security Labs discovered a supply-chain worm named CHAINDROP that hijacks the keyv monorepo and uses a preinstall hook to execute a dropper that fetches the bun runtime and runs an obfuscated payload. The worm harvests a wide range of credentials, including AI tooling and cloud provider tokens, and exfiltrates data via an Ethereum smart contract-defined C2 endpoint. Over 400 unique npm packages have been compromised, affecting libraries with hundreds of millions of monthly downloads. Detection rules and hunting queries are provided, but the attack demonstrates the risk of npm preinstall hooks and credential leakage.

What they found 3

  1. Over 400 unique npm packages have been compromised by the CHAINDROP worm.

    “At the time of this writing, over 400 unique npm packages have been compromised.”

  2. The worm is triggered via a preinstall hook in package.json.

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

  3. CHAINDROP retrieves its C2 endpoint from an Ethereum smart contract at address 0xE1f2395ee43e45A1556EC6438a88c31B83493103.

    “CHAINDROP does not hardcode a C2 domain; instead, it queries an Ethereum smart contract at address 0xE1f2395ee43e45A1556EC6438a88c31B83493103 to retrieve the current exfiltration endpoint at runtime.”

Caveats 1

  • The worm component activates only when an npm token with write permission and bypass_2fa is present, limiting spread to accounts with insecure token settings.

What’s new here 4

  • First observed large-scale npm worm that self-propagates by publishing malicious versions of packages the victim can write to.
  • Uses a preinstall hook in package.json to run a dropper without user interaction.
  • Fetches the bun JavaScript runtime on-the-fly to execute a heavily obfuscated 711 KB payload.
  • C2 endpoint is resolved at runtime from an Ethereum smart contract, allowing attacker-controlled rotation.