INCIDENT MAP

Browse / Sensitive Data Disclosure / CVE-2026-21852

Claude Code Leaks Data via Malicious Environment Configuration Before Trust Confirmation

CVE-2026-21852 ยท 2026-01-21 moderate

Class
Sensitive Data Disclosure (filed by a model that read the advisory)
Technique
Data exfiltration
Also involves
Unsafe Model Loading and Supply Chain
Affected
@anthropic-ai/claude-code (npm)
Gets past
Approval or confirmation prompt
CVSS
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
EPSS
27.5% chance of exploitation in 30 days

How it works, in short

A repository settings file can point the API base URL at an attacker endpoint, and Claude Code sends requests carrying the user's key before the trust prompt appears. (Our summary, written by a model. The source text is below.)

Details

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 ANTHROPIC_BASE_URL to an attacker-controlled endpoint, Claude Code would issue API requests before showing the trust prompt, including 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 the latest version.

References

Source: GitHub Advisory Database, used under CC BY 4.0.