CVE-2021-20222 Code injection in keycloak
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.
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.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-parent Maven | From 9.0.0 | 12.0.3 |
org.keycloak:keycloak-parent Maven | From 9.0.0 | 12.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.
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-2mq8-99q7-55wx.