CVE-2026-37980
Received Received - Intake
Stored XSS in Keycloak Organization Login Allows Remote Attack

Publication date: 2026-04-14

Last updated on: 2026-04-14

Assigner: Red Hat, Inc.

Description
A flaw was found in Keycloak, specifically in the organization selection login page. A remote attacker with `manage-realm` or `manage-organizations` administrative privileges can exploit a Stored Cross-Site Scripting (XSS) vulnerability. This flaw occurs because the `organization.alias` is placed into an inline JavaScript `onclick` handler, allowing a crafted JavaScript payload to execute in a user's browser when they view the login page. Successful exploitation enables arbitrary JavaScript execution, potentially leading to session theft, unauthorized account actions, or further attacks against users of the affected realm.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-14
Last Modified
2026-04-14
Generated
2026-05-07
AI Q&A
2026-04-14
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
redhat keycloak *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability involves a Stored Cross-Site Scripting (XSS) flaw in the organization alias field on the Keycloak organization selection login page. Detection involves identifying if malicious JavaScript payloads have been injected into the organization.alias value.

To detect this on your system, you can inspect the organization aliases stored in your Keycloak database or configuration for suspicious JavaScript code or unusual characters that could be used in an XSS attack.

Since the vulnerability requires administrative privileges to inject the payload, monitoring logs for changes or additions to organization aliases by users with manage-realm or manage-organizations privileges can also help detect exploitation attempts.

There are no specific commands provided in the available resources, but general approaches include:

  • Query the Keycloak database or API for organization aliases containing suspicious script tags or JavaScript event handlers.
  • Use web application scanning tools or browser developer tools to inspect the organization selection login page for inline JavaScript code that includes unexpected or malicious payloads.
  • Monitor Keycloak server logs for administrative changes to organizations or realms that might indicate injection attempts.

How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The vulnerability allows arbitrary JavaScript execution in users' browsers, potentially leading to session theft and unauthorized account actions.

Such unauthorized access and data exposure could impact compliance with standards like GDPR and HIPAA, which require protection of user data and prevention of unauthorized access.

However, the provided information does not explicitly discuss compliance implications or specific regulatory impacts.


Can you explain this vulnerability to me?

CVE-2026-37980 is a Stored Cross-Site Scripting (XSS) vulnerability in Keycloak's organization selection login page. It occurs because the organization alias is inserted into an inline JavaScript onclick handler without proper escaping, allowing an attacker to inject malicious JavaScript code.

An attacker with administrative privileges (manage-realm or manage-organizations) can craft a JavaScript payload in the organization alias. When a user views the login page, this payload executes in their browser, potentially compromising their session or account.


How can this vulnerability impact me? :

This vulnerability allows arbitrary JavaScript execution in the context of users viewing the affected login page.

  • Session hijacking, where an attacker can steal user sessions.
  • Unauthorized account actions performed on behalf of the user.
  • Further attacks targeting users within the affected Keycloak realm.

What immediate steps should I take to mitigate this vulnerability?

This vulnerability can be mitigated by ensuring that the organization alias (organization.alias) is properly escaped before being inserted into inline JavaScript handlers to prevent execution of malicious scripts.

Since the vulnerability requires administrative privileges (manage-realm or manage-organizations) to inject the malicious payload, restricting and auditing these privileges can reduce risk.

Applying any available patches or updates from Keycloak that address this Stored Cross-Site Scripting (XSS) vulnerability is recommended.

Monitor and review organization aliases for suspicious or unexpected JavaScript code or characters that could indicate an attempted exploit.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart