Loading...
Skip to main content

CVE-2023-25158 — Vulnerability in org.geotools:gt-jdbc — CVE Details

CRITICAL

GeoTools OGC Filter SQL Injection Vulnerabilities

Published February 22, 2023Updated November 8, 2023Source: osv

Summary

### Impact 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: 1. ``PropertyIsLike`` filter * Requires PostGIS DataStore with "encode functions" enabled * Or any JDBCDataStore (all relational databases) with String field (no mitigation) 3. ``strEndsWith`` function * Requires PostGIS DataStore with "encode functions" enabled 5. ``strStartsWith`` function * Requires PostGIS DataStore with "encode functions" enabled 6. ``FeatureId`` filter * Requires JDBCDataStore (all relational databases) with prepared statements disabled and table with String primary key (Oracle not affected, SQL Server and MySQL have no settings to enabled prepared statements, PostGIS does) 7. ``jsonArrayContains`` function * Requires PostGIS and Oracle DataStore with String or JSON field 8. ``DWithin`` filter * Happens only in Oracle DataStore, no mitigation ### Patches * GeoTools 28.2 * GeoTools 27.4 * GeoTools 26.7 * GeoTools 25.7 * GeoTools 24.7 ### Workarounds Partial mitigation: * In PostGIS DataStore disable "encode functions" * In any PostGIS enable "prepared statements" (only database with such settings) ```java Map<String, Object> params = new HashMap<>(); params.put("dbtype", "postgis"); params.put("host", "localhost"); params.put("port", 5432); params.put("schema", "public"); params.put("database", "database"); params.put("user", "postgres"); params.put("passwd", "postgres"); params.put("preparedStatements", true ); // mitigation params.put("encode functions", false ); // mitigation DataStore dataStore = DataStoreFinder.getDataStore(params); ``` ### References * [OGC Filter SQL Injection Vulnerabilities](https://github.com/geoserver/geoserver/security/advisories/GHSA-7g5f-wrx8-5ccf) (GeoServer)

Advisory Timeline

  • First published February 22, 2023 (1328 days ago).
  • Last revised November 8, 2023 — 258 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Maven
Update org.geotools:gt-jdbc to 28.2 or later
<!-- Update pom.xml dependency version to 28.2 for org.geotools:gt-jdbc -->
Maven
Update org.geotools:gt-jdbc to 27.4 or later
<!-- Update pom.xml dependency version to 27.4 for org.geotools:gt-jdbc -->
Maven
Update org.geotools:gt-jdbc to 25.7 or later
<!-- Update pom.xml dependency version to 25.7 for org.geotools:gt-jdbc -->
Maven
Update org.geotools:gt-jdbc to 26.7 or later
<!-- Update pom.xml dependency version to 26.7 for org.geotools:gt-jdbc -->
Maven
Update org.geotools:gt-jdbc to 24.7 or later
<!-- Update pom.xml dependency version to 24.7 for org.geotools:gt-jdbc -->

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (5)

Affects 1 ecosystem: maven (1).

PackageEcosystemAffectedFixed In
org.geotools:gt-jdbc
maven
All versions28.2
org.geotools:gt-jdbc
maven
All versions27.4
org.geotools:gt-jdbc
maven
All versions25.7
org.geotools:gt-jdbc
maven
All versions26.7
org.geotools:gt-jdbc
maven
All versions24.7

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2023-25158?
GeoTools OGC Filter SQL Injection Vulnerabilities This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2023-25158?
CVE-2023-25158 affects org.geotools:gt-jdbc. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2023-25158 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-99c3-qc2q-p94m

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies