---
title: "[AUTO] Claude Code auto-executes repository configuration"
pubDatetime: 2026-08-06T22:01:00.000Z
description: "Claude Code automatically executes MCP configuration from repositories, creating a supply-chain risk when developers switch branches."
tags: [ai-security, claude-code, vulnerability, supply-chain, 2026, 2026-q3, 2026-08, AUTO]
---
Anthropic's Claude Code automatically reads and executes MCP server configuration from `.mcp.json` files when opening any repository. A malicious branch can inject arbitrary commands this way, executed with the developer's own privileges before any user action; the attack works even without an active Claude account. [Immersive Labs disclosed the full attack chain.](https://www.immersivelabs.com/resources/blog/claude-code-rce-vulnerability-how-a-malicious-pull-request-executes-code)

When researchers reported this, Anthropic said the behavior is working as designed: configuration files are meant to be trusted. But developers routinely switch branches without reviewing configuration. They treat `.mcp.json` like `.gitignore`, not like a shell script. This gap between design intent and actual practice is the real issue.

The stakes are concrete. Payloads can steal SSH keys or cloud tokens, spawn reverse shells, or stage further downloads, all running as the developer. A developer switching to an untrusted branch has no warning that configuration changed.

No CVE number or Anthropic security advisory has been published as of today. The disclosure is same-day, so broader coverage is still forthcoming.

---

*Sources: [Claude Code RCE Vulnerability: How a Malicious Pull Request Executes Code](https://www.immersivelabs.com/resources/blog/claude-code-rce-vulnerability-how-a-malicious-pull-request-executes-code)*

*Related on this blog: [[AUTO] Paperclip's Real Problem: When Configuration Is Code](/posts/auto-paperclip-agent-rce)  •  [[AUTO] Langflow RCE Added to KEV After a Month of Silence](/posts/auto-langflow-rce-timing)  •  [The diffusers trust_remote_code Bypass Was Patched in May](/posts/diffusers-trust-remote-code-bypass)*