Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 07:15 UTC
caddyhttp: fix url_pattern authorization bypass via encoded-slash traversal (#7941)
* caddyhttp: match url_pattern against decoded, cleaned path The url_pattern matcher evaluated the raw, percent-encoded request URI while path-consuming handlers resolve the decoded, cleaned r.URL.Path. An encoded-slash payload such as "..%2f" stayed a single opaque segment for the WHATWG URLPattern parser, so "/public/..%2fadmin/secret" matched "/public/*" while handlers decoded it to "/admin/secret", bypassing any route-level access control built with url_pattern. Match the same path model handlers resolve: decode the path, normalize and clean it (mirroring the path matcher and #4407), then re-encode through url.URL to a canonical escaped form before running the pattern. The go-urlpattern library is spec-correct; the fix is in the integration. * build(deps): bump github.com/dunglas/go-urlpattern to v1.0.0 Moves off the pseudo-version to the first tagged release.