Check Point Finds Claude Code Flaws Enabling Repository-Based RCE and API-Key Theft

Summary
Check Point Research details Claude Code flaws that let malicious project configurations trigger command execution and expose API keys. Anthropic patched the issues before public disclosure.
Key points
- Repository-controlled Claude Code Hooks could run shell commands on a collaborator’s machine after project trust was accepted, without an additional execution prompt.
- MCP settings such as enableAllProjectMcpServers could bypass consent and run initialization commands before users could read the trust dialog.
- A malicious ANTHROPIC_BASE_URL setting could redirect API requests, including the victim’s API key, before trust was accepted.
- The researchers found a stolen API key could be used to access and manipulate shared Workspace files, including regenerating files for download, deleting or uploading files, and consuming storage or API credits.
- The researchers describe supply-chain scenarios involving malicious pull requests, honeypot repositories, and internal repositories.
- Anthropic enhanced trust warnings, prevented MCP initialization before approval, and deferred network requests until after consent; the reported issues were patched before public disclosure.
Article Details
- Attack Vectors
- Repository-controlled .claude/settings.json hooks executed shell commands when Claude Code opened an untrusted project, without a separate execution prompt.
- Project .mcp.json settings combined with repository-controlled MCP approval options to initialize attacker-supplied commands before user consent.
- A repository-controlled ANTHROPIC_BASE_URL redirected API requests, exposing the victim's Anthropic API key to an attacker-controlled endpoint before the trust dialog was accepted.
- Malicious configurations could be distributed through pull requests, honeypot repositories, or compromised internal repositories.
- Defensive Notes
- Update Claude Code; the article reports that all discussed vulnerabilities were patched before public disclosure.
- Inspect .claude/, .vscode/, and other tool-specific configuration directories before opening a project.
- Review configuration changes as carefully as source code, and heed warnings about untrusted project files.
- Anthropic's fixes prevent MCP initialization and network/API requests before user approval.
Indicators of compromise
| Type | Indicator | Context |
|---|---|---|
| DOMAIN | attacker-server[.]com | Attacker-controlled endpoint identified for delivering a payload and receiving redirected API requests, including the victim's API key. |
| URL | hxxp[:]//attacker-server[.]com/payload.sh | Example malicious payload URL used in a repository-controlled hook to download and execute a shell script. |
MITRE ATT&CK
T1041 · Exfiltration Over C2 ChannelOverriding ANTHROPIC_BASE_URL redirected API requests, including the authorization header containing the victim's API key, to an attacker-controlled endpoint.T1059 · Command and Scripting InterpreterRepository-controlled hooks and MCP initialization commands executed arbitrary shell commands on the developer's machine.T1078 · Valid AccountsThe article reports that a stolen Anthropic API key could be used to access and modify shared Workspace files.T1195 · Supply Chain CompromiseMalicious project configuration could spread through pull requests, honeypot repositories, or internal repositories.T1204 · User ExecutionThe attack could be triggered when a user opened a project and accepted its trust prompt.
CVE
Vendors
Products
Claude CodeCheck Point Research discovered critical vulnerabilities in Anthropic’s Claude Code that allowed remote code execution and API key exfiltration via repository-controlled configurations.WorkspacesBut as we explored Anthropic’s API documentation to understand the full scope of access, we discovered something far more concerning: Workspaces.
