Summary
GeoTools Remote Code Execution (RCE) vulnerability in evaluating XPath expressions
Remote Code Execution (RCE) is possible if an application uses certain GeoTools functionality to evaluate XPath expressions supplied by user input.
Details
The following methods pass XPath expressions to the commons-jxpath library which can execute arbitrary code and would be a security issue if the XPath expressions are provided by user input.
org.geotools.appschema.util.XmlXpathUtilites.getXPathValues(NamespaceSupport, String, Document)org.geotools.appschema.util.XmlXpathUtilites.countXPathNodes(NamespaceSupport, String, Document)org.geotools.appschema.util.XmlXpathUtilites.getSingleXPathValue(NamespaceSupport, String, Document)org.geotools.data.complex.expression.FeaturePropertyAccessorFactory.FeaturePropertyAccessor.get(Object, String, Class<T>)org.geotools.data.complex.expression.FeaturePropertyAccessorFactory.FeaturePropertyAccessor.set(Object, String, Object, Class)org.geotools.data.complex.expression.MapPropertyAccessorFactory.new PropertyAccessor() {...}.get(Object, String, Class<T>)org.geotools.xsd.StreamingParser.StreamingParser(Configuration, InputStream, String)
PoC
The following inputs to StreamingParser will delay the response by five seconds:
new org.geotools.xsd.StreamingParser(
new org.geotools.filter.v1_0.OGCConfiguration(),
new java.io.ByteArrayInputStream("<Filter></Filter>".getBytes()),
"java.lang.Thread.sleep(5000)")
.parse();
Mitigation
GeoTools can operate with reduced functionality by removing the gt-complex jar from your application. As an example of the impact application schema datastore would not function without the ability to use XPath expressions to query complex content.
The SourceForge download page lists drop-in-replacement jars for GeoTools: 31.1, 30.3, 30.2, 29.2, 28.2, 27.5, 27.4, 26.7, 26.4, 25.2, 24.0. These jars are for download only and are not available from maven central, intended to quickly provide a fix to affected applications.
References
https://github.com/geoserver/geoserver/security/advisories/GHSA-6jj6-gm7p-fcvv
https://osgeo-org.atlassian.net/browse/GEOT-7587
https://github.com/geotools/geotools/pull/4797
https://github.com/Warxim/CVE-2022-41852?tab=readme-ov-file#workaround-for-cve-2022-41852
Impact
This vulnerability can lead to executing arbitrary code.
CVE-2024-36404 has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (30.4, 31.2, 29.6, 28.6); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
org.geotools:gt-app-schema to 30.4 or later; org.geotools:gt-complex to 30.4 or later; org.geotools.xsd:gt-xsd-core to 30.4 or later; org.geotools:gt-app-schema to 31.2 or later; org.geotools:gt-complex to 31.2 or later; org.geotools.xsd:gt-xsd-core to 31.2 or later; org.geotools:gt-app-schema to 29.6 or later; org.geotools:gt-complex to 29.6 or later; org.geotools.xsd:gt-xsd-core to 29.6 or later; org.geotools:gt-app-schema to 28.6 or later; org.geotools:gt-complex to 28.6 or later; org.geotools.xsd:gt-xsd-core to 28.6 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2024-36404? CVE-2024-36404 is a critical-severity security vulnerability in org.geotools:gt-app-schema (maven), affecting versions >= 30.0, < 30.4. It is fixed in 30.4, 31.2, 29.6, 28.6.
- How severe is CVE-2024-36404? CVE-2024-36404 has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2024-36404?
org.geotools:gt-app-schema(maven) (versions >= 30.0, < 30.4)org.geotools:gt-complex(maven) (versions >= 30.0, < 30.4)org.geotools.xsd:gt-xsd-core(maven) (versions >= 30.0, < 30.4)
- Is there a fix for CVE-2024-36404? Yes. CVE-2024-36404 is fixed in 30.4, 31.2, 29.6, 28.6. Upgrade to this version or later.
- Is CVE-2024-36404 exploitable, and should I be worried? Whether CVE-2024-36404 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-36404 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-36404?
- Upgrade
org.geotools:gt-app-schemato 30.4 or later - Upgrade
org.geotools:gt-complexto 30.4 or later - Upgrade
org.geotools.xsd:gt-xsd-coreto 30.4 or later - Upgrade
org.geotools:gt-app-schemato 31.2 or later - Upgrade
org.geotools:gt-complexto 31.2 or later - Upgrade
org.geotools.xsd:gt-xsd-coreto 31.2 or later - Upgrade
org.geotools:gt-app-schemato 29.6 or later - Upgrade
org.geotools:gt-complexto 29.6 or later - Upgrade
org.geotools.xsd:gt-xsd-coreto 29.6 or later - Upgrade
org.geotools:gt-app-schemato 28.6 or later - Upgrade
org.geotools:gt-complexto 28.6 or later - Upgrade
org.geotools.xsd:gt-xsd-coreto 28.6 or later
- Upgrade