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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2025-1094

CVE-2025-1094: PostgreSQL libpq SQL Injection Vulnerability

CVE-2025-1094 is a SQL injection flaw in PostgreSQL libpq escape functions that allows attackers to inject malicious SQL under specific conditions. This article covers technical details, affected versions, and mitigation.

Updated: May 15, 2026

CVE-2025-1094 Overview

CVE-2025-1094 is a SQL injection vulnerability in PostgreSQL's libpq client library. The flaw resides in the quoting functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn(), which fail to properly neutralize quoting syntax under specific encoding conditions. Attackers can exploit this issue when application code passes escaped output to psql, the PostgreSQL interactive terminal. A parallel issue exists in PostgreSQL command line utilities when client_encoding is BIG5 and server_encoding is either EUC_TW or MULE_INTERNAL. The vulnerability is classified under [CWE-149] (Improper Neutralization of Quoting Syntax).

Critical Impact

A database input provider can inject arbitrary SQL commands, leading to data confidentiality, integrity, and availability compromise across affected PostgreSQL deployments.

Affected Products

  • PostgreSQL versions before 17.3
  • PostgreSQL versions before 16.7, 15.11, and 14.16
  • PostgreSQL versions before 13.19

Discovery Timeline

  • 2025-02-13 - CVE-2025-1094 published to NVD
  • 2025-02-15 - Debian LTS announcement released
  • 2025-02-16 - OpenWall OSS Security discussion published
  • 2025-02-20 - OpenWall OSS Security update released
  • 2025-02-21 - NetApp Security Advisory ntap-20250221-0010 published
  • 2025-02-24 - Second Debian LTS announcement issued
  • 2026-04-15 - Last updated in NVD database

Technical Details for CVE-2025-1094

Vulnerability Analysis

The vulnerability stems from improper handling of multi-byte character encoding boundaries in PostgreSQL's escape functions. When libpq processes input intended for SQL string literals or identifiers, the escape routines do not correctly account for invalid byte sequences in certain client encodings. An attacker who controls input passed to these functions can craft byte sequences that bypass the quoting logic.

Exploitation requires a specific downstream usage pattern: the escaped output must be forwarded to psql, where it is interpreted as commands. Because psql processes meta-commands and SQL statements, an injected payload can execute arbitrary SQL or invoke shell commands through psql features such as \!. The CWE-149 classification reflects the root cause in quoting syntax neutralization.

Root Cause

The escape functions assume that supplied input conforms to the declared client encoding. When the input contains malformed multi-byte sequences, the parser misidentifies byte boundaries and leaves quote characters un-escaped. The companion issue in command line utilities arises specifically when client_encoding is set to BIG5 while server_encoding is EUC_TW or MULE_INTERNAL, producing similar boundary confusion during argument processing.

Attack Vector

An attacker supplies crafted input to an application that calls one of the affected libpq escape functions. The application then passes the resulting string to psql for execution. Because the escape routine failed to neutralize the injected quote, psql interprets attacker-controlled bytes as SQL syntax or meta-commands. The attack is network-reachable wherever the application accepts remote input destined for a PostgreSQL toolchain workflow.

No verified public proof-of-concept code is referenced in the advisory. Refer to the PostgreSQL Security Advisory CVE-2025-1094 for authoritative technical detail.

Detection Methods for CVE-2025-1094

Indicators of Compromise

  • Unexpected psql meta-command execution, particularly \! shell escapes originating from application-driven sessions
  • Anomalous SQL statements in PostgreSQL audit logs that include unescaped single quotes adjacent to high-bit byte sequences
  • Database sessions originating from application service accounts that execute DDL or privilege-changing statements outside normal workflows
  • Use of BIG5 client encoding combined with EUC_TW or MULE_INTERNAL server encoding in connection logs

Detection Strategies

  • Enable log_statement = 'all' on affected PostgreSQL servers and review logs for malformed multi-byte sequences in query strings
  • Inspect application source for direct invocation of psql with arguments built from PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), or PQescapeStringConn() output
  • Correlate process execution telemetry on database hosts to flag psql child processes spawning shells or external binaries

Monitoring Recommendations

  • Forward PostgreSQL logs and host process telemetry into a centralized analytics platform for cross-source correlation
  • Alert on psql invocations that include \!, \copy, or \i meta-commands when launched by application service accounts
  • Track installed PostgreSQL package versions across the fleet and alert on hosts running releases prior to 17.3, 16.7, 15.11, 14.16, or 13.19

How to Mitigate CVE-2025-1094

Immediate Actions Required

  • Upgrade PostgreSQL server and client packages to 17.3, 16.7, 15.11, 14.16, 13.19, or later on every affected host
  • Audit application code that pipes escaped strings into psql and refactor to use parameterized queries through libpq directly
  • Restrict and rotate credentials for any PostgreSQL roles accessible to applications that handle untrusted input

Patch Information

The PostgreSQL Global Development Group released fixed builds on the February 2025 update cycle. Distribution-specific patches are available through the Debian LTS Announcement 2025-02-15, the Debian LTS Announcement 2025-02-24, and the NetApp Security Advisory ntap-20250221-0010. Apply the vendor-supplied package for your platform and restart the PostgreSQL service.

Workarounds

  • Avoid passing the output of libpq escape functions to psql as command-line arguments or standard input until patching is complete
  • Set client_encoding to a value other than BIG5 when communicating with servers using EUC_TW or MULE_INTERNAL
  • Restrict network access to PostgreSQL servers using firewall rules so only trusted application hosts can connect
bash
# Verify installed PostgreSQL version against fixed releases
psql --version

# Example Debian/Ubuntu upgrade path
sudo apt-get update
sudo apt-get install --only-upgrade postgresql postgresql-client libpq5
sudo systemctl restart postgresql

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

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechPostgresql

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability82.36%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-149
  • Technical References
  • PostgreSQL Security Advisory CVE-2025-1094

  • OpenWall OSS Security Discussion

  • OpenWall OSS Security Update

  • Debian LTS Announcement 2025-02-15

  • Debian LTS Announcement 2025-02-24

  • NetApp Security Advisory ntap-20250221-0010
  • Related CVEs
  • CVE-2024-1597: PostgreSQL JDBC Driver SQLi Vulnerability

  • CVE-2023-39417: PostgreSQL SQL Injection Vulnerability

  • CVE-2021-23214: PostgreSQL SQL Injection Vulnerability

  • CVE-2020-25695: PostgreSQL SQL Injection Vulnerability
Default Legacy - Prefooter | 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