Skip to content
This repository was archived by the owner on Aug 31, 2026. It is now read-only.

TUS uploads ignore the declared Upload-Length, allowing disk exhaustion by authenticated users

Moderate
hacdias published GHSA-ffv3-7h97-993q Jul 26, 2026

Package

gomod github.com/filebrowser/filebrowser/v2 (Go)

Affected versions

<= 2.63.18

Patched versions

2.63.19

Description

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

  1. Create a TUS upload with Upload-Length: 1024.
  2. Send a PATCH request with Upload-Offset: 0.
  3. 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

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

CVE ID

CVE-2026-72838

Weaknesses

No CWEs

Credits