GHSA-jh7p-qr78-84p7 CVE-2026-21852
Claude Code Leaks Data via Malicious Environment Configuration Before Trust Confirmation
- Severity
- 0.0 / 10
- High · CVSS 4.0
- Exploit chance (EPSS)
- 27.50%
- Chance of exploitation in the next 30 days. Higher than 98.07% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-522 Insufficiently Protected Credentials
- Fix
2.0.65- Upgrade @anthropic-ai/claude-code to this version or later
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.
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| @anthropic-ai/claude-code | < 2.0.65 |
2.0.65 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
@anthropic-ai/claude-code npm → 2.0.65
- npm
npm install @anthropic-ai/claude-code@2.0.65- yarn
yarn add @anthropic-ai/claude-code@2.0.65- pnpm
pnpm add @anthropic-ai/claude-code@2.0.65
Severity breakdown
CVSS 4.0 0.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
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None
- User interaction
- Passive
- Confidentiality (vulnerable system)
- Low
- Integrity (vulnerable system)
- Low
- Availability (vulnerable system)
- Low
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Weakness
CWE-522: Insufficiently Protected Credentials
The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.
How to prevent it
- Architecture and Design: Use an appropriate security mechanism to protect the credentials.
- Architecture and Design: Make appropriate use of cryptography to protect the credentials.
- Implementation: Use industry standards to protect the credentials (e.g. LDAP, keystore, etc.).
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-pq7j-f95f-qfcv Claude Code: Plugin Hash Pin Bypass Allows Bypass of Hash Pinning | High | Also affects @anthropic-ai/claude-code |
| GHSA-7835-87q9-rgvv Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution | High | Also affects @anthropic-ai/claude-code |
| GHSA-4vp2-6q8c-pvq2 @anthropic-ai/claude-code has an Insecure Temporary File in /copy Command that Enables Response Disclosure and Symlink-Based File Write | Medium | Also affects @anthropic-ai/claude-code |
| GHSA-fg94-h982-f3mm Claude Code: Out-of-Band Data Exfiltration via Pre-Approved HuggingFace Domain in WebFetch | Critical | Also affects @anthropic-ai/claude-code |
| GHSA-q5hj-mxqh-vv77 Claude Code: Trust Dialog Bypass via Git Worktree Spoofing Allows Arbitrary Code Execution | High | Also affects @anthropic-ai/claude-code |
| GHSA-vp62-r36r-9xqp Claude Code: Sandbox Escape via Symlink Following Allows Arbitrary File Write Outside Workspace | Critical | Also affects @anthropic-ai/claude-code |
| GHSA-5cwg-9f6j-9jvx Claude Code: Insecure System-Wide Configuration Loading Enables Local Privilege Escalation on Windows | High | Also affects @anthropic-ai/claude-code |
| GHSA-mmgp-wc2j-qcv7 Claude Code has a Workspace Trust Dialog Bypass via Repo-Controlled Settings File | High | Also affects @anthropic-ai/claude-code |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor