CVE-2023-25157 Unfiltered SQL Injection Vulnerabilities in Geoserver

Critical 9.8 Published Updated

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.

PackageAffectedFixed in
org.geoserver.community:gs-jdbcconfig MavenAll versions2.21.4
org.geoserver.community:gs-jdbcconfig MavenAll versions2.21.4
org.geoserver.community:gs-jdbcconfig MavenFrom 2.22.02.22.2
org.geoserver.community:gs-jdbcconfig MavenFrom 2.22.02.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.

Sources

Also known as GHSA-7g5f-wrx8-5ccf.

Is CVE-2023-25157 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free