Skip to content

fix(mfa): prevent lockout removing last factor after recovery sign-in - #2976

Merged
fadymak merged 1 commit into
masterfrom
fm/auth-2189-remove-recovery-codes-with-last-factor
Dec 2, 2026
Merged

fadymak merged 1 commit into
masterfrom
fm/auth-2189-remove-recovery-codes-with-last-factor

Conversation

@fadymak

@fadymak fadymak commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

A user who signed in with a recovery code could not remove an authenticator they had lost: the recovery codes had to be deleted first, which downgraded the session to AAL1 and left MFA enabled with no way back to AAL2. Removing the last verified second factor now removes the recovery codes with it.

  • DELETE /factors/{id} and the admin factor delete remove the recovery codes along with the last verified second factor, instead of returning mfa_recovery_codes_sole_factor
  • DELETE /factors/recovery-codes returns mfa_recovery_codes_in_use from a session that was verified with a recovery code

Fixes AUTH-2189

@fadymak
fadymak requested a review from a team as a code owner December 1, 2026 16:14
Comment thread internal/api/mfa.go Resolved
@fadymak
fadymak marked this pull request as draft December 1, 2026 16:23
@fadymak
fadymak marked this pull request as ready for review December 2, 2026 08:48

@lovromazgon lovromazgon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just posted a non-blocking question

Comment thread internal/api/mfa.go Resolved
@fadymak
fadymak merged commit de07a71 into master Dec 2, 2026
18 checks passed
@fadymak
fadymak deleted the fm/auth-2189-remove-recovery-codes-with-last-factor branch December 2, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants