CVE-2022-1438 Keycloak: xss on impersonation under specific circumstances

Medium 6.4 Published Updated

An attacker can execute arbitrary scripts via unsanitized HTML entities during user impersonation in Keycloak, potentially compromising user sessions.

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

What is CVE-2022-1438?

CVE-2022-1438 is a medium-severity cross-site scripting vulnerability in Redhat Keycloak, published on 20 Sep 2023. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

Official description

A flaw was found in Keycloak. Under specific circumstances, HTML entities are not sanitized during user impersonation, resulting in a Cross-site scripting (XSS) vulnerability.

Weakness: CWE-79

Which versions are affected by CVE-2022-1438?

2 open source packages ship an affected version, including org.keycloak:keycloak-services. It affects 1 product.

PackageAffectedFixed in
org.keycloak:keycloak-services MavenAll versions to 21.0.0None
org.keycloak:keycloak-services MavenAll versions to 21.0.0None

Products include Redhat Keycloak.

How do I fix CVE-2022-1438?

Apply the vendor's patch.

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-1438 being exploited?

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

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-w354-2f3c-qvg9.

Is CVE-2022-1438 in your software?

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

Check your SBOMs for free