CVE-2026-21852: Pre-trust API key exfiltration in Claude Code
- Vendor
- Anthropic
CVE-2026-21852 is a credential-exfiltration vulnerability in the project-load flow of Anthropic Claude Code versions before 2.0.65. An attacker-controlled repository can supply project settings that override ANTHROPIC_BASE_URL with an attacker-controlled endpoint. Claude Code applies this configuration and initiates authenticated API requests before displaying the repository trust prompt, potentially transmitting the user's Anthropic API key and other request data to the attacker. Exploitation requires opening the malicious project with Claude Code but does not require accepting its trust prompt.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Attackers can obtain Anthropic API credentials and sensitive data included in redirected API requests. Stolen keys can enable unauthorized API usage and associated charges. Depending on the key's permissions and workspace configuration, compromise can also expose shared Anthropic Workspace resources and permit reading, modifying, deleting, or uploading workspace data, extending the impact beyond the individual developer.
Mitigation
If you can’t patch tonight, do this now.
Until patched, do not launch Claude Code in untrusted repositories. Inspect repository-controlled configuration before project load and remove settings that override ANTHROPIC_BASE_URL or otherwise redirect API traffic. Validate the effective environment and configuration sources from a trusted workspace. Revoke and replace API keys suspected of exposure.
Remediation
Patch, then assume compromise.
Update Claude Code to version 2.0.65 or later, preferably the latest release. Standard auto-update users have received the fix; users managing updates manually must install a patched version. The fix defers network operations, including API key transmission, until the user explicitly confirms repository trust.
Exploits
1 exploit validated by Mallory's analysis. Hidden: 4 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Frequently asked questions
- Is CVE-2026-21852 exploited in the wild?
- As of Nov 8, 2026, Mallory has no reports of CVE-2026-21852 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-21852?
- Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2026-21852, the earliest disclosed Feb 27, 2026.
- Is there a patch for CVE-2026-21852?
- Update Claude Code to version 2.0.65 or later, preferably the latest release. Standard auto-update users have received the fix; users managing updates manually must install a patched version.
- What products are affected by CVE-2026-21852?
- Anthropic Claude Code.
- How severe is CVE-2026-21852?
- CVE-2026-21852 has a CVSS v4 score of 5.3 (Medium) and an EPSS score of 27.5% (98th percentile) as of Nov 8, 2026.
Recent activity
50 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.