CVE-2026-21852: CWE-522: Insufficiently Protected Credentials in anthropics claude-code
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.
AI Analysis
Technical Summary
CVE-2026-21852 affects anthropics' Claude Code, an agentic coding tool designed to assist developers by automating coding tasks. Prior to version 2.0.65, Claude Code's project-load flow contains a vulnerability where it processes configuration files from repositories immediately upon opening, before the user has confirmed trust in the repository. Specifically, a malicious repository can include a settings file that sets the environment variable ANTHROPIC_BASE_URL to an attacker-controlled endpoint. When Claude Code reads this configuration, it issues API requests to the attacker’s endpoint, sending sensitive data such as Anthropic API keys. This behavior exposes credentials prematurely, violating the principle of least privilege and trust verification. The vulnerability is classified under CWE-522, indicating insufficient protection of credentials. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N) indicates that the attack can be performed remotely over the network with low complexity, no privileges, but requires user interaction (opening the repository). The impact includes potential unauthorized access to Anthropic APIs, leading to data leakage or misuse of API capabilities. The vulnerability has been patched in version 2.0.65, and users with auto-update enabled have likely received the fix. Manual updaters must upgrade promptly to mitigate risk. No known exploits have been reported in the wild, but the nature of the vulnerability makes it a significant risk for developers who open untrusted repositories.
Potential Impact
For European organizations, this vulnerability poses a risk of unauthorized disclosure of Anthropic API keys, which could lead to misuse of AI services, data exfiltration, or further compromise of internal systems relying on these APIs. Organizations using Claude Code in development environments may inadvertently expose sensitive credentials by opening malicious repositories, potentially enabling attackers to execute unauthorized API calls or gather intelligence. This can undermine confidentiality and integrity of AI-driven workflows and data. The impact is heightened in sectors with strict data protection regulations such as GDPR, where leakage of credentials could lead to compliance violations and reputational damage. Additionally, organizations integrating Claude Code into CI/CD pipelines or collaborative coding environments may face increased risk if malicious code repositories are introduced. While availability impact is low, the confidentiality and integrity risks are moderate, warranting timely remediation. The vulnerability also highlights the importance of secure handling of credentials in developer tools, especially those interacting with cloud APIs.
Mitigation Recommendations
European organizations should ensure all instances of Claude Code are updated to version 2.0.65 or later, especially those updated manually. Implement strict policies to restrict opening repositories from untrusted or unknown sources. Employ network monitoring to detect unusual outbound API requests from developer workstations. Use environment variable protections or secrets management solutions to prevent leakage of API keys through configuration files. Educate developers about the risks of opening untrusted repositories and the importance of verifying repository trust prompts. Consider isolating development environments or using sandboxing techniques to limit the impact of potential credential exfiltration. Audit and rotate Anthropic API keys regularly to minimize exposure duration. Finally, monitor for any suspicious activity on Anthropic API usage that could indicate compromised credentials.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Belgium, Italy
CVE-2026-21852: CWE-522: Insufficiently Protected Credentials in anthropics claude-code
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.
AI-Powered Analysis
Technical Analysis
CVE-2026-21852 affects anthropics' Claude Code, an agentic coding tool designed to assist developers by automating coding tasks. Prior to version 2.0.65, Claude Code's project-load flow contains a vulnerability where it processes configuration files from repositories immediately upon opening, before the user has confirmed trust in the repository. Specifically, a malicious repository can include a settings file that sets the environment variable ANTHROPIC_BASE_URL to an attacker-controlled endpoint. When Claude Code reads this configuration, it issues API requests to the attacker’s endpoint, sending sensitive data such as Anthropic API keys. This behavior exposes credentials prematurely, violating the principle of least privilege and trust verification. The vulnerability is classified under CWE-522, indicating insufficient protection of credentials. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N) indicates that the attack can be performed remotely over the network with low complexity, no privileges, but requires user interaction (opening the repository). The impact includes potential unauthorized access to Anthropic APIs, leading to data leakage or misuse of API capabilities. The vulnerability has been patched in version 2.0.65, and users with auto-update enabled have likely received the fix. Manual updaters must upgrade promptly to mitigate risk. No known exploits have been reported in the wild, but the nature of the vulnerability makes it a significant risk for developers who open untrusted repositories.
Potential Impact
For European organizations, this vulnerability poses a risk of unauthorized disclosure of Anthropic API keys, which could lead to misuse of AI services, data exfiltration, or further compromise of internal systems relying on these APIs. Organizations using Claude Code in development environments may inadvertently expose sensitive credentials by opening malicious repositories, potentially enabling attackers to execute unauthorized API calls or gather intelligence. This can undermine confidentiality and integrity of AI-driven workflows and data. The impact is heightened in sectors with strict data protection regulations such as GDPR, where leakage of credentials could lead to compliance violations and reputational damage. Additionally, organizations integrating Claude Code into CI/CD pipelines or collaborative coding environments may face increased risk if malicious code repositories are introduced. While availability impact is low, the confidentiality and integrity risks are moderate, warranting timely remediation. The vulnerability also highlights the importance of secure handling of credentials in developer tools, especially those interacting with cloud APIs.
Mitigation Recommendations
European organizations should ensure all instances of Claude Code are updated to version 2.0.65 or later, especially those updated manually. Implement strict policies to restrict opening repositories from untrusted or unknown sources. Employ network monitoring to detect unusual outbound API requests from developer workstations. Use environment variable protections or secrets management solutions to prevent leakage of API keys through configuration files. Educate developers about the risks of opening untrusted repositories and the importance of verifying repository trust prompts. Consider isolating development environments or using sandboxing techniques to limit the impact of potential credential exfiltration. Audit and rotate Anthropic API keys regularly to minimize exposure duration. Finally, monitor for any suspicious activity on Anthropic API usage that could indicate compromised credentials.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-01-05T16:44:16.366Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69713c964623b1157cebad0a
Added to database: 1/21/2026, 8:52:38 PM
Last enriched: 1/21/2026, 9:05:16 PM
Last updated: 1/21/2026, 11:52:37 PM
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2026-23887: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in Intermesh groupoffice
MediumCVE-2026-23873: CWE-1236: Improper Neutralization of Formula Elements in a CSV File in zhblue hustoj
MediumCVE-2026-1036: CWE-862 Missing Authorization in 10web Photo Gallery by 10Web – Mobile-Friendly Image Gallery
MediumCVE-2026-23737: CWE-502: Deserialization of Untrusted Data in lxsmnsyc seroval
HighCVE-2026-23736: CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') in lxsmnsyc seroval
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.