Skip to content

[M2.2d2b] Audit and reauthenticate MFA management - #55

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.2d2b-mfa-management
Nov 5, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.2d2b-mfa-management

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

Users can now stage and activate TOTP enrollment, disable MFA, and regenerate recovery codes through audited application commands. Every operation rechecks the current password and session security version; disablement and recovery replacement additionally consume a valid factor. An active seed cannot be overwritten by another setup request.

Activation, disablement and recovery replacement atomically rotate all sessions and reset links, returning a fresh session. Recovery values are shown only in the command result and stay wrapped until the eventual HTTP delivery boundary. Failed audit or rotation rolls back MFA state and proof consumption. Public endpoints follow in M2.2d3.

Validation: API lint/typecheck and 60 real PostgreSQL/TLS SMTP integration tests pass. Four new tests cover password reauthentication, simultaneous activation, expiry, a racing password change, code regeneration invalidating old codes, protected disablement, session revocation and audit rollback. API unit tests also pass.

Security: current security version is checked again under the user lock after expensive password work. No seed/code appears in audit metadata; responses use Secret wrappers. No new dependency, migration or external transport. Stacked on #54; no merge requested.

  • M2.2d2b and MFA application commands complete
  • Real database concurrency and rollback tests pass
  • State transitions and recovery use audited
  • Plan/spec updated; no new secret exposure or shell invocation

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.2d2a-mfa-login-proof branch from 3402961 to 84d3e48 Compare November 5, 2026 12:32
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.2d2a-mfa-login-proof to main November 5, 2026 12:32
@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.2d2b-mfa-management branch from a4c213c to db1deb9 Compare November 5, 2026 12:33
@samuelmbabhazi
samuelmbabhazi merged commit c2ffb56 into main Nov 5, 2026
9 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.2d2b-mfa-management branch November 5, 2026 12:33
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
The API now exposes MFA status, setup, activation, disablement and
recovery-code regeneration. Login accepts TOTP or recovery proof.
Private provisioning data and new recovery codes are returned only at
their explicit delivery boundary, with no-store responses; security
changes set fresh session/CSRF cookies.

MFA writes require authenticated sessions, exact Origin and CSRF,
current-password reauthentication, and persisted limits by user as well
as IP. Authenticated retry snapshots now bind the user and security
version, preventing another account from retrieving a secret-bearing
response with the same key/body. Status exposes only enabled/pending
state and remaining-code count.

Validation: API lint/typecheck, 94 unit tests, production build and all
64 PostgreSQL/TLS SMTP integration tests pass. Four new HTTP tests cover
the full MFA lifecycle, password-only denial, one-use recovery login,
old-session rejection, cross-account/version retry isolation, account
limits across proxy IP changes, malformed proofs and audit rollback
without cookies. OpenAPI and client regenerated.

Security: all factor values are validated and wrapped on entry.
Origin/CSRF and rate guards precede replay. A changed security context
conflicts; lost recovery-code responses can be replaced after TOTP login
and reauthentication, as documented. Stacked on #55; no merge requested.

- [x] M2.2d3 criteria met
- [x] HTTP acceptance and malicious-input tests pass on real PostgreSQL
- [x] Audited commands reused for every mutation
- [x] Plan/spec and generated contract updated
- [x] No new shell invocation or secret exposure path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant