{"answers":{"affected":"24 open source packages ship an affected version, including org.geotools.xsd:gt-xsd-core, org.geotools:gt-app-schema and org.geotools:gt-complex.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-36404 exists.","fix":"Upgrade org.geotools.xsd:gt-xsd-core to a fixed version for your release line: 28.6, 29.6, 30.4 or 31.2.","what":"CVE-2024-36404 is a critical code injection vulnerability in geotools, published on 2 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-36404 and fix it if it is affected.\n\nWhat it is: CVE-2024-36404 is a critical code injection vulnerability in geotools, published on 2 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-36404 exists.\n\nAffected packages and fixed versions:\n- org.geotools.xsd:gt-xsd-core (Maven): affected all versions; fixed in 28.6\n- org.geotools.xsd:gt-xsd-core (Maven): affected all versions; fixed in 28.6\n- org.geotools.xsd:gt-xsd-core (Maven): affected from 29.0; fixed in 29.6\n- org.geotools.xsd:gt-xsd-core (Maven): affected from 29.0; fixed in 29.6\n- org.geotools.xsd:gt-xsd-core (Maven): affected from 30.0; fixed in 30.4\n- org.geotools.xsd:gt-xsd-core (Maven): affected from 30.0; fixed in 30.4\n- org.geotools.xsd:gt-xsd-core (Maven): affected from 31.0; fixed in 31.2\n- org.geotools.xsd:gt-xsd-core (Maven): affected from 31.0; fixed in 31.2\n- org.geotools:gt-app-schema (Maven): affected all versions; fixed in 28.6\n- org.geotools:gt-app-schema (Maven): affected all versions; fixed in 28.6\n- org.geotools:gt-app-schema (Maven): affected from 29.0; fixed in 29.6\n- org.geotools:gt-app-schema (Maven): affected from 29.0; fixed in 29.6\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-36404/ (Markdown: https://insights.sbomify.com/CVE-2024-36404/index.md)","id":"CVE-2024-36404","markdown":"https://insights.sbomify.com/CVE-2024-36404/index.md","name":"CVE-2024-36404","record":{"aliases":["GHSA-w3pj-wh35-fq8w"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Java geospatial library","requires_auth":"none","summary":"Attackers can execute arbitrary code via XPath injection in GeoTools if user input is evaluated, requiring library upgrades or removal of the gt-complex module.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-95","name":"Improper Neutralization of Directives in Dynamically Evaluated Code"}],"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.","ecosystems":["Maven"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":1,"refs":[{"date":null,"kind":"nuclei","ref":"http/cves/2024/CVE-2024-36404.yaml","stars":null,"title":"GeoServer and GeoTools - Remote Code Execution"}],"tier":"weaponised"},"has_fix":true,"headline":"GeoTools Remote Code Execution (RCE) vulnerability in evaluating XPath expressions","id":"CVE-2024-36404","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"code_injection","year":"2024"},"n_packages":24,"n_references":16,"next":{"headline":"Information disclosure in liboqs","id":"CVE-2024-36405"},"packages":[{"ecosystem":"Maven","fixed":["28.6"],"introduced":["0"],"last_affected":[],"package":"org.geotools.xsd:gt-xsd-core","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["28.6"],"introduced":["0"],"last_affected":[],"package":"org.geotools.xsd:gt-xsd-core","purl":"pkg:maven/org.geotools.xsd/gt-xsd-core","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["29.6"],"introduced":["29.0"],"last_affected":[],"package":"org.geotools.xsd:gt-xsd-core","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["29.6"],"introduced":["29.0"],"last_affected":[],"package":"org.geotools.xsd:gt-xsd-core","purl":"pkg:maven/org.geotools.xsd/gt-xsd-core","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["30.4"],"introduced":["30.0"],"last_affected":[],"package":"org.geotools.xsd:gt-xsd-core","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["30.4"],"introduced":["30.0"],"last_affected":[],"package":"org.geotools.xsd:gt-xsd-core","purl":"pkg:maven/org.geotools.xsd/gt-xsd-core","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["31.2"],"introduced":["31.0"],"last_affected":[],"package":"org.geotools.xsd:gt-xsd-core","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["31.2"],"introduced":["31.0"],"last_affected":[],"package":"org.geotools.xsd:gt-xsd-core","purl":"pkg:maven/org.geotools.xsd/gt-xsd-core","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["28.6"],"introduced":["0"],"last_affected":[],"package":"org.geotools:gt-app-schema","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["28.6"],"introduced":["0"],"last_affected":[],"package":"org.geotools:gt-app-schema","purl":"pkg:maven/org.geotools/gt-app-schema","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["29.6"],"introduced":["29.0"],"last_affected":[],"package":"org.geotools:gt-app-schema","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["29.6"],"introduced":["29.0"],"last_affected":[],"package":"org.geotools:gt-app-schema","purl":"pkg:maven/org.geotools/gt-app-schema","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["30.4"],"introduced":["30.0"],"last_affected":[],"package":"org.geotools:gt-app-schema","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["30.4"],"introduced":["30.0"],"last_affected":[],"package":"org.geotools:gt-app-schema","purl":"pkg:maven/org.geotools/gt-app-schema","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["31.2"],"introduced":["31.0"],"last_affected":[],"package":"org.geotools:gt-app-schema","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["31.2"],"introduced":["31.0"],"last_affected":[],"package":"org.geotools:gt-app-schema","purl":"pkg:maven/org.geotools/gt-app-schema","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["28.6"],"introduced":["0"],"last_affected":[],"package":"org.geotools:gt-complex","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["28.6"],"introduced":["0"],"last_affected":[],"package":"org.geotools:gt-complex","purl":"pkg:maven/org.geotools/gt-complex","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["29.6"],"introduced":["29.0"],"last_affected":[],"package":"org.geotools:gt-complex","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["29.6"],"introduced":["29.0"],"last_affected":[],"package":"org.geotools:gt-complex","purl":"pkg:maven/org.geotools/gt-complex","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["30.4"],"introduced":["30.0"],"last_affected":[],"package":"org.geotools:gt-complex","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["30.4"],"introduced":["30.0"],"last_affected":[],"package":"org.geotools:gt-complex","purl":"pkg:maven/org.geotools/gt-complex","source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["31.2"],"introduced":["31.0"],"last_affected":[],"package":"org.geotools:gt-complex","purl":null,"source":"GHSA-w3pj-wh35-fq8w"},{"ecosystem":"Maven","fixed":["31.2"],"introduced":["31.0"],"last_affected":[],"package":"org.geotools:gt-complex","purl":"pkg:maven/org.geotools/gt-complex","source":"GHSA-w3pj-wh35-fq8w"}],"prev":{"headline":"Denial of service/high operating costs through unauthenticated downloads in Matrix Media Repo","id":"CVE-2024-36403"},"products":["geotools"],"published":"2024-07-02","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"attribution","licence":"MIT","name":"Nuclei templates"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-08-02","vendors":["geotools"]},"summary":"Attackers can execute arbitrary code via XPath injection in GeoTools if user input is evaluated, requiring library upgrades or removal of the gt-complex module.","url":"https://insights.sbomify.com/CVE-2024-36404/"}