CVE-2022-1438 Keycloak: xss on impersonation under specific circumstances
An attacker can execute arbitrary scripts via unsanitized HTML entities during user impersonation in Keycloak, potentially compromising user sessions.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-1438?
CVE-2022-1438 is a medium-severity cross-site scripting vulnerability in Redhat Keycloak, published on 20 Sep 2023. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Official description
A flaw was found in Keycloak. Under specific circumstances, HTML entities are not sanitized during user impersonation, resulting in a Cross-site scripting (XSS) vulnerability.
Weakness: CWE-79
Which versions are affected by CVE-2022-1438?
2 open source packages ship an affected version, including org.keycloak:keycloak-services. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-services Maven | All versions to 21.0.0 | None |
org.keycloak:keycloak-services Maven | All versions to 21.0.0 | None |
Products include Redhat Keycloak.
How do I fix CVE-2022-1438?
Apply the vendor's patch.
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-1438 being exploited?
There is no known exploitation of CVE-2022-1438 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-w354-2f3c-qvg9.