M1-audit: abandoned first-run bootstrap permanently bricks SuperAdmin setup #91
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#91
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?
Bootstrap setup creates an Active SuperAdmin candidate (Bootstrap.cs:81-92) with no expiry; setup then 403s forever (guard 67-70), confirm 401s without the secret, and /status reports required=false (42-45).
Trigger: operator closes the tab before scanning the TOTP QR → setup is dead; only DB surgery recovers a fresh install.
Fix: when no TotpEnabled SuperAdmin exists, allow setup to re-issue (overwrite the candidate's TotpSecret under the existing lock); make /status
requiredmean 'no TotpEnabled SuperAdmin'. Test: abandoned-candidate recovery.Part of M1 closure audit #84.
Fixed in PR #117 (squash-merged as
74e8fb5; PR runs api-ci 11978 + security-ci 11979 green, suite + coverage gate 87.26% on CI).requirednow means 'no TotpEnabled SuperAdmin' — an unconfirmed candidate no longer reports required=false while setup 403s and confirm 401s. Suspended-but-enabled admins still hold the slot (bootstrap cannot reopen for a hijacker).Tests: 5 new (BootstrapRecoveryTests) incl. old-secret-dead verification + confirmed-admin hijack guard + real-user email collision; 2 existing contract tests updated (Setup_AbandonedCandidate_Reissues; concurrent-setup invariant now 'at most one candidate ROW persists').