GitHub Advisoryadvisory · npm

GHSA-jh7p-qr78-84p7 Claude Code Leaks Data via Malicious Environment Configuration Before Trust Confirmation

MEDIUM Published 2026-01-21 Modified 2026-01-21 Official page ↗
Aliases
CVE-2026-21852
Ecosystem
npm
Packages
@anthropic-ai/claude-code
Severity
Moderate
CVSS vector
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
Weaknesses
CWE-522
Reviewed
2026-01-21

Affected packages

• npm @anthropic-ai/claude-code: < 2.0.65 → fixed in 2.0.65

Description

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.

Related

Alias · CVE (1)

Weakness · CWE (1)

  • CWE-522 Insufficiently Protected Credentials weakness

References