CVE-2021-20222 Code injection in keycloak

High 7.5 Published Updated

Attackers can execute malicious code via the referrer URL in Keycloak's account console, compromising data and system availability.

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-2021-20222?

CVE-2021-20222 is a high-severity cross-site scripting vulnerability in Redhat Keycloak, published on 23 Mar 2021. 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 flaw was found in keycloak. The new account console in keycloak can allow malicious code to be executed using the referrer URL. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.

Weakness: CWE-79, CWE-20

Which versions are affected by CVE-2021-20222?

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

PackageAffectedFixed in
org.keycloak:keycloak-parent MavenFrom 9.0.012.0.3
org.keycloak:keycloak-parent MavenFrom 9.0.012.0.3

Products include Redhat Keycloak.

How do I fix CVE-2021-20222?

Upgrade org.keycloak:keycloak-parent to 12.0.3 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-2021-20222 being exploited?

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

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-2mq8-99q7-55wx.

Is CVE-2021-20222 in your software?

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

Check your SBOMs for free