Untrusted repositories turn Claude code into an attack vector
Vulnerabilities mentionedAll →
| CVE | Vulnerability | CVSS | EPSS | Flags | Affected | Exposure | Published |
|---|---|---|---|---|---|---|---|
| CVE-2025-59536 | Code Injection in Anthropic Claude Code Startup Trust Dialog (pre-1.0.111) Anthropic's Claude Code, an agentic coding tool, contained a code injection flaw (CWE-94) caused by a bug in its startup trust dialog implementation, so all versions before 1.0.111 are affected. An attacker who controls the contents of a project directory — for example a malicious or compromised repository — can get Claude Code to execute code contained in that project before the user has accepted the startup trust dialog, bypassing the prompt meant to gate execution. The trigger is simply a user starting Claude Code in an untrusted directory (user interaction is required, per the CVSS 4.0 vector scored 8.7 High), and a successful attack yields arbitrary code execution with the developer's local privileges, potentially exposing source code and credentials accessible to that account. Users on the standard auto-update channel have already received the fix automatically, while manually updated or version-pinned installations remain exposed until upgraded to 1.0.111 or later. No public proof-of-concept or CISA KEV listing is known, but EPSS assigns a 26.4% probability of exploitation within 30 days (98th percentile), and related research on Claude Code code execution and a similar Amazon Q Developer flaw indicates active researcher and attacker interest in this attack surface. Do: Update Claude Code to version 1.0.111 or later; auto-update users should already be patched but should verify the installed version on each workstation, while manually updated or pinned installs must be upgraded explicitly. Until patched, avoid starting Claude Code in untrusted or freshly cloned project directories, and treat trust-dialog prompts on unpatched versions as not yet protective. | 8.7 | 26% |
| largeon the order of hundreds of thousands of developer installations (local CLI; auto-update users already patched) | ||
| CVE-2026-21852 | API Key Exfiltration via Attacker-Controlled Base URL in Anthropic Claude Code Claude Code versions prior to 2.0.65 process repository settings during the project-load flow before the user has confirmed trust in a repository, and this flaw (CWE-522, insufficiently protected credentials) lets a malicious repository redirect API traffic and capture credentials. When a user opens an attacker-controlled repository, Claude Code reads a settings file that sets ANTHROPIC_BASE_URL to an attacker-controlled endpoint and immediately issues API requests before the trust prompt is shown. Because those requests are sent to the attacker's endpoint, the user's Anthropic API key can be leaked to the attacker. Anyone running an affected version of Anthropic Claude Code who opens untrusted or attacker-supplied repositories is affected, while users on standard auto-update have already received the fix. No public proof-of-concept or confirmed in-the-wild exploitation is known and the flaw is not on CISA's KEV list, but EPSS assigns a 24.8% probability of exploitation within 30 days (98th percentile). Do: Upgrade to Claude Code 2.0.65 or later; auto-update users have already received the fix, so manually verify the installed version if updates are managed by hand. Until patched, avoid opening untrusted repositories with Claude Code, and review repository settings files for ANTHROPIC_BASE_URL overrides before trusting a project. Check API usage logs or billing for unexpected requests to unfamiliar endpoints and rotate the Anthropic API key if exposure is suspected. | 5.3 | 25% |
| largeon the order of hundreds of thousands of developer users/installations (official install counts not disclosed) |
Full article410 words · extracted from securityaffairs.com · click to collapse
Pierluigi Paganini
February 25, 2026

Flaws in Anthropic’s Claude Code could allow remote code execution and theft of API keys when users open untrusted repositories.
Check Point Research team found multiple vulnerabilities in Anthropic’s Claude Code AI coding assistant that could lead to remote code execution and API key theft. The vulnerabilities abuse features such as Hooks, MCP servers, and environment variables to run arbitrary shell commands and exfiltrate Anthropic API credentials when users clone and open untrusted repositories.
“Critical vulnerabilities, CVE-2025-59536 and CVE-2026-21852, in Anthropic’s Claude Code enabled remote code execution and API key theft through malicious repository-level configuration files, triggered simply by cloning and opening an untrusted project.” reads the report published by Check Point Research.
“Built-in mechanisms—including Hooks, MCP integrations, and environment variables—could be abused to bypass trust controls, execute hidden shell commands, and redirect authenticated API traffic before user consent”
Researchers found that Claude Code’s project-level configuration files can act as an execution layer, allowing the attackers to abuse a single malicious repository as an attack vector. Simply cloning and opening a crafted repo could trigger hidden commands, bypass consent safeguards, steal Anthropic API keys, and pivot from a developer’s workstation into shared enterprise cloud environments, without visible warning.
The risks include silent command execution via abused Hooks, consent bypass in the Model Context Protocol (CVE-2025-59536), and API key exfiltration before trust confirmation (CVE-2026-21852), potentially exposing broader AI-driven workflows.
Anthropic’s API Workspaces feature lets multiple API keys share access to cloud-stored project files. Since files belong to the entire workspace and not just one API key, stealing a single key could let attackers access, change, or delete shared data, upload harmful content, and create unexpected charges. This behavior puts the whole team at risk, not just one developer.
The flaws highlight a new AI supply chain threat: repository configuration files now act as execution logic, so simply opening an untrusted project can trigger abuse. Anthropic addressed the issues by tightening trust prompts, blocking external tool execution, and restricting API calls until user approval.
“AI-powered coding tools are rapidly becoming part of enterprise development workflows. Their productivity benefits are significant, but so is the need to reassess traditional security assumptions.
Configuration files are no longer passive settings. They can influence execution, networking, and permissions.” concludes the report. “As AI integration deepens, security controls must evolve to match the new trust boundaries.”
Follow me on Twitter: @securityaffairs and Facebook and Mastodon
(SecurityAffairs – hacking, Claude)
Text extracted automatically; images, tables and formatting may be missing. Original: https://securityaffairs.com/188508/security/untrusted-repositories-turn-claude-code-into-an-attack-vector.html