Skip to content

fix(step-up): let a new factor be followed by another in the same sign-in - #627

Merged
Bccorb merged 1 commit into
mainfrom
fix/enroll-after-first-factor
Dec 2, 2026
Merged

Bccorb merged 1 commit into
mainfrom
fix/enroll-after-first-factor

Conversation

@Bccorb

@Bccorb Bccorb commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Fixes a sign-up dead end in 0.24.0.

Since 0.24.0, factor enrollment (passkey, TOTP, phone and recovery codes) asks for a fresh step-up when the account has a passkey or TOTP, and a step-up only accepts a factor enrolled before the session signed in. The enrollment check counted every factor, including one added in the current session. A new user who signed in with a code and added a first passkey was then asked for a step-up that nothing could pass, so the hosted sign-up stopped at the recovery codes page until the user signed in again.

  • requireFactorEnrollmentProof now counts only passkeys created, and TOTPs verified, before the session's sign-in, using the same sign-in time the step-up check uses.
  • A factor added during the session is treated like no factor, so the existing rule applies: a sign-in from the last five minutes.
  • When the sign-in time cannot be read, every factor counts, as before.
  • An account with a factor from before the sign-in still needs a fresh step-up.

Tests: unit tests for the query and the fallback, and a Postgres spec that generates recovery codes right after a first passkey and right after a first TOTP (both answered 403 step_up_required before this change), and still requires a step-up once the passkey predates the sign-in. Found by the OpenID Provider conformance run, whose device-flow sign-up stops on the recovery codes page against 0.24.0.

Released as a patch.

…n-in

Enrollment asked for a step-up whenever the account had a passkey or TOTP,
including one added in the current session, which a step-up refuses. A new
user was stopped between their first passkey and their recovery codes. Only a
factor from before the sign-in now asks for a step-up.
@Bccorb
Bccorb merged commit 365d482 into main Dec 2, 2026
9 checks passed
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.

1 participant