mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
Also reject null byte
This commit is contained in:
parent
98cd4333a1
commit
1e6eed42bd
1 changed files with 1 additions and 1 deletions
|
@ -348,7 +348,7 @@ func (strict *StrictOptions) enforce(r *http.Request) error {
|
|||
|
||||
// Reject paths with // or ..
|
||||
if strict == nil || !strict.LenientPaths {
|
||||
if strings.Contains(r.URL.Path, "//") || strings.Contains(r.URL.Path, "..") {
|
||||
if strings.Contains(r.URL.Path, "//") || strings.Contains(r.URL.Path, "..") || strings.Contains(r.URL.Path, "\x00") {
|
||||
return Error(http.StatusBadRequest, fmt.Errorf("invalid request path: %s", r.URL.RawPath))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue