M1-audit MUST: blob PUT never enforces declared BlobSize/ChunkCount — unbounded disk write #75

Closed
opened 2026-11-06 15:19:32 +01:00 by amiryahaya · 0 comments
Owner

M1-close ponytail-audit finding (issue #65).

CreateUploadUrl validates BlobSize (≤5 GB) and ChunkCount (≤10k) and stores them on the FileItem — but UploadBlob streams request.Body straight to disk with no size check. Concrete case: client declares 1 MB, uploads 10 GB (or re-PUTs a pending file endlessly) → disk fill on the API host. Combined with the unauthenticated nature of the PUT (UPL-02), the declared-size check is the cheapest containment available today.

Fix (smallest, interim until UPL-02/Phase 7): enforce Content-Length (or counted bytes) ≤ fileItem.BlobSize in UploadBlob; reject with 413. One check + test. Counts toward the quota-enforcement M-finding when it lands in Phase 7.

M1-close ponytail-audit finding (issue #65). CreateUploadUrl validates BlobSize (≤5 GB) and ChunkCount (≤10k) and stores them on the FileItem — but UploadBlob streams `request.Body` straight to disk with no size check. Concrete case: client declares 1 MB, uploads 10 GB (or re-PUTs a pending file endlessly) → disk fill on the API host. Combined with the unauthenticated nature of the PUT (UPL-02), the declared-size check is the cheapest containment available today. Fix (smallest, interim until UPL-02/Phase 7): enforce `Content-Length` (or counted bytes) ≤ fileItem.BlobSize in UploadBlob; reject with 413. One check + test. Counts toward the quota-enforcement M-finding when it lands in Phase 7.
Sign in to join this conversation.
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
primatekuntech/failsulit#75
No description provided.