Repository navigation
Closed
Labels
gator:validatedGator validated this issue as ready for workGator validated this issue as ready for workretired:area:sandboxRetired; do not apply. See #5151 for item-specific migration to the current taxonomy.Retired; do not apply. See #5151 for item-specific migration to the current taxonomy.state:review-readyReady for human reviewReady for human reviewstate:staleInactive item at risk of automatic closure.Inactive item at risk of automatic closure.topic:securityVulnerability management, security analysis/auditing, bypass detection, and abuse prevention.Vulnerability management, security analysis/auditing, bypass detection, and abuse prevention.topic:testingUnit, integration, regression, conformance, E2E tests, coverage, flakes, and test infrastructure.Unit, integration, regression, conformance, E2E tests, coverage, flakes, and test infrastructure.
Description
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:
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
Labels
gator:validatedGator validated this issue as ready for workGator validated this issue as ready for workretired:area:sandboxRetired; do not apply. See #5151 for item-specific migration to the current taxonomy.Retired; do not apply. See #5151 for item-specific migration to the current taxonomy.state:review-readyReady for human reviewReady for human reviewstate:staleInactive item at risk of automatic closure.Inactive item at risk of automatic closure.topic:securityVulnerability management, security analysis/auditing, bypass detection, and abuse prevention.Vulnerability management, security analysis/auditing, bypass detection, and abuse prevention.topic:testingUnit, integration, regression, conformance, E2E tests, coverage, flakes, and test infrastructure.Unit, integration, regression, conformance, E2E tests, coverage, flakes, and test infrastructure.
Activity
zredlined commentedon May 21, 2026
Implementation Plan
Issue type:
choreComplexity: Low
Confidence: High — clear path
Summary
Add focused regression tests for hostname parser/canonicalization edge cases in the sandbox proxy path. The tests should document the parser-differential class from the referenced Claude Code SOCKS5 NUL-byte bypass and verify OpenShell continues to fail closed across policy matching, wildcard hosts, DNS resolution, and SSRF/internal-IP checks.
Scope
crates/openshell-sandbox/src/proxy.rs: add unit tests around CONNECT target parsing and resolver/SSRF helper behavior for malformed or ambiguous hostnames.crates/openshell-sandbox/src/opa.rs: add or extend wildcard-host policy tests for NUL/control/encoded-style hostname inputs, ensuring policy matching does not create an unintended allow path.Implementation Steps
*.example.comstyle rules.Test Plan
cargo test -p openshell-sandbox <focused filters> --libcovering proxy parser, OPA wildcard matching, and resolver/SSRF behavior.Risks & Open Questions
parse_target, decide whether to make this issue include the small fail-closed validation fix or split that into a separate fix ticket. Given the security context, a minimal validation fix would likely be appropriate if needed.Documentation Impact
Revision 1 — initial plan
fix(tests): Add hostname parser security regression tests (NVIDIA#1498)
johntmyers commentedon Jun 3, 2026
Validated
This issue is valid for OpenShell because it is a focused sandbox security/testing item with maintainer-authored scope and an active linked PR (#1562).
Recommended next step: track the linked PR through review and CI.
github-actions commentedon Jun 19, 2026
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.