7.1high
Keycloak: redirect_uri validation bypass
- Severity
- 7.1high CVSS:3.1 by redhat
- Exploit likelihood
- 1.03% (higher than 64% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- redhat
- Also known as
- GHSA-mpwq-j3xf-7m5w
Description
A flaw was found in the redirect_uri 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rhbk/keycloak-operator-bundle | Not specified Not affected: from 22.0.7-1 before * | CVE List |
| rhbk/keycloak-rhel9 | Not specified Not affected: from 22-6 before * | CVE List |
| rhbk/keycloak-rhel9-operator | Not specified Not affected: from 22-9 before * | CVE List |
| Red Hat Red Hat build of Keycloak 22.0.7 | Not specified | CVE List |
| rh-sso7-keycloak | Not specified Not affected: from 0:18.0.11-2.redhat_00003.1.el7sso before *, from 0:18.0.12-1.redhat_00001.1.el7sso before *, from 0:18.0.11-2.redhat_00003.1.el8sso before *, from 0:18.0.12-1.redhat_00001.1.el8sso before *, from 0:18.0.11-2.redhat_00003.1.el9sso before *, from 0:18.0.12-1.redhat_00001.1.el9sso before * | CVE List |
| rh-sso-7/sso76-openshift-rhel8 | Not specified Not affected: from 7.6-38 before *, from 7.6-41 before * | CVE List |
| rh-sso-7/sso7-rhel8-operator-bundle | Not specified Not affected: from 7.6.6-2 before * | CVE List |
| keycloak | Not specified | CVE List |
| org.keycloak:keycloak-services (Maven) | before 23.0.3 | GitHub Advisory Database |
| redhat keycloak | before 22.0.7 | NVD |
| redhat single_sign-on | 7.6 | NVD |
| redhat openshift_container_platform | 4.11, 4.12 | NVD |
| redhat openshift_container_platform_for_ibm_z | 4.9, 4.10 | NVD |
| redhat openshift_container_platform_for_linuxone | 4.9, 4.10 | NVD |
| redhat openshift_container_platform_for_power | 4.9, 4.10 | NVD |
| redhat migration_toolkit_for_applications | 6.0, 7.0 | NVD |
All scores
| redhat | 7.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L |
| GitHub | 7.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L |
| NVD | 7.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L |
Classification
What each source says
CVE List
A flaw was found in the redirect_uri 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.
GitHub Advisory Database
An issue was found in the redirect_uri 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
NVD (es)
Se encontró un fallo en la lógica de validación de redirect_uri en Keycloak. Este problema puede permitir la omisión de hosts permitidos explícitamente. Un ataque exitoso puede provocar el robo de un token de acceso, lo que hace posible que el atacante se haga pasar por otros usuarios.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-6291 changed 2026-11-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-mpwq-j3xf-7m5w changed 2024-02-16 | CC-BY-4.0 |
| NVD | CVE-2023-6291 changed 2026-11-04 | Public domain |