Miasma worm is a self‑replicating supply‑chain malware campaign and Mitigation
The Miasma worm is a self‑replicating supply‑chain malware campaign that struck 73 Microsoft GitHub repositories across four major Microsoft organizations — Azure, Azure‑Samples, Microsoft, and MicrosoftDocs — in early June 2026. It represents one of the most significant escalations in modern software‑supply‑chain attacks, especially because it targets AI‑assisted developer tools rather than traditional package‑install mechanisms.
What Happened
A malicious commit was pushed into the Azure/durabletask repository using previously compromised contributor credentials.
GitHub responded by disabling 73 Microsoft repositories in an automated sweep lasting 105 seconds.
The commit did not modify source code. Instead, it added configuration files designed to auto‑execute a 4.3–4.6 MB obfuscated JavaScript payload when opened in:
Claude Code
Gemini CLI
Cursor
Visual Studio Code
npm test script
Why This Attack Is Different
Traditional supply‑chain attacks rely on poisoning package registries (npm, PyPI).
Miasma bypasses that entirely by triggering execution when a developer opens a folder in an AI coding agent or IDE.
This shift from “execute on package install” to “execute on folder open” is a major evolution in supply‑chain threat tactics.
What the Payload Does
Once triggered, the worm:
Harvests credentials for AWS, Azure, GCP, Kubernetes, npm, GitHub, and 90+ developer tool configurations.
Uses stolen tokens to self‑propagate into any repository the victim can write to.
Creates new public repos containing stolen secrets under names like:
Miasma: The Spreading Blight
Hades – The End for the Damned
This makes it a self‑replicating worm, not just a one‑off compromise.
Connection to Earlier Attacks
The same contributor account was used in May 2026 to upload malicious durabletask PyPI packages (versions 1.4.1–1.4.3), which delivered an information‑stealer.
The June attack appears to be a re‑compromise, suggesting the attacker never lost access to the stolen credentials.
Impacted Microsoft Repositories
Examples include:
durabletask (.NET, Go, JS, MSSQL, Java, Netherite, protobuf)
azure-search-openai-demo
functions-container-action
llm-fine-tuning
windows-driver-docs
These are widely used in Azure Functions, Durable Functions, and AI integration workflows — meaning downstream developers may have unknowingly opened compromised repos.
Why This Matters for Developers
If a developer cloned or opened any affected repository after June 2, 2026, their workstation credentials may be compromised.
StepSecurity recommends immediate credential rotation for all cloud and GitHub tokens.
What Miasma Actually Is
A variant of the Mini Shai‑Hulud worm, publicly released by TeamPCP in mid‑May 2026.
Continues to mutate and spread across ecosystems (GitHub, PyPI, npm).
The most important mitigation for the Miasma worm is credential rotation and workstation cleanup, because the worm’s entire propagation mechanism depends on stolen cloud, GitHub, and developer‑tool tokens. All major sources agree that any developer who opened an affected Microsoft repository after June 2, 2026 must assume compromise.
Below is a consolidated, authoritative mitigation plan based strictly on the published incident analyses.
1. Immediately Rotate All Credentials
This is the #1 required action.
Rotate every credential that may have been accessible on any machine that opened an affected repo:
GitHub PATs, SSH keys, fine‑grained tokens
Azure, AWS, GCP CLI credentials
Kubernetes kubeconfigs
npm tokens
Vault tokens
Any cloud or CI/CD secrets stored locally
StepSecurity and multiple security researchers explicitly warn that developers should rotate credentials if affected repositories were opened after June 2.
The worm steals over 90 developer‑tool configurations, so assume broad exposure.
2. Clean and Rebuild Developer Workstations
Because the payload executes automatically when a repo is opened in tools like Claude Code, Gemini CLI, Cursor, or VS Code, the workstation itself may be compromised.
Recommended actions:
Reimage or fully rebuild affected developer machines (strongly recommended for high‑trust environments).
Remove any unauthorized
.claude/,.gemini/,.cursor/,.vscode/, or.github/scripts.Delete any unknown JavaScript files, especially large obfuscated ones (4.3–4.6 MB). [^3]
3. Block and Quarantine Affected Repositories
GitHub already disabled the 73 Microsoft repos, but organizations should:
Block internal mirrors or forks of the affected repos.
Prevent CI/CD systems from pulling cached copies.
Audit any internal repos that developers could write to — the worm auto‑commits itself into any repo the victim has access to.
4. Audit All Repositories for Unauthorized Commits
The worm uses stolen tokens to push malicious commits into any repo the victim can write to.
Look for:
Backdated commits
Commits with
[skip ci]flagsUnexpected config files in AI‑tool directories
Large obfuscated JavaScript files (4.3–4.6 MB)
The attacker used a backdated commit with [skip ci] to evade detection.
5. Review CI/CD Pipelines for Secret Exposure
The worm targets:
GitHub Actions runner memory
OIDC tokens
SLSA provenance signing flows
Passwordless sudo on Linux CI runners
Microsoft’s own analysis of the Red Hat variant shows the malware scrapes CI/CD secrets and republishes poisoned packages.
Actions:
Rotate all CI/CD secrets
Revoke OIDC tokens
Rebuild runners
Validate SLSA provenance for all artifacts
6. Harden AI‑Assisted Development Environments
This attack specifically exploited AI coding tools.
Recommended controls:
Disable auto‑execution of workspace tasks in VS Code
Block AI tool config files from executing scripts
Sandbox AI coding agents
Require manual approval for workspace‑level tasks
The worm detonates on folder open, not package install — a major shift in supply‑chain attack vectors.
7. Verify Package Integrity Across Your Ecosystem
Miasma is a variant of the Mini Shai‑Hulud worm and has already infected:
Microsoft durabletask (PyPI)
Red Hat npm packages
Multiple npm repos outside registries
The Red Hat variant used authentic provenance signatures while still being malicious.
Actions:
Re‑verify all dependencies with Sigstore/SLSA
Rebuild from trusted sources
Block known malicious package versions
8. Organization‑Wide Incident Response
Because this is a self‑replicating worm, treat it as a full supply‑chain compromise:
Notify security teams
Conduct enterprise‑wide credential rotation
Perform forensic review of developer endpoints
Audit cloud access logs for anomalous activity
Review GitHub audit logs for unexpected pushes

Comments
Post a Comment