Описание
GeoTools OGC Filter SQL Injection Vulnerabilities
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:
PropertyIsLikefilter- Requires PostGIS DataStore with "encode functions" enabled
- Or any JDBCDataStore (all relational databases) with String field (no mitigation)
strEndsWithfunction- Requires PostGIS DataStore with "encode functions" enabled
strStartsWithfunction- Requires PostGIS DataStore with "encode functions" enabled
FeatureIdfilter- 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)
jsonArrayContainsfunction- Requires PostGIS and Oracle DataStore with String or JSON field
DWithinfilter- 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)
References
- OGC Filter SQL Injection Vulnerabilities (GeoServer)
Пакеты
org.geotools:gt-jdbc
>= 28.0, < 28.2
28.2
org.geotools:gt-jdbc
>= 27.0, < 27.4
27.4
org.geotools:gt-jdbc
>= 26.0, < 26.7
26.7
org.geotools:gt-jdbc
>= 25.0, < 25.7
25.7
org.geotools:gt-jdbc
< 24.7
24.7
Связанные уязвимости
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.