caddy/modules/caddyhttp/rewrite
Matthew Holt 3c65959560 rewrite: escape decoded original and component path placeholders
Decoded path placeholders (orig_uri.path, path components and file
matcher values) were inserted raw into the rewritten URI, so an
encoded '%' or '?' could be decoded a second time. Escape all decoded
path placeholders in path context in a single replacement pass; escaped
and whole-URI placeholders keep their URI syntax.

Addresses scan report 9e3a082391f793d1.

Code written by GitHub Copilot (GPT-6.1 Sol, Claude Opus 5.5); reviewed by mholt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-11 11:06:40 -07:00
..
caddyfile.go chore: Dumb prealloc lint fix (#7430) 2026-01-13 14:13:43 -05:00
rewrite.go rewrite: escape decoded original and component path placeholders 2026-11-11 11:06:40 -07:00
rewrite_bench_test.go caddyhttp: presize buffers in hot paths to reduce allocations (#7842) 2026-11-04 20:26:53 +00:00
rewrite_test.go rewrite: escape decoded original and component path placeholders 2026-11-11 11:06:40 -07:00