CVE-2022-0225: XSS

Published Jan 13, 2022
·
Updated

A flaw was found in Keycloak. This flaw allows a privileged attacker to use the malicious payload as the group name while creating a new group from the admin console, leading to a stored Cross-site scripting (XSS) attack.

Other sources

The ”Groups” dropdown in ”Add user” is not escaped properly and can be exploited.

Steps to reproduce

Start a vanilla keycloak (or an existing one): docker run -p 8080:8080 -e KEYCLOAKUSER=admin -e KEYCLOAKPASSWORD=admin quay.io/keycloak/keycloak:16.1.0 Login and go to Groups. Click New to add a new group. Add a group using the payload below:

"><img src=x onerror=prompt(location)>

Go to Users and click Add user. Click Groups and enter a character, as o, to display the group. This will trigger our prompt from the group name.

Maybe also other places has this issue? This is probably an easy fix for you, but in case you want me to look into it I can do it. I’m jxn0 on github.

Red Hat

Affected Software

9 affected componentsFixes available
redhat/rh-sso7-keycloak<0:15.0.8-1.redhat_00001.1.el7
0:15.0.8-1.redhat_00001.1.el7
redhat/rh-sso7-keycloak<0:15.0.8-1.redhat_00001.1.el8
0:15.0.8-1.redhat_00001.1.el8
redhat/rh-sso7-keycloak<0:18.0.3-1.redhat_00001.1.el7
0:18.0.3-1.redhat_00001.1.el7
redhat/rh-sso7-keycloak<0:18.0.3-1.redhat_00001.1.el8
0:18.0.3-1.redhat_00001.1.el8
redhat/rh-sso7<0:1-5.el9
0:1-5.el9
redhat/rh-sso7-javapackages-tools<0:6.0.0-7.el9
0:6.0.0-7.el9
redhat/rh-sso7-keycloak<0:18.0.3-1.redhat_00001.1.el9
0:18.0.3-1.redhat_00001.1.el9
redhat keycloak
redhat Single Sign-on=7.0

Event History

Jan 13, 2022
CVE Published
12:00 AM
Data Sourced
via Red Hat·10:42 AM
DescriptionSeverityAffected Software
Aug 26, 2022
CVE Published
via MITRE·05:25 PM
Data Sourced
via MITRE·05:25 PM
DescriptionWeakness

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2022-0225?

CVE-2022-0225 is a vulnerability found in Keycloak that allows a privileged attacker to use a malicious payload as the group name, leading to a stored Cross-site scripting (XSS) attack.

2

What is the severity of CVE-2022-0225?

CVE-2022-0225 has a severity rating of 5.7, which is considered medium.

3

Which versions of Keycloak are affected by CVE-2022-0225?

CVE-2022-0225 affects versions 0:15.0.8-1.redhat_00001.1.el7, 0:15.0.8-1.redhat_00001.1.el8, 0:18.0.3-1.redhat_00001.1.el7, 0:18.0.3-1.redhat_00001.1.el8, and 0:18.0.3-1.redhat_00001.1.el9.

4

How can the vulnerability be fixed?

To fix the vulnerability, update Keycloak to version 0:18.0.3-1.redhat_00001.1.el9 or apply the appropriate remedy provided by Redhat.

5

What is the Common Weakness Enumeration (CWE) associated with CVE-2022-0225?

CVE-2022-0225 is associated with CWE-79, which is a category for Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203