Vulnerability high
Severity
high
no CVSS

CVE-2026-21852: Claude Code API Key Exfiltration via Malicious Repository Config

CVE-2026-21852 is a high-severity credential theft issue in Claude Code, an AI agent. Affected: Claude Code < 2.0.65. Fixed in 2.0.65.

Is Claude Code running on your developers' machines? Anomity finds every device with this AI agent installed, shows the version, and can block it by policy. Detect this across your developers' devices with Anomity →

Key facts

ID
CVE-2026-21852
Severity
high
Attack type
Credential theft, Data exfiltration
Component
Claude Code · AI agent
Known exploited
No known exploitation
Published
Last verified

What is CVE-2026-21852?

Claude Code's project-load flow issued API requests, including auth headers, to ANTHROPIC_BASE_URL before showing a trust prompt, allowing a malicious repo's settings file to silently redirect all API calls to an attacker server and steal the developer's Anthropic API key. Discovered by Check Point Research; fixed in Claude Code v2.0.65 in January 2026.

Affected versions

AffectedFixed in
Claude Code < 2.0.652.0.65

Am I affected by CVE-2026-21852?

You are affected if you run Claude Code < 2.0.65. Versions 2.0.65 and later include the fix.

How do I fix CVE-2026-21852?

Upgrade Claude Code to v2.0.65+. Rotate Anthropic API keys if Claude Code was used on untrusted repos prior to patch. Block ANTHROPIC_BASE_URL overrides in project-scoped settings.

How do I find every machine running Claude Code?

Anomity inventories the AI agents, MCP servers, IDE extensions and skills on each developer device, so you can see which machines run Claude Code and which version, then enforce a policy on it.

References