Skip to content

fix(tus): reject negative upload-length to prevent inconsistent cache entry#5876

Merged
hacdias merged 1 commit intofilebrowser:masterfrom
ArielLeyva:#5834/fix-TUS-Negative-Upload-Length-Creates-Inconsistent-Cache-Entry
Apr 4, 2026
Merged

fix(tus): reject negative upload-length to prevent inconsistent cache entry#5876
hacdias merged 1 commit intofilebrowser:masterfrom
ArielLeyva:#5834/fix-TUS-Negative-Upload-Length-Creates-Inconsistent-Cache-Entry

Conversation

@ArielLeyva
Copy link
Copy Markdown
Contributor

Description

This PR adds a validation step to reject negative Upload-Length values in TUS upload requests.
A negative length could create an inconsistent upload cache entry and cause FileBrowser to treat the upload as completed prematurely (Described at GHSA-ffx7-75gc-jg7c). By ensuring the value is non‑negative, we prevent invalid upload sessions and avoid triggering hooks before the file actually exists.

Additional Information

Closes #5834

Checklist

Before submitting your PR, please indicate which issues are either fixed or closed by this PR. See GitHub Help: Closing issues using keywords.

  • I am aware the project is currently in maintenance-only mode. See README
  • I am aware that translations MUST be made through Transifex and that this PR is NOT a translation update
  • I am making a PR against the master branch.
  • I am sure File Browser can be successfully built. See builds and development.

@ArielLeyva ArielLeyva requested a review from a team as a code owner March 30, 2026 23:26
kumaraguru1735 added a commit to kumaraguru1735/filebrowser-laravel that referenced this pull request Mar 31, 2026
Bug fixes:
- filebrowser#5627: Skip inaccessible subfolders in directory listing (was 500)
- filebrowser#5294: Cap text editor content at 5MB (prevents memory exhaustion DoS)
- filebrowser#5683: Allow copy/move TO root directory (was blocked)
- filebrowser#5835: Share creation requires both share AND download permissions
- filebrowser#5834: Reject negative/zero TUS Upload-Length, add 10GB sanity cap
- filebrowser#5239: Block sharing root directory (too broad, accidental exposure)
- filebrowser#5216: Validate JWT signature on token renewal
- filebrowser#2078: Support BMP thumbnails, skip GIF resize (preserve animation)
- filebrowser#5306: Normalize paths in copy/rename (strip trailing slashes)

Ported PRs:
- filebrowser#5876: Reject negative TUS upload-length
- filebrowser#5875: Check download perm when sharing
- filebrowser#5873: Deep conflict resolution — merge dirs, preserve non-conflicting
- filebrowser#5832: Optional directory sizes via ?dirSizes=true param
- filebrowser#5658: User quota management — configurable quota_resolver callback

Config additions:
- quota_resolver: callable for per-user disk quotas
- max_content_size: cap for text editor loading (default 5MB)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hacdias hacdias merged commit 7a16129 into filebrowser:master Apr 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

TUS Negative Upload-Length Creates Inconsistent Cache Entry

2 participants