Skip to content

test: add regression coverage for proxy hostname parser differentials #1498

Description

@zredlined

Description

Add regression tests that exercise hostname parser/canonicalization edge cases at the sandbox proxy boundary. This is inspired by the Claude Code SOCKS5 NUL-byte allowlist bypass documented here:

https://oddguan.com/blog/second-time-same-sandbox-anthropic-claude-code-network-allowlist-bypass-data-exfiltration/#the-disclosure-experience

Context

The core class is a parser differential: policy matching approves one hostname representation while the resolver/connect path dials a different destination. OpenShell does not appear to share the specific SOCKS5 NUL-byte issue, but the class is worth pinning down in tests.

Definition of Done

  • Add focused regression coverage for malformed CONNECT hostnames, including NUL/control characters and encoded variants.
  • Include wildcard policy cases so policy matching and resolution are exercised together.
  • Confirm internal-IP/SSRF checks still fail closed for malformed or ambiguous destinations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions