CVE-2026-107889: Keycloak-services: keycloak-services: stored xss on login page via kcsanitize bypass

Published Oct 9, 2026
·
Updated

A flaw was found in the login theme rendering component of Keycloak. The issue occurs because the security filter responsible for cleaning user input can be bypassed, allowing a realm administrator to store malicious scripts in display fields. This could result in unauthorized JavaScript execution in the browsers of users visiting the login page, potentially leading to data exposure or session interference.

Other sources

A stored cross-site scripting (XSS) vulnerability was discovered in Keycloak's login theme rendering. The vulnerability stems from a bypass in the kcSanitize filter. While kcSanitize correctly identifies and neutralizes certain numeric character references, a subsequent post-processing function, fixURLs(), restores the ampersand encoding. This restoration re-activates the malicious character references before they are parsed by the browser. An attacker with manage-realm permissions can exploit this by storing crafted HTML payloads in realm display fields like displayNameHtml or via localization overrides. Successful exploitation allows arbitrary JavaScript to execute in the context of any user loading the realm's login page. A specific variant on the WebAuthn error page allows for execution without any user interaction. An attacker could use this flaw to steal session tokens, perform actions on behalf of the user, or deface the login interface.

— Red Hat

Affected Software

1 affected component
Red Hat Keycloak

Event History

Oct 9, 2026
Data Sourced
via Red Hat·04:08 AM
DescriptionSeverityAffected Software
CVE Published
via MITRE·04:28 AM
Data Sourced
via MITRE·04:28 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:16 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who can exploit this vulnerability?

An attacker needs realm-management privileges, specifically manage-realm permissions, to store a crafted payload in realm display fields or localization overrides. It is not described as exploitable by an unauthenticated attacker without administrative access.

2

Which users are exposed to the injected script?

Any user whose browser loads the affected realm's login page can have arbitrary JavaScript executed in that page's context. The described impact includes potential data exposure and session interference.

3

Where can an administrator check for malicious stored content?

Review realm display fields such as displayNameHtml and any localization overrides for crafted HTML or encoded character-reference payloads. The issue involves payloads that become active after kcSanitize processing and subsequent URL post-processing.

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