CyberSecBulletin
CVE-2023-6291NVD status: Modified

Red Hat build of Keycloak 22: URL Redirection to Untrusted Site

CVE-2023-6291 is a high-severity URL redirection to untrusted site vulnerability in Red Hat build of Keycloak 22 from Red Hat, with a CVSS 3.1 base score of 7.1 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, but only if a user takes part, for example by opening a link or file. There is no confirmed exploitation so far. EPSS estimates a 0.95% chance of exploitation within 30 days, higher than 62% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Keycloak to 22.0.7 or a later version.
  2. Read the advisory on access.redhat.com for workarounds and exact fixed builds.
  3. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
  4. Because the attack needs a user to take part, warn users about unexpected links and files related to this product until it is patched.

Affected products and versions

VendorProductAffected versionsFixed in
Red HatRed Hat build of Keycloak 22Not specified in the recordNot stated
Red HatRed Hat build of Keycloak 22.0.7Not specified in the recordNot stated
Red HatRed Hat Single Sign-On 7Not specified in the recordNot stated
Red HatRed Hat Single Sign-On 7.6 for RHEL 7Not specified in the recordNot stated
Red HatRed Hat Single Sign-On 7.6 for RHEL 8Not specified in the recordNot stated
Red HatRed Hat Single Sign-On 7.6 for RHEL 9Not specified in the recordNot stated
Red HatRHEL-8 based Middleware ContainersNot specified in the recordNot stated
Red HatSingle Sign-On 7.6.6Not specified in the recordNot stated
Red HatMigration Toolkit for Applications 6Not specified in the recordNot stated
Red HatMigration Toolkit for Applications 7Not specified in the recordNot stated
Red HatOpenShift ServerlessNot specified in the recordNot stated
Red HatRed Hat Data Grid 8Not specified in the recordNot stated
Red HatRed Hat Decision Manager 7Not specified in the recordNot stated
Red HatRed Hat Fuse 7Not specified in the recordNot stated
Red HatRed Hat JBoss Data Grid 7Not specified in the recordNot stated
Red HatRed Hat JBoss Enterprise Application Platform 6Not specified in the recordNot stated
Red HatRed Hat Process Automation 7Not specified in the recordNot stated
Red HatKeycloakbefore 22.0.722.0.7
Red HatSingle Sign-on7.6Not stated
Red HatOpenshift Container Platform4.11; 4.12Not stated
Red HatOpenshift Container Platform For IBM Z4.9; 4.10Not stated
Red HatOpenshift Container Platform For Linuxone4.9; 4.10Not stated
Red HatOpenshift Container Platform For Power4.9; 4.10Not stated
Red HatMigration Toolkit For Applications6.0; 7.0Not stated

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
RequiredA user must take an action such as opening a file or link.
Scope
ChangedThe attack can reach beyond the vulnerable component into other systems.
Confidentiality
LowSome restricted data can be read.
Integrity
LowLimited modification of data is possible.
Availability
LowPerformance or availability is reduced.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.1HighCNA (redhat.com)
CVSS 3.17.1HighNVD

Official 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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: URL Redirection to Untrusted Site

The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.

How developers prevent this class of flaw

  • Use an intermediate disclaimer page that provides the user with a clear warning that they are leaving the current site. Implement a long timeout before the redirect occurs, or force the user to click on the link. Be careful to avoid XSS problems (CWE-79) when generating the disclaimer page.
  • When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs. For example, ID 1 could map to /login.asp and ID 2 could map to http://www.example.com/. Features such as the ESAPI AccessReferenceMap provide this capability.
  • Ensure that no externally-supplied requests are honored by requiring that all redirect requests include a unique nonce generated by the application. Be sure that the nonce is not predictable (CWE-330).

More URL Redirection to Untrusted Site vulnerabilities (CWE-601)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Other vulnerabilities in Red Hat build of Keycloak 22

All Red Hat build of Keycloak 22 vulnerabilities

Recent URL Redirection to Untrusted Site vulnerabilities

Spotted an error? Tell us.