Keyv and friends compromised in active Shai-Hulud supply chain attack
Attackers compromised a widely used npm package maintainer's account, injecting a sophisticated credential-stealing worm across a family of libraries totaling over two billion monthly installs. This supply chain attack, dubbed "Shai-Hulud", highlights the severe vulnerabilities in the software distribution ecosystem and the advanced tactics bad actors employ. It's popular on HN for its critical security implications and the detailed technical breakdown of the breach.
The Lowdown
On August 4, 2026, a critical supply chain attack, named "Shai-Hulud", compromised the GitHub account of a maintainer responsible for the popular keyv key-value storage library and several other caching utilities. This breach led to the injection of a credential-stealing worm into widely-used npm packages, with the malicious versions quickly published and boasting valid provenance. The attack spread rapidly, ultimately affecting over 868 packages with a combined total of more than two billion monthly installs.
- Scope of Compromise: Key packages affected include
keyv(604M/month),flat-cache(580M/month),file-entry-cache(571M/month), andcacheable-request(137M/month), alongside numerous others, reaching 2 billion monthly installs in total. - Attack Mechanism: Attackers pushed two malicious files,
setup.mjsandMath_Symbol.js, tomainbranches and immediately released new package versions with a"preinstall": "node setup.mjs"script. - Payload Execution:
setup.mjsacted as an obfuscated dropper, silently downloading the Bun JavaScript runtime to execute the highly obfuscatedMath_Symbol.js. - Credential Theft:
Math_Symbol.jsis a 728 KB JavaScript file designed to harvest a wide range of credentials, encrypt them, and exfiltrate them to a public GitHub repository. - Stolen Data: The worm targets npm tokens, GitHub tokens (PATs, OAuth, App, OIDC from runners), AWS credentials (files, env vars, IMDS, ECS, Secrets Manager), Kubernetes secrets (service account tokens, Kubeconfig), HashiCorp Vault tokens (env vars, files, K8s auth, AWS IAM auth), Stripe and Slack tokens, and performs a generic filesystem scan for private keys,
.envfiles, SSH configs, Terraform state, Docker creds, KeePass, VPN configs, and IDE settings. - Worm-like Propagation: The payload includes functionality to infect packages of other maintainers who have installed one of the compromised packages, contributing to its rapid spread.
This incident underscores the severe and evolving threat of supply chain attacks within the software ecosystem. The sophisticated nature of the "Shai-Hulud" worm, its broad reach, and its ability to steal a comprehensive array of sensitive credentials present a significant wake-up call for developers and organizations reliant on open-source packages.