fix(api-files): M8 audit batch 3 — children filter, parent write-access, delete guard, quota, reclassify cap, invitation normalization (#214) #218
No reviewers
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!218
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/m8-api-files"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
M8-close audit remediation batch 3 (#214 findings M8-4, M8-6, M8-14, M8-20 + runner-up).
M8-4 (lattice bypass): GET /folders/{id}/children now applies FilterShareVisibleAsync — the #210 per-row filter skipped this surface, so a demoted share holder could still read folder names + levels there that every other listing hides.
M8-6 (cross-user data loss): CreateFolder requires write access on the parent (owner / tenant-root / active write share — the UploadFile rule); DeleteFolder refuses with 409 while foreign-owned subfolders exist in the tree (a read-share holder could plant invisible subfolders whose content the owner's later delete destroyed).
M8-14 (quota blind spot): TenantQuota counts Size when BlobSize is unset — legacy multipart uploads were invisible to quota (a tenant could fill the staging disk without tripping it).
M8-20 (lattice integrity): ReclassifyFile/Folder refuse levels above the actor's clearance — previously an Internal-clearance owner could declassify admin-raised content or raise to Top Secret and keep inherent access. No tests covered reclassify clearance; one added, and the legacy owner-raise test updated to grant clearance first (it encoded the old behavior).
Runner-up: CreateInvitation normalizes the email — registration lowercases emails and HandleReceived matches exactly, so mixed-case invites never surfaced for their recipient.
Tests: M8AuditFixTests (6) — children hide/keep, parent access 403/allowed, delete 409-then-success, quota counts legacy rows, reclassify 403/allowed, mixed-case invitation surfacing. Full suite 1088 green.
Part of the M8-close FIX-ALL (umbrella #215, audit #214). M8-19 (unique active-share index) lands with the sharing batch.
M8-4: GET /folders/{id}/children now applies FilterShareVisibleAsync — share-granted children whose level exceeds the recipient's clearance drop from the listing (the #210 filter skipped this surface, leaking names+levels every other listing hides). M8-6: CreateFolder requires write access on the parent (owner / tenant-root / active write share — the UploadFile rule); DeleteFolder refuses with 409 while foreign-owned subfolders exist in the tree (write-share holders' content is no longer destroyed silently). M8-14: TenantQuota counts Size when BlobSize is unset — legacy multipart rows were invisible to quota (one tenant could fill the staging disk). M8-20: ReclassifyFile/Folder refuse levels above the actor's clearance (mirror of the upload override cap — previously an Internal owner could declassify admin-raised content or raise to Top Secret). Runner-up: CreateInvitation normalizes the email once — registration lowercases emails and HandleReceived matches exactly, so mixed-case invites never surfaced for their recipient. Tests: M8AuditFixTests (6) — children filter hide/keep, parent access 403/allowed, delete 409-then-success, quota counts legacy rows, reclassify 403/allowed, mixed-case invitation surfacing. Suite 1084+6 green.