CVE-2025-21621 GeoServer Reflected Cross-Site Scripting (XSS) vulnerability in WMS GetFeatureInfo HTML format

Medium 6.1 Published Updated

Remote attackers can execute arbitrary JavaScript in victims' browsers via crafted SLD_BODY parameters in GeoServer's WMS GetFeatureInfo HTML output.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-21621?

CVE-2025-21621 is a medium-severity cross-site scripting vulnerability in geoserver, published on 25 Nov 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

GeoServer is an open source server that allows users to share and edit geospatial data. Prior to version 2.25.0, 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. This issue has been patched in version 2.25.0.

Weakness: CWE-79

Which versions are affected by CVE-2025-21621?

4 open source packages ship an affected version, including org.geoserver.web:gs-web-app and org.geoserver:gs-wms. It affects 1 product.

PackageAffectedFixed in
org.geoserver.web:gs-web-app MavenAll versions2.25.0
org.geoserver.web:gs-web-app MavenAll versions2.25.0
org.geoserver:gs-wms MavenAll versions2.25.0
org.geoserver:gs-wms MavenAll versions2.25.0

Products include Geoserver Geoserver.

How do I fix CVE-2025-21621?

Upgrade org.geoserver.web:gs-web-app to 2.25.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2025-21621 being exploited?

There is no known exploitation of CVE-2025-21621 in the wild and no public exploit code.

Sources

Also known as GHSA-w66h-j855-qr72.

Is CVE-2025-21621 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free