| Field | Value |
|---|---|
| CVE / NVD | CVE-2026-21852 |
| Date (index) | 2026-01-21 |
| Affected product (index) | Claude Code (Anthropic agentic coding tool) |
| GHSA ID | GHSA-jh7p-qr78-84p7 |
| OWASP MCP Top 10 (2025) | MCP01 — Token Mismanagement & Secret Exposure |
| Published / disclosed | 2026-01-21 |
| Ecosystem | Application / upstream project |
| Component | Claude Code |
| EPSS score | 0.229700000 (FIRST EPSS, 2026-06-30) |
| CVSS score | Medium — 5.3 — CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X (NVD CVSS 4.0) |
| CWE | CWE-522 |
| Affected versions | Claude Code prior to 2.0.65 (per NVD) |
| Fixed versions | 2.0.65 and later (per NVD) |
| Fix status | Patched (per NVD description) |
| Exploit status | Public CVE record |
| Notes | Details below are aligned to the English NVD description at indexing time; re-check NVD for CNA updates. |
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.
Depends on deployment: many MCP issues require a reachable HTTP/SSE listener, a malicious remote MCP server, a poisoned project/workspace config, or a victim opening attacker-influenced content. Treat developer workstations and shared CI runners as high-value targets when MCP servers run with host access.
See the NVD description and linked references for the upstream root cause; CWE rows above summarize the weakness mapping published by NVD.
MCP extends an agent’s reach into tools, hosts, and cloud APIs. Failures in transport authentication, logging, URL validation, session binding, or local config loading frequently become RCE, credential theft, SSRF, or session hijacking in MCP-shaped deployments.
Add a minimal vulnerable code snippet here after reviewing the linked upstream commit / tag diff (do not paste weaponized payloads).
Upgrade to vendor-fixed versions where available, reduce network exposure (bind to localhost, require auth on HTTP transports), and apply standard MCP deployment hygiene (tool allowlists, egress controls, separate secrets from logs).
references for commits, tags, and release notes.
If a public PoC exists, prefer vendor advisories and defensive write-ups; do not host weaponized exploit code in this repository.
Track NVD references for CVE-2026-21852 and apply the upstream patched release/commit recommended by the vendor/CNA.