M1.5-audit NICE batch: small findings (node drift, duplicate helper, suspended-SA polish, …) #111

Closed
opened 2026-11-07 19:23:27 +01:00 by amiryahaya · 1 comment
Owner

Batched nice-to-haves from the M1.5 close audit (#66 umbrella #101):

  1. Node version drift: desktop-release.yml pins node 20; desktop-ci/admin-ci/cd pin 22 (desktop-release.yml:43) — release toolchain differs from the gating CI.
  2. IsUniqueConstraintViolation duplicated in RegisterVerify.cs:176 and UserProvisioningService.cs:231 — move to FailSulit.Api.Common.
  3. Suspended SA path: 401 → 403 (honest status), RecordAuthFailure skipped so suspended-SA loops are unthrottled (M2mAuthMiddleware.cs:66-71); the per-IP partition of the m2m policy is unreachable (middleware always 401s/429s first).
  4. TotpSetupConfirm: no limiter/guard + non-constant-time compares (TotpSetupConfirm.cs:40, TotpService.cs:55-56) — latent brute-force surface; route through TotpSecurityGuard + FixedTimeEquals.
  5. Blob cleanup not best-effort (DeleteFile.cs:44, DeleteFolder.cs:41-42): one storage throw 500s a committed operation and skips remaining blobs in folder delete; DownloadFile missing blob → 500 instead of 404 (DownloadFile.cs:47).
Batched nice-to-haves from the M1.5 close audit (#66 umbrella #101): 1. **Node version drift**: desktop-release.yml pins node 20; desktop-ci/admin-ci/cd pin 22 (desktop-release.yml:43) — release toolchain differs from the gating CI. 2. **IsUniqueConstraintViolation duplicated** in RegisterVerify.cs:176 and UserProvisioningService.cs:231 — move to FailSulit.Api.Common. 3. **Suspended SA path**: 401 → 403 (honest status), RecordAuthFailure skipped so suspended-SA loops are unthrottled (M2mAuthMiddleware.cs:66-71); the per-IP partition of the m2m policy is unreachable (middleware always 401s/429s first). 4. **TotpSetupConfirm: no limiter/guard + non-constant-time compares** (TotpSetupConfirm.cs:40, TotpService.cs:55-56) — latent brute-force surface; route through TotpSecurityGuard + FixedTimeEquals. 5. **Blob cleanup not best-effort** (DeleteFile.cs:44, DeleteFolder.cs:41-42): one storage throw 500s a committed operation and skips remaining blobs in folder delete; DownloadFile missing blob → 500 instead of 404 (DownloadFile.cs:47).
Author
Owner

ALL FIVE RESOLVED — closing. PR #139 (squash; PR runs api-ci 12341 + security-ci 12342 green, suite 980/0/39, coverage 87.74%): 1) desktop-release node 20→22; 2) DbErrors.IsUniqueConstraintViolation in Common (dup removed); 3) suspended SA 403 + budgeted + security audit; 4) /totp/setup/confirm: auth-totp limiter + TotpSecurityGuard (5 bad codes lock even the VALID code — tested) + VerifyBackupCode full-scan FixedTimeEquals (case-insensitive preserved — regression caught in-slice); 5) DeleteFile/DeleteFolder best-effort blob cleanup, DownloadFile missing-blob 404. 3 new tests NiceBatchTests.

ALL FIVE RESOLVED — closing. PR #139 (squash; PR runs api-ci 12341 + security-ci 12342 green, suite 980/0/39, coverage 87.74%): 1) desktop-release node 20→22; 2) DbErrors.IsUniqueConstraintViolation in Common (dup removed); 3) suspended SA 403 + budgeted + security audit; 4) /totp/setup/confirm: auth-totp limiter + TotpSecurityGuard (5 bad codes lock even the VALID code — tested) + VerifyBackupCode full-scan FixedTimeEquals (case-insensitive preserved — regression caught in-slice); 5) DeleteFile/DeleteFolder best-effort blob cleanup, DownloadFile missing-blob 404. 3 new tests NiceBatchTests.
Sign in to join this conversation.
No milestone
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#111
No description provided.