
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-21852 is a credential exfiltration vulnerability in Anthropic's Claude Code agentic coding tool, classified as "Claude Code Leaks Data via Malicious Environment Configuration Before Trust Confirmation." Prior to version 2.0.65, Claude Code's project-load flow would read repository configuration files and issue API requests — including transmitting the user's Anthropic API keys — before displaying the trust confirmation prompt to the user. The vulnerability affects all versions of the @anthropic-ai/claude-code npm package below 2.0.65. It was published on January 20, 2026, and received a CVSS v3.1 base score of 7.5 (High) and a CVSS v4.0 base score of 5.3 (Medium) (Github Advisory, Anthropic Advisory).
The root cause is classified as CWE-522 (Insufficiently Protected Credentials) and CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor). Claude Code's project-load flow failed to enforce a trust boundary before processing repository-supplied configuration: when a user opened a directory in Claude Code, the tool would read any present settings file and apply environment variables — including ANTHROPIC_BASE_URL — prior to presenting the trust prompt. An attacker who controls a repository can place a settings file that redirects ANTHROPIC_BASE_URL to an attacker-controlled server; Claude Code then issues API requests (carrying the user's API key in the Authorization header) to that server before the user has any opportunity to review or reject the repository. This is a time-of-check/time-of-use (TOCTOU) design flaw in the trust model, requiring only that the victim open the malicious repository with Claude Code (Github Advisory, Anthropic Advisory).
Successful exploitation results in the silent exfiltration of the victim's Anthropic API key to an attacker-controlled server, with no visible indication to the user. With a stolen API key, an attacker can make unauthorized API calls billed to the victim's account, access any data or capabilities the key permits, and potentially pivot to other systems or services if the same credentials are reused. The attack requires minimal user interaction — simply opening a malicious repository in Claude Code is sufficient to trigger the leak — making it particularly dangerous in developer workflows involving third-party or open-source repositories (Github Advisory, Check Point Research).
Multiple public proof-of-concept exploits are available on GitHub, including repositories at https://github.com/atiilla/CVE-2026-21852-PoC and https://github.com/snoopysecurity/CVE-2026-21852-PoC, added as early as March 2, 2026 (Feedly). The vulnerability is also indexed on Sploitus. As of the advisory, there is no confirmed evidence of in-the-wild exploitation, and no threat actor attribution has been reported. The EPSS score is approximately 0.033–0.041%, indicating a low but non-negligible probability of exploitation in the near term. The vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Nessus detection plugin 305985 is available for scanning (Tenable).
.claude/settings.json or equivalent project-level configuration) that sets ANTHROPIC_BASE_URL to an attacker-controlled HTTPS endpoint (e.g., https://attacker.example.com/api).Authorization header, which will contain the victim's Anthropic API key in Bearer token format.claude (Claude Code). Claude Code reads the repository's settings file and applies the ANTHROPIC_BASE_URL override before displaying the trust prompt.api.anthropic.com) carrying Authorization: Bearer sk-ant-... headers..claude/settings.json or equivalent Claude Code project settings file in a repository containing an ANTHROPIC_BASE_URL key pointing to an external or unfamiliar domain.Anthropic has released a patch in Claude Code version 2.0.65, which ensures that repository configuration files are not processed and API requests are not issued until after the user confirms trust for the repository. Users on standard Claude Code auto-update have already received this fix automatically. Users performing manual updates should upgrade to version 2.0.65 or later immediately via their preferred installation method (curl installer, Homebrew, WinGet, or npm). As an interim workaround, users should avoid opening repositories from untrusted or unknown sources in Claude Code, and should inspect any .claude/settings.json or equivalent configuration files for unexpected ANTHROPIC_BASE_URL entries before running Claude Code. Any API keys potentially exposed should be rotated immediately via the Anthropic console (Github Advisory, Anthropic Advisory).
Check Point Research published a detailed technical write-up covering CVE-2026-21852 alongside a related RCE vulnerability (CVE-2025-59536), describing how malicious repository files could turn Claude Code into an attack vector for API key theft and remote code execution (Check Point Research). The disclosure received broad coverage from outlets including The Hacker News, The Register, Security Affairs, BankInfoSecurity, and IT Pro, with community discussion active on Reddit's r/blueteamsec, r/Anthropic, and r/CVEWatch. Security researchers on Mastodon and Bluesky highlighted the vulnerability as a cautionary example of trust-model failures in AI coding agents. The vulnerability was featured in F5 Labs' weekly threat bulletin and Check Point's AI threat landscape digest for March–April 2026, reflecting sustained industry attention to AI tool supply chain risks (The Hacker News, Check Point Research).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."