CVE-2023-6291
JSON

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 packageVersionsReported by
rhbk/keycloak-operator-bundleNot specified
Not affected: from 22.0.7-1 before *
CVE List
rhbk/keycloak-rhel9Not specified
Not affected: from 22-6 before *
CVE List
rhbk/keycloak-rhel9-operatorNot specified
Not affected: from 22-9 before *
CVE List
Red Hat Red Hat build of Keycloak 22.0.7Not specifiedCVE List
rh-sso7-keycloakNot 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-rhel8Not specified
Not affected: from 7.6-38 before *, from 7.6-41 before *
CVE List
rh-sso-7/sso7-rhel8-operator-bundleNot specified
Not affected: from 7.6.6-2 before *
CVE List
keycloakNot specifiedCVE List
org.keycloak:keycloak-services (Maven)before 23.0.3GitHub Advisory Database
redhat keycloakbefore 22.0.7NVD
redhat single_sign-on7.6NVD
redhat openshift_container_platform4.11, 4.12NVD

All scores

redhat7.1high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
GitHub7.1high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
NVD7.1high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L

Classification

CWE-20CWE-601

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

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

https://access.redhat.com/errata/RHSA-2023:7854vendor-advisory, web
https://access.redhat.com/errata/RHSA-2023:7855vendor-advisory, web
https://access.redhat.com/errata/RHSA-2023:7856vendor-advisory, web
https://access.redhat.com/errata/RHSA-2023:7857vendor-advisory, web
https://access.redhat.com/errata/RHSA-2023:7858vendor-advisory, web
https://access.redhat.com/errata/RHSA-2023:7860vendor-advisory, web
https://access.redhat.com/errata/RHSA-2023:7861vendor-advisory, web
https://access.redhat.com/errata/RHSA-2024:0798vendor-advisory
https://access.redhat.com/errata/RHSA-2024:0799vendor-advisory
https://access.redhat.com/errata/RHSA-2024:0800vendor-advisory
https://access.redhat.com/errata/RHSA-2024:0801vendor-advisory
https://access.redhat.com/errata/RHSA-2024:0804vendor-advisory

Sources

SourceRecordLicence
CVE ListCVE-2023-6291 changed 2026-11-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-mpwq-j3xf-7m5w changed 2024-02-16CC-BY-4.0
NVDCVE-2023-6291 changed 2026-11-04Public domain