CVE-2025-21621: Gs web app Cross-Site Scripting Vulnerability
MODERATECVE-2025-21621 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Gs web app libraries in the Maven ecosystem. The issue involves geoserver has a reflected cross-site scripting (xss) vulnerability in its wms getfeatureinfo html format. Remediation is available by upgrading affected packages to version 2.25.0.
CVE-2025-21621 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2025-21621
To remediate this vulnerability, upgrade all affected Gs web app dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.geoserver.web</groupId>
<artifactId>gs-web-app</artifactId>
<version>2.25.0</version>
</dependency>
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>gs-wms</artifactId>
<version>2.25.0</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.geoserver.web
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2025-21621, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.geoserver.web
Analyze the terminal output to locate any version of Gs web app in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.25.0), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.geoserver.web 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 Gs web app, 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
CVE-2025-21621 Affected Gs web app Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.geoserver.web:gs-web-app
|
Maven |
< 2.25.0
|
2.25.0
|
|
org.geoserver:gs-wms
|
Maven |
< 2.25.0
|
2.25.0
|
References
Frequently Asked Questions
What is CVE-2025-21621?
Which Gs web app versions are affected?
What version fixes CVE-2025-21621?
Is gs-web-app affected?
Is gs-wms affected?
What is the CVSS score of CVE-2025-21621?
What CWE is associated with CVE-2025-21621?
How can I check Maven dependencies for CVE-2025-21621?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w66h-j855-qr72",
"modified" : "2025-11-27T09:00:13Z",
"published" : "2025-11-25T18:41:53Z",
"aliases" : [ "CVE-2025-21621" ],
"summary" : "GeoServer has a Reflected Cross-Site Scripting (XSS) vulnerability in its WMS GetFeatureInfo HTML format",
"details" : "### Summary\nA reflected cross-site scripting (XSS) vulnerability exists in the WMS GetFeatureInfo HTML output format that enables a remote attacker to execute arbitrary JavaScript code in a victim's browser through specially crafted SLD_BODY parameters. \n\n### Details\n\nThe WMS service setting that controls HTML auto-escaping is either disabled by default, or completely missing, in the affected versions (see workarounds).\n\n### Impact\n\nIf an attacker can control a script that is executed in the victim's browser, then they can typically fully compromise that user. Amongst other things, the attacker can:\n1. Perform any action within the application that the user can perform.\n2. View any information that the user is able to view.\n3. Modify any information that the user is able to modify.\n4. Initiate interactions with other application users, including malicious attacks, that will appear to originate from the initial victim user.\n\n### Workarounds\nChanging any of the following WMS service settings should mitigate this vulnerability in most environments:\n1. Enable GetFeatureInfo HTML auto-escaping (available in GeoServer 2.21.3+ and 2.22.1+)\n2. Disable dynamic styling\n3. Disable GetFeatureInfo text/html MIME type\n\n### References\nhttps://osgeo-org.atlassian.net/browse/GEOS-11297\nhttps://github.com/geoserver/geoserver/pull/7406",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.geoserver.web:gs-web-app"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.25.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.geoserver:gs-wms"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.25.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/geoserver/geoserver/security/advisories/GHSA-w66h-j855-qr72"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-21621"
}, {
"type" : "WEB",
"url" : "https://github.com/geoserver/geoserver/pull/7406"
}, {
"type" : "WEB",
"url" : "https://github.com/geoserver/geoserver/commit/dc9ff1c726dd73c884437a123b4ad72b19383c7d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/geoserver/geoserver"
}, {
"type" : "WEB",
"url" : "https://osgeo-org.atlassian.net/browse/GEOS-11203"
}, {
"type" : "WEB",
"url" : "https://osgeo-org.atlassian.net/browse/GEOS-11297"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-11-25T18:41:53Z",
"nvd_published_at" : "2025-11-25T22:15:47Z"
}
}