# CVE-2024-23821: GeoServer's GWC Demos Page vulnerable to Stored Cross-Site Scripting (XSS)

> An authenticated administrator can inject JavaScript into GeoServer's catalog, leading to stored XSS execution in other users' browsers via the GWC Demos Page.

- **Severity:** Medium 4.8 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 20 Mar 2024
- **Updated:** 10 Apr 2025
- **Also known as:** GHSA-88wc-fcj9-q3r9

## What is CVE-2024-23821?

CVE-2024-23821 is a medium-severity cross-site scripting vulnerability in geoserver, published on 20 Mar 2024. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

### Official description

GeoServer is an open source software server written in Java that allows users to share and edit geospatial data. A stored cross-site scripting (XSS) vulnerability exists in versions prior to 2.23.4 and 2.24.1 that enables an authenticated administrator with workspace-level privileges to store a JavaScript payload in the GeoServer catalog that will execute in the context of another user's browser when viewed in the GWC Demos Page.  Access to the GWC Demos Page is available to all users although data security may limit users' ability to trigger the XSS. Versions 2.23.4 and 2.24.1 contain a patch for this issue.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2024-23821?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.geoserver:gs-gwc` | Maven | All versions | 2.23.4 |
| `org.geoserver:gs-gwc` | Maven | All versions | 2.23.4 |
| `org.geoserver:gs-gwc` | Maven | From 2.24.0 | 2.24.1 |
| `org.geoserver:gs-gwc` | Maven | From 2.24.0 | 2.24.1 |

Products: Geoserver Geoserver.

## How do I fix CVE-2024-23821?

Upgrade org.geoserver:gs-gwc to a fixed version for your release line: 2.23.4 or 2.24.1.

## Is CVE-2024-23821 being exploited?

There is no known exploitation of CVE-2024-23821 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-2024-23821 and fix it if it is affected.

What it is: CVE-2024-23821 is a medium-severity cross-site scripting vulnerability in geoserver, published on 20 Mar 2024. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-23821 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.geoserver:gs-gwc (Maven): affected all versions; fixed in 2.23.4
- org.geoserver:gs-gwc (Maven): affected all versions; fixed in 2.23.4
- org.geoserver:gs-gwc (Maven): affected from 2.24.0; fixed in 2.24.1
- org.geoserver:gs-gwc (Maven): affected from 2.24.0; fixed in 2.24.1

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-2024-23821/ (Markdown: https://insights.sbomify.com/CVE-2024-23821/index.md)
```

## Sources

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

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