CVE-2023-25157 is a critical-severity (CVSS 9.8) SQL Injection vulnerability in org.geoserver.community:gs-jdbcconfig. 10 public exploit references exist, so weaponization risk is real. A fix is available for org.geoserver.community:gs-jdbcconfig — see the affected versions and patch details below.
Unfiltered SQL Injection Vulnerabilities in Geoserver
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2023-25157 by exploitation likelihood (EPSS) against impact (CVSS). In the shaded patch-first corner (EPSS 50%+, CVSS 7.0+).
Where this sits among everything scored
Of 395,308 CVEs with a current EPSS score, this one falls in the 50–90% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
org.geoserver.community:gs-jdbcconfig☕org.geoserver.community:gs-jdbcconfigReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
Impact
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.
SQL Injection Vulnerabilities have been found with:
PropertyIsLikefilter, when used with a String field and any database DataStore, or with a PostGIS DataStore with encode functions enabledstrEndsWithfunction, when used with a PostGIS DataStore with encode functions enabledstrStartsWithfunction, when used with a PostGIS DataStore with encode functions enabledFeatureIdfilter, when used with any database table having a String primary key column and when prepared statements are disabledjsonArrayContainsfunction, when used with a String or JSON field and with a PostGIS or Oracle DataStore (GeoServer 2.22.0+ only)DWithinfilter, when used with an Oracle DataStore
Patches
- GeoSever 2.21.4
- GeoServer 2.22.2
- GeoServer 2.20.7
- GeoServer 2.19.7
- GeoServer 2.18.7
Workarounds
- Disabling the PostGIS Datastore encode functions setting to mitigate
strEndsWith,strStartsWithvulnerabilities (Like filters have no mitigation, if there is a string field in the feature type published). - Enabling the PostGIS DataStore preparedStatements setting to mitigate the
FeatureIdvulnerability.
References
- OGC Filter SQL Injection Vulnerabilities (GeoTools)
- OGC Filter Injection Vulnerability Statement (GeoServer Blog)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.geoserver.community:gs-jdbcconfig | all versions | 2.21.4org.geoserver.community:gs-jdbcconfig:2.21.4 |
| ☕Maven | org.geoserver.community:gs-jdbcconfig | ≥ 2.22.0&&< 2.22.2 | 2.22.2org.geoserver.community:gs-jdbcconfig:2.22.2 |
Affected Products
geoserverosgeoResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
GeoServer is an open source software server written in Java that allows …
GeoServer is an open source software server written in Java that allows …
GeoServer is an open source software server written in Java that allows …
GeoServer is an open source software server written in Java that allows …
GeoServer is an open source software server written in Java that allows …
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.geoserver.community:gs-jdbcconfig, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.geoserver.community:gs-jdbcconfig to 2.21.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2023-25157 is resolved across your whole dependency graph.
Workarounds
Until you can upgrade, make sure every query built from user input uses parameterised statements or a prepared-statement API rather than string concatenation, and reduce the database account's privileges so an injected query cannot read or alter data beyond what the feature needs.
How to detect CVE-2023-25157
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2023-25157 -u https://target- Template
- GeoServer OGC Filter - SQL Injection
- Severity
- critical
- Impact
- Successful exploitation of this vulnerability could allow an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data leakage, or data manipulation.
- Remediation
- Apply the latest security patches or updates provided by the GeoServer project to fix the SQL Injection vulnerability.
Template by ProjectDiscovery nuclei-templates (ritikchaddha, DhiyaneshDK, iamnoooob), MIT licensed. View the full template. Scan only systems you are authorised to test.
Frequently Asked Questions
Is CVE-2023-25157 in your dependencies?
Find it across Maven, including transitive dependencies.