GHSA-m98g-63qj-fp8j: Keycloak parent Cross-Site Scripting Vulnerability

MODERATE
CWE-79
Published
Advisory Summary

GHSA-m98g-63qj-fp8j is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Keycloak parent libraries in the Maven ecosystem. The issue involves reflected xss on clients-registrations endpoint. Remediation is available by upgrading affected packages to version 18.0.0.

GHSA-m98g-63qj-fp8j at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-m98g-63qj-fp8j
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Keycloak parent
Package Ecosystem Maven
Published Date
Last Updated

How to Fix GHSA-m98g-63qj-fp8j

To remediate this vulnerability, upgrade all affected Keycloak parent 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-parent fixed: 18.0.0
<dependency>
    <groupId>org.keycloak</groupId>
    <artifactId>keycloak-parent</artifactId>
    <version>18.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-m98g-63qj-fp8j, 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 parent in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 18.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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where 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. In Keycloak parent, 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

A POST based reflected Cross Site Scripting vulnerability on has been identified in Keycloak. When a malicious request is sent to the client registration endpoint, the error message is not properly escaped, allowing an attacker to execute malicious scripts into the user's browser. ### Acknowledgement Keycloak would like to thank Quentin TEXIER (Pentester at Opencyber) for reporting this issue.

GHSA-m98g-63qj-fp8j Affected Keycloak parent Versions

1 component(s)
Fixed Versions:
18.0.0
Product / Package Ecosystem Affected Versions Fixed Version
org.keycloak:keycloak-parent
Maven
≥ 10.0.0
< 18.0.0
18.0.0

References

Frequently Asked Questions

What is GHSA-m98g-63qj-fp8j?
GHSA-m98g-63qj-fp8j is a security vulnerability in Keycloak parent involving Reflected XSS on clients-registrations endpoint under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Keycloak parent versions are affected?
Affected versions include releases prior to 18.0.0 across affected packages: org.keycloak:keycloak-parent.
What version fixes GHSA-m98g-63qj-fp8j?
Upgrading to 18.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is keycloak-parent affected?
Yes, org.keycloak:keycloak-parent is affected in releases prior to 18.0.0. Upgrade your dependency to 18.0.0 or later.
What CWE is associated with GHSA-m98g-63qj-fp8j?
GHSA-m98g-63qj-fp8j is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check Maven dependencies for GHSA-m98g-63qj-fp8j?
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-m98g-63qj-fp8j",
  "modified" : "2022-04-28T21:01:28Z",
  "published" : "2022-04-28T21:01:28Z",
  "aliases" : [ ],
  "summary" : "Reflected XSS on clients-registrations endpoint",
  "details" : "A POST based reflected Cross Site Scripting vulnerability on has been identified in Keycloak. When a malicious request is sent to the client registration endpoint, the error message is not properly escaped, allowing an attacker to execute malicious scripts into the user's browser.\n\n### Acknowledgement\n\nKeycloak would like to thank Quentin TEXIER (Pentester at Opencyber) for reporting this issue.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.keycloak:keycloak-parent"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "18.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/keycloak/keycloak/security/advisories/GHSA-m98g-63qj-fp8j"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/keycloak/keycloak"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-04-28T21:01:28Z",
    "nvd_published_at" : null
  }
}