NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

CVE-2026-47751: Claude Code Action: Malicious MCP Server Configuration in PRs Enables Remote Code Execution and Secret Exfiltration

mediumCVSS 4.0 5.3GHSA-8q5r-mmjf-575q

anthropics/claude-code-action before 1.0.74 checked out a pull request's head branch, read its .mcp.json and enabled all project MCP servers. A PR with a malicious .mcp.json could run code on the GitHub Actions runner and leak workflow secrets once a privileged user or automatic trigger ran the action on it. Fixed in 1.0.74.

Published Jun 10, 2026 · Updated Sep 1, 2026 · Analysis Oct 26, 2026

What an attacker can do

Three behaviors combined. The action checked out the PR head, which the attacker controls. It read .mcp.json from the working directory through the default setting sources. And it set enableAllProjectMcpServers, so every MCP server in that file started without approval. An MCP server entry is a command, so the attacker's file defines what runs.

The attacker needs to open a pull request against a repository that uses the action. A privileged user must invoke the action on that PR, or an automatic trigger must do it. Then the command runs on the runner with the workflow's environment. That can expose API keys, tokens and any other secrets available to the job, and it can give the attacker a foothold in the repository's CI.

The CVSS 4.0 vector rates it medium, with low privileges and an attack requirement. The pull request fix shows the risk was wider than MCP: hooks, env settings and other .claude files in a PR could also take effect before the first turn. Repositories that accept PRs from forks and trigger the action automatically are the most exposed.

Who is affected

GitHub Action anthropics/claude-code-action before 1.0.74. Workflows that reference @v1, @beta, @main or other non-pinned tags already received the fix, according to the advisory. Workflows pinned to an older version or commit SHA are affected.

Find your pins:

grep -rn "anthropics/claude-code-action" .github/workflows

The risk applies when the action runs on pull requests that can come from untrusted contributors.

anthropics/claude-code-action

Ecosystem
GitHub Actions
Affected
< 1.0.74
Fixed in
1.0.74

How to fix it

Update pinned references to anthropics/claude-code-action 1.0.74 or later. Unpinned references (@v1, @beta, @main) already have the fix.

The fix, in pull request 1066, restores .claude and .mcp.json from the PR's base branch before the CLI starts, and deletes them if the base has none. PR-only edits to those paths are discarded for that run, and later commits extend this to .gitmodules, .ripgreprc and .claude.json. If a PR legitimately changes .claude, merge that config change first and test afterward.

If an unpatched version ran on an untrusted PR, rotate the secrets that workflow could read.

How to tell if you were hit

Review runs of the action on pull requests that touch .mcp.json, and read the PR diff for new mcpServers entries, especially ones with command, args or env fields that fetch or run remote code. In the Actions log, look for unexpected processes or network calls during the job and for secrets printed or sent out. Check the workflow's secret usage and audit logs for tokens used from unfamiliar locations. Beam's offline scan can review an MCP configuration such as .mcp.json before anything runs it.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Due to the combination of checking out PR head branches (attacker-controlled), reading .mcp.json from the working directory via default setting sources, and unconditionally enabling all project MCP servers via enableAllProjectMcpServers, it was possible for an attacker who opened a PR containing a malicious .mcp.json file to achieve arbitrary code execution on the GitHub Actions runner. This could lead to exfiltration of secrets available to the workflow (such as API keys and tokens) when a privileged user triggered the Claude action on the PR. Exploiting this required the ability to open a pull request against a repository using the claude-code-action and a privileged user or automatic trigger to invoke the action on that PR.

Users pinned to a vulnerable version of claude-code-action are advised to update to the latest version. Users referencing anthropics/claude-code-action@v1, anthropics/claude-code-action@beta, anthropics/claude-code-action@main, or other non-pinned tags will have received this fix already

Claude Code thanks hackerone.com/reptou for reporting this issue.

Credited to antonisloukis.

Questions

Which claude-code-action version fixes CVE-2026-47751?

1.0.74. Users on @v1, @beta, @main or other unpinned tags already have the fix.

Does the attack need a maintainer to do something?

It needs a privileged user to invoke the action on the PR, or an automatic trigger to do so. The attacker only needs to be able to open a pull request.

What can the attacker get?

Code execution on the GitHub Actions runner and the secrets available to the workflow, such as API keys and tokens.

What does the fix change for my workflows?

For PR-triggered runs, .mcp.json and .claude files from the PR are replaced with the base branch versions, so config added only in the PR does not take effect during that run.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries