Vulnerability in Anthropic Claude Code
CVE-2026-21852
Claude Code is an agentic coding tool. Prior to version 2.0.65, vulnerability in Claude Code's project-load flow allowed malicious repositories to exfiltrate data including Anthropic API keys before users confirmed trust. An attacker-controlled repository could include a settings file that sets ANTHROPIC_BASE_URL to an attacker-controlled endpoint and when the repository was opened, Claude Code would read the configuration and immediately issue API requests before showing the trust prompt, potentially leaking the user's API keys. Users on standard Claude Code auto-update have received this fix already. Users performing manual updates are advised to update to version 2.0.65, which contains a patch, or to the latest version.
Published · last modified .
CVSS v3 metric
CVSS v3 base score 7.5 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
EPSS exploit prediction
EPSS 0.275, 98.1th percentile (scored ); unchanged over 30 days. About EPSS.
Affected products
- Anthropic Claude Code
- Anthropics Claude-Code — versions < 2.0.65
Weakness classification (CWE)
Public exploits and proof-of-concept code
5 public repositories with exploit or proof-of-concept code for this CVE:
- atiilla/CVE-2026-21852-PoC (24 stars, last pushed 2026-02-27)
- abhishek2512mishra/claude-code-security-audit (last pushed 2026-09-21): Security scanner auditing Claude Code environments for CVE-2026-21852 pre-trust execution, hook hijacking, and eBPF lockdown.
- Perufitlife/dotclaude-security (last pushed 2026-06-21): Scan a repo's .claude/ config (settings.json hooks, MCP servers, env, allowed-tools) for the RCE & API-key-exfiltration footguns (CVE-2025-59536, CVE-2026-21852) that fire when you clone+open an untr…
- TreRB/ai-ide-config-guard (last pushed 2026-04-20): Scan a repo for AI-IDE config files that can trigger RCE via Claude Code hooks, Cursor rules, MCP auto-registration. Detects CVE-2025-59536, CVE-2026-21852, CVE-2026-30615 + Pillar Rules File Backdoo…
- M0broot/CVE-Archive (last pushed 2026-02-27): Claude Code Vulnerability [CVE-2026-21852]
References
This CVE has public exploit evidence. See the latest CVEs with public exploits.