9.8critical
Unfiltered SQL Injection Vulnerabilities in Geoserver
- Severity
- 9.8critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 85.8% (higher than 99% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-7g5f-wrx8-5ccf
Description
GeoServer is an open source software server written in Java that allows users to share and edit geospatial data. GeoServer includes support for the OGC Filter expression language and the OGC Common Query Language (CQL) as part of the Web Feature Service (WFS) and Web Map Service (WMS) protocols. CQL is also supported through the Web Coverage Service (WCS) protocol for ImageMosaic coverages. Users are advised to upgrade to either version 2.21.4, or version 2.22.2 to resolve this issue. Users unable to upgrade should disable the PostGIS Datastore *encode functions* setting to mitigate ``strEndsWith``, ``strStartsWith`` and ``PropertyIsLike `` misuse and enable the PostGIS DataStore *preparedStatements* setting to mitigate the ``FeatureId`` misuse.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| geoserver geoserver | >= 2.22.0, < 2.22.2, < 2.21.4 | CVE List |
| org.geoserver.community:gs-jdbcconfig (Maven) | before 2.21.4, from 2.22.0 before 2.22.2 | GitHub Advisory Database |
| osgeo geoserver | before 2.18.7, from 2.19.0 before 2.19.7, from 2.20.0 before 2.20.7, from 2.21.0 before 2.21.4, from 2.22.0 before 2.22.2 | NVD |
All scores
| GitHub_M | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.
What each source says
CVE List
GeoServer is an open source software server written in Java that allows users to share and edit geospatial data. GeoServer includes support for the OGC Filter expression language and the OGC Common Query Language (CQL) as part of the Web Feature Service (WFS) and Web Map Service (WMS) protocols. CQL is also supported through the Web Coverage Service (WCS) protocol for ImageMosaic coverages. Users are advised to upgrade to either version 2.21.4, or version 2.22.2 to resolve this issue. Users unable to upgrade should disable the PostGIS Datastore *encode functions* setting to mitigate ``strEndsWith``, ``strStartsWith`` and ``PropertyIsLike `` misuse and enable the PostGIS DataStore *preparedStatements* setting to mitigate the ``FeatureId`` misuse.
GitHub Advisory Database
Impact
GeoServer includes support for the OGC Filter expression language and the OGC Common Query Language (CQL) as part of the Web Feature Service (WFS) and Web Map Service (WMS) protocols. CQL is also supported through the Web Coverage Service (WCS) protocol for ImageMosaic coverages.
SQL Injection Vulnerabilities have been found with:
PropertyIsLikefilter, when used with a String field and any database DataStore, or with a PostGIS DataStore with encode functions enabledstrEndsWithfunction, when used with a PostGIS DataStore with encode functions enabledstrStartsWithfunction, when used with a PostGIS DataStore with encode functions enabledFeatureIdfilter, when used with any database table having a String primary key column and when prepared statements are disabledjsonArrayContainsfunction, when used with a String or JSON field and with a PostGIS or Oracle DataStore (GeoServer 2.22.0+ only)DWithinfilter, when used with an Oracle DataStore
Patches
- GeoSever 2.21.4
- GeoServer 2.22.2
- GeoServer 2.20.7
- GeoServer 2.19.7
- GeoServer 2.18.7
Workarounds
- Disabling the PostGIS Datastore encode functions setting to mitigate
strEndsWith,strStartsWithvulnerabilities (Like filters have no mitigation, if there is a string field in the feature type published). - Enabling the PostGIS DataStore preparedStatements setting to mitigate the
FeatureIdvulnerability.
References
- OGC Filter SQL Injection Vulnerabilities (GeoTools)
- OGC Filter Injection Vulnerability Statement (GeoServer Blog)
NVD (es)
GeoServer es un servidor de software de código abierto escrito en Java que permite a los usuarios compartir y editar datos geoespaciales. GeoServer incluye soporte para el lenguaje de expresión de filtro OGC y el lenguaje de consulta común (CQL) de OGC como parte de los protocolos Web Feature Service (WFS) y Web Map Service (WMS). CQL también es compatible a través del protocolo Web Coverage Service (WCS) para coberturas de ImageMosaic. Se recomienda a los usuarios que actualicen a la versión 2.21.4 o 2.22.2 para resolver este problema. Los usuarios que no puedan actualizar deben deshabilitar la configuración *encode funciones* de PostGIS Datastore para mitigar el mal uso de ``strEndsWith``, ``strStartsWith`` y ``PropertyIsLike `` y habilitar la configuración *preparedStatements* de PostGIS DataStore para mitigar ``FeatureId` `mal uso.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-25157 changed 2025-03-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-7g5f-wrx8-5ccf changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2023-25157 changed 2026-06-17 | Public domain |