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

  1. Compromised contributor GitHub account pushes malicious commits (Red Hat employee June 1; durabletask contributor June 5)
  2. Malicious GitHub Actions workflow requests OIDC token (id-token: write)
  3. Short-lived token exchanged for npm publish credentials via trusted publishing
  4. Backdoored tarballs published with valid SLSA provenance attestations
  5. preinstall hook executes 4.2 MB obfuscated Bun payload on every npm 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 allowScripts allowlist 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

Sources