Skip to main content
Mallory
CriticalPublic exploitVulnerability

CVE-2023-25157: SQL injection in GeoServer OGC Filter and CQL processing

Published Feb 21, 2023 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS9.8Critical · v3.1
EPSS85.8%100th percentile
CISA KEVNoNot listed
In the wildReported2 exploitation records in Mallory
Vendor
Osgeo
IdentifiersCVE-2023-25157CWE-89 · Improper Neutralization of Special…

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.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

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.

Public exploits

Exploits

6 exploits validated by Mallory's analysis. Hidden: 2 rejected by Mallory's analysis as not a working exploit.

View more in app →
CVE-2023-25157This is a Docker Compose-based local training lab and operational PowerShell proof-of-concept suite for GeoServer/GeoTools OGC Filter SQL injection vulnerabilities CVE-2023-25157 and CVE-2023-25158. The main exploit automation is attack-chain.ps1, supported by shared HTTP helpers in lab-common.ps1 and shorter differential PoCs for each CVE. It sends unauthenticated WFS 1.1.0 GetCapabilities, DescribeFeatureType, and GetFeature requests to the exposed gateway, then exercises CQL_FILTER function and text FeatureId injection paths. Evidence files preserve the generated request URLs and responses from a successful run. The lab builds vulnerable GeoServer 2.22.0/GeoTools 28.0, patched GeoServer 2.22.2/GeoTools 28.2, two mitigation configurations, and an optional deliberately over-privileged worst-case configuration. OpenResty exposes only 127.0.0.1:8889 and maps distinct paths to each profile; GeoServer and PostGIS are segregated into Docker networks and are not host-published. The realistic route strips SQL errors but does not prevent the demonstrated result-count boolean oracle. The repository additionally contains SQL database seeding and privilege models, a non-JDBC shapefile negative control, setup/validation scripts, gateway configuration, a Vietnamese exploit guide/report, and report-generation assets. The standard attack chain is constrained to lab canaries and read-only data extraction: it demonstrates that least privilege blocks access to internal_assets, whereas the geoserver_impact role permits canary disclosure. The optional worst-case script is separate and reads only the mounted /lab/flag.txt lab canary.ivanesk315 · Disclosed Sep 10, 2026 · powershell · python · web · network · containerOperationalCVE-2023-25157This repository contains a proof-of-concept (PoC) exploit for CVE-2023-25157, a critical SQL injection vulnerability in GeoServer's OGC Filter implementation. The main file, CVE-2023-25157.py, is a Python script that automates the exploitation process. It first enumerates available feature types and their properties from a target GeoServer instance by sending crafted HTTP requests to the /geoserver/ows endpoint. It then attempts to exploit the SQL injection vulnerability by injecting a payload into the CQL_FILTER parameter of a GetFeature request, aiming to extract the database version as a demonstration. The script is intended for educational and research purposes, as stated in the README.md, and requires the user to supply the base URL of the target GeoServer. The attack vector is network-based, targeting HTTP endpoints exposed by GeoServer. The repository is structured simply, with one Python exploit script and a detailed README explaining usage, context, and legal disclaimers.win3zz · Disclosed Jun 6, 2023 · python · networkPoCCVE-2023-25157-checkerThis repository contains a single Go-based proof-of-concept exploit for CVE-2023-25157, a SQL injection vulnerability in GeoServer's WFS service. The main file, CVE-2023-25157.go, is a command-line tool that takes a target GeoServer base URL as input. It first checks the /geoserver/ows?service=WFS&version=1.0.0&request=GetCapabilities endpoint to enumerate available feature types. For each feature type, it queries for available properties. It then attempts to exploit the SQL injection vulnerability by sending specially crafted requests to the /geoserver/ows endpoint, injecting SQL via the CQL_FILTER parameter to extract information such as the current database user. The script outputs the results of these attempts, including any error messages or extracted data. The repository is structured simply, with the main exploit logic in a single Go file, and includes a README with usage instructions and references. No weaponized or post-exploitation payloads are included; the script is a POC for detection and demonstration of the vulnerability.7imbitz · Disclosed Jun 12, 2023 · go · networkPoCgeoserver-CVE-2023-25157This repository is a proof-of-concept (POC) exploit for a SQL injection vulnerability in GeoServer 2.22.1. The repository contains three files: a docker-compose.yml for setting up a vulnerable GeoServer and PostGIS environment, a startup.sh script to initialize the GeoServer instance with the required workspace and datastore, and poc.py, a Python script that performs the actual exploit. The exploit targets the /geoserver/ows endpoint, sending a specially crafted CQL_FILTER parameter in a WFS GetFeature request to attempt SQL injection and extract database version information. The setup scripts ensure the environment is ready for exploitation, making this a self-contained POC for demonstrating the vulnerability.custiya · Disclosed Apr 21, 2025 · python · bash · networkPoCCVE-2023-25157This repository contains a proof-of-concept (POC) exploit for a SQL injection vulnerability in GeoServer versions prior to 2.18.7, 2.19.7, 2.20.7, 2.21.4, and 2.22.2. The vulnerability arises from improper filtering of user input in the CQL_FILTER parameter, allowing remote, unauthenticated attackers to inject SQL via crafted HTTP requests. The main exploit script, exp.py, is written in Python and automates the process of: 1. Enumerating available FeatureTypes from the target GeoServer instance using the /geoserver/ows endpoint. 2. For each FeatureType, retrieving its properties via the /geoserver/wfs endpoint. 3. Attempting SQL injection on each property by sending a specially crafted CQL_FILTER parameter in a GetFeature request, aiming to extract database information (such as the version). The script supports both single and multiple target URLs, uses multi-threading for efficiency, and provides colored output for result clarity. The README.md provides a detailed description of the vulnerability, affected versions, and example payloads. No hardcoded IPs or domains are present; the script is designed to be run against user-supplied targets. The exploit demonstrates the vulnerability by extracting database information, confirming the presence of the SQL injection flaw.charis3306 · Disclosed Apr 24, 2025 · python · networkPoCCVE-2023-25157-GeoServer-SQLi-LabThis repository is a vulnerable lab and proof-of-concept documentation set for GeoServer/GeoTools SQL injection vulnerabilities CVE-2023-25157 and CVE-2023-25158. It is not an automated exploit tool; instead, it provides a reproducible Docker environment plus detailed exploitation guidance showing how malicious WFS filter input is translated into unsafe SQL against PostgreSQL/PostGIS. Repository structure: README.md gives the overview and startup instructions; REPORT.md is the main technical write-up describing four tested attack vectors and sample HTTP requests/SQL behavior; docker-compose.yml launches a two-container lab (GeoServer 2.22.1 and PostGIS/PostgreSQL 13-3.1); init.sql creates sample spatial tables and seed data; startup.sh auto-configures GeoServer through its REST API, creating a workspace, vulnerable PostGIS datastore, and two published feature types. Main exploit capabilities: the PoC demonstrates unauthenticated or weakly protected web exploitation over GeoServer WFS endpoints using crafted CQL_FILTER or OGC XML Filter input. The documented vectors include strStartsWith, strEndsWith, PropertyIsLike, and FeatureId-based injection. The goal is error-based SQL injection: attacker-controlled input breaks out of generated SQL string context, appends SQL such as a CAST(version()) expression, and causes PostgreSQL to return an error containing backend version information. This proves arbitrary SQL expression injection in the query path, though the repository stops at information disclosure and does not include automation, shells, or persistence payloads. Notable targeting details: the lab intentionally enables vulnerable datastore settings in startup.sh, especially 'encode functions=true' and 'preparedStatements=false', and exposes primary keys. The FeatureId vector specifically depends on a string primary key table (example_str). The exploit surface is GeoServer's HTTP/WFS interface, while the backend target is PostgreSQL/PostGIS. Overall maturity is best classified as POC because the repository is a lab and report with manual payloads rather than a weaponized exploit implementation.Giangdurian · Disclosed Jul 13, 2026 · markdown · yaml · web · networkPoC
Exposure surface

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.

VendorProductType
OsgeoGeoserverapplication
FAQ

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.
Activity feed

Recent activity

4 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence2Every report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.