Skip to content

test(gateway): require URI path-segment route boundaries - #181

Draft
seonghobae wants to merge 9 commits into
mainfrom
chatgpt/route-segment-boundary-v1
Draft

test(gateway): require URI path-segment route boundaries#181
seonghobae wants to merge 9 commits into
mainfrom
chatgpt/route-segment-boundary-v1

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Security finding

Refs #180. Protected main@a52ccd0a24a727d9349bb32def7713882d8cad1e selects routes with raw lexical prefix matching. That lets /api capture /apix and lets /api/admin capture /api/administrator, binding a request to the wrong Wardnet route/enforcement/upstream authority before later controls execute.

Hostile RED — executed

Exact RED head 93d097626d96f9adaffc267f47be162c397355f3 changes only crates/waf-ids-core/tests/route_path_segment_boundary.rs; production code remains untouched.

CI run 34129793580, rust job 101766902311, executed on a GitHub-hosted Ubuntu runner and failed in the new integration test after checkout/toolchain/fmt and the pre-existing crate tests had passed. The hostile boundary suite ran 3 tests: 1 passed and 2 failed exactly on the vulnerable lexical-prefix behavior:

  • /api incorrectly selected a route for lexical siblings such as /apix//api-v2 rather than returning no route;
  • /api/administrator incorrectly selected the narrower admin route instead of the valid /api parent (left: Some("admin"), right: Some("api")).

The root/trailing-slash compatibility case passed. This is the required realistic RED against unchanged production behavior; no no-op commit, predecessor result, duplicate verifier, or retry was used to manufacture it. Fuzz 34129793534 also completed successfully on this RED head.

RFC 3986 §3.3 is the path-segment authority.

Minimal causal GREEN

Exact current head is fc5645bb2e661f9af63d84b1d08e939b3d7ab3fe. Production change is limited to crates/waf-ids-core/src/lib.rs::select_route: an enabled route now matches only an exact configured path or a slash-delimited descendant. Prefixes ending in / retain their existing descendant behavior, root / remains catch-all, disabled routes remain ignored, and longest valid match remains unchanged.

Fresh compare against protected main@a52ccd0... is behind_by=0; the effective delta is exactly two files: the 77-line hostile regression and the 8-line route-predicate change. RouteConfig wire shape and EgressWeave-owned destination/DNS/redirect/proxy/TLS/resource authorization are untouched. The downstream suffix strip is reached only after this segment-safe route selection and therefore does not require a second routing authority or refactor.

Current exact gate — 2026-09-08 KST

The unchanged exact head has terminal repository/security execution; the earlier incomplete Security/SAST queue snapshot is superseded.

  • CI 34141693656SUCCESS. Rust job 101804880009 acquired GitHub-hosted runner 1001746000, checked out exact fc5645..., and passed cargo fmt --check, locked workspace tests, and Clippy.
  • Fuzz 34141693771SUCCESS on the unchanged exact head.
  • Security Scan 34141693787SUCCESS on the unchanged exact head.
  • SAST Semgrep 34141693672SUCCESS on the unchanged exact head.
  • CodeQL PR 34141693695FAILURE at the central delegated current-head verdict boundary, not in Wardnet route source. Detect job 101804881432 checked out exact fc5645... and succeeded. Compatibility job 101811024526 acquired hosted ubuntu-24.04, read the current-head dispatch verdict, and failed closed at Release runner or enforce current-head CodeQL verdict. The separate dispatch job 101815255279 subsequently acquired a hosted runner and successfully dispatched the exact current-head scan. This is a central producer/terminal-verdict sequencing/publication specimen under .github#1929; no leaf rerun/source churn converts it to GREEN.

Hosted acquisition across CI/Security/SAST/CodeQL also remains an exact .github#712 canary: ubuntu-24.04 is dispatchable, so queue delay is not a reason for a runner-label workaround.

Current inline review-thread and submitted-review inventories are empty. Keep Draft until the delegated exact-head CodeQL verdict is terminal-valid and the central solo-maintainer ruleset is ordinarily satisfiable. Live ruleset 18156473 still requires one approval with no named/code-owner/last-push reviewer and exposes routine OrganizationAdmin/always bypass; .github#772 owns that repair. Do not use this product PR as a merge-policy probe.

No force push/destructive rebase, self/model approval, routine administrator bypass, gate weakening, mutable foreign dependency, or predecessor evidence reuse.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

Writer repair note (exact-head evidence): two attempted causal GREEN writes (5392ac6f57a2bde362d1f500c64588aafe127de1, 52e54ae4abd6da0f2492260dd81e976871a86c15) were rejected by review because they rewrote unrelated source formatting/comments instead of changing only the route predicate. Both were immediately neutralized by ordinary, non-force revert commits. Current head 209053f72f778e383fa2949039ab3b8e1890555a points to tree 12552fe3cd938b6a3ab6f0ad3d912c96ba11a49f, exactly the same tree as the verified RED head 93d097626d96f9adaffc267f47be162c397355f3; the PR net diff is again only crates/waf-ids-core/tests/route_path_segment_boundary.rs and production behavior remains intentionally RED. Do not reuse checks from the intermediate heads or claim GREEN. The authorized next change remains the minimal select_route predicate only, followed by exact-current CI/Fuzz/SAST/Security/CodeQL/review evidence.

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

Labels

maintenance priority: medium Normal-priority or P2 work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant