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.
The GeoTools library, which GeoServer uses, processes property/attribute names of feature types in a way that unsafely passes them to the commons-jxpath library. This library can execute arbitrary code when evaluating XPath expressions. This mechanism was intended exclusively for complex feature types (Application Schema data stores), but is incorrectly applied to simple feature types as well, making the vulnerability affect ALL GeoServer instances. The exploit is possible through requests: WFS GetFeature, WFS GetPropertyValue, WMS GetMap, WMS GetFeatureInfo, WMS GetLegendGraphic, and WPS Execute.
An unauthenticated attacker can execute arbitrary code on the server, which in practice means complete system takeover, data exfiltration, modification of geospatial data, or lateral movement within the network.
GeoServer must be immediately updated to version 2.22.6, 2.23.6, 2.24.4, or 2.25.2 (depending on the branch in use). If an update is not possible immediately, a workaround is available consisting of removing the `gt-complex-x.y.jar` file from the GeoServer installation (e.g., `gt-complex-31.1.jar` for GeoServer 2.25.1) — note: this may limit functionality or prevent GeoServer from starting if the gt-complex module is required.
All default GeoServer installations in versions prior to 2.22.6, 2.23.6, 2.24.4, and 2.25.2, as well as the related GeoTools library (all versions before the patch release).
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HGeoserver
APPGeoserver2.23.0 – 2.23.6 (bez)2.24.0 – 2.24.4 (bez)2.25.0 – 2.25.2 (bez)< 2.22.6Geotools
APPGeotools30.031.031.1 – 31.2 (bez)30.1 – 30.4 (bez)< 29.6
CISA KEV — detailsi
- Vendori
- OSGeo
- Producti
- GeoServer
- Added to KEVi
- July 15, 2024
- Remediation deadline (US Federal)i
- August 5, 2024(overdue)
Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.
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.
Related vulnerabilities
XXE w GeoTools/GeoServer/GeoNetwork — podatność XML External Entity
GeoServer 2, in some configurations, allows remote attackers to execute arbitrary code via java.lang.Runtime.g...
GeoTools is an open source Java library that provides tools for geospatial data. GeoTools includes support for...
GeoServer is an open source server that allows users to share and edit geospatial data. From version 2.26.0 to...
GeoServer is an open source server that allows users to share and edit geospatial data. Prior to versions 2.23...