Skip to content

fix(sandbox): deny forward proxy for l7-configured endpoints#339

Closed
drew wants to merge 1 commit intoNVIDIA:mainfrom
vincentkoc:codex/fix-forward-proxy-bypassing-l7-rules
Closed

fix(sandbox): deny forward proxy for l7-configured endpoints#339
drew wants to merge 1 commit intoNVIDIA:mainfrom
vincentkoc:codex/fix-forward-proxy-bypassing-l7-rules

Conversation

@drew
Copy link
Collaborator

@drew drew commented Mar 16, 2026

Motivation

  • The forward-proxy path forwarded rewritten HTTP requests after only L4 checks and allowed_ips validation, which allowed sandboxed clients to bypass endpoint L7 method/path rules that are enforced in the CONNECT/L7 inspection path.
  • The change prevents an untrusted process from using HTTP_PROXY + plain http:// requests to reach endpoints that have L7 policies, closing a high-severity policy bypass.

Description

  • Added a guard in handle_forward_proxy() that calls query_l7_config(...) and returns HTTP/1.1 403 Forbidden when the matched endpoint has L7 configuration, so forward-proxy requests cannot bypass per-request L7 inspection.
  • Emitted structured denial logging and a denial-event via emit_denial_simple(..., "forward_l7") for visibility and auditing.
  • Updated architecture/security-policy.md to document that forward-proxy requests are rejected for endpoints with L7 config and that CONNECT must be used for L7-inspected endpoints.

Testing

  • Ran cargo fmt --all --check, which succeeded.
  • Attempted mise run pre-commit, which failed due to environment/tooling remote resolution and trust warnings in this container, not due to code changes.
  • Attempted cargo test -p openshell-sandbox --lib proxy::tests -- --nocapture, which began compilation in this environment but did not complete within the session (heavy dependency build); thus unit tests were not fully executed here.

Codex Task

@drew drew added integration:aardvark Aardvark integration integration:codex Codex integration labels Mar 16, 2026
@github-actions
Copy link

Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text:


I have read the DCO document and I hereby sign the DCO.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot.

@johntmyers
Copy link
Collaborator

Closing in favor of consolidated re-implementation. See #350 for tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:aardvark Aardvark integration integration:codex Codex integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants