GeoTools OGC Filter SQL Injection Vulnerabilities
ImpactGeoTools 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:``PropertyIsLike`` filterRequires PostGIS DataStore with "encode functions" enabledOr any JDBCDataStore (all relational databases) with String field (no mitigation)``strEndsWith`` functionRequires PostGIS DataStore with "encode functions" enabled``strStartsWith`` functionRequires PostGIS DataStore with "encode functions" enabled``FeatureId`` filterRequires 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)``jsonArrayContains`` functionRequires PostGIS and Oracle DataStore with String or JSON field``DWithin`` filterHappens only in Oracle DataStore, no mitigationPatchesGeoTools 28.2GeoTools 27.4GeoTools 26.7GeoTools 25.7GeoTools 24.7WorkaroundsPartial mitigation:In PostGIS DataStore disable "encode functions"In any PostGIS enable "prepared statements" (only database with such settings)References[OGC Filter SQL Injection Vulnerabilities](https://github.com/geoserver/geoserver/security/advisories/GHSA-7g5f-wrx8-5ccf) (GeoServer)