Bug 2251407 (CVE-2023-6291)

Summary: CVE-2023-6291 keycloak: redirect_uri validation bypass
Product: [Other] Security Response Reporter: Rohit Keshri <rkeshri>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: aileenc, asoldano, bbaranow, bmaxwell, boliveir, brian.stansberry, cdewolf, chazlett, darran.lofthouse, dhanak, dkreling, dosoudil, drichtar, dsimansk, ecerquei, fjuma, gmalinko, ibek, istudens, ivassile, iweiss, janstey, jkoops, jrokos, kingland, kverlaen, lball, lgao, matzew, mnovotny, mosmerov, msochure, mstefank, msvehla, mulliken, nwallace, pdelbell, pdrozd, peholase, pesilva, pierdipi, pjindal, pmackay, pskopek, rguimara, rhuss, rjohnson, rmartinc, rowaters, rstancel, rstepani, security-response-team, smaestri, sthorger, tom.jenkinson
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2251416    
Bug Blocks: 2251409    

Description Rohit Keshri 2023-11-24 19:06:10 UTC
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 "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

Comment 8 errata-xmlrpc 2023-12-14 18:58:11 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On 7.6 for RHEL 9

Via RHSA-2023:7855 https://access.redhat.com/errata/RHSA-2023:7855

Comment 9 errata-xmlrpc 2023-12-14 18:58:19 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On 7.6 for RHEL 8

Via RHSA-2023:7856 https://access.redhat.com/errata/RHSA-2023:7856

Comment 10 errata-xmlrpc 2023-12-14 18:58:30 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On 7.6 for RHEL 7

Via RHSA-2023:7854 https://access.redhat.com/errata/RHSA-2023:7854

Comment 11 errata-xmlrpc 2023-12-14 19:04:33 UTC
This issue has been addressed in the following products:

  Single Sign-On 7.6.6

Via RHSA-2023:7858 https://access.redhat.com/errata/RHSA-2023:7858

Comment 12 errata-xmlrpc 2023-12-14 19:16:45 UTC
This issue has been addressed in the following products:

  Red Hat build of Keycloak 22.0.7

Via RHSA-2023:7860 https://access.redhat.com/errata/RHSA-2023:7860

Comment 13 errata-xmlrpc 2023-12-14 19:55:08 UTC
This issue has been addressed in the following products:

  RHEL-8 based Middleware Containers

Via RHSA-2023:7857 https://access.redhat.com/errata/RHSA-2023:7857

Comment 14 errata-xmlrpc 2023-12-14 20:04:30 UTC
This issue has been addressed in the following products:

  Red Hat build of Keycloak 22

Via RHSA-2023:7861 https://access.redhat.com/errata/RHSA-2023:7861

Comment 15 errata-xmlrpc 2024-02-13 16:52:43 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On 7.6 for RHEL 8

Via RHSA-2024:0799 https://access.redhat.com/errata/RHSA-2024:0799

Comment 16 errata-xmlrpc 2024-02-13 16:53:13 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On 7.6 for RHEL 9

Via RHSA-2024:0800 https://access.redhat.com/errata/RHSA-2024:0800

Comment 17 errata-xmlrpc 2024-02-13 16:53:30 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On 7.6 for RHEL 7

Via RHSA-2024:0798 https://access.redhat.com/errata/RHSA-2024:0798

Comment 18 errata-xmlrpc 2024-02-13 16:54:28 UTC
This issue has been addressed in the following products:

  RHEL-8 based Middleware Containers

Via RHSA-2024:0801 https://access.redhat.com/errata/RHSA-2024:0801

Comment 19 errata-xmlrpc 2024-02-13 17:08:04 UTC
This issue has been addressed in the following products:

  Red Hat Single Sign-On

Via RHSA-2024:0804 https://access.redhat.com/errata/RHSA-2024:0804