Add size limit to uploads #43

Merged
BlakeRain merged 1 commit from security/upload-hardening into main 2026-05-24 11:35:11 +00:00
Owner

This PR adds a new option --upload-size-limit that enables a limit on the size of uploads in a single request. This should mitigate potential DoS with very large requests.

If the --upload-size-limit is set, then the maximum size of a request to the /uploads endpoint is limited. This requires that the Content-Length header is present, but will also count the bytes that are being read from the stream to ensure they do not exceed the limit in cases where the Content-Length header is lying.

This PR adds a new option `--upload-size-limit` that enables a limit on the size of uploads in a single request. This should mitigate potential DoS with very large requests. If the `--upload-size-limit` is set, then the maximum size of a request to the `/uploads` endpoint is limited. This requires that the `Content-Length` header is present, but will also count the bytes that are being read from the stream to ensure they do not exceed the limit in cases where the `Content-Length` header is lying.
feat: add size limit to uploads
All checks were successful
Check / check (pull_request) Successful in 4m21s
36ff2f6dd4
BlakeRain force-pushed security/upload-hardening from 36ff2f6dd4
All checks were successful
Check / check (pull_request) Successful in 4m21s
to 8def80476d
All checks were successful
Check / check (pull_request) Successful in 4m37s
2026-05-24 11:30:25 +00:00
Compare
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BlakeRain/parcel!43
No description provided.