CVE-2023-25157: GeoServer OGC Filter SQL Injection Vulnerabilities
Summary
CVE-2023-25157: GeoServer OGC Filter SQL Injection Vulnerabilities. Affects org.geoserver.community:gs-jdbcconfig across 2 version ranges.
< 2.21.4
>= 2.22.0, < 2.22.2
Fixed in 2.21.4 or 2.22.2, depending on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
GeoServer is an open-source server for sharing geospatial data. It supports various protocols such as Web Feature Service (WFS), Web Map Service (WMS), and Web Coverage Service (WCS). The OGC Filter expression language and the OGC Common Query Language (CQL) are used in these protocols. GeoServer is vulnerable to SQL Injection attacks when certain filters and functions are used with different data stores.
Vulnerability Detail
The identified SQL Injection vulnerabilities in GeoServer include:
- SQL Injection in the
PropertyIsLikefilter when used with a String field and any database DataStore or with a PostGIS DataStore with encode functions enabled. - SQL Injection in the
strEndsWithfunction when used with a PostGIS DataStore with encode functions enabled. - SQL Injection in the
strStartsWithfunction when used with a PostGIS DataStore with encode functions enabled. - SQL Injection in the
FeatureIdfilter when used with any database table having a String primary key column and when prepared statements are disabled. - SQL Injection in the
jsonArrayContainsfunction when used with a String or JSON field and with a PostGIS or Oracle DataStore (GeoServer 2.22.0+ only). - SQL Injection in the
DWithinfilter when used with an Oracle DataStore.
These vulnerabilities can lead to unauthorized access, data manipulation, and potentially complete compromise of the GeoServer instance.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 2.21.42.21.4 -
>= 2.22.0, < 2.22.22.22.2
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There are two workarounds suggested:
- Disabling the PostGIS Datastore 'encode functions' setting can mitigate the vulnerabilities related to
strEndsWithandstrStartsWithfunctions. - Enabling the PostGIS DataStore 'preparedStatements' setting can mitigate the vulnerability related to the
FeatureIdfilter.
Conclusion
GeoServer is vulnerable to SQL Injection attacks in certain filters and functions. It is crucial to update to the patched versions mentioned in the 'how_to_fix' section to mitigate these vulnerabilities and ensure the security of the GeoServer instance. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for org.geoserver.community:gs-jdbcconfig →
FAQ
GeoServer is an open-source server for sharing geospatial data. It supports various protocols and provides a platform for publishing and managing geospatial data.
The impacted versions of GeoServer include 2.21.4, 2.22.2, 2.20.7, 2.19.7, and 2.18.7. It is recommended to update to the patched versions mentioned in the 'how_to_fix' section.
These vulnerabilities can allow attackers to perform SQL Injection attacks, leading to unauthorized access, data manipulation, and potential compromise of the GeoServer instance.
Yes, there are two workarounds suggested:
- Disabling the PostGIS Datastore 'encode functions' setting.
- Enabling the PostGIS DataStore 'preparedStatements' setting.
You can find more information about these vulnerabilities in the references provided in the vulnerability details section.