CVEs / CVE-2024-36401
CVE-2024-36401: OSGeo GeoServer GeoTools Eval Injection Vulnerability
- Known exploited in the CISA KEV catalog since 15 Jul 2024
- critical 9.8 CVSS 3.1 (NVD)
- EPSS 99.8% chance of exploitation in the next 30 days, higher than 99% of CVEs (30 Oct 2026)
- Last changed at its sources
Are you affected? Check your servers with Stackurity: it lists the software on each server and the vulnerabilities to fix first.
Check your servers with Stackurity Already using Stackurity? Search for CVE-2024-36401
Summary
OSGeo GeoServer GeoTools contains an improper neutralization of directives in dynamically evaluated code vulnerability due to unsafely evaluating property names as XPath expressions. This allows unauthenticated attackers to conduct remote code execution via specially crafted input.
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.
Affected and fixed versions
| Product | Affected | Fixed in |
|---|---|---|
| geoserver geoserver | >= 2.23.0, < 2.23.6 | — |
| geoserver geoserver | >= 2.24.0, < 2.24.4 | — |
| geoserver geoserver | >= 2.25.0, < 2.25.2 | — |
| geoserver geoserver | < 2.22.6 | — |
| geoserver geoserver | before 2.23.6 | 2.23.6 |
| geoserver geoserver | from 2.24.0, before 2.24.4 | 2.24.4 |
| geoserver geoserver | from 2.25.0, before 2.25.2 | 2.25.2 |
| Product | Affected | Fixed in |
|---|---|---|
| org.geoserver.web:gs-web-app (Maven) | from 2.24.0, before 2.24.4 | 2.24.4 |
| org.geoserver:gs-wfs (Maven) | from 2.24.0, before 2.24.4 | 2.24.4 |
| org.geoserver:gs-wms (Maven) | from 2.24.0, before 2.24.4 | 2.24.4 |
| org.geoserver.web:gs-web-app (Maven) | from 2.25.0, before 2.25.2 | 2.25.2 |
| org.geoserver:gs-wfs (Maven) | from 2.25.0, before 2.25.2 | 2.25.2 |
| org.geoserver:gs-wms (Maven) | from 2.25.0, before 2.25.2 | 2.25.2 |
| org.geoserver.web:gs-web-app (Maven) | from 2.23.0, before 2.23.6 | 2.23.6 |
| org.geoserver:gs-wfs (Maven) | from 2.23.0, before 2.23.6 | 2.23.6 |
| org.geoserver:gs-wms (Maven) | from 2.23.0, before 2.23.6 | 2.23.6 |
| org.geoserver.web:gs-web-app (Maven) | before 2.22.6 | 2.22.6 |
| org.geoserver:gs-wfs (Maven) | before 2.22.6 | 2.22.6 |
| org.geoserver:gs-wms (Maven) | before 2.22.6 | 2.22.6 |
| org.geotools:gt-app-schema (Maven) | from 30.0, before 30.4 | 30.4 |
| org.geotools:gt-complex (Maven) | from 30.0, before 30.4 | 30.4 |
| org.geotools.xsd:gt-xsd-core (Maven) | from 30.0, before 30.4 | 30.4 |
| org.geotools:gt-app-schema (Maven) | from 31.0, before 31.2 | 31.2 |
| org.geotools:gt-complex (Maven) | from 31.0, before 31.2 | 31.2 |
| org.geotools.xsd:gt-xsd-core (Maven) | from 31.0, before 31.2 | 31.2 |
| org.geotools:gt-app-schema (Maven) | from 29.0, before 29.6 | 29.6 |
| org.geotools:gt-complex (Maven) | from 29.0, before 29.6 | 29.6 |
| org.geotools.xsd:gt-xsd-core (Maven) | from 29.0, before 29.6 | 29.6 |
| org.geotools:gt-app-schema (Maven) | before 28.6 | 28.6 |
| org.geotools:gt-complex (Maven) | before 28.6 | 28.6 |
| org.geotools.xsd:gt-xsd-core (Maven) | before 28.6 | 28.6 |
Package versions from GHSA-6jj6-gm7p-fcvv, GHSA-w3pj-wh35-fq8w.
Exploitation
| In CISA KEV since | 15 Jul 2024 |
|---|---|
| Due date for US federal agencies | 5 Aug 2024 |
| Used in ransomware campaigns | Unknown |
| Required action | Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable. |
Severity
| CVSS 3.1 | 9.8 criticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HScored by NVD |
|---|---|
| Weakness | CWE-95, CWE-94 |
References
- CVE-2024-36401 on NVD
- CVE-2024-36401 in the CISA KEV catalog
- https://github.com/geoserver/geoserver/security/advisories/GHSA-6jj6-gm7p-fcvv (cited by CISA)
- https://github.com/geotools/geotools/pull/4797 (cited by CISA)
- CVE-2024-36401 on OSV
- https://github.com/Warxim/CVE-2022-41852?tab=readme-ov-file#workaround-for-cve-2022-41852 Exploit, Third Party Advisory
- https://github.com/geoserver/geoserver/security/advisories/GHSA-6jj6-gm7p-fcvv Mitigation, Vendor Advisory
- https://github.com/geotools/geotools/pull/4797 Issue Tracking, Patch
- https://github.com/geotools/geotools/security/advisories/GHSA-w3pj-wh35-fq8w Exploit, Vendor Advisory
- https://osgeo-org.atlassian.net/browse/GEOT-7587 Vendor Advisory
- https://www.vicarius.io/vsociety/posts/geoserver-rce-cve-2024-36401 Exploit, Third Party Advisory
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-36401 US Government Resource
Sources
Exploitation status from the CISA Known Exploited Vulnerabilities catalog. EPSS scores from FIRST. Descriptions, severity and references from the National Vulnerability Database. Open-source package versions from OSV (CC-BY 4.0). Text is shown as each source states it; Stackurity does not edit it. Check the vendor's advisory before acting.
This product uses data from the NVD API but is not endorsed or certified by the NVD.