Security Audit Finds Remote Code Execution Vulnerability in Anthropic's Claude Code
Key Takeaways
- ▸A low-severity RCE vulnerability was confirmed in Claude Code's remote-worker mode through environment variable injection via the update_environment_variables transport message handler
- ▸The vulnerability enables multiple attack vectors including arbitrary code execution, OAuth credential theft, HTTPS traffic interception, and TLS validation bypass in remote deployments
- ▸The attack surface is limited to remote-worker configurations where clients connect to untrusted servers; local CLI usage is unaffected due to reliance on trusted inter-process communication
Summary
Security researchers at audited.xyz have identified a low-severity remote code execution (RCE) vulnerability in Anthropic's Claude Code following a source code audit conducted after the March 31, 2026 leak. The vulnerability stems from unrestricted environment variable mutation via transport messages in Claude Code's structured I/O layer, which accepts update_environment_variables messages without an allowlist and applies them directly to process.env. Researchers demonstrated a proof-of-concept attack using NODE_OPTIONS injection in remote-worker mode, successfully achieving arbitrary code execution on a test system.
The vulnerability is limited to remote-worker deployments where Claude Code connects to a session ingress server via WebSocket or SSE, as local CLI usage relies on a Unix pipe to a trusted parent process. However, within remote configurations, the server endpoint gains unrestricted control over the worker's runtime environment. Beyond RCE, the same mechanism enables credential exfiltration through OAuth/API endpoint redirection, traffic interception via HTTPS_PROXY manipulation, and TLS certificate validation bypass. Anthropic confirmed the technical analysis on April 7, 2026, and the researchers propose a simple one-line allowlist fix restricting mutations to CLAUDE_CODE_-prefixed keys.
- A simple allowlist restriction limiting variable mutations to CLAUDE_CODE_-prefixed keys is proposed as the fix, highlighting a defense-in-depth gap in Anthropic's security architecture
Editorial Opinion
While Anthropic positions Claude Code as having undergone security auditing, this vulnerability reveals a meaningful gap in defense-in-depth practices around environment variable handling in distributed deployments. The low severity rating reflects the limited attack surface in remote-worker mode, but the ease of exploitation and breadth of potential impact—from credential exfiltration to arbitrary code execution—underscore the importance of cryptographic client-to-server authentication and input validation even in trusted infrastructure contexts. The straightforward fix suggests this oversight was an architectural decision rather than a fundamental flaw, but it raises questions about the rigor of pre-release security reviews for widely-deployed AI infrastructure.



