Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @anthropic-ai/claude-code
  4. ›
  5. CVE-2026-21852

CVE-2026-21852: Claude Code Leaks Data via Malicious Environment Configuration Before Trust Confirmation

January 21, 2026

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

  • github.com/advisories/GHSA-jh7p-qr78-84p7
  • github.com/anthropics/claude-code
  • github.com/anthropics/claude-code/security/advisories/GHSA-jh7p-qr78-84p7
  • nvd.nist.gov/vuln/detail/CVE-2026-21852

Code Behaviors & Features

Detect and mitigate CVE-2026-21852 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.0.65

Fixed versions

  • 2.0.65

Solution

Upgrade to version 2.0.65 or above.

Impact 6.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L

Learn more about CVSS

Weakness

  • CWE-522: Insufficiently Protected Credentials

Source file

npm/@anthropic-ai/claude-code/CVE-2026-21852.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 04 Feb 2026 00:36:32 +0000.