CVE-2023-25157: Unfiltered SQL Injection Vulnerabilities in Geoserver

Reference page built from the source records below, each shown as its source publishes it. Dataset version ref-34e11a0a4436, updated 2026-06-17T05:40:48.073Z.

NVD analysis

Status
Modified
Published
2023-02-21T22:15:10.620
Last modified
2026-06-17T05:40:48.073
Weaknesses
CWE-89

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.

MetricScoreSeverityVectorScored by
CVSS 3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H[email protected] (Secondary)
CVSS 3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H[email protected] (Primary)

References

This product uses the NVD API but is not endorsed or certified by the NVD.

Read on 2026-11-03T01:44:29.037Z under licence nvd-api-terms-of-use@ff2a5288 from https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2023-25157

CVE record

Title (CNA)
Unfiltered SQL Injection Vulnerabilities in Geoserver
Assigner
GitHub_M
State
PUBLISHED
Published
2023-02-21T21:00:13.392Z
Updated
2025-03-10T21:07:17.645Z
Problem types
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

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.

References

Read on 2026-11-03T02:02:52.687Z under licence cve-terms-of-use@81bfa2f3 from https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2023/25xxx/CVE-2023-25157.json

GitHub Advisory Database

GHSA-7g5f-wrx8-5ccf: GeoServer OGC Filter SQL Injection Vulnerabilities

Severity (GitHub)
critical
CVSS
9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weaknesses
CWE-89
Published
2023-02-22T19:15:56Z
Updated
2023-02-22T19:15:58Z
  • maven org.geoserver.community:gs-jdbcconfig: affected < 2.21.4, first patched 2.21.4
  • maven org.geoserver.community:gs-jdbcconfig: affected >= 2.22.0, < 2.22.2, first patched 2.22.2

### 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:

* ``PropertyIsLike`` filter, when used with a String field and any database DataStore, or with a PostGIS DataStore with encode functions enabled
* ``strEndsWith`` function, when used with a PostGIS DataStore with encode functions enabled
* ``strStartsWith`` function, when used with a PostGIS DataStore with encode functions enabled
* ``FeatureId`` filter, when used with any database table having a String primary key column and when prepared statements are disabled
* ``jsonArrayContains`` function, when used with a String or JSON field and with a PostGIS or Oracle DataStore (GeoServer 2.22.0+ only)
* ``DWithin`` filter, 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

1. Disabling the PostGIS Datastore *encode functions* setting to mitigate ``strEndsWith``, ``strStartsWith`` vulnerabilities (Like filters have no mitigation, if there is a string field in the feature type published).
2. Enabling the PostGIS DataStore *preparedStatements* setting to mitigate the ``FeatureId`` vulnerability.

### References

* [OGC Filter SQL Injection Vulnerabilities](https://github.com/geotools/geotools/security/advisories/GHSA-99c3-qc2q-p94m) (GeoTools)
* [OGC Filter Injection Vulnerability Statement](https://geoserver.org/vulnerability/2023/02/20/ogc-filter-injection.html) (GeoServer Blog)

Read on 2026-11-03T08:52:58.841Z under licence ghsa-cc-by-4.0@9e5f1b3c from https://api.github.com/advisories/GHSA-7g5f-wrx8-5ccf

Also known as / affected packages

Detection rules (SigmaHQ)

SigmaHQ rules whose own tags name this CVE. Each rule page shows the rule as its author published it.

Defensive techniques (MITRE D3FEND)

D3FEND maps these defensive techniques to the weakness (CWE) that NVD lists for this CVE, through the digital artifacts the weakness affects. D3FEND does not say they stop this vulnerability.

CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

D3FEND ontology version 1.6.0.

Read on 2026-11-02T23:54:25.031Z under licence d3fend-terms-of-use@f98cbc7e from https://d3fend.mitre.org/api/weakness/cwe/CWE-89.json

MITRE D3FEND™ knowledge graph. © 2025 The MITRE Corporation.
"The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use D3FEND for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy." Terms: https://d3fend.mitre.org/tou/

Sources and licences

  • National Vulnerability Database (NIST)

    This product uses the NVD API but is not endorsed or certified by the NVD.

    NVD API Terms of Use (NIST publications in the public domain, 17 U.S.C. 105)

  • CVE Program, The MITRE Corporation

    Copyright © 1999-2026, The MITRE Corporation. CVE is a trademark and the CVE logo is a registered trademark of The MITRE Corporation. CVE Usage: MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE™). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy.

    CVE Program Terms of Use ("CVE Usage" licence)

  • GitHub Advisory Database

    Source: GitHub Advisory Database, https://github.com/advisories/GHSA-7g5f-wrx8-5ccf, licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Changes: fields selected and reformatted by ransomware-tracker.com.

    CC BY 4.0

  • GitHub Advisory Database via OSV.dev

    GHSA-7g5f-wrx8-5ccf: GitHub Advisory Database, https://github.com/advisories/GHSA-7g5f-wrx8-5ccf. Licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/), provided as is, without warranties. Retrieved via OSV.dev (https://osv.dev/vulnerability/GHSA-7g5f-wrx8-5ccf), which enriches records; fields selected and reformatted by ransomware-tracker.com.

    CC BY 4.0

  • SigmaHQ

    "Potential CVE-2023-25157 Exploitation Attempt" by Nasreddine Bencherchali (Nextron Systems) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules-emerging-threats/2023/Exploits/CVE-2023-25157/web_cve_2023_25157_geoserver_sql_injection.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

  • MITRE D3FEND

    MITRE D3FEND™ knowledge graph. © 2025 The MITRE Corporation.
    "The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use D3FEND for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy." Terms: https://d3fend.mitre.org/tou/

    MITRE D3FEND Terms of Use (site + knowledge graph); source repo MIT

Cite this page

Dragons Eye Ransomware Tracker, "CVE-2023-25157: Unfiltered SQL Injection Vulnerabilities in Geoserver",
entity page, dataset version ref-34e11a0a4436, updated 2026-06-17T05:40:48.073Z,
https://ransomware-tracker.com/cve/CVE-2023-25157 (accessed 2026-11-03).
Underlying source: National Vulnerability Database (NIST), CVE API 2.0, record last modified 2026-06-17T05:40:48.073.
Underlying source: CVE List (CVE Program, The MITRE Corporation), record updated 2025-03-10T21:07:17.645Z.
Underlying source: GitHub Advisory Database, GHSA-7g5f-wrx8-5ccf, updated 2023-02-22T19:15:58Z.
Underlying source: GitHub Advisory Database, GHSA-7g5f-wrx8-5ccf, via OSV.dev, modified 2026-09-10T03:49:56.856032898Z.
Underlying source: SigmaHQ rule c0341543-5ed0-4475-aabc-7eea8c52aa66, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.
Underlying source: MITRE D3FEND, ontology version 1.6.0.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.

CISA KEV index