mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-07-17 16:36:49 +00:00
fix: clean path in patch handler
This commit is contained in:
parent
c21af0791a
commit
4bd7d69c82
1 changed files with 2 additions and 0 deletions
|
|
@ -212,6 +212,8 @@ func resourcePatchHandler(fileCache FileCache) handleFunc {
|
|||
dst := r.URL.Query().Get("destination")
|
||||
action := r.URL.Query().Get("action")
|
||||
dst, err := url.QueryUnescape(dst)
|
||||
dst = path.Clean("/" + dst)
|
||||
src = path.Clean("/" + src)
|
||||
if !d.Check(src) || !d.Check(dst) {
|
||||
return http.StatusForbidden, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue