RyotaK — Claude Code GitHub Actions Supply Chain Compromise via Permission Bypass
AI relevance: A permission bypass in Anthropic's official CI/CD GitHub Action lets an unauthenticated attacker chain prompt injection, OIDC token theft, and MCP tool abuse to push backdoored code into Anthropic's own repository — a textbook agentic supply chain compromise that impacts every downstream user.
- Security researcher RyotaK (GMO Flatt Security) disclosed a critical vulnerability in
anthropics/claude-code-action, patched in v1.0.94. - The
checkWritePermissionsfunction unconditionally trusted any actor with a name ending in[bot], regardless of actual repository permissions — a flawed trust assumption about GitHub App bot identity. - Attack chain: create a malicious GitHub App → install on attacker repo → use its installation token to open an issue/PR on the target repo → the bot-named actor bypasses the permission check → workflow processes attacker-controlled content.
- The agent mode (distinct from tag mode) lacked a
checkHumanActorsafeguard, allowing the bypass to proceed unchallenged. - Once inside the workflow, a crafted issue description with a fake error message triggers prompt injection — Claude Code permits commands like
catandheadwithout explicit user approval. - Attacker reads
/proc/self/environto stealACTIONS_ID_TOKEN_REQUEST_TOKENandACTIONS_ID_TOKEN_REQUEST_URL— credentials for requesting GitHub Actions OIDC tokens. - These OIDC tokens are exchanged for privileged Claude GitHub App installation tokens via Anthropic's backend, giving write access to repository contents, issues, PRs, and workflows.
- The
mcp__github__update_issueMCP tool in Anthropic's own triage workflow was then abused to write stolen secrets into a public issue for exfiltration. - Most severe: the
anthropics/claude-code-actionrepository itself used a vulnerable agent-mode workflow. A successful exploit allows injecting malicious code directly into the action's source — propagating to every downstream repository. - Second attack path: RyotaK also found a misconfiguration in Anthropic's example workflows using
allowed_non_write_users: "*". Combined withissues: writeandid-token: writepermissions across two workflows, an attacker can chain them to steal aGITHUB_TOKENvia publicly visible workflow run summaries, then escalate to full repo compromise without the GitHub App bypass. - The full attack chain spans seven steps from rogue GitHub App creation to backdoored code propagation — a complete agentic supply chain compromise.
Why it matters
This is a real-world demonstration of Microsoft's newly catalogued "Agentic Supply Chain Compromise" failure mode — natural-language attack surfaces (prompt injection) combined with CI/CD infrastructure to achieve code-level supply chain compromise. Any organization using Claude Code GitHub Actions should audit immediately.
What to do
- Update
anthropics/claude-code-actionto v1.0.94+ immediately. - Pin action versions to specific SHA commits rather than mutable tags.
- Review
allowed_non_write_userssettings in all AI-agent workflows — never set to wildcard. - Audit workflow permission boundaries: avoid combining
issues: writewithid-token: writein the same workflow unless strictly necessary. - Treat AI agent CI/CD workflows as high-value targets in your threat model — they have access to both secrets and the ability to execute arbitrary natural-language instructions.