CVE-2022-4361 Keycloak vulnerable to cross-site scripting when validating URI-schemes on SAML and OIDC
Attackers can execute malicious scripts in Keycloak SAML or OIDC providers via crafted URLs, potentially compromising user accounts.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-4361?
CVE-2022-4361 is a critical cross-site scripting vulnerability in Redhat Keycloak, published on 7 Jul 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Keycloak, an open-source identity and access management solution, has a cross-site scripting (XSS) vulnerability in the SAML or OIDC providers. The vulnerability can allow an attacker to execute malicious scripts by setting the AssertionConsumerServiceURL value or the redirect_uri.
Which versions are affected by CVE-2022-4361?
2 open source packages ship an affected version, including org.keycloak:keycloak-services. It affects 5 products.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-services Maven | All versions | 21.1.2 |
org.keycloak:keycloak-services Maven | All versions | 21.1.2 |
Products include Redhat Keycloak, Redhat Openshift Container Platform, Redhat Openshift Container Platform for Ibm Linuxone, Redhat Openshift Container Platform for Power, Redhat Single Sign-On.
How do I fix CVE-2022-4361?
Upgrade org.keycloak:keycloak-services to 21.1.2 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-2022-4361 being exploited?
There is no known exploitation of CVE-2022-4361 in the wild and no public exploit code.
Public exploit code: 2 proofs of concept on GitHub.
Other vulnerabilities in Redhat Keycloak
- 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
- CVE-2022-3782 Keycloak vulnerable to path traversal via double URL encoding
Sources
Also known as GHSA-3p62-6fjh-3p5h.