Summary
The TUS resumable-upload endpoint (PATCH /api/tus/...) accepted request bodies without enforcing the size the client declared when the upload was created, allowing an authenticated user with normal file-upload permissions to consume arbitrary disk space. tusPatchHandler retrieved the declared upload length from the cache, but the value was only used to decide whether the upload was complete after writing. It did not prevent oversized request bodies from being written.
Reported against an unmodified FileBrowser v2.63.14 windows-amd64 release in an isolated local environment; the same upload logic was present through v2.63.18.
Details
The PATCH handler read the request body with io.Copy but did not verify that the number of bytes written was within Upload-Length - Upload-Offset (http/tus_handlers.go, tusPatchHandler):
defer r.Body.Close()
bytesWritten, err := io.Copy(openFile, r.Body)
if err != nil {
return http.StatusInternalServerError, fmt.Errorf("could not write to file: %w", err)
}
The declared length was consulted only afterwards, to decide whether the upload had finished, so a single PATCH could stream arbitrary data to disk regardless of the length the client declared at creation time.
PoC
- Create a TUS upload with
Upload-Length: 1024.
- Send a
PATCH request with Upload-Offset: 0.
- Send a request body of 50 MB.
The server returned HTTP 204 and wrote the full 50 MB, despite the upload being declared as 1 KB.
All testing was performed only against a local isolated instance. No public or third-party deployment was tested.
Impact
A low-privileged authenticated user with ordinary create/write permissions can write more data than the server accepted for a given upload, and repeat this to exhaust the disk used by FileBrowser. Once the filesystem is exhausted, FileBrowser and other services sharing the same storage may become unavailable or fail unpredictably.
Patches
Fixed in v2.63.19 by commit 4daddec6. Each PATCH write is now bounded to the bytes still expected (Upload-Length - Upload-Offset), a PATCH whose offset already exceeds the declared length is rejected with 400, and a body exceeding the declared length is rolled back and rejected with 413. The reporter re-tested v2.63.19 and confirmed the bypass is closed: the 50 MB PATCH against a 1 KB declared upload returns 413 and leaves a 0-byte file on disk.
Workarounds
None. Upgrade to v2.63.19.
Out of scope
The original report also covered the regular upload endpoint (POST /api/resources/...), where writeFile copies the request body with io.Copy and no size limit. That behaviour is not treated as a vulnerability and is not addressed by this advisory: File Browser has no maximum upload size and no storage quota, so no bound declared by the server is being bypassed — a user holding Create/Modify permission is authorized to write files of arbitrary size within their own scope. Deployments where that matters should bound it at the storage or proxy layer (filesystem quotas, a dedicated volume or container limit, or a reverse-proxy body limit). Per-user quotas remain an unimplemented feature request (#711, #2090, #2179, #2361).
References
Summary
The TUS resumable-upload endpoint (
PATCH /api/tus/...) accepted request bodies without enforcing the size the client declared when the upload was created, allowing an authenticated user with normal file-upload permissions to consume arbitrary disk space.tusPatchHandlerretrieved the declared upload length from the cache, but the value was only used to decide whether the upload was complete after writing. It did not prevent oversized request bodies from being written.Reported against an unmodified FileBrowser v2.63.14 windows-amd64 release in an isolated local environment; the same upload logic was present through v2.63.18.
Details
The PATCH handler read the request body with
io.Copybut did not verify that the number of bytes written was withinUpload-Length - Upload-Offset(http/tus_handlers.go,tusPatchHandler):The declared length was consulted only afterwards, to decide whether the upload had finished, so a single PATCH could stream arbitrary data to disk regardless of the length the client declared at creation time.
PoC
Upload-Length: 1024.PATCHrequest withUpload-Offset: 0.The server returned HTTP 204 and wrote the full 50 MB, despite the upload being declared as 1 KB.
All testing was performed only against a local isolated instance. No public or third-party deployment was tested.
Impact
A low-privileged authenticated user with ordinary create/write permissions can write more data than the server accepted for a given upload, and repeat this to exhaust the disk used by FileBrowser. Once the filesystem is exhausted, FileBrowser and other services sharing the same storage may become unavailable or fail unpredictably.
Patches
Fixed in v2.63.19 by commit
4daddec6. Each PATCH write is now bounded to the bytes still expected (Upload-Length - Upload-Offset), a PATCH whose offset already exceeds the declared length is rejected with400, and a body exceeding the declared length is rolled back and rejected with413. The reporter re-tested v2.63.19 and confirmed the bypass is closed: the 50 MB PATCH against a 1 KB declared upload returns413and leaves a 0-byte file on disk.Workarounds
None. Upgrade to v2.63.19.
Out of scope
The original report also covered the regular upload endpoint (
POST /api/resources/...), wherewriteFilecopies the request body withio.Copyand no size limit. That behaviour is not treated as a vulnerability and is not addressed by this advisory: File Browser has no maximum upload size and no storage quota, so no bound declared by the server is being bypassed — a user holdingCreate/Modifypermission is authorized to write files of arbitrary size within their own scope. Deployments where that matters should bound it at the storage or proxy layer (filesystem quotas, a dedicated volume or container limit, or a reverse-proxy body limit). Per-user quotas remain an unimplemented feature request (#711, #2090, #2179, #2361).References