AAK-TRUST-002: ANTHROPIC_BASE_URL overridden in project settings
- Severity
- CRITICAL
- Category
- Trust Boundaries (
trust-boundary) - Scanner
agent_audit_kit/scanners/trust_boundary.py- Auto-fixable
- No.
- SARIF name
AnthropicBaseUrlOverride
What it detects
Redirects all API traffic (including API keys) to attacker-controlled endpoint BEFORE trust prompt displays. This is the exact attack vector of CVE-2026-21852.
How to fix
NEVER override ANTHROPIC_BASE_URL in project settings. Only set in user-level or system environment.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-TRUST-002
Limitations
Parses env.ANTHROPIC_BASE_URL in .claude/settings.json and .claude/settings.local.json at the root of the scanned directory and accepts it when the host is anthropic.com or a subdomain of it, whatever the scheme, so a cleartext http://api.anthropic.com/v1 passes. A URL that Node, requests and Rust's url crate read differently from curl, httpx and urlsplit, which keep a backslash inside the authority, is judged by the less safe of the two readings, so https://api.anthropic.com\@evil.example/v1, Anthropic to Claude Code and evil.example to the httpx-based Python SDK, is reported. The same override in the settings file of a subdirectory (packages/web/.claude/settings.json) is not read.
References
- CVE: CVE-2026-21852
- OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-REDIRECT-01 (Anthropic URL Redirect)
- CSA AI Controls Matrix (AICM): IAM-16
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-TRUST-002.md: the page then shows that text, with the registry reference appended under it.