Repository navigation
Description
Description
Two related hardening gaps remain after the pre-account takeover fix in 26.7 (PRs #47538 and #48208):
-
"Sign out from other devices" does not invalidate active authentication sessions. When a user resets their password and checks "Sign out from other devices", only user sessions are terminated. Active authentication sessions (e.g., someone in the middle of a required action like Terms & Conditions or passkey registration) are unaffected and can still complete the flow and gain access.
-
setEmailVerified(true)is called from multiple places beyond the verify-email action. This allows email to be implicitly marked as verified through unrelated flows, most notably IDP account linking viaIdpVerifyAccountLinkActionTokenHandler. An account registered by one party can have its email silently verified when the legitimate owner links via a social provider, giving both parties access.
Version affected
All current versions. The original passkey registration variant was fixed in 26.7, but these gaps remain.
Expected behavior
- "Sign out from other devices" should invalidate all sessions for the user, including in-progress authentication sessions — not just established user sessions.
setEmailVerified(true)should only be set when the email is actually verified through the dedicated verify-email required action. Other flows should either not mark the email as verified or require explicit email verification as a prerequisite.
Actual behavior
- Authentication sessions survive credential reset. Someone parked on a required action screen can complete login after the legitimate user has changed the password and opted to sign out other devices.
setEmailVerified(true)is called from at least 7 locations:VerifyEmailActionTokenHandler— the intended pathIdpVerifyAccountLinkActionTokenHandler— IDP account linkingUpdateEmailActionTokenHandler— update email confirmationExecuteActionsActionTokenHandler— admin-initiated execute actionsResetCredentialEmail— password reset flowLDAPStorageProvider— LDAP user importAbstractTokenExchangeProvider— token exchange
Steps to reproduce
Auth session invalidation gap:
- Enable self-registration and verify email
- User A registers and completes login up to a required action (e.g., Terms & Conditions)
- User A (legitimate owner) resets password from another session and checks "Sign out from other devices"
- User A's first session (parked on Terms & Conditions) can still complete the action and gain access
Implicit email verification via IDP linking:
- Enable self-registration, verify email, and a social IDP (e.g., Facebook)
- Party A registers
john@email.comwith a password — does not verify email - Legitimate owner of
john@email.comlater clicks "Login with Facebook" - After Facebook authentication, Keycloak shows "Account already exists. Link account?"
- User confirms and re-authenticates via email verification (default in first broker login flow)
IdpVerifyAccountLinkActionTokenHandlersetsemailVerified=true- Both Party A (via password) and the legitimate owner (via Facebook) can now access the account
Anything else?
- Implementing auth session lookup by user requires changes to
AuthenticationSessionProvider— this capability does not exist today - Restricting
setEmailVerified(true)has usability implications for IDP linking and password reset flows - LDAP import and token exchange cases are lower risk (admin-controlled or based on external IDP assertions) but should be reviewed for consistency
This issue was originally tracked in the private repository. Migrated by @abstractj.
Activity
rmartinc commentedon Aug 18, 2026
Closing this as the two sub-tasks are now completed.