CVE-2024-36404
📋 TL;DR
This vulnerability in GeoTools allows remote code execution when applications process user-supplied XPath expressions. Attackers can execute arbitrary code on affected systems. Applications using GeoTools for geospatial data processing with XPath evaluation functionality are at risk.
💻 Affected Systems
- GeoTools
⚠️ Manual Verification Required
This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.
Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).
🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise allowing attacker to execute arbitrary commands, access sensitive data, and pivot to other systems.
Likely Case
Application compromise leading to data theft, service disruption, or lateral movement within the network.
If Mitigated
Limited impact if input validation prevents malicious XPath expressions or if affected functionality is disabled.
🎯 Exploit Status
Exploitation requires user input to reach XPath evaluation functions. Similar to CVE-2022-41852 exploitation patterns.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 31.2, 30.4, or 29.6
Vendor Advisory: https://github.com/geotools/geotools/security/advisories/GHSA-w3pj-wh35-fq8w
Restart Required: Yes
Instructions:
1. Update GeoTools dependency to version 31.2, 30.4, or 29.6. 2. Update pom.xml or build.gradle with new version. 3. Rebuild and redeploy application. 4. Restart application services.
🔧 Temporary Workarounds
Remove gt-complex jar
allDisables XPath expression evaluation functionality to prevent exploitation
Remove gt-complex-*.jar from application classpath or dependency management
Use patched jar from SourceForge
allDownload and use drop-in replacement jars for specific versions
Download from SourceForge and replace existing GeoTools jars
🧯 If You Can't Patch
- Implement strict input validation to reject or sanitize XPath expressions from user input
- Disable or restrict access to functionality using XPath evaluation
🔍 How to Verify
Check if Vulnerable:
Check GeoTools version in application dependencies. If using versions prior to 31.2, 30.4, or 29.6 and using XPath evaluation with user input, system is vulnerable.
Check Version:
Check pom.xml for <geotools.version> or run: java -cp geotools-*.jar org.geotools.Version
Verify Fix Applied:
Verify GeoTools version is 31.2, 30.4, or 29.6 in application dependencies and gt-complex jar is not present if using workaround.
📡 Detection & Monitoring
Log Indicators:
- Unusual XPath expression patterns
- Java process spawning unexpected child processes
- Errors in XPath evaluation
Network Indicators:
- Outbound connections from application to unexpected destinations
- Command and control traffic patterns
SIEM Query:
source="application.logs" AND ("XPath" OR "gt-complex") AND (error OR exception)
🔗 References
- https://github.com/Warxim/CVE-2022-41852?tab=readme-ov-file#workaround-for-cve-2022-41852
- https://github.com/geotools/geotools/commit/f0c9961dc4d40c5acfce2169fab92805738de5ea
- https://github.com/geotools/geotools/pull/4797
- https://github.com/geotools/geotools/security/advisories/GHSA-w3pj-wh35-fq8w
- https://osgeo-org.atlassian.net/browse/GEOT-7587
- https://sourceforge.net/projects/geotools/files/GeoTools%2024%20Releases/24.0/geotools-24.0-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2025%20Releases/25.2/geotools-25.2-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2026%20Releases/26.4
- https://sourceforge.net/projects/geotools/files/GeoTools%2026%20Releases/26.7/geotools-26.7-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2027%20Releases/27.4/geotools-27.4-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2027%20Releases/27.5/geotools-27.5-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2028%20Releases/28.2/geotools-28.2-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2029%20Releases/29.2/geotools-29.2-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2030%20Releases/30.2/geotools-30.2-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2030%20Releases/30.3/geotools-30.3-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2031%20Releases/31.1
- https://github.com/Warxim/CVE-2022-41852?tab=readme-ov-file#workaround-for-cve-2022-41852
- https://github.com/geotools/geotools/commit/f0c9961dc4d40c5acfce2169fab92805738de5ea
- https://github.com/geotools/geotools/pull/4797
- https://github.com/geotools/geotools/security/advisories/GHSA-w3pj-wh35-fq8w
- https://osgeo-org.atlassian.net/browse/GEOT-7587
- https://sourceforge.net/projects/geotools/files/GeoTools%2024%20Releases/24.0/geotools-24.0-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2025%20Releases/25.2/geotools-25.2-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2026%20Releases/26.4
- https://sourceforge.net/projects/geotools/files/GeoTools%2026%20Releases/26.7/geotools-26.7-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2027%20Releases/27.4/geotools-27.4-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2027%20Releases/27.5/geotools-27.5-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2028%20Releases/28.2/geotools-28.2-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2029%20Releases/29.2/geotools-29.2-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2030%20Releases/30.2/geotools-30.2-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2030%20Releases/30.3/geotools-30.3-patches.zip/download
- https://sourceforge.net/projects/geotools/files/GeoTools%2031%20Releases/31.1