-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: ServerMux does not sanitize ".%2e" ("..") from url path #70130
Comments
The current behaviour is consistent with #21955 where we chose to preserve the path if it is escaped. |
Makes sense, perhaps that this should be documented somewhere, that ServerMux will not fully sanitize the path, as it might imply; "ServeMux also takes care of sanitizing the URL request path". |
Change https://go.dev/cl/623835 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
Oct 31, 2024
For #70130 Change-Id: Idd7ca3d11b78887709b83dd5c868de9cc506ecff Reviewed-on: https://go-review.googlesource.com/c/go/+/623835 Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go version
go1.22.6 linux/amd64
Output of
go env
in your module/workspace:What did you do?
The http server mux implies it does request path sanitization, and it does work with
..
in the url path, however, it does not work with.%2e
.Start a basic http server,
go run main.go
Basic http server code
What did you see happen?
The http server mux does not sanitize a path with url encoded
.
.Tested with
..
(expected)Tested with
.%2e
(possible security issue, does not get sanitized)Output from the server:
What did you expect to see?
I expected http server mux to sanitize the url encoded
.
, and reject the request before it gets to the handler.The text was updated successfully, but these errors were encountered: