# CVE-2024-36401: OSGeo GeoServer GeoTools Eval Injection

> Unauthenticated attackers can execute arbitrary code on GeoServer via crafted OGC requests due to unsafe XPath evaluation in property names.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 15 Jul 2024 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jul 2024
- **Updated:** 21 Oct 2025
- **Also known as:** GHSA-6jj6-gm7p-fcvv

## What is CVE-2024-36401?

CVE-2024-36401 is a critical code injection vulnerability in geoserver, published on 1 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

GeoServer is an open source server that allows users to share and edit geospatial data. Prior to versions 2.22.6, 2.23.6, 2.24.4, and 2.25.2, multiple OGC request parameters allow Remote Code Execution (RCE) by unauthenticated users through specially crafted input against a default GeoServer installation due to unsafely evaluating property names as XPath expressions.

The GeoTools library API that GeoServer calls evaluates property/attribute names for feature types in a way that unsafely passes them to the commons-jxpath library which can execute arbitrary code when evaluating XPath expressions. This XPath evaluation is intended to be used only by complex feature types (i.e., Application Schema data stores) but is incorrectly being applied to simple feature types as well which makes this vulnerability apply to **ALL** GeoServer instances. No public PoC is provided but this vulnerability has been confirmed to be exploitable through WFS GetFeature, WFS GetPropertyValue, WMS GetMap, WMS GetFeatureInfo, WMS GetLegendGraphic and WPS Execute requests. This vulnerability can lead to executing arbitrary code.

Versions 2.22.6, 2.23.6, 2.24.4, and 2.25.2 contain a patch for the issue. A workaround exists by removing the `gt-complex-x.y.jar` file from the GeoServer where `x.y` is the GeoTools version (e.g., `gt-complex-31.1.jar` if running GeoServer 2.25.1). This will remove the vulnerable code from GeoServer but may break some GeoServer functionality or prevent GeoServer from deploying if the gt-complex module is needed.

Weakness: CWE-94 (Improper Control of Generation of Code), CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code)

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

24 open source packages ship an affected version, including org.geoserver.web:gs-web-app, org.geoserver:gs-wfs and org.geoserver:gs-wms. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.geoserver.web:gs-web-app` | Maven | All versions | 2.22.6 |
| `org.geoserver.web:gs-web-app` | Maven | All versions | 2.22.6 |
| `org.geoserver.web:gs-web-app` | Maven | From 2.23.0 | 2.23.6 |
| `org.geoserver.web:gs-web-app` | Maven | From 2.23.0 | 2.23.6 |
| `org.geoserver.web:gs-web-app` | Maven | From 2.24.0 | 2.24.4 |
| `org.geoserver.web:gs-web-app` | Maven | From 2.24.0 | 2.24.4 |
| `org.geoserver.web:gs-web-app` | Maven | From 2.25.0 | 2.25.2 |
| `org.geoserver.web:gs-web-app` | Maven | From 2.25.0 | 2.25.2 |
| `org.geoserver:gs-wfs` | Maven | All versions | 2.22.6 |
| `org.geoserver:gs-wfs` | Maven | All versions | 2.22.6 |
| `org.geoserver:gs-wfs` | Maven | From 2.23.0 | 2.23.6 |
| `org.geoserver:gs-wfs` | Maven | From 2.23.0 | 2.23.6 |
| `org.geoserver:gs-wfs` | Maven | From 2.24.0 | 2.24.4 |
| `org.geoserver:gs-wfs` | Maven | From 2.24.0 | 2.24.4 |
| `org.geoserver:gs-wfs` | Maven | From 2.25.0 | 2.25.2 |
| `org.geoserver:gs-wfs` | Maven | From 2.25.0 | 2.25.2 |
| `org.geoserver:gs-wms` | Maven | All versions | 2.22.6 |
| `org.geoserver:gs-wms` | Maven | All versions | 2.22.6 |
| `org.geoserver:gs-wms` | Maven | From 2.23.0 | 2.23.6 |
| `org.geoserver:gs-wms` | Maven | From 2.23.0 | 2.23.6 |
| `org.geoserver:gs-wms` | Maven | From 2.24.0 | 2.24.4 |
| `org.geoserver:gs-wms` | Maven | From 2.24.0 | 2.24.4 |
| `org.geoserver:gs-wms` | Maven | From 2.25.0 | 2.25.2 |
| `org.geoserver:gs-wms` | Maven | From 2.25.0 | 2.25.2 |

Products: Geoserver Geoserver, Geotools Geotools.

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

Upgrade org.geoserver.web:gs-web-app to a fixed version for your release line: 2.22.6, 2.23.6, 2.24.4 or 2.25.2. US federal agencies must fix it by 5 Aug 2024.

## Is CVE-2024-36401 being exploited?

Yes. Attackers have exploited CVE-2024-36401 in the wild since at least 15 Jul 2024.

Public exploit code:

- GeoServer（CVE-2024-36401/CVE-2024-36404）漏洞利用工具 (github_poc): https://github.com/whitebear-ch/GeoServerExploit
- GeoServer Remote Code Execution (github_poc): https://github.com/Chocapikk/CVE-2024-36401
- Remote Code Execution (RCE) Vulnerability In Evaluating Property Name Expressions with multies ways to exploit (github_poc): https://github.com/Mr-xn/CVE-2024-36401
- geoserver CVE-2024-36401漏洞利用工具 (github_poc): https://github.com/ahisec/geoserver-
- CVE-2024-36401 图形化利用工具，支持各个JDK版本利用以及回显、内存马实现 (github_poc): https://github.com/bmth666/GeoServer-Tools-CVE-2024-36401
- POC for CVE-2024-36401. This POC will attempt to establish a reverse shell from the vlun targets. (github_poc): https://github.com/bigb0x/CVE-2024-36401

## Other vulnerabilities in geoserver

- [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)
- [CVE-2023-51444](https://insights.sbomify.com/CVE-2023-51444/): GeoServer arbitrary file upload vulnerability in REST Coverage Store API (high 7.2)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-36401 and fix it if it is affected.

What it is: CVE-2024-36401 is a critical code injection vulnerability in geoserver, published on 1 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2024-36401 in the wild since at least 15 Jul 2024.

Affected packages and fixed versions:
- org.geoserver.web:gs-web-app (Maven): affected all versions; fixed in 2.22.6
- org.geoserver.web:gs-web-app (Maven): affected all versions; fixed in 2.22.6
- org.geoserver.web:gs-web-app (Maven): affected from 2.23.0; fixed in 2.23.6
- org.geoserver.web:gs-web-app (Maven): affected from 2.23.0; fixed in 2.23.6
- org.geoserver.web:gs-web-app (Maven): affected from 2.24.0; fixed in 2.24.4
- org.geoserver.web:gs-web-app (Maven): affected from 2.24.0; fixed in 2.24.4
- org.geoserver.web:gs-web-app (Maven): affected from 2.25.0; fixed in 2.25.2
- org.geoserver.web:gs-web-app (Maven): affected from 2.25.0; fixed in 2.25.2
- org.geoserver:gs-wfs (Maven): affected all versions; fixed in 2.22.6
- org.geoserver:gs-wfs (Maven): affected all versions; fixed in 2.22.6
- org.geoserver:gs-wfs (Maven): affected from 2.23.0; fixed in 2.23.6
- org.geoserver:gs-wfs (Maven): affected from 2.23.0; fixed in 2.23.6

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

## Sources

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

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