fix: clean request path before acls - #1055
Conversation
Add proxy controller tests covering path ACL bypass attempts: query params, trailing slashes, dot segments, percent-encoding and protocol-relative/absolute/relative URIs, across forward auth, ext authz and auth request. Also document the regex semantics of the path allow/block options in .env.example. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughPath-based authentication configuration is documented as regex-driven. Proxy request paths are parsed, validated, and normalized before authorization decisions, with tests covering bypass attempts across Traefik, Nginx, and Envoy integrations. ChangesPath ACL enforcement
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent path-based ACL bypasses by normalizing/cleaning the incoming request path (e.g., removing query parameters and dot segments) before ACL regex evaluation, and by updating related docs and tests.
Changes:
- Normalize
ProxyContext.Pathbefore ACL evaluation ingetProxyContext. - Update AppPath documentation/env comments to describe regex-based allow/block semantics.
- Expand proxy controller tests to cover query params, trailing slashes, dot segments, and encoding-related bypass attempts; update test configs accordingly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/controller/proxy_controller.go | Adds request-path normalization prior to ACL evaluation. |
| internal/controller/proxy_controller_test.go | Adds tests covering path allow/block behavior and bypass vectors. |
| internal/test/test.go | Updates/extends test app configs for regex-based allow/block path ACLs. |
| internal/model/config.go | Updates AppPath field descriptions to reflect regex semantics. |
| .env.example | Updates env var comments to reflect regex semantics for path ACLs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary by CodeRabbit
Security
Documentation