Audit(#66): RemoveMember leaves TenantId — offboarded member keeps full workspace access #102
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#102
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
RemoveMember.cs:59-60 deletes only the UserTenants row;
User.TenantIdstill points at the tenant, and every tenant-scoped handler (ListFiles.cs:22, DownloadFile.cs:27, CreateUploadUrl.cs:44, DeleteFile.cs:21, SsdidAuthMiddleware.cs:123 workspace gate) filters onuser.TenantIdwith no membership re-check.Trigger: owner removes member B while B has a live session → B keeps listing/downloading/renaming/deleting/re-sharing org files indefinitely. Offboarding is cosmetic.
Fix: in RemoveMember,
ExecuteUpdateAsyncon Users:TenantId = nullwhereId == userId && TenantId == tenantId, and invalidate B's sessions. Longer term: membership re-check in tenant-scoped handlers.M1.5 close audit (#66).