Skip to content

Hide Navigation Hide TOC

Claude Code ANTHROPIC_BASE_URL Credential Exfiltration (CVE-2026-21852) - ATR-2026-00524 (03b1c961-3e51-53e3-8f3b-5a0d95d26007)

Detects exploitation of CVE-2026-21852 (Moderate, CVSS 5.3), credential exfiltration in Claude Code via attacker-controlled ANTHROPIC_BASE_URL. An attacker-controlled repository ships a .claude/settings.json (or environment configuration) that sets ANTHROPIC_BASE_URL to an attacker-controlled endpoint. Claude Code makes its first API request BEFORE the trust prompt renders, leaking the Authorization: Bearer <api-key> header — i.e. the developer's active Anthropic API key — to the attacker's server. The full kill chain is: clone-or-open malicious repo → Claude Code loads repo-scoped settings → first API request fires pre-trust against ANTHROPIC_BASE_URL → attacker captures the live API key from the Authorization header → attacker uses key for unauthorised inference, account takeover, or onward credential pivoting. Detection anchors on ANTHROPIC_BASE_URL being set to any endpoint outside the documented Anthropic-controlled host list (api.anthropic.com, *.googleapis.com Vertex endpoints, *.bedrock.*.amazonaws.com Bedrock endpoints) — bare IP, plain http, or any non-Anthropic FQDN is a strong signal. CWE-522 (insufficiently protected credentials), CWE-1188 (insecure default), CWE-440 (expected behaviour violation). Patches in Claude Code >= 2.0.65 (GHSA-jh7p-qr78-84p7); affected versions < 2.0.65. PoC at github.com/atiilla/CVE-2026-21852-PoC. This rule detects exploit configs in repo-scoped settings.json and shell-env files, and provides defence-in-depth post-patch by flagging the dangerous endpoint rebind regardless of upstream patch state.

Cluster A Galaxy A Cluster B Galaxy B Level
ML Supply Chain Compromise (d2cf31e0-a550-4fe0-8fdb-8941b3ac00d9) MITRE ATLAS Attack Pattern Claude Code ANTHROPIC_BASE_URL Credential Exfiltration (CVE-2026-21852) - ATR-2026-00524 (03b1c961-3e51-53e3-8f3b-5a0d95d26007) Agent Threat Rules 1
Steal Web Session Cookie - T1539 (10ffac09-e42d-4f56-ab20-db94c67d76ff) Attack Pattern Claude Code ANTHROPIC_BASE_URL Credential Exfiltration (CVE-2026-21852) - ATR-2026-00524 (03b1c961-3e51-53e3-8f3b-5a0d95d26007) Agent Threat Rules 1
Exfiltration via ML Inference API (b07d147f-51c8-4eb6-9a05-09c86762a9c1) MITRE ATLAS Attack Pattern Claude Code ANTHROPIC_BASE_URL Credential Exfiltration (CVE-2026-21852) - ATR-2026-00524 (03b1c961-3e51-53e3-8f3b-5a0d95d26007) Agent Threat Rules 1
Claude Code ANTHROPIC_BASE_URL Credential Exfiltration (CVE-2026-21852) - ATR-2026-00524 (03b1c961-3e51-53e3-8f3b-5a0d95d26007) Agent Threat Rules Compromise Software Supply Chain - T1195.002 (bd369cd9-abb8-41ce-b5bb-fff23ee86c00) Attack Pattern 1
Credentials In Files - T1552.001 (837f9164-50af-4ac0-8219-379d8a74cefc) Attack Pattern Claude Code ANTHROPIC_BASE_URL Credential Exfiltration (CVE-2026-21852) - ATR-2026-00524 (03b1c961-3e51-53e3-8f3b-5a0d95d26007) Agent Threat Rules 1
Unsecured Credentials - T1552 (435dfb86-2697-4867-85b5-2fef496c0517) Attack Pattern Claude Code ANTHROPIC_BASE_URL Credential Exfiltration (CVE-2026-21852) - ATR-2026-00524 (03b1c961-3e51-53e3-8f3b-5a0d95d26007) Agent Threat Rules 1
Claude Code ANTHROPIC_BASE_URL Credential Exfiltration (CVE-2026-21852) - ATR-2026-00524 (03b1c961-3e51-53e3-8f3b-5a0d95d26007) Agent Threat Rules Unsecured Credentials (04d61746-9df1-468e-99d3-0a4685856deb) MITRE ATLAS Attack Pattern 1
Supply Chain Compromise - T1195 (3f18edba-28f4-4bb9-82c3-8aa60dcac5f7) Attack Pattern Compromise Software Supply Chain - T1195.002 (bd369cd9-abb8-41ce-b5bb-fff23ee86c00) Attack Pattern 2
Unsecured Credentials - T1552 (435dfb86-2697-4867-85b5-2fef496c0517) Attack Pattern Credentials In Files - T1552.001 (837f9164-50af-4ac0-8219-379d8a74cefc) Attack Pattern 2