CVE-2026-18211: Keycloak-services: keycloak-services: secure-client-uris policy bypass via localhost-prefixed domains

Published Jul 29, 2026
·
Updated

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

2 affected components
Keycloak secure-client-uris (client policy executor)
redhat Build Of Keycloak

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. 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
  2. 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

Jul 29, 2026
Data Sourced
via Red Hat·08:24 AM
DescriptionSeverityAffected Software
Jul 31, 2026
CVE Published
via MITRE·07:08 AM
Data Sourced
via MITRE·07:08 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:16 AM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-18211?

The severity of CVE-2026-18211 is rated as medium with a score of 4.2.

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.

3

What area of Keycloak is affected by CVE-2026-18211?

CVE-2026-18211 affects the secure-client-uris client policy executor in Keycloak.

4

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.

5

What type of vulnerability is CVE-2026-18211 categorized as?

CVE-2026-18211 is categorized as an Input Validation vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203