CVE-2021-20323 Cross-site Scripting in Keycloak
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.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-core Maven | From 15.0.0 | 17.0.0 |
org.keycloak:keycloak-core Maven | From 15.0.0 | 17.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.
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-2021-20195 keycloak Self Stored Cross-site Scripting vulnerability
- CVE-2019-14910 Keycloak Authentication Error
- CVE-2019-14909 Keycloak Authentication Error
Sources
Also known as GHSA-xpgc-j48j-jwv9.