CVE-2026-137431: Keycloak-services: keycloak-services: leading ? in a redirect_uri parameter name bypasses the forbidden oidc parameter check
A flaw was found in the keycloak-services component of Keycloak, which is used to handle OpenID Connect authentication flows. The issue occurs because the security check that prevents attackers from pre-seeding security parameters in a redirect URL can be bypassed by adding an extra question mark character to the parameter name. This allows an attacker to trick a user's browser into using an attacker-controlled login code. As a result, a victim may be unknowingly logged into an attacker's account, leading to account confusion or the exposure of sensitive data entered by the victim.
Other sources
A flaw was found in the RedirectUtils.containsForbiddenOidcParameters method of Keycloak. Keycloak is designed to reject authorization requests where the redirecturi contains forbidden OIDC response parameters (such as code, state, iss, or sessionstate) to prevent parameter injection. However, the validation logic performs a literal string comparison that fails to account for a leading ? character in the parameter name. An attacker can exploit this by crafting a redirecturi such as https://good.example/cb??code=EVIL&atlrovo=disablepublicresolution. Because the parameter name is seen as ?code instead of code, it bypasses the forbidden parameter check. When the server appends its own parameters after a successful login, the attacker-supplied value appears first. Browser-based clients that strip the leading ? and read the first occurrence of a parameter will obtain the attacker's value. This enables a login CSRF or account confusion attack where a victim ends up logged into the attacker's account. This is an incomplete fix for CVE-2026-9689 and CVE-2026-18209.
— Red Hat
Affected Software
Event History
Frequently Asked Questions
Does an attacker need an account or authenticated access to exploit this?
No privileges are required, and the attack can be delivered over the network. Exploitation has high attack complexity and requires user interaction.
Who is realistically exposed?
Users completing an OpenID Connect authentication flow are exposed if an attacker can cause their browser to use an attacker-controlled login code. The result can be account confusion or exposure of sensitive data the victim enters while using the attacker’s account.
What is the expected security impact?
The reported impact is limited confidentiality and integrity impact, with no availability impact. The vulnerability can cause a victim to be logged into an attacker-controlled account rather than the intended account.