CVE-2022-1274 HTML Injection in Keycloak Admin REST API

Medium 5.4 Published Updated

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.

Weakness: CWE-79, CWE-80

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.

PackageAffectedFixed in
org.keycloak:keycloak-services MavenAll versions20.0.5
org.keycloak:keycloak-services MavenAll versions20.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.

All Redhat Keycloak vulnerabilities

Sources

Also known as GHSA-m4fv-gm5m-4725.

Is CVE-2022-1274 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free