CVE-2021-20323
published 2022-03-25CVE-2021-20323: A POST based reflected Cross Site Scripting vulnerability on has been identified in Keycloak.
PriorityP350medium6.1CVSS 3.1
AVNACLPRNUIRSCCLILAN
EXPLOIT
EPSS
37.25%
98.4th percentile
A POST based reflected Cross Site Scripting vulnerability on has been identified in Keycloak.
Affected
1 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| redhat | keycloak | < 17.0.0 | 17.0.0 |
Detection & IOCsextracted from sources · hover to see the quote
url/auth/realms/master/clients-registrations/default
url/auth/realms/master/clients-registrations/openid-connect
url/realms/master/clients-registrations/default
url/realms/master/clients-registrations/openid-connect
otherhttp.favicon.hash:-1105083093
- →Look for POST requests to the clients-registrations endpoint (both /auth/realms/*/clients-registrations/default and /auth/realms/*/clients-registrations/openid-connect) with Content-Type: application/json containing unknown/arbitrary JSON field names.
- →Detect HTTP 400 responses from the clients-registrations endpoint where the response body contains 'Unrecognized field' and the response Content-Type is text/html — this indicates the unsanitized field name is being reflected as HTML.
- →Match on response Content-Type of text/html for requests to the clients-registrations endpoint, as the server incorrectly returns text/html (typo: 'text/hml' in advisory) for JSON error responses, enabling XSS.
- →Shodan/FOFA fingerprinting: identify exposed Keycloak instances via favicon hash -1105083093 or HTML body/title containing 'Keycloak'.
- ·The vulnerability requires Content-Type: application/json and is POST-only, limiting common browser-based exploitation paths without attacker-controlled infrastructure.
- ·The XSS is exploitable across any realm on the Keycloak instance, not just the 'master' realm used in PoC paths.
CVSS provenance
nvdv3.16.1MEDIUMCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
nvdv2.04.3MEDIUMAV:N/AC:M/Au:N/C:N/I:P/A:N
vendor_redhat6.1MEDIUM
CVEs like this are exactly what “Exploited This Week” covers.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Red Hat
keycloak-services: POST based reflected Cross Site Scripting vulnerability
vendor_redhat·2021-10-14·CVSS 6.1
CVE-2021-20323 [MEDIUM] CWE-79 keycloak-services: POST based reflected Cross Site Scripting vulnerability
keycloak-services: POST based reflected Cross Site Scripting vulnerability
A POST based reflected Cross Site Scripting vulnerability on has been identified in Keycloak.
A flaw has been found in Keycloak. The clients-registrations endpoint allows execution of javascript code on the client-side, which makes it vulnerable to a Cross-Site Scripting attack.
GHSA
Cross-site Scripting in Keycloak
ghsa·2022-03-26
CVE-2021-20323 [MEDIUM] CWE-79 Cross-site Scripting in Keycloak
Cross-site Scripting in Keycloak
A POST based reflected Cross Site Scripting vulnerability on has been identified in Keycloak version 15. The issue was fixed in version 17.0.0.
OSV
Cross-site Scripting in Keycloak
osv·2022-03-26
CVE-2021-20323 [MEDIUM] Cross-site Scripting in Keycloak
Cross-site Scripting in Keycloak
A POST based reflected Cross Site Scripting vulnerability on has been identified in Keycloak version 15. The issue was fixed in version 17.0.0.
No detection rules found.
Nuclei
Keycloak 10.0.0 - 18.0.0 - Cross-Site Scripting
nuclei·CVSS 6.1
CVE-2021-20323 [MEDIUM] Keycloak 10.0.0 - 18.0.0 - Cross-Site Scripting
Keycloak 10.0.0 - 18.0.0 - Cross-Site Scripting
Keycloak 10.0.0 to 18.0.0 contains a cross-site scripting vulnerability via the client-registrations endpoint. On a POST request, the application does not sanitize an unknown attribute name before including it in the error response with a 'Content-Type' of text/hml. Once reflected, the response is interpreted as HTML. This can be performed on any realm present on the Keycloak instance. Since the bug requires Content-Type application/json and is submitted via a POST, there is no common path to exploit that has a user impact.
Template:
id: CVE-2021-20323
info:
name: Keycloak 10.0.0 - 18.0.0 - Cross-Site Scripting
author: ndmalc,incogbyte
severity: medium
description: |
Keycloak 10.0.0 to 18.0.0 contains a cross-site scripting vulnerability
2022-03-25
Published