CVE-2025-21621: GeoServer has a Reflected Cross-Site Scripting (XSS) vulnerability in its WMS GetFeatureInfo HTML format
Summary A 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 SLDBODY parameters. Details The WMS service setting that controls HTML auto-escaping is either disabled by default, or completely missing, in the affected versions (see workarounds).
Published Nov 25, 2025 · Updated Nov 27, 2025
Affected packages
org.geoserver.web:gs-web-app
- Ecosystem
- Maven
- Affected
- < 2.25.0
- Fixed in
- 2.25.0
- Check
mvn dependency:tree -Dincludes=org.geoserver.web:gs-web-app
org.geoserver:gs-wms
- Ecosystem
- Maven
- Affected
- < 2.25.0
- Fixed in
- 2.25.0
- Check
mvn dependency:tree -Dincludes=org.geoserver:gs-wms
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
A 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.
Details
The WMS service setting that controls HTML auto-escaping is either disabled by default, or completely missing, in the affected versions (see workarounds).
Impact
If 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:
- Perform any action within the application that the user can perform.
- View any information that the user is able to view.
- Modify any information that the user is able to modify.
- Initiate interactions with other application users, including malicious attacks, that will appear to originate from the initial victim user.
Workarounds
Changing any of the following WMS service settings should mitigate this vulnerability in most environments:
- Enable GetFeatureInfo HTML auto-escaping (available in GeoServer 2.21.3+ and 2.22.1+)
- Disable dynamic styling
- Disable GetFeatureInfo text/html MIME type
References
https://osgeo-org.atlassian.net/browse/GEOS-11297 https://github.com/geoserver/geoserver/pull/7406
Credited to sikeoka.
References
- https://github.com/geoserver/geoserver/security/advisories/GHSA-w66h-j855-qr72
- https://github.com/geoserver/geoserver/pull/7406
- https://osgeo-org.atlassian.net/browse/GEOS-11203
- https://osgeo-org.atlassian.net/browse/GEOS-11297
- https://nvd.nist.gov/vuln/detail/CVE-2025-21621
- https://github.com/geoserver/geoserver/commit/dc9ff1c726dd73c884437a123b4ad72b19383c7d
- https://github.com/advisories/GHSA-w66h-j855-qr72
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Maven vulnerabilities
All Maven entriesCVE-2024-45747
GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates
high7.2Aug 19, 2026CVE-2025-52465
GeoServer has an arbitrary file write vulnerability in its Master Password Dump Page
high7.2Jun 12, 2026CVE-2025-58175
GeoServer has a Server-Side Request Forgery (SSRF) Vulnerability in its XML Entity Resolution
medium6.5Jun 12, 2026CVE-2025-58360
GeoServer is vulnerable to Unauthenticated XML External Entities (XXE) attack via WMS GetMap feature
high8.2ExploitedNov 25, 2025CVE-2024-34711
GeoServer has improper ENTITY_RESOLUTION_ALLOWLIST URI validation in XML Processing (SSRF)
critical9.3Jun 10, 2025CVE-2024-38524
GWC Home Page communicate version and revision information
medium5.3Jun 10, 2025
