M1-audit MUST: UpdateFile accepts arbitrary Status — flipping uploaded→pending re-opens the unauthenticated blob window #73

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

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

PUT /api/files/{id} (creator-only) sets fileItem.Status = request.Status verbatim (UpdateFile.cs:36). Two concrete cases:

  1. Creator flips an uploaded file's status back to pending → UploadBlob's only guard (Status == "pending", unauthenticated PUT) re-opens the public blob-overwrite window for that file id.
  2. Any arbitrary string is accepted ("banana") → corrupts the state machine that UploadBlob/DeleteFile/queries depend on.

Fix (smallest): whitelist allowed transitions (pending→uploaded only) + validate value against the known set. ~10 lines + test.

M1-close ponytail-audit finding (issue #65). PUT /api/files/{id} (creator-only) sets `fileItem.Status = request.Status` verbatim (UpdateFile.cs:36). Two concrete cases: 1. Creator flips an uploaded file's status back to `pending` → UploadBlob's only guard (`Status == "pending"`, unauthenticated PUT) re-opens the public blob-overwrite window for that file id. 2. Any arbitrary string is accepted ("banana") → corrupts the state machine that UploadBlob/DeleteFile/queries depend on. Fix (smallest): whitelist allowed transitions (pending→uploaded only) + validate value against the known set. ~10 lines + test.
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#73
No description provided.