Claude Code SOCKS5 Sandbox Bypass Exfiltrates Credentials and MCP Configs #
Aonan Guan, who leads cloud and AI security at Wyze Labs, publicly disclosed his second Claude Code network sandbox bypass in five months. The latest issue is a SOCKS5 hostname null-byte injection. Claude Code's proxy enforces its egress allowlist by passing the raw DOMAINNAME bytes from a CONNECT request through a JavaScript endsWith() check against the user's wildcard policy. JavaScript treats \x00 as an ordinary UTF-16 code unit, so a crafted host like attacker-host.com\x00.google.com matches an allowlist entry for .google.com and is approved. When libc later resolves the hostname via getaddrinfo(), the C runtime truncates at the null byte and dials attacker-host.com instead. Every release from v2.0.24 (sandbox GA on Oct 20, 2025) through v2.1.89 was vulnerable. Anthropic shipped a fix in v2.1.90 on April 1, 2026, with no security note in the changelog, no advisory on the Claude Code page, and no CVE assigned. Exfiltration paths reachable from inside the sandbox include MCP server configs, ~/.claude.json, project source, and anything else the agent could read.
Arbitrary data exfiltration past the network allowlist for roughly 5.5 months across about 130 published versions. Users who relied on a wildcard allowlist during that window received no advisory telling them to rotate credentials.
endsWithandgetaddrinfodisagree about whether\x00is a character. That isn't an exotic bug. The Apache HTTP server fixed the SSL-certificate-null-byte version of it in 2009. Shipping a network policy that's robust against motivated attackers takes engineering. Shipping one quietly takes considerably less.