The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2023-25157

CVE-2023-25157: OSGeo GeoServer SQL Injection Vulnerability

CVE-2023-25157 is a SQL injection flaw in OSGeo GeoServer affecting OGC Filter and CQL implementations. Attackers can exploit this through WFS, WMS, and WCS protocols. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: February 4, 2026

CVE-2023-25157 Overview

CVE-2023-25157 is a critical SQL Injection vulnerability affecting GeoServer, an open source software server written in Java that allows users to share and edit geospatial data. The vulnerability exists in GeoServer's 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.

Attackers can exploit this flaw by crafting malicious CQL queries that bypass input validation, allowing them to execute arbitrary SQL commands against the underlying PostGIS database. This can lead to unauthorized data access, data manipulation, and potentially full system compromise.

Critical Impact

This SQL injection vulnerability allows unauthenticated remote attackers to execute arbitrary SQL commands against the PostGIS database, potentially leading to complete database compromise, sensitive data exfiltration, and lateral movement within the network.

Affected Products

  • OSGeo GeoServer versions prior to 2.21.4
  • OSGeo GeoServer versions 2.22.x prior to 2.22.2
  • GeoServer deployments using PostGIS Datastore with encode functions enabled

Discovery Timeline

  • 2023-02-21 - CVE-2023-25157 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-25157

Vulnerability Analysis

The vulnerability stems from insufficient input sanitization in GeoServer's handling of CQL (Common Query Language) expressions. When processing OGC Filter expressions through WFS, WMS, and WCS protocols, GeoServer fails to properly sanitize user-controlled input before incorporating it into SQL queries executed against PostGIS databases.

Specifically, the vulnerability affects multiple CQL functions and expressions including strEndsWith, strStartsWith, PropertyIsLike, and FeatureId operations. These functions can be manipulated to inject malicious SQL code that escapes the intended query context and executes attacker-controlled database commands.

The attack requires no authentication and can be executed remotely over the network with low complexity. Successful exploitation grants attackers the ability to read, modify, or delete database contents, potentially compromising the confidentiality, integrity, and availability of the entire geospatial data infrastructure.

Root Cause

The root cause is improper input validation (CWE-89: SQL Injection) in the CQL expression parser. The vulnerability specifically manifests in how GeoServer constructs SQL queries from user-supplied OGC Filter expressions without adequate sanitization or parameterization. The code fails to escape special characters in comment patterns and does not properly handle prepared statements for all query types.

As shown in the security patch, the fix introduces pattern matching to escape SQL comment sequences that could be used for injection:

java
// see https://github.com/hibernate/hibernate-orm/commit/59fede7acaaa1579b561407aefa582311f7ebe78
private static final Pattern ESCAPE_CLOSING_COMMENT_PATTERN = Pattern.compile("\\*/");
private static final Pattern ESCAPE_OPENING_COMMENT_PATTERN = Pattern.compile("/\\*");

private boolean debugMode;

public static Dialect detect(DataSource dataSource, boolean debugMode) {
    Dialect dialect;
    try {
        Connection conn = dataSource.getConnection();

Source: GitHub Commit Update

Attack Vector

The attack is executed remotely over the network through GeoServer's web service interfaces. An attacker can craft malicious HTTP requests containing specially crafted CQL expressions targeting any of the vulnerable functions (strEndsWith, strStartsWith, PropertyIsLike, or FeatureId). These requests are processed by GeoServer's WFS, WMS, or WCS endpoints without proper validation.

The attacker does not require any authentication or special privileges to exploit this vulnerability. By injecting SQL comment sequences and malicious query fragments, the attacker can break out of the intended query context and execute arbitrary SQL statements against the PostGIS backend database.

Detection Methods for CVE-2023-25157

Indicators of Compromise

  • Unusual or malformed CQL query parameters in GeoServer access logs containing SQL syntax such as --, /*, */, or UNION SELECT
  • Unexpected database errors or query failures logged by the PostGIS backend
  • Abnormal network traffic patterns to GeoServer WFS/WMS/WCS endpoints with excessively long or encoded parameters
  • Evidence of data exfiltration or unauthorized database queries in PostGIS audit logs

Detection Strategies

  • Implement web application firewall (WAF) rules to detect and block SQL injection patterns in requests to GeoServer endpoints
  • Monitor GeoServer access logs for requests containing suspicious CQL expressions with strEndsWith, strStartsWith, PropertyIsLike, or FeatureId parameters
  • Deploy database activity monitoring on PostGIS backends to detect anomalous query patterns or unauthorized data access
  • Use intrusion detection systems (IDS) to identify network traffic containing SQL injection payloads targeting GeoServer services

Monitoring Recommendations

  • Enable verbose logging on GeoServer instances to capture full request details including CQL parameters
  • Configure alerts for failed authentication attempts and unusual query patterns in database logs
  • Implement network traffic analysis to identify potential exploitation attempts against GeoServer endpoints
  • Regularly review access logs for patterns consistent with SQL injection reconnaissance or exploitation

How to Mitigate CVE-2023-25157

Immediate Actions Required

  • Upgrade GeoServer to version 2.21.4 or version 2.22.2 immediately to resolve this vulnerability
  • If immediate upgrade is not possible, disable the PostGIS Datastore encode functions setting to mitigate strEndsWith, strStartsWith, and PropertyIsLike misuse
  • Enable the PostGIS DataStore preparedStatements setting to mitigate the FeatureId exploitation vector
  • Review GeoServer access logs for evidence of exploitation attempts

Patch Information

The GeoServer project has released security patches in versions 2.21.4 and 2.22.2. The fix implements proper input sanitization by escaping SQL comment patterns and improving the dialect detection mechanism to support debug mode for better security controls.

Users should upgrade to the latest patched version by downloading from the official GeoServer website or updating via their package manager. The specific commit addressing this vulnerability is available at the GitHub Commit Update.

For detailed technical information, refer to the GitHub Security Advisory GHSA-7g5f-wrx8-5ccf.

Workarounds

  • Disable the PostGIS Datastore encode functions setting in GeoServer configuration to prevent exploitation via strEndsWith, strStartsWith, and PropertyIsLike functions
  • Enable the PostGIS DataStore preparedStatements setting to mitigate FeatureId exploitation
  • Restrict network access to GeoServer endpoints using firewall rules to limit exposure to trusted networks only
  • Deploy a web application firewall (WAF) in front of GeoServer to filter malicious SQL injection attempts
bash
# Configuration example for GeoServer PostGIS Datastore
# In the GeoServer admin interface or datastore configuration:
# 1. Navigate to Stores > [Your PostGIS Store] > Connection Parameters
# 2. Set the following parameters:

# Disable encode functions to prevent strEndsWith/strStartsWith/PropertyIsLike exploitation
encode functions=false

# Enable prepared statements to prevent FeatureId exploitation
preparedStatements=true

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechOsgeo Geoserver

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability93.70%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-89
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-7g5f-wrx8-5ccf
  • Related CVEs
  • CVE-2023-43795: Osgeo GeoServer SSRF Vulnerability

  • CVE-2023-41339: GeoServer SSRF Vulnerability via WMS

  • CVE-2022-24847: GeoServer JNDI Injection RCE Vulnerability

  • CVE-2021-40822: Osgeo GeoServer SSRF Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English