CVE-2024-36404
GeoTools Remote Code Execution (RCE) vulnerability in evaluating XPath expressions
Check your servers for CVE-2024-36404
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-36404 affects geotools, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
GeoTools is an open source Java library that provides tools for geospatial data. Prior to versions 31.2, 30.4, and 29.6, Remote Code Execution (RCE) is possible if an application uses certain GeoTools functionality to evaluate XPath expressions supplied by user input. Versions 31.2, 30.4, and 29.6 contain a fix for this issue. As a workaround, GeoTools can operate with reduced functionality by removing the `gt-complex` jar from one's application. As an example of the impact, application schema `datastore` would not function without the ability to use XPath expressions to query complex content. Alternatively, one may utilize a drop-in replacement GeoTools jar from SourceForge for versions 31.1, 30.3, 30.2, 29.2, 28.2, 27.5, 27.4, 26.7, 26.4, 25.2, and 24.0. These jars are for download only and are not available from maven central, intended to quickly provide a fix to affected applications.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 23.2%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 98.2% of all scored CVEs. Scores of 30 Nov 2026.
The assessment of CISA (SSVC, 12 Jul 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- yes: an attacker can automate the attack across many targets
- Technical impact
- total: full control of the component or of its data
Weakness
- CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code
Affected products
As the CNA lists them.
Is my server affected?
Find the installed version of geotools and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i geotools
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2024-36404 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2024-36404RHEL, Rocky, Alma, Fedora
rpm -q geotools
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2024-36404Alpine
apk list --installed | grep -i geotoolsWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-36404
trivy image --scanners vuln IMAGE | grep CVE-2024-36404
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
Other references
- https://github.com/geotools/geotools/pull/4797 github.com
- https://github.com/geotools/geotools/commit/f0c9961dc4d40c5acfce2169fab92805738de5ea github.com
- https://github.com/Warxim/CVE-2022-41852?tab=readme-ov-file#workaround-for-cve-2022-41852 github.com
- https://osgeo-org.atlassian.net/browse/GEOT-7587 osgeo-org.atlassian.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2024%20Releases/24.0/geotools-24.0-patches.zip/download sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2025%20Releases/25.2/geotools-25.2-patches.zip/download sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2026%20Releases/26.4 sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2026%20Releases/26.7/geotools-26.7-patches.zip/download sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2027%20Releases/27.4/geotools-27.4-patches.zip/download sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2027%20Releases/27.5/geotools-27.5-patches.zip/download sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2028%20Releases/28.2/geotools-28.2-patches.zip/download sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2029%20Releases/29.2/geotools-29.2-patches.zip/download sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2030%20Releases/30.2/geotools-30.2-patches.zip/download sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2030%20Releases/30.3/geotools-30.3-patches.zip/download sourceforge.net
- https://sourceforge.net/projects/geotools/files/GeoTools%2031%20Releases/31.1 sourceforge.net
Source: the record CVE-2024-36404 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse