Repository navigation
Description
User Story
As an operator running agents behind an L7 rest endpoint,
I want request paths that contain an encoded semicolon (%3B) to reach the upstream unchanged,
so that the agent acts on the resource it named and not on a different one.
Problem Statement
With the default strip_path_parameters: true, canonicalize_request_target percent-decodes %3B into a literal ; before splitting and stripping ;params. An encoded semicolon, which is data under RFC 3986, is then treated as a path-parameter delimiter: it and everything after it in that segment are dropped. Because the request line is rewritten with the canonical path (rewritten == true), the truncated path is what goes on the wire.
Observed with the canonicalizer from main (0ea0d31) built standalone:
| request-target | canonical path sent upstream |
|---|---|
/a/%3Bx |
/a/ |
/objects/backup%3Bold |
/objects/backup |
/a/..;/b |
/b (intended: ..; traversal guard) |
Relevant code:
- decode: https://github.com/NVIDIA/OpenShell/blob/0ea0d3102089ebaa4e891a12389056f545b48415/crates/openshell-supervisor-network/src/l7/path.rs#L272
- strip after decode: https://github.com/NVIDIA/OpenShell/blob/0ea0d3102089ebaa4e891a12389056f545b48415/crates/openshell-supervisor-network/src/l7/path.rs#L187
strip_path_parameters: https://github.com/NVIDIA/OpenShell/blob/0ea0d3102089ebaa4e891a12389056f545b48415/crates/openshell-supervisor-network/src/l7/path.rs#L284
The existing tests (/public/..%3B/secret → /secret) cover the dot-segment case only; there is no test asserting that %3B inside an ordinary segment survives.
Impact / Why This Matters
The agent's request is retargeted without any error or log entry:
DELETE /v1/objects/backup%3Boldis forwarded asDELETE /v1/objects/backup, which deletes a different object.GET/PUTon resource names, S3-style keys, or IDs that contain;read or overwrite the wrong resource.- Nothing is surfaced to the agent or operator (no OCSF event, no 4xx), so the data loss is silent.
The only workaround today is setting strip_path_parameters: false on the endpoint, which also disables the intended ;jsessionid-class mitigation.
Acceptance Criteria
- A
%3Binside a non-dot segment is preserved as%3Bin both the policy input and the forwarded request line (e.g./a/b%3Bc→/a/b%3Bc). -
..%3B/%2e%2e%3Btraversal is still resolved or rejected as today. - Alternatively, the request is rejected with a clear 4xx + OCSF event instead of being silently rewritten.
- Unit tests cover
%3Bin ordinary segments, including the trailing-segment case.
Reproduction Steps
- Create a sandbox with a
protocol: restendpoint for a test upstream (e.g. an HTTP echo server) and an allow rule for/**with method*. - From inside the sandbox:
curl -X DELETE "http://<upstream>/objects/backup%3Bold" - Observe the upstream receives
DELETE /objects/backup.
Environment
- OpenShell:
main@ 0ea0d31 (code review; canonicalizer exercised standalone) - Component:
openshell-supervisor-networkL7 REST relay, defaultCanonicalizeOptions - Any driver (the behavior is in the supervisor proxy)
Activity
sachinsharma3191 commentedon Oct 2, 2026
I'd like to work on this one.
Root cause:
canonicalize_request_targetdecodes%3Bto a literal;inpercent_decode_with_sentineland only afterwards strips;params. So encoded data gets treated as a delimiter, and the truncated path is what goes on the wire.build_canonical_pathalso emits;literally, which would let an upstream re-interpret a decoded%3B.Proposed fix: handle
%3Bthe same way%2Fis handled now. Decode it to a sentinel byte, which a literal;can't collide with because control bytes are already rejected.strip_path_parameterscuts only at a literal;, andbuild_canonical_pathre-emits the sentinel as%3B.One deliberate exception: a
%3Bdirectly after a.or..segment name is still treated as a delimiter. The existing regression tests require/public/..%3B/secretto resolve to/secret, because servers that decode before stripping would read..;as... That keeps the traversal guard intact.Behavior change to confirm:
/a/%3Bxgoes from forwarded as/a/to forwarded as/a/%3Bx, withrewritten == false. Operators who relied on%3Bbeing stripped will see a difference. Is that acceptable, or do you want it behind an option?Scope: the change is limited to
l7/path.rsplus unit tests. I'll runcargo testand clippy onopenshell-supervisor-network. Could a maintainer confirm that approach and accept the issue?github-actions commentedon Oct 16, 2026
This issue has had no activity for 14 days and is now marked stale. It may be closed in 14 days if there is no further activity. Comment or remove the state:stale label to keep it open.
CloneOfAlex commentedon Oct 16, 2026
Still relevant — please keep this open.
Quick status for triage: a fix already exists in #3986 (encoded-%3B sentinel mirroring the %2F handling, with the ..%3B traversal guard preserved and regression tests added). It was auto-closed by the vouch check before any review, not on the merits.
Two decisions would unblock this:
Is the approach in #3986 acceptable? If so, it can be reopened once the author is vouched, or @sachinsharma3191 offered to take it.
On the behavior change (/a/%3Bx forwarded as /a/%3Bx instead of /a/): should this be the new default, or gated behind a CanonicalizeOptions flag? I’d argue default, since the current behavior silently retargets requests (e.g. DELETE /objects/backup%3Bold → DELETE /objects/backup) with no 4xx or OCSF event.
cc @derekwaynecarr @mrunalp @sjenning (code owners on #3986)
github-actions commentedon Nov 15, 2026
This issue has had no activity for 28 days and is now marked stale. It may be closed in 14 days if there is no further activity. Comment or remove the state:stale label to keep it open.