Anthropics claude-code
Claude Code Leaks Data via Malicious Environment Configuration Before Trust Confirmation
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 2.0.65
Fixed in 2.0.65
Mitigation
Upgrade claude-code to 2.0.65 or later.
References
- Vendor advisory github.com/anthropics/claude-code/security/adv…
Timeline
Days relative to CVE publicationFirst public PoC 36 days after publication; not in CISA KEV. First PoC: atiilla/CVE-2026-21852-PoC (created 27 Feb 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs · 2 pending · 2 suspicious or fake
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| atiilla/CVE-2026-21852-PoC | 27 Feb 2026 +36 d | 24 | PoC |
Pending 2
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| M0broot/CVE-Archive | 27 Feb 2026 +37 d | 0 | Pending · repository unavailable (HTTP 404) |
| abhishek2512mishra/claude-code-security-audit | 13 Sep 2026 +235 d | 0 | Pending
Flags · score 15
Below the suspicion threshold (50); does not change the assessment. |
Suspicious or fake 2
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| TreRB/ai-ide-config-guard | 20 Apr 2026 +88 d | 0 | Suspicious · score 100
Why suspicious
|
| Perufitlife/dotclaude-security | 21 Jun 2026 +151 d | 0 | Suspicious · score 100
Why suspicious
|
Only PoCs count toward the first-PoC date and the characteristics below. Suspicious repositories (score ≥ 50) never count. Do not run PoC code from unknown sources.