CVE-2022-1274 HTML Injection in Keycloak Admin REST API
Attackers can inject arbitrary HTML into Keycloak emails, enabling phishing attacks against users of the identity management server.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-1274?
CVE-2022-1274 is a medium-severity cross-site scripting vulnerability in Redhat Keycloak, published on 29 Mar 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
A flaw was found in Keycloak in the execute-actions-email endpoint. This issue allows arbitrary HTML to be injected into emails sent to Keycloak users and can be misused to perform phishing or other attacks against users.
Which versions are affected by CVE-2022-1274?
2 open source packages ship an affected version, including org.keycloak:keycloak-services. It affects 3 products.
| Package | Affected | Fixed in |
|---|---|---|
org.keycloak:keycloak-services Maven | All versions | 20.0.5 |
org.keycloak:keycloak-services Maven | All versions | 20.0.5 |
Products include Redhat Keycloak, Redhat Openshift Container Platform, Redhat Single Sign-On.
How do I fix CVE-2022-1274?
Upgrade org.keycloak:keycloak-services 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-1274 being exploited?
There is no known exploitation of CVE-2022-1274 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-m4fv-gm5m-4725.