The vulnerability CVE-2026-18963 describes an unauthenticated account takeover via a bypass in the reset-credentials flow. The provided commit 'dc2d4e524b4dae85aedc87ca28b9e4fa567d56c1' directly addresses this CVE. Analysis of the commit's diff reveals three key functions in the org.keycloak.authentication package that were modified to fix this flaw.
-
org.keycloak.authentication.DefaultAuthenticationFlow.processAction: This function was modified to change how the AUTHENTICATION_SELECTOR_SCREEN_DISPLAYED authentication note is set. Previously, it was set to a generic 'true' string, which could be easily spoofed. The fix changes this to store a specific model.getId(), making it harder for an attacker to bypass the email verification by simply setting a boolean flag.
-
org.keycloak.authentication.DefaultAuthenticationFlow.processFlow: This function's logic for handling the AUTHENTICATION_SELECTOR_SCREEN_DISPLAYED note was significantly strengthened. The vulnerable version relied on Boolean.parseBoolean, which would accept a simple 'true' string. The patched version now retrieves a specific selector (which should be the model.getId()) and compares it against the lastExecutionId. If these do not match, or if the selector is null, the authentication note is removed, preventing an attacker from progressing without proper validation.
-
org.keycloak.authentication.authenticators.resetcred.ResetCredentialEmail.action: This function was the final point of failure in the vulnerable flow. It previously called context.success() unconditionally, allowing an attacker who had bypassed earlier checks to complete the password reset. The fix introduces a crucial check to verify that the user in the current context matches the actionTokenUserId from the authentication session. If there's a mismatch, the action fails with AuthenticationFlowError.INVALID_USER, preventing unauthorized password changes. This ensures that only a user with a valid action token can successfully complete the reset process.
These three functions, when chained together, represent the core logic of the vulnerable reset-credentials flow that allowed unauthenticated attackers to force password resets. Exploitation would involve interacting with these functions to bypass the intended security checks.