CVE-2023-25157 Unfiltered SQL Injection Vulnerabilities in Geoserver
Attackers can execute arbitrary SQL commands via unfiltered CQL filters in GeoServer, potentially reading or modifying geospatial data.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-25157?
CVE-2023-25157 is a critical SQL injection vulnerability in geoserver, published on 21 Feb 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-89
Which versions are affected by CVE-2023-25157?
4 open source packages ship an affected version, including org.geoserver.community:gs-jdbcconfig. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.geoserver.community:gs-jdbcconfig Maven | All versions | 2.21.4 |
org.geoserver.community:gs-jdbcconfig Maven | All versions | 2.21.4 |
org.geoserver.community:gs-jdbcconfig Maven | From 2.22.0 | 2.22.2 |
org.geoserver.community:gs-jdbcconfig Maven | From 2.22.0 | 2.22.2 |
Products include Osgeo Geoserver.
How do I fix CVE-2023-25157?
Upgrade org.geoserver.community:gs-jdbcconfig to a fixed version for your release line: 2.21.4 or 2.22.2.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2023-25157 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-25157 exists.
Public exploit code: 1 Nuclei template and 10 proofs of concept on GitHub.
Other vulnerabilities in geoserver
- CVE-2024-34711 GeoServer has improper ENTITY_RESOLUTION_ALLOWLIST URI validation in XML Processing (SSRF)
- CVE-2023-41339 Unsecured WMS dynamic styling sld=<url> parameter affords blind unauthenticated SSRF in GeoServer
- CVE-2023-43795 WPS Server Side Request Forgery in GeoServer
- CVE-2024-29198 GeoServer Vulnerable to Unauthenticated SSRF via TestWfsPost
- CVE-2025-30145 GeoServer has an Infinite Loop Vulnerability in Jiffle process
Sources
Also known as GHSA-7g5f-wrx8-5ccf.