Red Hat build of Keycloak 26.2
Org.keycloak/keycloak-services: open redirect when using wildcard valid redirect uris in keycloak
A flaw was found in Keycloak's URL validation logic during redirect operations. By crafting a malicious request, an attacker could bypass validation to redirect users to unauthorized URLs, potentially leading to the exposure of sensitive information within the domain or facilitating further attacks. This vulnerability specifically affects Keycloak clients configured with a wildcard (*) in the "Valid Redirect URIs" field and requires user interaction to be successfully exploited. The issue stems from a discrepancy in how Keycloak and the underlying Java URI implementation handle the user-info component of a URL. If a malicious redirect URL is constructed using multiple @ characters in the user-info section, Java's URI parser fails to extract the user-info, leaving only the raw authority field. Consequently, Keycloak's validation check fails to detect the malformed user-info, falls back to a wildcard comparison, and incorrectly permits the malicious redirect.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
Fixed in 26.2.16-1
Fixed in 26.2-21
Fixed in 26.2-21
Fixed in 26.4.12-1
Fixed in 26.4-17
Fixed in 26.4-17
Mitigation
Upgrade Red Hat build of Keycloak 26.2 to 26.2.16-1 or later.
Upgrade Red Hat build of Keycloak 26.2 to 26.2-21 or later.
Upgrade Red Hat build of Keycloak 26.2 to 26.2-21 or later.
Upgrade Red Hat build of Keycloak 26.4 to 26.4.12-1 or later.
Upgrade Red Hat build of Keycloak 26.4 to 26.4-17 or later.
Upgrade Red Hat build of Keycloak 26.4 to 26.4-17 or later.
Workaround
To mitigate this vulnerability, Red Hat recommends avoiding the use of wildcard characters in the "Valid Redirect URIs" field for clients within Keycloak. Instead, explicitly list all allowed redirect URIs. Review all client configurations to ensure that wildcards are not used unless absolutely necessary, and if used, ensure that the client application is robust against open redirect vulnerabilities. Changes to client configurations in Keycloak may require a restart or reload of the Keycloak service to take effect, which could impact active user sessions.
References
- Vendor advisory access.redhat.com/errata/RHSA-2026:19594
- Vendor advisory access.redhat.com/errata/RHSA-2026:19595
- Vendor advisory access.redhat.com/errata/RHSA-2026:19596
1 more
- Vendor advisory access.redhat.com/errata/RHSA-2026:19597
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.