The vulnerability, CVE-2026-7507, is a session fixation issue in Keycloak's authentication flow. The root cause lies in the org.keycloak.services.resources.SessionCodeChecks.initialVerifyAuthSession method. This function is responsible for verifying the consistency of an authentication session initiated via a URL against the user's existing session in their browser, which is tracked by a cookie.
The flawed logic in the initialVerifyAuthSession function failed to properly validate session ownership. Specifically, if an attacker crafted a URL containing their own auth_session_id and tricked a victim into clicking it, the function would not raise an error if the victim did not already have an existing session cookie. The vulnerable code only checked for a mismatch if both the URL's session and the cookie's session were present. The absence of a cookie was not treated as a security violation.
This allowed an attacker to 'fixate' their pre-created authentication session onto the victim's browser. When the victim subsequently logged in, they would unknowingly complete the authentication process for the attacker's session, giving the attacker full control over the victim's account.
The patch addresses this by modifying the conditional logic to ensure that if an auth_session_id is provided in the request, a corresponding and matching session cookie must also be present. If the cookie is missing, the check now correctly fails, preventing the session fixation attack.