CVE-2021-20195 keycloak Self Stored Cross-site Scripting vulnerability

Critical 9.6 Published Updated

Attackers can execute arbitrary JavaScript via stored XSS in Keycloak, leading to complete account takeover and system compromise.

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

CVE-2021-20195 is a critical cross-site scripting vulnerability in Redhat Keycloak, published on 28 May 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 in versions before 13.0.0. A Self Stored XSS attack vector escalating to a complete account takeover is possible due to user-supplied data fields not being properly encoded and Javascript code being used to process the data. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.

Weakness: CWE-116, CWE-20

Which versions are affected by CVE-2021-20195?

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

PackageAffectedFixed in
org.keycloak:keycloak-core MavenAll versions13.0.0
org.keycloak:keycloak-core MavenAll versions13.0.0

Products include Redhat Keycloak.

How do I fix CVE-2021-20195?

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

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

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-q6w2-89hq-hq27.

Is CVE-2021-20195 in your software?

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

Check your SBOMs for free