CVE-2022-4137 Keycloak: reflected xss attack
Reflected XSS in Keycloak's OAuth endpoint allows attackers to inject scripts via malicious links, potentially compromising user data.
- 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-2022-4137?
CVE-2022-4137 is a high-severity cross-site scripting vulnerability in Redhat Keycloak, published on 25 Sep 2023. 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 reflected cross-site scripting (XSS) vulnerability was found in the 'oob' OAuth endpoint due to incorrect null-byte handling. This issue allows a malicious link to insert an arbitrary URI into a Keycloak error page. This flaw requires a user or administrator to interact with a link in order to be vulnerable. This may compromise user details, allowing it to be changed or collected by an attacker.
Which versions are affected by CVE-2022-4137?
2 open source packages ship an affected version, including org.keycloak:keycloak-parent. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-parent Maven | All versions | 20.0.5 |
org.keycloak:keycloak-parent Maven | All versions | 20.0.5 |
Products include Redhat Keycloak, Redhat Single Sign-On.
How do I fix CVE-2022-4137?
Upgrade org.keycloak:keycloak-parent to 20.0.5 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-4137 being exploited?
There is no known exploitation of CVE-2022-4137 in the wild and no public exploit code.
Public exploit code: 1 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-9hhc-pj4w-w5rv.