CVE-2022-4137 Keycloak: reflected xss attack

High 8.1 Published Updated

Reflected XSS in Keycloak's OAuth endpoint allows attackers to inject scripts via malicious links, potentially compromising user data.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-4137?

CVE-2022-4137 is a high-severity cross-site scripting vulnerability in Redhat Keycloak, published on 25 Sep 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

A reflected cross-site scripting (XSS) vulnerability was found in the 'oob' OAuth endpoint due to incorrect null-byte handling. This issue allows a malicious link to insert an arbitrary URI into a Keycloak error page. This flaw requires a user or administrator to interact with a link in order to be vulnerable. This may compromise user details, allowing it to be changed or collected by an attacker.

Weakness: CWE-79, CWE-81

Which versions are affected by CVE-2022-4137?

2 open source packages ship an affected version, including org.keycloak:keycloak-parent. It affects 2 products.

PackageAffectedFixed in
org.keycloak:keycloak-parent MavenAll versions20.0.5
org.keycloak:keycloak-parent MavenAll versions20.0.5

Products include Redhat Keycloak, Redhat Single Sign-On.

How do I fix CVE-2022-4137?

Upgrade org.keycloak:keycloak-parent to 20.0.5 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2022-4137 being exploited?

There is no known exploitation of CVE-2022-4137 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-9hhc-pj4w-w5rv.

Is CVE-2022-4137 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free