CVE-2026-21852

CVE-2026-21852 is a high-severity vulnerability in Anthropic Claude Code with a CVSS 3.x base score of 7.5. Its EPSS exploit-prediction score of 23% places it in the 97th percentile, indicating an elevated likelihood of exploitation. The underlying weakness is classified as CWE-522.

Key facts

Description

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.

Frequently asked questions

What is 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.
How severe is CVE-2026-21852?
CVE-2026-21852 has a CVSS 3.x base score of 7.5, rated high severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is high, integrity none, and availability none.
Is CVE-2026-21852 being actively exploited?
It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 23% (97th percentile), an estimate of the probability of exploitation in the next 30 days.
What products are affected by CVE-2026-21852?
CVE-2026-21852 affects Anthropic Claude Code. See the affected-products list for the exact vulnerable versions.
How do I fix CVE-2026-21852?
Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
Does CVE-2026-21852 have an EU (EUVD) identifier?
Yes. CVE-2026-21852 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2026-3597.
When was CVE-2026-21852 published?
CVE-2026-21852 was published on 2026-01-21 and last updated on 2026-06-17.

References

Affected products (1)

More vulnerabilities in Anthropic Claude Code

All CVEs affecting Anthropic Claude Code →

Other CWE-522 (Insufficiently Protected Credentials) vulnerabilities

Browse all CWE-522 (Insufficiently Protected Credentials) vulnerabilities →