Definition
Miasma (“The Spreading Blight”) is a credential-stealing npm supply chain worm variant of Mini Shai-Hulud, deployed in the June 1, 2026 compromise of 30+ @redhat-cloud-services packages. Likely adapted from TeamPCP’s open-sourced Shai-Hulud framework by a separate threat actor.
Campaign Timeline
- 2026-08-04: Related shai-hulud-worm wave via keyv/cacheable maintainer compromise — same family tradecraft (Bun preinstall, provenance-backed publish); see npm-supply-chain-2026 (2026-08-04-wiz-keyv-cacheable-npm-attack)
- 2026-06-01: Red Hat npm — 30+ @redhat-cloud-services packages via Phantom Gyp technique
- 2026-06-03: Second wave of Miasma dead-drop repositories
- 2026-06-05: Microsoft GitHub — 73 repos across Azure, Azure-Samples, Microsoft, MicrosoftDocs (2026-06-05-miasma-microsoft-stepsecurity)
- 2026-06-05: Malicious commit 5f456b8 to Azure/durabletask; GitHub disabled repos in 105-second sweep
Attack Chain
- Compromised contributor GitHub account pushes malicious commits (Red Hat employee June 1; durabletask contributor June 5)
- Malicious GitHub Actions workflow requests OIDC token (
id-token: write) - Short-lived token exchanged for npm publish credentials via trusted publishing
- Backdoored tarballs published with valid SLSA provenance attestations
preinstallhook executes 4.2 MB obfuscated Bun payload on everynpm install
Capabilities
- Harvests AWS, GCP, Azure, Vault, Kubernetes, GitHub, npm, SSH, Docker, GPG credentials
- Exfiltrates via disguised api.anthropic.com/v1/api traffic
- Injects hooks into AI coding tools (Claude Code, Cursor, VS Code, Gemini CLI) — auto-executes on repo open
- June 5 escalation: Targets microsoft org repos directly, not just npm packages
- Self-propagates by republishing accessible packages
- Dead-man switch: can wipe home directories if tokens revoked before persistence removal
npm v12 Response (June 2026)
GitHub cited Shai-Hulud and Miasma as direct motivation for npm v12 breaking changes (2026-06-09-npm-v12-supply-chain-security). Install-time lifecycle scripts — Miasma’s primary vector via preinstall hooks — will be blocked by default in v12 unless explicitly approved via npm approve-scripts. The Register noted: “Shai-Hulud worm exploited exactly this.”
Mitigation
- Pin to known-clean package versions (pre-June 1, 2026)
- Migrate to npm 11.16.0+ and build
allowScriptsallowlist before v12 (npm) - Rotate ALL secrets before revoking tokens (avoid triggering dead-man switch)
- Audit
.github/workflows/for unauthorized changes - Do not rely on SLSA attestations alone as trust signal
Related
- supply-chain-attacks
- github-security
- cybersecurity
- red-hat
- microsoft
- phantom-gyp
- ai-agent-security
- devtools
Sources
- 2026-06-01-red-hat-npm-aikido-primary
- 2026-06-01-red-hat-npm-wiz-research
- 2026-06-01-red-hat-npm-safedep-analysis
- 2026-06-05-microsoft-github-miasma-worm-repositories
- 2026-06-05-miasma-microsoft-stepsecurity
- 2026-06-05-miasma-microsoft-rescana
- 2026-06-05-miasma-microsoft-webpronews
- 2026-06-07-microsoft-github-miasma-worm-repositories
- 2026-06-09-npm-v12-supply-chain-security
- 2026-06-10-npm-v12-theregister-auto-run-scripts