Critical flaw in Anthropic's Claude Code let attackers hijack public repositories with a single issue

2 Sources

Share

A security researcher discovered a vulnerability in Anthropic's Claude Code GitHub Action that allowed attackers to hijack public repositories using nothing more than a malicious GitHub issue. The flaw bypassed permission checks through fake bot accounts and prompt injection, enabling theft of OIDC tokens and full write access. Anthropic patched the issue within four days, but the attack pattern has already caused real supply chain damage.

Critical Flaw Exposed Thousands of Repositories

A critical flaw in Anthropic's Claude Code GitHub Action let attackers take control of vulnerable public repositories with nothing more than a single malicious GitHub issue

1

. Security researcher RyotaK of GMO Flatt Security discovered the vulnerability and reported it to Anthropic in January, prompting a rapid response that fixed the core bypass within four days

2

. The patches arrived in claude-code-action v1.0.94, with additional hardening measures implemented through the spring

1

.

Source: Hacker News

Source: Hacker News

Anthropic rated the vulnerability 7.8 under CVSS v4.0 and paid a bug bounty of $4,800 to the researcher

2

. The stakes were particularly high because Anthropic's own action repository used the same vulnerable workflow, meaning a successful attack could have pushed malicious code into the action itself and onto downstream projects that pull it

1

.

How Permission Checks Failed

Claude Code GitHub Action integrates Claude into CI/CD pipelines to triage issues, review pull requests, and run slash commands. By default, the workflow receives read and write access to a repository's code, issues, pull requests, discussions, and workflow files

1

. To protect against abuse, the action was designed to verify that only users with write access could trigger it.

The trigger check contained a critical vulnerability. It automatically trusted any actor whose name ended in [bot], operating on the assumption that GitHub Apps are trusted tools installed by administrators

2

. However, anyone can register a GitHub App, install it on a repository they control, and use its token to open an issue on any public repository. When the action saw a bot name, it waved the content through without proper verification

1

. While tag mode included an extra check to confirm the actor was a real human, agent mode lacked this safeguard entirely

1

.

Prompt Injection Enabled Token Theft

Once past the permission checks, attackers leveraged prompt injection to hijack public repositories and steal OIDC tokens . This technique involves planting instructions inside content that an AI reads as data but executes as commands. RyotaK crafted an issue body disguised as an error message, refining the prompt until Claude would "recover" by running the commands buried inside it

1

.

The target was /proc/self/environ, the Linux file that holds a process's environment variables, including credentials

1

. Although Claude Code blocks naive reads of sensitive environment variables, RyotaK bypassed the guard and got Claude to extract sensitive environment variables and write the values back into the issue, where the attacker could collect them

1

2

.

Those environment variables contained the credential pair GitHub Actions uses to request an OIDC token, a signed token proving "I'm this workflow running in this repo"

1

. Claude Code trades that token with Anthropic's backend for a Claude GitHub App installation token with write access to the target's code, issues, and workflows

1

. Steal those credentials, replay the exchange, and an attacker gains full write access to the repository .

Multiple Attack Vectors Discovered

RyotaK identified additional paths that didn't require the bot trick at all. Anthropic's own example issue-triage workflow shipped with the setting allowed_non_write_users: "*", which permits anyone to trigger the action

1

2

. Anthropic's documentation already flagged this configuration as risky, but many repositories copied the example and inherited the vulnerability .

Worse still, Claude was posting task summaries to the workflow run's publicly visible summary panel, creating a ready-made channel for data exfiltration

1

. A third variant exploited race conditions: edit a trusted user's issue after the workflow fires but before Claude reads it, and the malicious payload rides in as trusted input

1

.

Real-World Supply Chain Attacks Already Occurred

This vulnerability in AI-powered developer tools isn't theoretical. The same pattern has already enabled supply chain attacks with real consequences . In February, a prompt-injected issue title against Cline's claude-code-action triage workflow let attackers steal an npm publish token and push an unauthorized [email protected]

1

. The rogue version force-installed a separate AI agent called OpenClaw on roughly 4,000 developer systems during an eight-hour window before being pulled . While this particular package wasn't overtly malicious, the same chain could easily have shipped real malware to everyone who updated

1

.

An autonomous bot called HackerBot-Claw then spent late February probing GitHub Actions misconfigurations at Microsoft, Datadog, and CNCF projects

1

. When it attempted to prompt-inject a Claude-based reviewer through a poisoned config file, Claude caught it and refused

1

. The inconsistent success rate of these attacks highlights both the defenses and their limitations .

RyotaK reports discovering approximately 50 separate ways to bypass Claude Code's permission system and execute commands . His findings are part of a steady stream of prompt injection flaws affecting AI coding agents, underscoring a fundamental challenge: prompt injection remains unsolved

1

.

Immediate Action Required

Organizations using Claude Code GitHub Action must update to v1.0.94 or later immediately

1

. Beyond the patch, teams should audit any workflow that allows users without write access or bots to trigger Claude. If the workflow processes untrusted input, don't feed it any secret beyond the Anthropic API key and GITHUB_TOKEN, and remove tools and permissions that could enable exfiltration

1

.

The deeper issue is structural. An AI agent with real tools and real tokens can be manipulated as far as its permissions allow, and the permissions most organizations grant by default are often excessive . As AI-powered developer tools become standard in software development workflows, the attack surface for supply chain attacks continues to expand, demanding more rigorous security practices around permission scoping and input validation.

Today's Top Stories