fix(api): #95/#96 hygiene batch — re-verified M1-audit leftovers #145

Merged
amiryahaya merged 1 commit from chore/hygiene-batch into main 2026-11-11 02:15:07 +01:00
Owner

Re-verified all 27 open M1-audit findings (#95/#96) against main @ 7f853c8 with 4 parallel code sweeps; this batch lands the 9 small LIVE ones (triage evidence posted on both issues).

#95 items fixed here

  • Item 5: wrap-signature decode buffer 4096 → 8192 — ML-DSA-87 (~4627 B) was silently rejected ("not valid base64"); WrapTestSigning.CreateMlDsa87Identity + integration test prove the roundtrip.
  • Item 8: KeyFeature.ParseKdfSalt — malformed kdf_salt (client-controlled, outside the signed payload) is a 400, not a FormatException 500; wired into wrap upload, pairing approve AND recovery rekey (all three call sites).

#96 items fixed here

  • Item 1: dead QRCoder dependency removed from FailSulit.Api.csproj.
  • Item 2 remainder: RegisterVerify invite-accept bare catch narrowed to unique-violation (transient DB failure no longer swallowed into a fake-201); stale orphan comment dropped.
  • Item 3: LinkOidc mirrors LinkEmail — own-provider re-link now reports "already linked to this account"; cross-account collision keeps "another account".
  • Item 4: CompleteRecovery pre-checks NewDid → 409 (own DID excluded; unique index still backstops races).
  • Item 6: SessionCleanupService sweeps pairing challenges + recovery requests expired > 24 h (rows with pubkey blobs previously lived forever); fresh rows kept, read paths still enforce expiry.
  • Item 8: README Auth Flow updated — IdP passkey flow, email+OTP, social OIDC; wallet flow marked frozen.
  • Item 9: ApproveRequest response carries the reviewed_at it actually stamped (was the stale AsNoTracking null).

TDD: RED ×6 → GREEN; suite 987/0/39 Release, coverage gate 87.20% local (≥80 gate).

Not in scope (re-ranked to M3 on the tracker): folder access-policy unification (#95-2/3), placeholder fingerprint binding (-4), pairing/rekey tx boundaries (-6/7), legacy OIDC token-in-query (-1), blob sweeper (-11), share ownership/tenant checks (-12), paging/query-push (-13/14), StoragePath DTO (-17), unlink email+TOTP guard (-9), prod compose secret + email fail-fast (-16), recovery handler dedup (#96-7), test gaps c/h (#95-18).

Closes nothing by itself — items are annotated on #95/#96.

Re-verified all 27 open M1-audit findings (#95/#96) against main @ 7f853c8 with 4 parallel code sweeps; this batch lands the 9 small LIVE ones (triage evidence posted on both issues). **#95 items fixed here** - Item 5: wrap-signature decode buffer 4096 → 8192 — ML-DSA-87 (~4627 B) was silently rejected ("not valid base64"); `WrapTestSigning.CreateMlDsa87Identity` + integration test prove the roundtrip. - Item 8: `KeyFeature.ParseKdfSalt` — malformed kdf_salt (client-controlled, outside the signed payload) is a 400, not a FormatException 500; wired into wrap upload, pairing approve AND recovery rekey (all three call sites). **#96 items fixed here** - Item 1: dead QRCoder dependency removed from FailSulit.Api.csproj. - Item 2 remainder: RegisterVerify invite-accept bare catch narrowed to unique-violation (transient DB failure no longer swallowed into a fake-201); stale orphan comment dropped. - Item 3: LinkOidc mirrors LinkEmail — own-provider re-link now reports "already linked to this account"; cross-account collision keeps "another account". - Item 4: CompleteRecovery pre-checks NewDid → 409 (own DID excluded; unique index still backstops races). - Item 6: SessionCleanupService sweeps pairing challenges + recovery requests expired > 24 h (rows with pubkey blobs previously lived forever); fresh rows kept, read paths still enforce expiry. - Item 8: README Auth Flow updated — IdP passkey flow, email+OTP, social OIDC; wallet flow marked frozen. - Item 9: ApproveRequest response carries the reviewed_at it actually stamped (was the stale AsNoTracking null). **TDD**: RED ×6 → GREEN; suite 987/0/39 Release, coverage gate 87.20% local (≥80 gate). **Not in scope** (re-ranked to M3 on the tracker): folder access-policy unification (#95-2/3), placeholder fingerprint binding (-4), pairing/rekey tx boundaries (-6/7), legacy OIDC token-in-query (-1), blob sweeper (-11), share ownership/tenant checks (-12), paging/query-push (-13/14), StoragePath DTO (-17), unlink email+TOTP guard (-9), prod compose secret + email fail-fast (-16), recovery handler dedup (#96-7), test gaps c/h (#95-18). Closes nothing by itself — items are annotated on #95/#96.
fix(api): #95/#96 hygiene batch — re-verified M1-audit leftovers
All checks were successful
Security CI / security-scan (pull_request) Successful in 3m53s
API CI / build-and-test (pull_request) Successful in 7m25s
495a6327b3
Re-verified all 27 open M1-audit findings against main (2026-11-11 code
sweeps); this PR lands the 9 small live ones:

- #95-5: wrap-signature decode buffer 4096 -> 8192 — ML-DSA-87 (~4627B)
  was silently rejected; MlDsa87 test identity proves the roundtrip
- #95-8: kdf_salt / invalid base64 now 400 (KeyFeature.ParseKdfSalt)
  instead of FormatException 500 — wired into wrap upload, pairing
  approve and recovery rekey
- #96-1: dead QRCoder dependency removed
- #96-2: RegisterVerify invite-accept bare catch narrowed to
  unique-violation (no more fake-201 on transient DB failure); stale
  orphan comment removed
- #96-3: LinkOidc mirrors LinkEmail — own-provider re-link reports
  'linked to this account' (was 'another account')
- #96-4: CompleteRecovery pre-checks NewDid -> 409 (was unique-violation 500)
- #96-6: SessionCleanupService sweeps aged (>24h) pairing challenges +
  recovery requests (pubkey blobs previously lived forever)
- #96-8: README Auth Flow updated (IdP passkey/email+OTP/social; wallet frozen)
- #96-9: ApproveRequest response carries the reviewed_at it stamped

TDD RED x6 -> GREEN: 987/0/39 Release, coverage gate 87.20%.
Remaining #95/#96 items re-ranked into M3 (see tracker comments).
amiryahaya deleted branch chore/hygiene-batch 2026-11-11 02:15:08 +01:00
Sign in to join this conversation.
No description provided.