CVE-2026-21852
MEDIUM 5.3CVSS 4.0Claude 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.
- Published
- 21 Jan 2026
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-522
- Also known as
- GHSA-jh7p-qr78-84p7
- Sources
- NVDJSONOSV GHSA-jh7p-qr78-84p7JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | MEDIUM 5.3 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | anthropic | claude_codecpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:* |
< 2.0.65 | 2.0.65 |
| OSV | npm | @anthropic-ai/claude-code | < 2.0.65 | 2.0.65 |
References
- https://github.com/anthropics/claude-code/security/advisories/GHSA-jh7p-qr78-84p7 · Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-21852 · ADVISORY
- https://github.com/anthropics/claude-code · PACKAGE
History
- 25 Nov 2026 21:01 UTC · NVD: first stored (published 21 Jan 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 21 Jan 2026)