CVE-2021-20323 Cross-site Scripting in Keycloak

Medium 6.1 Published Updated

Attackers can execute arbitrary scripts in victim browsers via reflected XSS in Keycloak, potentially compromising user sessions.

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-20323?

CVE-2021-20323 is a medium-severity cross-site scripting vulnerability in Redhat Keycloak, published on 25 Mar 2022. 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 POST based reflected Cross Site Scripting vulnerability on has been identified in Keycloak.

Weakness: CWE-79

Which versions are affected by CVE-2021-20323?

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

PackageAffectedFixed in
org.keycloak:keycloak-core MavenFrom 15.0.017.0.0
org.keycloak:keycloak-core MavenFrom 15.0.017.0.0

Products include Redhat Keycloak.

How do I fix CVE-2021-20323?

Upgrade org.keycloak:keycloak-core to 17.0.0 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-20323 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-20323 exists.

Public exploit code: 1 Nuclei template and 3 proofs of concept on GitHub.

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-xpgc-j48j-jwv9.

Is CVE-2021-20323 in your software?

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

Check your SBOMs for free