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

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

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **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:** Yes
- **Published:** 25 Nov 2025
- **Updated:** 26 Nov 2025
- **Also known as:** GHSA-w66h-j855-qr72

## 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 (Improper Neutralization of Input During Web Page Generation)

## 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.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.geoserver.web:gs-web-app` | Maven | All versions | 2.25.0 |
| `org.geoserver.web:gs-web-app` | Maven | All versions | 2.25.0 |
| `org.geoserver:gs-wms` | Maven | All versions | 2.25.0 |
| `org.geoserver:gs-wms` | Maven | All versions | 2.25.0 |

Products: Geoserver Geoserver.

## How do I fix CVE-2025-21621?

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

## Is CVE-2025-21621 being exploited?

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

## Other vulnerabilities in geoserver

- [CVE-2024-36401](https://insights.sbomify.com/CVE-2024-36401/): OSGeo GeoServer GeoTools Eval Injection (critical 9.8, exploited in the wild)
- [CVE-2025-58360](https://insights.sbomify.com/CVE-2025-58360/): OSGeo GeoServer Improper Restriction of XML External Entity Reference (high 8.2, exploited in the wild)
- [CVE-2023-35042](https://insights.sbomify.com/CVE-2023-35042/): GeoServer RCE due to improper control of generation of code in jai-ext`Jiffle` map algebra language (critical 9.8)
- [CVE-2024-24749](https://insights.sbomify.com/CVE-2024-24749/): Classpath resource disclosure in GWC Web Resource API on Windows / Tomcat (high 7.5)
- [CVE-2023-41877](https://insights.sbomify.com/CVE-2023-41877/): GeoServer log file path traversal vulnerability (high 7.2)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-21621 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2025-21621 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.geoserver.web:gs-web-app (Maven): affected all versions; fixed in 2.25.0
- org.geoserver.web:gs-web-app (Maven): affected all versions; fixed in 2.25.0
- org.geoserver:gs-wms (Maven): affected all versions; fixed in 2.25.0
- org.geoserver:gs-wms (Maven): affected all versions; fixed in 2.25.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-21621/ (Markdown: https://insights.sbomify.com/CVE-2025-21621/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-21621
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-21621
- OSV: https://osv.dev/vulnerability/CVE-2025-21621

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-21621/
Summaries are generated and may contain mistakes; the official description above is the record.
