Skip to content

The redirect_uri validation logic allows for bypassing explicitly allowed hosts that would otherwise be restricted

High severity GitHub Reviewed Published Dec 19, 2023 in keycloak/keycloak • Updated Jan 26, 2024

Package

maven org.keycloak:keycloak-services (Maven)

Affected versions

< 23.0.3

Patched versions

23.0.3

Description

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:[email protected]" 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

References

@abstractj abstractj published to keycloak/keycloak Dec 19, 2023
Published to the GitHub Advisory Database Dec 21, 2023
Reviewed Dec 21, 2023
Published by the National Vulnerability Database Jan 26, 2024
Last updated Jan 26, 2024

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L

EPSS score

0.144%
(51st percentile)

Weaknesses

CVE ID

CVE-2023-6291

GHSA ID

GHSA-mpwq-j3xf-7m5w

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.