CVE-2026-107889 Overview
CVE-2026-107889 is a stored Cross-Site Scripting (XSS) vulnerability in the login theme rendering component of Keycloak. The security filter that sanitizes user input can be bypassed, allowing a realm administrator to inject malicious scripts into display fields. These scripts execute in the browsers of users who visit the login page. The flaw is tracked under CWE-79 and documented in the Red Hat CVE-2026-107889 Advisory.
Critical Impact
An authenticated realm administrator can store JavaScript payloads that run in the context of any user loading the affected login page, enabling session interference and sensitive data exposure.
Affected Products
- Keycloak (login theme rendering component)
- Red Hat build of Keycloak
- Red Hat Single Sign-On (downstream distributions tracking the upstream fix)
Discovery Timeline
- 2026-10-09 - CVE-2026-107889 published to NVD
- 2026-10-13 - Last updated in NVD database
Technical Details for CVE-2026-107889
Vulnerability Analysis
The vulnerability resides in how the Keycloak login theme renders administrator-controlled display fields. The input sanitization filter intended to strip or encode active content fails to neutralize certain payloads. An attacker with realm administrator privileges can persist crafted strings that the renderer later emits into the login page without proper encoding. When any user navigates to that login page, the browser parses the injected markup and executes attacker-supplied JavaScript. Because the script runs in the origin that hosts the identity provider, it can read page content, manipulate form submissions, and interfere with authentication flows.
Root Cause
The root cause is improper neutralization of input during web page generation [CWE-79] in the login theme rendering path. The sanitization logic does not cover all contexts in which display field values are later serialized into HTML, allowing script content to survive the filter and reach the response body.
Attack Vector
Exploitation requires high privileges: the attacker must already hold realm administrator rights. The attacker edits a display field under administrator control and stores an XSS payload. No further user interaction is required beyond a victim visiting the login page. Because the login page is cross-domain by design and shared across the realm, the impact crosses a security scope boundary and affects users outside the attacker's direct control. Technical details are described in the Red Hat Bugzilla #2548355 entry.
No verified public proof-of-concept code is available. See the vendor advisory for additional technical context.
Detection Methods for CVE-2026-107889
Indicators of Compromise
- Realm or client display field values containing HTML tags, <script> blocks, javascript: URIs, or event handler attributes such as onerror= and onload=.
- Audit log entries showing administrator updates to realm display name, client names, or theme-related configuration followed by anomalous login page content.
- Browser console errors or unexpected outbound requests from the Keycloak login page to attacker-controlled domains.
Detection Strategies
- Query the Keycloak admin REST API for all realms and clients, then scan returned string fields for HTML or script metacharacters.
- Enable and review Keycloak admin event logging for UPDATE_REALM, UPDATE_CLIENT, and theme configuration changes performed by privileged accounts.
- Deploy Content Security Policy (CSP) reporting on the login endpoint to surface script execution originating from inline sources.
Monitoring Recommendations
- Forward Keycloak admin and user event streams to a centralized SIEM for correlation of administrator changes with subsequent login anomalies.
- Alert on unexpected creation or modification of realm administrator accounts, as the vulnerability requires that privilege level.
- Monitor authentication success and failure patterns after administrative display field changes to catch session interference activity.
How to Mitigate CVE-2026-107889
Immediate Actions Required
- Apply the Keycloak security update referenced in the Red Hat CVE-2026-107889 Advisory as soon as a fixed build is available for your distribution.
- Audit all realm administrator accounts and remove unused or stale privileged users to shrink the exploitation surface.
- Inspect display fields across realms and clients, and remove any values containing HTML or script content.
Patch Information
Refer to the Red Hat CVE-2026-107889 Advisory and Red Hat Bugzilla #2548355 for fixed version information and errata links for Red Hat build of Keycloak and Red Hat Single Sign-On. Upstream Keycloak users should track project release notes for the corresponding patched release.
Workarounds
- Restrict realm administrator role assignments to a minimal set of trusted operators and enforce multi-factor authentication on those accounts.
- Deploy a strict Content Security Policy on the login page that disallows inline scripts and untrusted script sources.
- Place a web application firewall in front of the Keycloak login endpoint with rules that block responses containing suspected script payloads in display field positions.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

