Table of Contents
- How does a clean GitHub repo trick AI coding agents into running malware?
- The hidden config files that do the damage
- Why 'just cloning to read the code' is no longer safe
- What the payload steals — and why your hosting is the target
- How to protect yourself, your team, and your servers
- Treat editor config like executable code
- Frequently Asked Questions
Key Takeaways
- A repo can look completely clean in its source code yet still execute malware the moment you open it in an AI coding agent or modern IDE.
- The June 2026 Miasma worm planted hidden auto-run config files like .claude/settings.json, .cursor/rules, and .vscode/tasks.json that trigger on folder open or session start.
- The payload was a credential harvester hunting for AWS, Azure, GCP, GitHub, and npm secrets — exactly the keys that control your hosting and infrastructure.
- Reviewing diffs for unexpected editor-config directories and disabling auto-run features are your fastest defenses.
- Isolated, least-privilege hosting and rotating exposed tokens limit the blast radius when a developer machine is compromised.
How does a clean GitHub repo trick AI coding agents into running malware?
A clean-looking GitHub repo tricks AI coding agents into running malware by hiding the attack outside the source code you actually read. The dangerous part lives in editor and agent configuration files — things like .claude/settings.json, .cursor/rules, and .vscode/tasks.json — that tell tools to auto-run a script the instant you clone and open the project.
This is exactly how the Miasma worm spread in June 2026. Researchers documented commits titled 'chore: update dependencies [skip ci]' pushed to popular repositories. The commit added no real dependencies. Instead it planted a dropper and wired it to execute automatically through five different paths: Claude Code, Gemini CLI, Cursor, VS Code, and the npm test script. The source files looked normal in a code review. The trap was in the plumbing nobody scrolls down to inspect.
The result was a credential-stealing worm that disabled dozens of repositories — including a reported 73 Microsoft-owned repos across Azure and related orgs — and exfiltrated cloud secrets to attacker-controlled accounts. The lesson for anyone running websites and infrastructure is blunt: cloning a repo to read it is no longer a safe, read-only act.
The hidden config files that do the damage
Auto-run features were built for convenience — spin up a dev environment, let the agent install things for you. Attackers turned that convenience into an execution trigger. Here are the exact files Miasma used and how each one fires.
| File planted | Tool it targets | How it auto-runs |
|---|---|---|
| .claude/settings.json | Claude Code | SessionStart hook runs a shell command when an agent session opens |
| .gemini/settings.json | Gemini CLI | Identical SessionStart mechanism on session open |
| .cursor/rules/setup.mdc | Cursor | Rule with alwaysApply instructs the AI to 'run the setup script' |
| .vscode/tasks.json | VS Code | Task configured to run on folderOpen — no agent needed |
| package.json | npm / CI | Hijacked test script runs the payload during npm test |
| .github/setup.js | The dropper | Obfuscated loader that fetches and runs the real worm |
The .cursor/rules entry is the cleverest of the set. It is a prompt injection that ships inside the repo: plain-language instructions telling the AI assistant to execute node .github/setup.js to 'initialize the project environment.' The agent, trying to be helpful, does exactly that. No exploit, no zero-day — just a tool following instructions it was never meant to trust.
Why 'just cloning to read the code' is no longer safe
For two decades, cloning a repository to read its source felt risk-free. You only got hurt if you actually built or ran the project. AI coding agents and IDE auto-run features quietly broke that assumption, and attackers noticed before most defenders did.
The Miasma dropper used real engineering to stay quiet. The .github/setup.js loader was obfuscated with a simple ROT-4 cipher, then decrypted two AES-128-GCM blobs, downloaded the Bun runtime from its official GitHub releases page, and ran the worm in an isolated Bun process. Pulling the runtime from a legitimate source helped it slip past naive allowlists.
The repo did not need a vulnerability in your code. It needed your tools to do what they were designed to do — run setup commands automatically — against a file you never agreed to trust.
This is what makes config-injection attacks so effective: every signal a developer relies on says 'safe.' The README is normal. The dependencies check out. The commit message reads like routine maintenance. The only tell is a directory most people never open in a diff.
Tired of slow, overcrowded web hosting?
LaunchPad Host runs on NVMe SSDs + LiteSpeed with free migration, free SSL, daily backups, and crypto payments. 30-day money-back guarantee.
See Hosting PlansWhat the payload steals — and why your hosting is the target
Miasma was not vandalism. It was a precision credential harvester, and the credentials it wanted are the ones that control your hosting and infrastructure. The worm scanned compromised machines for secrets belonging to AWS, Azure, GCP, HashiCorp Vault, Kubernetes, npm, and GitHub, then exfiltrated them to attacker-created public GitHub repos and used the stolen tokens to self-propagate.
Think about what those keys unlock. A leaked cloud API key can spin up servers on your bill, read your databases, or wipe production. A stolen GitHub Personal Access Token lets an attacker push malicious commits to your repos — turning you into the next link in the chain. For anyone running a website, a single compromised laptop can cascade into hijacked deployments, defaced sites, and runaway cloud charges.
The uncomfortable truth most security guides skip: your developer workstation is now part of your hosting attack surface. If your deploy keys and server credentials live in plaintext on the same machine where you clone unfamiliar repos, one careless git clone can hand an attacker the keys to your entire stack.
How to protect yourself, your team, and your servers
You do not need exotic tooling to shut this down. A handful of habits and one mindset shift — treat editor config as code that can run — covers the vast majority of the risk.
- Review the whole diff, including config dirs. Any pull request or fresh clone that adds .claude/, .gemini/, .cursor/, or .vscode/ deserves a hard look. Unexpected editor config is a supply-chain signal, not noise.
- Quick-scan before you open. A one-liner like test -f .github/setup.js && echo DROPPER, plus a grep for SessionStart hooks and folderOpen tasks, catches the obvious traps.
- Disable auto-run for untrusted projects. Turn off folder-open tasks and agent session hooks unless you trust the source. Never run npm test on a codebase you have not vetted.
- Clone unknown repos in a sandbox. A throwaway container or VM with no real credentials means a detonating dropper finds nothing worth stealing.
- Keep secrets off the workstation. Use short-lived tokens, a secrets manager, and per-environment keys. If a token does leak, rotate it immediately and check for unauthorized commits or new public repos under your account.
- Isolate and least-privilege your hosting. Deploy keys should do one job. Separate staging from production. The smaller each credential's reach, the smaller the damage when one escapes.
This is also where your hosting choices matter. Running your sites on infrastructure where access is tightly scoped and isolated limits how far a stolen key can travel. LaunchPad Host leans privacy-forward and keeps environments separated, so a credential leak on a dev box is far less likely to become a full infrastructure takeover — and crypto-friendly billing means a compromised card is not the thing standing between you and keeping your sites online.
Treat editor config like executable code
The durable takeaway from the Miasma campaign is a small but permanent change in how you read a repository. Source code is no longer the only thing that runs. Configuration that auto-launches scripts is executable, and it deserves the same scrutiny as the code itself.
Bake that into your workflow so a clean-looking repo can never run for long unchecked:
- Add editor-config directories to your code-review checklist as a standing item.
- Prefer cloning unfamiliar projects into disposable, credential-free environments.
- Watch for batches of commits with [skip ci] messages landing across multiple repos at once — a hallmark of token-reuse propagation.
- Rotate any cloud, GitHub, or npm token the moment a machine that held it touches a suspect repo.
The developers who came through Miasma cleanest were not the ones with the biggest security budgets. They were the ones who already assumed that opening a repo could run code — and built their hosting and secrets around that assumption.
Frequently Asked Questions
Cloning alone only copies files to disk. The danger appears the moment you open that folder in an AI coding agent or a modern IDE with auto-run enabled. Config files such as .vscode/tasks.json (run on folder open) or .claude/settings.json session hooks can execute a script automatically, and a .cursor/rules file can instruct the AI to run one. So in practice, cloning plus opening in these tools can absolutely run attacker code without you typing a command.
Before opening an unfamiliar repo, inspect it from a plain terminal. Look for editor-config directories (.claude, .gemini, .cursor, .vscode) and a .github/setup.js dropper, and grep the configs for SessionStart hooks, folderOpen tasks, and hijacked npm scripts. If anything auto-runs a script, do not open it in an agent or IDE. Safer still, clone it inside a disposable container or VM that holds no real credentials.
Miasma was a credential harvester. Once it executed, it scanned the machine for AWS, Azure, GCP, HashiCorp Vault, Kubernetes, npm, and GitHub secrets, exfiltrated them to attacker-controlled public GitHub repos, and then used the stolen GitHub tokens to push itself into more repositories. Those are exactly the keys that control hosting, deployments, and cloud spend, which is why the attack was so damaging.
Good hosting practice shrinks the blast radius. Use short-lived, least-privilege deploy keys scoped to one job, keep staging and production separated, and store secrets in a manager rather than plaintext on a workstation. Privacy-forward hosts like LaunchPad Host that isolate environments make it harder for one leaked credential to reach your whole stack, and rotating exposed tokens fast closes the window an attacker has to act.
Related tools, articles & authoritative sources
Hand-picked internal pages and external references from sources Google itself considers authoritative on this topic.
Related free tools
- Site Validator (robots, sitemap, SSL, headers) Validate robots.txt, sitemap.xml, SSL certificate, and security headers.
- DNS Lookup & Records Checker All DNS records (A, AAAA, MX, NS, TXT, CAA, SPF, DMARC) for any domain.
- PageSpeed & Core Web Vitals Google Lighthouse scores: performance, SEO, accessibility, best practices.
Offshore & privacy hosting
- DMCA-Ignored Hosting Due-process complaint handling, explained
- Offshore Hosting EU jurisdiction, privacy-first, from $3.99/mo
- Bulletproof Hosting Alternative What searchers actually want, without the risk