fix: recursive check

This commit is contained in:
Henrique Dias committed 2026-06-07 17:12:31 +02:00
1 parent 67ed670d92
commit 3406d3d7f9
6 files changed
+94 -13

No files matched your search

+1 -2
View File
@@ -166,8 +166,7 @@ func tusPatchHandler(cache UploadCache) handleFunc {
if r.Header.Get("Content-Type") != "application/offset+octet-stream" {
return http.StatusUnsupportedMediaType, nil
}
// Defense in depth: refuse to write through a symlink that escapes the
// scope, in case the target path is (or sits behind) an escaping link.
if ok, scopeErr := files.WithinScope(d.user.Fs, r.URL.Path); scopeErr != nil || !ok {
return http.StatusForbidden, nil
}