Claude Code Leaks Data via Malicious Environment Configuration Before Trust Confirmation
CVE-2026-21852 · GHSA-jh7p-qr78-84p7 · published 2026-01-21
- Severity
- Medium
- CVSS score
- 5.3
- Chance of exploitation (EPSS)
- 27.5%
- Fixed in
- 2.0.65
- Exploitation No known exploitation
- Automatable Yes
- Technical impact Partial
- CISA SSVC
A vulnerability in Claude Code's project-load flow allowed malicious repositories to exfiltrate data including Anthropic API keys before users confirmed trust. If a user started Claude Code in an attacker-controller repository, and the repository included a settings file that set ANTHROPICBASEURL to an attacker-controlled endpoint, Claude Code would issue API requests before showing the trust prompt, including potentially leaking the user's API keys.
Upgrade @anthropic-ai/claude-code to 2.0.65 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| @anthropic-ai/claude-code | npm | < 2.0.65 | 2.0.65 |
- CriticalPhoenix: Format String Injection in applyChatTemplatearize-phoenix
- CriticalFlowise: Unauthenticated OAuth2 token refresh endpoint returns access tokens — enables token theft for any connected serviceflowise
- CriticalMLflow: Environment variable injection in AI Gateway secrets enables server-side credential exfiltrationmlflow
- CriticalvLLM has RCE In Video Processingvllm
- HighConfig revision hashes could expose password verifiersopenclaw
- Highn8n: Shared Credential Header Leak via HTTP Request Pagination Expressionn8n, n8n, n8n
- HighClaude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace@anthropic-ai/claude-code
- HighClaude Code: Plugin Hash Pin Bypass Allows Bypass of Hash Pinning@anthropic-ai/claude-code
- HighClaude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution@anthropic-ai/claude-code
- HighClaude Code: Trust Dialog Bypass via Git Worktree Spoofing Allows Arbitrary Code Execution@anthropic-ai/claude-code
- HighClaude Code: Sandbox Escape via Symlink Following Allows Arbitrary File Write Outside Workspace@anthropic-ai/claude-code
- HighClaude Code has a Workspace Trust Dialog Bypass via Repo-Controlled Settings File@anthropic-ai/claude-code
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.