CVE-2023-6291: Keycloak: redirect_uri validation bypass
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
Event History
Frequently Asked Questions
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.
How can I fix CVE-2023-6291?
To fix CVE-2023-6291, update Keycloak to version 23.0.3 or later.
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.
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.
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.