ChainDrop supply chain attack infects over 400 NPM packages

A self-propagating worm has compromised hundreds of NPM packages to steal developer credentials and automate further malicious releases.

Image: Microsoft Security Blog

A large-scale supply chain attack dubbed ChainDrop has compromised more than 400 packages within the NPM registry, according to reports from Microsoft and security researchers. The campaign, which utilizes a variant of the Mini Shai-Hulud worm, targets developer workstations and continuous integration and continuous delivery (CI/CD) environments to exfiltrate sensitive infrastructure credentials.

The attack began after the compromise of a maintainer's GitHub account, which provided initial access to the keyv and cacheable namespaces. Once an infected package is installed, a preinstall lifecycle hook executes a malicious payload. This script downloads the Bun JavaScript runtime and a 710 KB obfuscated second-stage bundle that performs credential harvesting and system enumeration.

The malware is designed to identify and steal credentials for NPM, GitHub, Amazon Web Services, Kubernetes, and HashiCorp Vault. By leveraging these stolen identities, the worm automates its own propagation. It downloads the latest tarballs of packages accessible to the compromised account, injects the malicious code, increments the patch version, and republishes the modified packages to the NPM registry.

Beyond package poisoning, the worm establishes persistence by injecting configuration files into Claude and Visual Studio Code environments. It also employs an Ethereum blockchain for command-and-control communication, a technique known as EtherHiding. The malware includes a dead-man’s switch that polls the GitHub API every 60 seconds, deleting its state and exiting if the stolen token is revoked.

Security researchers observed over 2,200 malicious package versions published in under four hours on August 4. Because the attackers modified package tarballs directly rather than compromising source repositories, many malicious releases lack corresponding commits or pull requests. The infected packages have a combined reach of over 500 million weekly downloads, making the scope of the potential exposure significant.

Organizations that have installed affected packages are advised to treat their build runners and developer workstations as compromised. Remediation steps include revoking and rotating all potentially exposed credentials, rebuilding CI/CD environments from trusted sources, and auditing repositories for unauthorized modifications or anomalous activity.

Sources

  1. SecurityWeekOver 400 NPM Packages Infected in ChainDrop Supply Chain Attack
  2. Microsoft Security BlogChainDrop supply chain compromise: Anatomy of a self-propagating worm