CVE-2026-18211: Keycloak-services: keycloak-services: secure-client-uris policy bypass via localhost-prefixed domains
A flaw was found in the secure-client-uris client policy executor in Keycloak. The executor permits non-HTTPS redirect URIs when allow-http-on-localhost is enabled by performing a simple string prefix check for http://localhost or http://127.0.0.1 instead of parsing the URI to validate the host component. An attacker can exploit this by registering a client via Dynamic Client Registration using a redirect URI that starts with the allowed prefix but points to an attacker-controlled domain (e.g., http://localhost.evil.test). If the policy is scoped to authorizationcode requests, it fails to block the registration or the subsequent use of the malicious URI. When a victim authenticates through the attacker's client, the authorization code is transmitted over cleartext HTTP to the attacker's server. This allows the attacker to intercept the authorization code and potentially gain unauthorized access to the victim's session.
Other sources
A flaw was found in the secure-client-uris client policy executor within Keycloak core services. This component is responsible for enforcing security requirements on client configurations, such as requiring encrypted connections for redirect URIs. Due to an improper check that only looks at the start of a web address rather than properly verifying the host, an attacker can bypass these security restrictions by using a specially crafted domain name. This could allow an attacker to intercept sensitive authentication codes over unencrypted connections.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Disable 'allow-http-on-localhost' so the secure-client-uris policy executor does not permit non-HTTPS redirect URIs based on localhost/127.0.0.1 prefix string checks.
Keycloak secure-client-uris policy executor (Keycloak core services) allow-http-on-localhost = disabled - Compensating control
Ensure Dynamic Client Registration redirect URIs enforce HTTPS only (no cleartext HTTP) to prevent interception of authorization codes via unencrypted connections.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-18211?
The severity of CVE-2026-18211 is rated as medium with a score of 4.2.
How do I fix CVE-2026-18211?
To address CVE-2026-18211, ensure that the secure-client-uris policy is configured to disallow non-HTTPS redirect URIs even when allow-http-on-localhost is enabled.
What area of Keycloak is affected by CVE-2026-18211?
CVE-2026-18211 affects the secure-client-uris client policy executor in Keycloak.
Can I use HTTP redirect URIs with CVE-2026-18211?
If allow-http-on-localhost is enabled, CVE-2026-18211 allows HTTP redirect URIs for localhost-prefixed domains, which poses a security risk.
What type of vulnerability is CVE-2026-18211 categorized as?
CVE-2026-18211 is categorized as an Input Validation vulnerability.