SQL injection in GeoServer OGC Filter and CQL processing
CVE-2023-25157 is an SQL injection vulnerability in GeoServer's processing of OGC Filter and Common Query Language (CQL) expressions for database-backed geospatial services. Relevant interfaces include Web Feature Service (WFS), Web Map Service (WMS), and Web Coverage Service (WCS) for ImageMosaic coverages. Vulnerable expression-handling patterns include PropertyIsLike, strEndsWith, strStartsWith, FeatureId, jsonArrayContains, and DWithin. Crafted expressions can manipulate backend database queries, with exposure and consequences dependent on datastore configuration and published functionality.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation can manipulate queries against GeoServer's backend databases and disclose data without authorization. Additional database-level compromise depends on the datastore configuration and exposed functionality. Specific remote code execution, privilege escalation, or availability impacts are not established for this CVE by the available information.
If you can’t patch tonight, do this now.
Disable the PostGIS DataStore encode functions setting to mitigate strEndsWith and strStartsWith misuse. Enable the PostGIS DataStore preparedStatements setting to mitigate FeatureId misuse. Guidance differs for PropertyIsLike: the CVE description includes it among issues mitigated by disabling encode functions, while the advisory states that Like-filter issues have no mitigation when a published feature type contains a string field. Do not rely on that setting alone to address Like-filter exposure; apply a fixed release.
Patch, then assume compromise.
Upgrade to a fixed GeoServer release appropriate for the deployed branch: 2.18.7, 2.19.7, 2.20.7, 2.21.4, or 2.22.2.
6 exploits validated by Mallory's analysis. Hidden: 2 rejected by Mallory's analysis as not a working exploit.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
4 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.