# CVE-2026-21852: Claude Code Leaks Data via Malicious Environment Configuration Before Trust Confirmation

- Severity: Medium 5.3 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 27.5%, higher than 98% of CVEs (2026-12-01)
- Published: 2026-01-21T01:00:31.000Z
- Modified: 2026-06-17T10:19:01.843Z
- Also known as: GHSA-jh7p-qr78-84p7
- Weaknesses: CWE-522
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- anthropics claude-code: < 2.0.65
- @anthropic-ai/claude-code (npm): before 2.0.65
- anthropic claude_code: before 2.0.65

## Every score

- GitHub_M: CVSS:4.0 5.3 Medium `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`
- GitHub: CVSS:4.0 Medium `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: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`

## 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)

## Sources

- CVE List: [CVE-2026-21852](https://www.cve.org/CVERecord?id=CVE-2026-21852), CVE Terms of Use, modified 2026-01-21
- GitHub Advisory Database: [GHSA-jh7p-qr78-84p7](https://github.com/advisories/GHSA-jh7p-qr78-84p7), CC-BY-4.0, modified 2026-02-03
- NVD: [CVE-2026-21852](https://nvd.nist.gov/vuln/detail/CVE-2026-21852), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-21852 · Whole record: https://cve.day/CVE-2026-21852.json · Rebuilt by cve.day 2026-11-25T22:59:13.021Z
