CVE-2023-25157 in osgeo geoserver
LogPulse has a published detection rule for this CVE: it raises a notable when someone tries to exploit it.
What the vulnerability is
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 software: osgeo geoserver
Scores
- CVSS: 9.8 (critical)
- EPSS: 85.76% chance of exploitation in the next 30 days
- CISA KEV: Not listed
- Published: 2023-02-21
What LogPulse has for it
- Detection rule: Yes, published
- Agent check (vulnerable version): No
- Mitigation: Yes, see below
How to mitigate it
Upgrade GeoServer to 2.21.4, 2.22.2 or later
Patch or upgrade. GeoServer 2.21.4 and 2.22.2 escape OGC filter and CQL functions before they reach a JDBC datastore, which closes the SQL injection in CVE-2023-25157.
Applies to: GeoServer before 2.21.4 and 2.22.0 to 2.22.1 with a PostGIS or other JDBC datastore.
- Check the version under About GeoServer in the web admin, or in the WAR file name.
- Back up the GeoServer data directory.
- Deploy GeoServer 2.22.2 or later (or 2.21.4 on the 2.21 line), keeping the same data directory.
- If you cannot upgrade now: in each PostGIS store disable 'Encode functions' and enable 'Prepared statements', then restart.
- Check that WFS and WMS layers still load.
Sources:
Source data: NIST NVD, CISA KEV and FIRST EPSS. LogPulse processes new CVEs every hour.
We build every detection with great care, but no two environments are the same. Log sources, parsing and configuration differ, so test a detection in your own environment before you rely on it.