{"answers":{"affected":"10 open source packages ship an affected version, including org.geotools:gt-jdbc. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-25158 in the wild and no public exploit code.","fix":"Upgrade org.geotools:gt-jdbc to a fixed version for your release line: 24.7, 25.7, 26.7 or 27.4.","what":"CVE-2023-25158 is a critical SQL injection vulnerability in geotools, published on 21 Feb 2023. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-25158 and fix it if it is affected.\n\nWhat it is: CVE-2023-25158 is a critical SQL injection vulnerability in geotools, published on 21 Feb 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2023-25158 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- org.geotools:gt-jdbc (Maven): affected all versions; fixed in 24.7\n- org.geotools:gt-jdbc (Maven): affected all versions; fixed in 24.7\n- org.geotools:gt-jdbc (Maven): affected from 25.0; fixed in 25.7\n- org.geotools:gt-jdbc (Maven): affected from 25.0; fixed in 25.7\n- org.geotools:gt-jdbc (Maven): affected from 26.0; fixed in 26.7\n- org.geotools:gt-jdbc (Maven): affected from 26.0; fixed in 26.7\n- org.geotools:gt-jdbc (Maven): affected from 27.0; fixed in 27.4\n- org.geotools:gt-jdbc (Maven): affected from 27.0; fixed in 27.4\n- org.geotools:gt-jdbc (Maven): affected from 28.0; fixed in 28.2\n- org.geotools:gt-jdbc (Maven): affected from 28.0; fixed in 28.2\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-2023-25158/ (Markdown: https://insights.sbomify.com/CVE-2023-25158/index.md)","id":"CVE-2023-25158","markdown":"https://insights.sbomify.com/CVE-2023-25158/index.md","name":"CVE-2023-25158","record":{"aliases":["GHSA-99c3-qc2q-p94m"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"Java geospatial library","requires_auth":"none","summary":"Attackers can execute arbitrary SQL commands via OGC Filters in GeoTools JDBCDataStore implementations, potentially reading or modifying database contents.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"geotools","vendor":"geotools"}],"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-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"description":"GeoTools is an open source Java library that provides tools for geospatial data. GeoTools includes support for OGC Filter expression language parsing, encoding and execution against a range of datastore. SQL Injection Vulnerabilities have been found when executing OGC Filters with JDBCDataStore implementations. Users are advised to upgrade to either version 27.4 or to 28.2 to resolve this issue. Users unable to upgrade may disable `encode functions` for PostGIS DataStores or enable `prepared statements` for JDBCDataStores as a partial mitigation.","ecosystems":["Maven"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Unfiltered SQL Injection in Geotools","id":"CVE-2023-25158","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"sql_injection","year":"2023"},"n_packages":10,"n_references":2,"next":{"headline":"Nextcloud Server previews are accessible without a watermark","id":"CVE-2023-25159"},"packages":[{"ecosystem":"Maven","fixed":["24.7"],"introduced":["0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":null,"source":"GHSA-99c3-qc2q-p94m"},{"ecosystem":"Maven","fixed":["24.7"],"introduced":["0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":"pkg:maven/org.geotools/gt-jdbc","source":"GHSA-99c3-qc2q-p94m"},{"ecosystem":"Maven","fixed":["25.7"],"introduced":["25.0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":null,"source":"GHSA-99c3-qc2q-p94m"},{"ecosystem":"Maven","fixed":["25.7"],"introduced":["25.0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":"pkg:maven/org.geotools/gt-jdbc","source":"GHSA-99c3-qc2q-p94m"},{"ecosystem":"Maven","fixed":["26.7"],"introduced":["26.0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":null,"source":"GHSA-99c3-qc2q-p94m"},{"ecosystem":"Maven","fixed":["26.7"],"introduced":["26.0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":"pkg:maven/org.geotools/gt-jdbc","source":"GHSA-99c3-qc2q-p94m"},{"ecosystem":"Maven","fixed":["27.4"],"introduced":["27.0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":null,"source":"GHSA-99c3-qc2q-p94m"},{"ecosystem":"Maven","fixed":["27.4"],"introduced":["27.0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":"pkg:maven/org.geotools/gt-jdbc","source":"GHSA-99c3-qc2q-p94m"},{"ecosystem":"Maven","fixed":["28.2"],"introduced":["28.0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":null,"source":"GHSA-99c3-qc2q-p94m"},{"ecosystem":"Maven","fixed":["28.2"],"introduced":["28.0"],"last_affected":[],"package":"org.geotools:gt-jdbc","purl":"pkg:maven/org.geotools/gt-jdbc","source":"GHSA-99c3-qc2q-p94m"}],"prev":{"headline":"Unfiltered SQL Injection Vulnerabilities in Geoserver","id":"CVE-2023-25157"},"products":["geotools"],"published":"2023-02-21","related":[{"cvss_score":9.9,"headline":"GeoTools, GeoServer, and GeoNetwork XML External Entity (XXE) Processing Vulnerability in XSD schema handling","id":"CVE-2025-30220","kev_date_added":null,"published":"2025-06-10"},{"cvss_score":8.2,"headline":"Unchecked JNDI lookups in GeoTools","id":"CVE-2022-24818","kev_date_added":null,"published":"2022-04-13"}],"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":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-03-10","vendors":["geotools"]},"summary":"Attackers can execute arbitrary SQL commands via OGC Filters in GeoTools JDBCDataStore implementations, potentially reading or modifying database contents.","url":"https://insights.sbomify.com/CVE-2023-25158/"}