GHSA-755v-r4x4-qf7m: Keycloak core Cross-Site Scripting Vulnerability

MODERATE
CWE-80
Published
Advisory Summary

GHSA-755v-r4x4-qf7m is a MODERATE cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Keycloak core libraries in the Maven ecosystem. The issue involves stored cross-site scripting (xss) in keycloak via groups dropdown. Remediation is available by upgrading affected packages to version 20.0.0.

GHSA-755v-r4x4-qf7m at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-755v-r4x4-qf7m
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
Affected Product Keycloak core
Package Ecosystem Maven
Published Date
Last Updated

How to Fix GHSA-755v-r4x4-qf7m

To remediate this vulnerability, upgrade all affected Keycloak core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.keycloak:keycloak-core fixed: 20.0.0
<dependency>
    <groupId>org.keycloak</groupId>
    <artifactId>keycloak-core</artifactId>
    <version>20.0.0</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.keycloak

How to Check if You Are Affected

To determine whether your Java application is affected by GHSA-755v-r4x4-qf7m, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.keycloak

Analyze the terminal output to locate any version of Keycloak core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 20.0.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.keycloak command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Keycloak core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A Stored XSS vulnerability was reported in the Keycloak Security mailing list, affecting all the versions of Keycloak, including the latest release (16.0.1). The vulnerability allows a privileged attacker to execute malicious scripts in the admin console, abusing of the groups' dropdown functionality. ### Impact Successful attacks of this vulnerability can result a privileged attacker to load a XSS script, and steal data from other users. The impact can be considered moderate to low, considering privileged credentials are required. ### References - Please refer to the Keycloak Security mailing list for more information.

GHSA-755v-r4x4-qf7m Affected Keycloak core Versions

1 component(s)
Fixed Versions:
20.0.0
Product / Package Ecosystem Affected Versions Fixed Version
org.keycloak:keycloak-core
Maven
< 20.0.0
20.0.0

References

Frequently Asked Questions

What is GHSA-755v-r4x4-qf7m?
GHSA-755v-r4x4-qf7m is a security vulnerability in Keycloak core involving Stored Cross-Site Scripting (XSS) in Keycloak via groups dropdown under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS).
Which Keycloak core versions are affected?
Affected versions include releases prior to 20.0.0 across affected packages: org.keycloak:keycloak-core.
What version fixes GHSA-755v-r4x4-qf7m?
Upgrading to 20.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is keycloak-core affected?
Yes, org.keycloak:keycloak-core is affected in releases prior to 20.0.0. Upgrade your dependency to 20.0.0 or later.
What CWE is associated with GHSA-755v-r4x4-qf7m?
GHSA-755v-r4x4-qf7m is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.).
How can I check Maven dependencies for GHSA-755v-r4x4-qf7m?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.keycloak'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-755v-r4x4-qf7m",
  "modified" : "2022-11-29T23:55:23Z",
  "published" : "2022-11-29T23:55:23Z",
  "aliases" : [ ],
  "summary" : "Stored Cross-Site Scripting (XSS) in Keycloak via groups dropdown",
  "details" : "### Summary\n\nA Stored XSS vulnerability was reported in the Keycloak Security mailing list, affecting all the versions of Keycloak, including the latest release (16.0.1). The vulnerability allows a privileged attacker to execute malicious scripts in the admin console, abusing of the groups' dropdown functionality. \n\n### Impact\n\nSuccessful attacks of this vulnerability can result a privileged attacker to load a XSS script, and steal data from other users. The impact can be considered moderate to low, considering privileged credentials are required.\n\n### References\n- Please refer to the Keycloak Security mailing list for more information.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.keycloak:keycloak-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "20.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/keycloak/keycloak/security/advisories/GHSA-755v-r4x4-qf7m"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/keycloak/keycloak"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-80" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-29T23:55:23Z",
    "nvd_published_at" : null
  }
}