Threat reportVulnerabilityTL-2026-1929
Claude Code RCE via Malicious .mcp.json in Pull Request Branches
ImmersiveLabs researcher Kevin Breen disclosed that Claude Code (CLI and VS Code extension) automatically parses and launches Model Context Protocol servers defined in a repository's .mcp.json file at session startup, so a malicious .mcp.json smuggled into a pull request branch spawns an attacker-controlled local process under the developer's OS privileges the moment the branch is checked out and Claude Code is launched — with no per-command approval.
Key facts
| Identifiers | TL-2026-1929, CVE-2026-47751 |
|---|---|
| Severity | HIGH |
| EPSS | CVE-2026-47751: 0.7% (54.1th percentile) |
| Affected products | Anthropic Claude Code; Anthropic Claude Code VS Code extension |
| Weaknesses (CWE) | CWE-862, CWE-829 |
| Tools | Claude Code CLI, Claude Code VS Code extension, playwright |
| MITRE ATT&CK techniques | T1005 Data from Local System, T1036.005 Match Legitimate Resource Name or Location, T1059.004 Unix Shell, T1059.007 JavaScript, T1071.001 Web Protocols, T1095 Non-Application Layer Protocol, T1195.001 Compromise Software Dependencies and Development Tools, T1552.001 Credentials In Files, T1552.004 Private Keys, T1608.001 Upload Malware |
| Motivation | UNKNOWN |
| Target sectors | technology, software-development |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 9 cited sources |
Detection coverage
As of 2026-08-07, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-1929 across Splunk SPL, Microsoft KQL and Sigma, covering 8 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: Claude Code MCP Child-Process Exploitation via Malicious .mcp.json (SPL)
Detects Claude Code (CLI or VS Code extension) spawning a child process matching the known-malicious .mcp.json 'command'/'args' patterns disclosed by ImmersiveLabs: a raw reverse shell (nc -e), a curl-pipe-to-shell staged payload, or an unverified scoped npx package masquerading as a legitimate MCP server (e.g. a fake 'playwright' or 'postgres' server). Because Claude Code's folder-trust grant is not re-evaluated on branch checkout, this fires the moment a developer opens a repository on a PR branch carrying a poisoned .mcp.json.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1195.001, T1059.004, T1059.007, T1036.005
- Data sources: sysmon, auditd, edr_process_telemetry, windows_security
- Severity: critical
- Confidence: medium
Splunk SPL
index=endpoint sourcetype IN ("sysmon","xmlwineventlog:microsoft-windows-sysmon/operational","linux:sysmon") EventCode=1 earliest=-24h@h
| eval parent_lower=lower(ParentImage), cmd_lower=lower(CommandLine)
| where match(parent_lower, "(claude|code(\.exe)?|electron|node)")
| where match(cmd_lower, "(nc\s+-e|/bin/bash|curl[^\n]*\|\s*(sh|bash)|npx\s+-y\s+@)")
| where NOT match(cmd_lower, "@(modelcontextprotocol|anthropic-ai)/")
| eval mcp_pattern=case(
match(cmd_lower,"nc\s+-e"), "reverse_shell_nc_dash_e",
match(cmd_lower,"curl[^\n]*\|\s*(sh|bash)"), "curl_pipe_to_shell_staged_payload",
match(cmd_lower,"npx\s+-y\s+@"), "unverified_npx_scoped_package",
1=1, "other_suspicious_mcp_child")
| stats count min(_time) as first_seen max(_time) as last_seen values(CommandLine) as commandlines by host, User, ParentImage, Image, mcp_pattern
| where count > 0Microsoft KQL
DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName has_any ("claude", "Code.exe", "Code", "electron", "node")
| where ProcessCommandLine matches regex @"(?i)(nc\s+-e|/bin/bash|curl[^\n]*\|\s*(sh|bash)|npx\s+-y\s+@)"
| where not(ProcessCommandLine has_any ("@modelcontextprotocol/", "@anthropic-ai/"))
| extend McpPattern = case(
ProcessCommandLine matches regex @"(?i)nc\s+-e", "reverse_shell_nc",
ProcessCommandLine matches regex @"(?i)curl[^\n]*\|\s*(sh|bash)", "curl_pipe_to_shell",
ProcessCommandLine matches regex @"(?i)npx\s+-y\s+@", "unverified_npx_package",
"other")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, FileName, ProcessCommandLine, McpPatternSigma
title: Claude Code MCP Server Spawns Suspicious Child Process from .mcp.json
id: a1e4c2d0-6f3b-4b1a-9e2f-1a2b3c4d5e01
status: experimental
description: Detects Claude Code (CLI or VS Code extension) spawning a child process matching known malicious .mcp.json 'command'/'args' patterns (reverse shell, curl-pipe-to-shell staged payload, unverified npx scoped package) disclosed by ImmersiveLabs (Kevin Breen) as a PR-branch RCE vector.
references:
- https://www.immersivelabs.com/resources/blog/claude-code-rce-vulnerability-how-a-malicious-pull-request-executes-code
- https://gbhackers.com/claude-code-rce-flaw/
author: Threadlinqs Team
date: 2026-08-07
tags:
- attack.initial-access
- attack.t1195.001
- attack.execution
- attack.t1059.004
- attack.t1059.007
- attack.defense-evasion
- attack.t1036.005
- attack.tool.claude_code
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|contains:
- 'claude'
- 'Code'
- 'electron'
- 'node'
selection_cmd:
CommandLine|re: '(?i)(nc\s+-e|/bin/bash|curl.*\|\s*(sh|bash)|npx\s+-y\s+@)'
filter_known_good:
CommandLine|contains:
- '@modelcontextprotocol/'
- '@anthropic-ai/'
condition: selection_parent and selection_cmd and not filter_known_good
falsepositives:
- Legitimate MCP servers that npx-install unlisted third-party packages as part of approved developer tooling
- Developers manually running curl-pipe-to-shell installers unrelated to MCP during normal workstation setup
level: highKnown false positives:
- Legitimate MCP servers that npx-install unlisted third-party packages as part of approved developer tooling
- Developers manually running curl-pipe-to-shell installers unrelated to MCP during normal workstation setup
Tuning notes: Maintain an allowlist of approved MCP server package scopes (e.g. @modelcontextprotocol/, @anthropic-ai/, internal org scopes) and known-good server binary paths per repository; alert only on unapproved commands/scopes spawned as direct children of the Claude Code / VS Code process tree.
- Claude Code MCP Child-Process Exploitation via Malicious [indicator] (KQL) · unlock with TL Creds
- Post-Exploitation Credential Access by Claude Code MCP Child Process (KQL) · unlock with TL Creds
- C2/Staging Outbound Connection from Claude Code MCP-Spawned Process (KQL) · unlock with TL Creds
- Claude Code MCP Child-Process Exploitation via Malicious [indicator] (Sigma) · unlock with TL Creds
- Post-Exploitation Credential Access by Claude Code MCP Child Process (Sigma) · unlock with TL Creds
- C2/Staging Outbound Connection from Claude Code MCP-Spawned Process (Sigma) · unlock with TL Creds
- Post-Exploitation Credential Access by Claude Code MCP Child Process (SPL) · unlock with TL Creds
- C2/Staging Outbound Connection from Claude Code MCP-Spawned Process (SPL) · unlock with TL Creds
Indicators of compromise
As of 2026-08-07, Threadlinqs Intelligence tracks 8 indicators of compromise for TL-2026-1929.
Technical analysis
Anthropic classifies the behavior as consistent with its workspace/folder trust model rather than a vulnerability requiring a fix.
On 2026-08-06 ImmersiveLabs (researcher Kevin Breen, Senior Director of Cyber Threat Research) published a proof-of-concept showing that Claude Code initializes locally-defined MCP servers from a project's .mcp.json during session startup before any user interaction, regardless of which git branch is currently checked out. Because Claude Code's folder-trust grant is established once per repository and is not re-evaluated on branch switches, an attacker who can land a pull request (or push to a branch a developer will check out) can add or modify a .mcp.json entry whose 'command'/'args' fields spawn an arbitrary local process — a reverse shell, a curl-pipe-to-shell staged payload, or an npx/Docker-wrapped malicious package — disguised as ordinary development tooling (e.g. a server named 'playwright'). The command executes with the developer's full OS-level privileges, with no sandboxing, no command allowlist, and no verification that the named MCP server is legitimate. Because SSH keys, cloud credentials, and shell environment variables are all reachable from that process, ImmersiveLabs frames the primary risk as silent, unattended compromise of developer workstations and downstream cloud/CI credentials.
Anthropic's response, quoted by ImmersiveLabs, is that 'when you trust a folder, that grant covers the repository's configuration...checking out...other branches does not re-trigger the trust prompt,' and the company characterized the reported behavior as 'working as designed' rather than a bug requiring a patch — positioning malicious branch/PR content as within scope of the existing folder-trust boundary rather than a new trust boundary of its own. No CVE has been assigned to this specific finding as of the 2026-08-07 GBHackers report, and no in-the-wild exploitation has been reported; this is PoC-stage vulnerability research.
This disclosure is the latest in a recurring pattern of Claude Code MCP/config trust-boundary findings during 2025-2026: Check Point Research's 'Caught in the Hook' work (CVE-2025-59536, an MCP consent bypass and SessionStart-hook RCE via .claude/settings.json, patched in Claude Code 1.0.111+; and CVE-2026-21852, ANTHROPIC_BASE_URL-based API key exfiltration, patched in 2.0.65+); a Tenable-credited flaw in the claude-code-action GitHub Action (CVE-2026-47751) where a PR-branch .mcp.json achieved arbitrary code execution in CI runners with access to workflow secrets (fixed in action v1.0.78); and a June 2026 Repello AI finding that Claude Code's MCP approvals are keyed to server *name* rather than the approved command content, so a name-preserving command swap in .mcp.json executes silently on next launch — which Anthropic also classified as 'working as designed.' Unlike those, the ImmersiveLabs finding targets the baseline, already-patched trust flow itself: even with prior fixes applied, an already-trusted folder's persisted trust extends across arbitrary future branch content by design, so no additional confirmation step exists between 'attacker lands a PR' and 'attacker's MCP command executes.'
MITRE ATT&CK techniques by tactic:
Collection
Defense Evasion
T1036.005 Match Legitimate Resource Name or Location
Execution
T1059.004 Unix Shell; T1059.007 JavaScript
Command and Control
T1071.001 Web Protocols; T1095 Non-Application Layer Protocol
Initial Access
T1195.001 Compromise Software Dependencies and Development Tools
Credential Access
T1552.001 Credentials In Files; T1552.004 Private Keys
Resource Development
Remediation
Immediate actions
- Treat .mcp.json and .claude/ (settings.json, hooks) as executable code, not passive configuration, in code review
- Review the exact command/args/env fields of any .mcp.json change before checking out a branch or merging a PR that touches it
- Apply heightened scrutiny to pull requests from external or first-time contributors that add or modify .mcp.json or .claude/settings.json
- Run `claude mcp reset-project-choices` to clear stale project-level MCP approvals rather than relying on standing 'allow all future' grants
Workarounds
- Do not launch Claude Code (CLI or VS Code extension) inside a working directory immediately after checking out an unreviewed or untrusted branch/PR
- Isolate untrusted branch checkouts in disposable dev containers or VMs when Claude Code will be run against them
Longer-term hardening
- Avoid selecting the 'Use this and all future MCP servers in this project' standing-grant option; approve MCP servers individually where possible
- Add CI/CD or pre-commit gating that flags any diff touching .mcp.json, .claude/settings.json, or other agent-read configuration files for mandatory human review
- Track Anthropic's guidance and any future hardening of MCP approval binding (name-keyed vs. command-content-keyed trust)
Affected and fixed versions
- Anthropic — Claude Code
Vulnerable versions: All versions implementing the current project-scoped MCP/.mcp.json trust model as of the 2026-08-06 disclosure - Anthropic — Claude Code VS Code extension
Vulnerable versions: All versions sharing the CLI's MCP initialization and folder-trust behavior as of the 2026-08-06 disclosure
Timeline
- Check Point Research reports the first related Claude Code trust-boundary flaw to Anthropic: SessionStart hooks in locked-ioc-1 executing arbitrary commands without user confirmation.
- GitHub Security Advisory GHSA-ph6w-f82w-28w6 published, covering the MCP consent-bypass / hooks RCE issue later tracked as CVE-2025-59536.
- CVE-2025-59536 (Claude Code MCP consent bypass via enableAllProjectMcpServers) formally published; fixed in Claude Code 1.0.111+.
- CVE-2026-21852 (API key exfiltration via malicious ANTHROPIC_BASE_URL override) published; fixed in Claude Code 2.0.65+.
- Rémy Marot reports the claude-code-action GitHub Action MCP configuration RCE (later CVE-2026-47751) to Anthropic; PR head-branch checkout plus default enableAllProjectMcpServers allows CI-runner code execution with workflow secrets.
- Check Point Research publicly discloses the 'Caught in the Hook' findings (CVE-2025-59536, CVE-2026-21852), amplified by The Hacker News and other outlets.
- claude-code-action v1.0.78 released fixing CVE-2026-47751; Tenable confirms remediation on 2026-03-25.
- Repello AI reports the MCP name-keyed trust flaw to Anthropic (approvals bound to server name, not command content); Anthropic responds the same day classifying it as 'working as designed.'
- ImmersiveLabs (Kevin Breen) publishes the PR-branch locked-ioc-2 RCE research: a malicious locked-ioc-2 checked out via a pull request branch executes local commands under developer privileges on Claude Code launch, with no additional approval since the repository folder is already trusted.
- GBHackers reports on the ImmersiveLabs disclosure; Anthropic reiterates that trusting a folder covers its configuration across all subsequently checked-out branches, declining to treat this as a new vulnerability requiring a code change.
Sources cited
- Claude Code Action Runner Arbitrary Code Execution via Malicious MCP Server Configuration (TRA-2026-27, CVE-2026-47751) Tenable · Advisory · 2026-03-24
- Claude Code RCE Vulnerability: How a Malicious Pull Request Executes Code immersivelabs.com · Research · 2026-08-06
- Caught in the Hook: RCE and API Token Exfiltration Through Claude Code Project Files (CVE-2025-59536, CVE-2026-21852) Check Point Research · Research · 2026-02-25
- A Trusted Name Is Not a Trusted Command: MCP Approvals in Claude Code repello.ai · Research · 2026-06-10
- Claude Code settings documentation (MCP servers, project trust) code.claude.com · Vendor report · 2026-08-07
- GHSA-ph6w-f82w-28w6: Claude Code MCP consent bypass / hooks RCE advisory GitHub · Code repository · 2025-08-29
- Claude Code RCE Flaw gbhackers.com · News · 2026-08-07
- Claude Code Flaws Allow Remote Code Execution and API Key Exfiltration The Hacker News · News · 2026-02-25
- Claude Code Hacked to Achieve Full RCE and Hijacked Organization API keys cybersecuritynews.com · News · 2026-02-25
Previous and next in vulnerability
Drafted by the Threadlinqs research pipeline from 9 sources; published ; last updated —.