CVE-2023-25157: SQL injection in GeoServer OGC Filter and CQL processing
- Vendor
- Osgeo
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.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
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.
Mitigation
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.
Remediation
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.
Exploits
6 exploits validated by Mallory's analysis. Hidden: 2 rejected by Mallory's analysis as not a working exploit.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2023-25157 exploited in the wild?
- Yes. As of Oct 16, 2026, Mallory has reports of exploitation in the wild.
- Is there a public exploit for CVE-2023-25157?
- Yes. Mallory tracks 6 public exploits or proofs of concept for CVE-2023-25157, the earliest disclosed Jun 6, 2023.
- Is there a patch for CVE-2023-25157?
- 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.
- What products are affected by CVE-2023-25157?
- Osgeo Geoserver.
- How severe is CVE-2023-25157?
- CVE-2023-25157 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 85.8% (100th percentile) as of Oct 16, 2026.
Recent activity
4 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.