CVE-2023-6291: Keycloak: redirect_uri validation bypass

Published Nov 24, 2023
·
Updated

A flaw was found in the redirecturi validation logic in Keycloak. This issue may allow a bypass of otherwise explicitly allowed hosts. A successful attack may lead to an access token being stolen, making it possible for the attacker to impersonate other users.

Other sources

An issue was found in the redirecturi validation logic that allows for a bypass of otherwise explicitly allowed hosts.

The problem arises in the verifyRedirectUri method, which attempts to enforce rules on user-controllable input, but essentially causes a desynchronization in how Keycloak and browsers interpret URLs. Keycloak, for example, receives "www%2ekeycloak%2eorg%2fapp%2f:y@example.com" and thinks the authority to be keycloak.org when it is actually example.com. This happens because the validation logic is performed on a URL decoded version, which no longer represents the original input.

Acknowledgements Karel Knibbe

GitHub

An issue was found in the redirecturi validation logic that allows for a bypass of otherwise explicitly allowed hosts.

The problem arises in the verifyRedirectUri method, which attempts to enforce rules on user-controllable input, but essentially causes a desynchronization in how Keycloak and browsers interpret URLs. Keycloak, for example, receives "https://www%2ekeycloak%2eorg%2fapp%2f:y@example.com" and thinks the authority to be keycloak.org when it is actually example.com. This happens because the validation logic is performed on a URL decoded version, which no longer represents the original input.

Refer: https://github.com/keycloak/keycloak/pull/24819

Red Hat

Affected Software

18 affected componentsFixes available
maven/org.keycloak:keycloak-services<23.0.3
23.0.3
redhat keycloak<22.0.7
redhat Single Sign-on
All of the following
Any of the following
redhat OpenShift Container Platform=4.11
redhat OpenShift Container Platform=4.12
redhat Openshift Container Platform For Ibm Z=4.9
redhat Openshift Container Platform For Ibm Z=4.10
redhat Openshift Container Platform For Linuxone=4.9
redhat Openshift Container Platform For Linuxone=4.10
redhat Openshift Container Platform For Power=4.9
redhat Openshift Container Platform For Power=4.10
redhat Enterprise Linux=8.0
All of the following
redhat Single Sign-on=7.6
Any of the following
redhat Enterprise Linux=7.0
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
redhat Migration Toolkit For Applications=6.0
redhat Migration Toolkit For Applications=7.0

Event History

Nov 24, 2023
Data Sourced
via Red Hat·07:06 PM
DescriptionSeverityAffected Software
Dec 21, 2023
Advisory Published
06:25 PM
Jan 26, 2024
CVE Published
via MITRE·02:23 PM
Data Sourced
via MITRE·02:23 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:15 PM
DescriptionSeverityWeakness
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-2023-6291?

CVE-2023-6291 is classified as a medium severity vulnerability due to its potential to allow access token theft.

2

How can I fix CVE-2023-6291?

To fix CVE-2023-6291, update Keycloak to version 23.0.3 or later.

3

What software is affected by CVE-2023-6291?

CVE-2023-6291 affects Keycloak versions earlier than 23.0.3 and several Red Hat OpenShift Container Platform versions.

4

What type of attack can be executed using CVE-2023-6291?

An attacker exploiting CVE-2023-6291 can perform access token theft, potentially leading to user impersonation.

5

Is there a workaround for CVE-2023-6291?

Currently, the only effective mitigation for CVE-2023-6291 is to upgrade the affected software to the latest version.

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