CVE-2021-20195 keycloak Self Stored Cross-site Scripting vulnerability
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.
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.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-core Maven | All versions | 13.0.0 |
org.keycloak:keycloak-core Maven | All versions | 13.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.
Other vulnerabilities in Redhat Keycloak
- CVE-2022-4361 Keycloak vulnerable to cross-site scripting when validating URI-schemes on SAML and OIDC
- CVE-2022-1245 Keycloak vulnerable to privilege escalation on Token Exchange feature
- CVE-2019-14910 Keycloak Authentication Error
- CVE-2019-14909 Keycloak Authentication Error
- CVE-2022-3782 Keycloak vulnerable to path traversal via double URL encoding
Sources
Also known as GHSA-q6w2-89hq-hq27.