// For flags

CVE-2024-36401

OSGeo GeoServer GeoTools Eval Injection Vulnerability

Severity Score

9.8
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

12
*Multiple Sources

Exploited in Wild

Yes
*KEV

Decision

Act
*SSVC
Descriptions

GeoServer is an open source server that allows users to share and edit geospatial data. Prior to versions 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.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.

GeoServer es un servidor de código abierto que permite a los usuarios compartir y editar datos geoespaciales. Antes de las versiones 2.23.6, 2.24.4 y 2.25.2, varios parámetros de solicitud de OGC permitían la ejecución remota de código (RCE) por parte de usuarios no autenticados a través de entradas especialmente diseñadas en una instalación predeterminada de GeoServer debido a la evaluación insegura de nombres de propiedades como expresiones XPath. La API de la librería GeoTools a la que llama GeoServer evalúa los nombres de propiedades/atributos para tipos de entidades de una manera que los pasa de manera insegura a la librería commons-jxpath, que puede ejecutar código arbitrario al evaluar expresiones XPath. Esta evaluación XPath está destinada a ser utilizada únicamente por tipos de funciones complejas (es decir, almacenes de datos de esquemas de aplicación), pero también se aplica incorrectamente a tipos de funciones simples, lo que hace que esta vulnerabilidad se aplique a **TODAS** las instancias de GeoServer. No se proporciona ninguna PoC pública, pero se ha confirmado que esta vulnerabilidad es explotable a través de solicitudes WFS GetFeature, WFS GetPropertyValue, WMS GetMap, WMS GetFeatureInfo, WMS GetLegendGraphic y WPS Execute. Esta vulnerabilidad puede llevar a la ejecución de código arbitrario. Las versiones 2.23.6, 2.24.4 y 2.25.2 contienen un parche para el problema. Existe una workaround eliminando el archivo `gt-complex-xyjar` del GeoServer donde `xy` es la versión de GeoTools (por ejemplo, `gt-complex-31.1.jar` si ejecuta GeoServer 2.25.1). Esto eliminará el código vulnerable de GeoServer, pero puede interrumpir algunas funciones de GeoServer o evitar que GeoServer se implemente si se necesita el módulo gt-complex.

GeoServer is an open-source software server written in Java that provides the ability to view, edit, and share geospatial data. It is designed to be a flexible, efficient solution for distributing geospatial data from a variety of sources such as Geographic Information System (GIS) databases, web-based data, and personal datasets. In the GeoServer versions before 2.23.6, greater than or equal to 2.24.0, before 2.24.4 and greater than equal to 2.25.0, and before 2.25.1, 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. An attacker can abuse this by sending a POST request with a malicious xpath expression to execute arbitrary commands as root on the system.

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.

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
* Common Vulnerability Scoring System
SSVC
  • Decision:Act
Exploitation
Active
Automatable
Yes
Tech. Impact
Total
* Organization's Worst-case Scenario
Timeline
  • 2024-05-27 CVE Reserved
  • 2024-07-01 CVE Published
  • 2024-07-01 First Exploit
  • 2024-07-15 Exploited in Wild
  • 2024-08-05 KEV Due Date
  • 2024-08-10 EPSS Updated
  • 2024-08-19 CVE Updated
CWE
  • CWE-94: Improper Control of Generation of Code ('Code Injection')
  • CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Geoserver
Search vendor "Geoserver"
Geoserver
Search vendor "Geoserver" for product "Geoserver"
< 2.23.6
Search vendor "Geoserver" for product "Geoserver" and version " < 2.23.6"
-
Affected
Geoserver
Search vendor "Geoserver"
Geoserver
Search vendor "Geoserver" for product "Geoserver"
>= 2.24.0 < 2.24.4
Search vendor "Geoserver" for product "Geoserver" and version " >= 2.24.0 < 2.24.4"
-
Affected
Geoserver
Search vendor "Geoserver"
Geoserver
Search vendor "Geoserver" for product "Geoserver"
>= 2.25.0 < 2.25.2
Search vendor "Geoserver" for product "Geoserver" and version " >= 2.25.0 < 2.25.2"
-
Affected
Geotools
Search vendor "Geotools"
Geotools
Search vendor "Geotools" for product "Geotools"
< 29.6
Search vendor "Geotools" for product "Geotools" and version " < 29.6"
-
Affected
Geotools
Search vendor "Geotools"
Geotools
Search vendor "Geotools" for product "Geotools"
>= 30.0 < 30.4
Search vendor "Geotools" for product "Geotools" and version " >= 30.0 < 30.4"
-
Affected
Geotools
Search vendor "Geotools"
Geotools
Search vendor "Geotools" for product "Geotools"
>= 31.0 < 31.2
Search vendor "Geotools" for product "Geotools" and version " >= 31.0 < 31.2"
-
Affected