2026-02-03 — Claude Code trusted-domain validation bypass (CVE-2026-24052)¶
What happened: Claude Code’s WebFetch “trusted domain” verification used a startsWith() check, allowing attacker-controlled domains like modelcontextprotocol.io.example.com to pass validation meant for modelcontextprotocol.io.
Why it matters: Any agent/tool that automatically fetches URLs based on a “trusted domains” allowlist can be tricked into contacting attacker infrastructure without explicit user consent.
- Potential impact: data exfiltration (query strings, prompts, context, metadata) and persistence via poisoning of fetched content.
- This is the agent-era equivalent of a classic URL parsing / origin validation bug.
Durable guidance (defensive)¶
If you implement a “trusted domains” allowlist for automated fetches:
- Parse URLs (don’t string-match).
- Validate against the hostname, not the full URL string.
-
If you allow subdomains, enforce a dot-boundary suffix match:
-
✅
host == example.comORhost.endswith(".example.com") -
❌
host.startswith("example.com")(bypass viaexample.com.attacker.tld) -
Normalize before comparison:
- lower-case host
- remove trailing dot
- reject userinfo (
user@host) surprises -
consider punycode/IDN (
xn--…) handling -
Don’t forget redirects:
- validate the final destination (and ideally each hop)
-
cap redirect depth
-
Prefer human-in-the-loop for cross-domain fetches.
Status¶
GitHub’s advisory notes that users on standard auto-update have received the fix.
References¶
- GitHub Advisory Database: https://github.com/advisories/GHSA-vhw5-3g5m-8ggf
- Upstream advisory: https://github.com/anthropics/claude-code/security/advisories/GHSA-vhw5-3g5m-8ggf