CVE-2017-12158 Keycloak Reflected XSS
An attacker can execute arbitrary scripts in an authenticated user's browser via a malicious HOST header in the Keycloak admin console.
- 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-2017-12158?
CVE-2017-12158 is a medium-severity cross-site scripting vulnerability in Red Hat, Inc. keycloak, published on 26 Oct 2017. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
It was found that Keycloak would accept a HOST header URL in the admin console and use it to determine web resource locations. An attacker could use this flaw against an authenticated user to attain reflected XSS via a malicious server.
Which versions are affected by CVE-2017-12158?
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 | 3.4.0 |
org.keycloak:keycloak-parent Maven | All versions | 3.4.0 |
Products include Keycloak Keycloak, Redhat Single Sign On.
How do I fix CVE-2017-12158?
Upgrade org.keycloak:keycloak-parent to 3.4.0 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-2017-12158 being exploited?
There is no known exploitation of CVE-2017-12158 in the wild and no public exploit code.
Other vulnerabilities in Red Hat, Inc. keycloak
Sources
Also known as CLEANSTART-2026-IW40503, GHSA-v38p-mqq3-m6v5, MINI-2v2m-r65g-8m3q, MINI-vpp2-gqh7-fg69.