Skip to content

Fix/passthrough allow encoded slash/mr miles - #5644

Open
mr-miles wants to merge 2 commits into
NVIDIA:mainfrom
mr-miles:fix/passthrough-allow-encoded-slash/mr-miles
Open

mr-miles wants to merge 2 commits into
NVIDIA:mainfrom
mr-miles:fix/passthrough-allow-encoded-slash/mr-miles

Conversation

@mr-miles

Copy link
Copy Markdown
Contributor

Summary

Policy validation accepts allow_encoded_slash on an endpoint without a protocol, and that mode still canonicalizes HTTP request paths and rejects %2F, but the supervisor ignored the flag. This PR makes modeless endpoints honor it on both the CONNECT relay and the forward proxy.

Related Issue

Closes #5643

Changes

  • Read the opt-in from the decision's matched endpoint records, which carry modeless endpoints (EndpointDecision::modeless_allows_encoded_slash). Overlapping modeless endpoints combine, like their allows.
  • Pass it to the route-less HTTP relay (relay_passthrough_with_credentials), which previously always parsed with strict defaults.
  • Use it in the forward proxy's canonicalizer when no inspected route applies. Inspected routes keep the existing per-endpoint re-check against the matched config.
  • Leave endpoint_configs unchanged, so a modeless endpoint cannot shadow an inspected endpoint's TLS mode or protocol on the same host and port.
  • Update the passthrough rejection hint, which told users to add protocol: rest, and the network rules docs.

Release Notes

Endpoints without a protocol now honor allow_encoded_slash: true, so request paths containing %2F (for example npm scoped packages) are forwarded instead of rejected. Without the flag, they are still rejected.

Testing

  • rustfmt --edition 2024 --check on changed files, and cargo clippy -p openshell-supervisor-network --lib --tests clean on both commits
  • Unit tests added: allow_encoded_slash true, false and omitted on a modeless endpoint, through prepare_http_relay/relay_http_stream with a decision from a real policy evaluation, and through handle_forward_proxy. Each first forwards a plain path as a setup check. The first commit adds the tests alone; the true cases are expected to fail until the second commit.
  • E2E tests: not added.

Checklist

An endpoint without a protocol still has its HTTP request paths
canonicalized, and %2F is rejected, but allow_encoded_slash is not
consulted: the CONNECT passthrough relay and the forward proxy both
parse strictly.

Add tests for a modeless endpoint with allow_encoded_slash true, false
and omitted, through the route-less HTTP relay (prepare_http_relay and
relay_http_stream with a decision from a real policy evaluation) and
through handle_forward_proxy. Each first forwards a plain path as a
setup check. The true cases fail until the supervisor honors the flag.

Signed-off-by: mr-miles <[email protected]>
NVIDIA#5643)

Policy validation accepts allow_encoded_slash on an endpoint without a
protocol, and that mode still canonicalizes HTTP request paths and
rejects %2F, but the flag never reached the parser: a modeless endpoint
has no L7 config, so the route-less relay parsed with strict defaults
and the forward proxy read the flag only from inspected route configs.

Read the opt-in from the matched endpoint records, which carry modeless
endpoints, and pass it to the passthrough relay and to the forward
proxy's canonicalizer when no inspected route applies. Overlapping
modeless endpoints combine, like their allows. Inspected endpoints keep
the per-endpoint re-check, and endpoint_configs is unchanged, so a
modeless endpoint cannot shadow an inspected endpoint's TLS mode or
protocol. Update the passthrough rejection hint and the network rules
docs.

Signed-off-by: mr-miles <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: allow_encoded_slash passes policy validation but is ignored on endpoints without a protocol

1 participant