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-2025-8715

CVE-2025-8715: PostgreSQL pg_dump RCE Vulnerability

CVE-2025-8715 is a remote code execution flaw in PostgreSQL pg_dump that allows attackers to execute arbitrary code during database restore operations. This article covers technical details, affected versions, and mitigation.

Published: March 11, 2026

CVE-2025-8715 Overview

CVE-2025-8715 is a critical command injection vulnerability in PostgreSQL's pg_dump utility that allows attackers to execute arbitrary code during database restore operations. The vulnerability stems from improper neutralization of newline characters, enabling malicious actors to inject psql meta-commands through specially crafted database object names. This flaw affects multiple PostgreSQL backup and migration utilities including pg_dump, pg_dumpall, pg_restore, and pg_upgrade.

Critical Impact

An attacker with access to the origin database server can inject arbitrary code that executes with the privileges of the operating system account running psql during dump restoration, potentially achieving superuser-level SQL injection on the target server.

Affected Products

  • PostgreSQL versions 17.0 through 17.5 (fixed in 17.6)
  • PostgreSQL versions 16.0 through 16.9 (fixed in 16.10)
  • PostgreSQL versions 15.0 through 15.13 (fixed in 15.14)
  • PostgreSQL versions 14.0 through 14.18 (fixed in 14.19)
  • PostgreSQL versions 13.0 through 13.21 (fixed in 13.22)
  • PostgreSQL versions 11.20 through 12.x (regression introduced in 11.20)

Discovery Timeline

  • 2025-08-14 - CVE-2025-8715 published to NVD
  • 2025-08-15 - Last updated in NVD database

Technical Details for CVE-2025-8715

Vulnerability Analysis

This vulnerability represents a regression of CVE-2012-0868, which had previously addressed newline injection issues in PostgreSQL dump utilities. The flaw was reintroduced in version 11.20, affecting the backup and restore workflow that is fundamental to PostgreSQL database administration.

The attack exploits the trust relationship between the dump file and the restore process. When pg_dump generates a SQL dump file, it includes object names (tables, functions, views, etc.) that are later interpreted by psql during restoration. By embedding newline characters followed by psql meta-commands within object names on the origin server, an attacker can break out of the expected SQL context and execute arbitrary commands.

The vulnerability is classified under CWE-93 (Improper Neutralization of CRLF Sequences), which describes weaknesses where applications fail to properly sanitize input containing carriage return and line feed characters before using that input in HTTP headers or other line-oriented protocols.

Root Cause

The root cause lies in insufficient input validation and output encoding within pg_dump when processing database object names. When generating the dump output, the utility fails to properly escape or neutralize newline characters embedded in object names. This allows the newline sequence to terminate the current SQL statement or string context, enabling subsequent content to be interpreted as new psql meta-commands rather than as part of the object name.

The regression in version 11.20 suggests that changes to the code handling object name serialization inadvertently removed or bypassed the sanitization logic that was implemented to address CVE-2012-0868.

Attack Vector

The attack requires an attacker to have privileges on the source PostgreSQL server to create database objects with malicious names. The attack sequence involves:

  1. An attacker creates a database object (such as a table, function, or view) with a name containing embedded newline characters followed by psql meta-commands
  2. A database administrator performs a routine backup using pg_dump or pg_dumpall
  3. The generated dump file contains the malicious object name without proper sanitization
  4. When an administrator restores the dump using psql, the embedded meta-commands execute with the privileges of the restoring user's operating system account

The vulnerability is particularly dangerous because it bridges the trust boundary between the database server and the client machine performing the restore. Code execution occurs on the client side, potentially affecting systems that are otherwise isolated from the compromised database server.

For technical details on the vulnerability mechanism and exploitation, refer to the PostgreSQL Security Advisory CVE-2025-8715.

Detection Methods for CVE-2025-8715

Indicators of Compromise

  • Unexpected or unusual database object names containing newline characters (\n, \r\n) or escape sequences
  • Database objects with names containing psql meta-command syntax such as \!, \copy, or \o
  • Suspicious process execution originating from psql processes during restore operations
  • Unexpected network connections or file system activity during database restoration

Detection Strategies

  • Implement database auditing to log all DDL operations, particularly CREATE statements for objects with unusual names
  • Monitor psql and pg_restore process execution for unexpected child processes or system calls
  • Scan dump files for suspicious patterns before restoration, particularly looking for newline-separated meta-commands within quoted identifiers
  • Deploy endpoint detection to alert on unusual process trees spawned by database restore utilities

Monitoring Recommendations

  • Enable PostgreSQL statement logging to capture object creation with potentially malicious names
  • Implement file integrity monitoring on dump files stored in backup repositories
  • Configure alerting for execution of shell commands or file operations during scheduled restore windows
  • Review database object names periodically for suspicious character sequences or patterns

How to Mitigate CVE-2025-8715

Immediate Actions Required

  • Upgrade PostgreSQL to patched versions: 17.6, 16.10, 15.14, 14.19, or 13.22
  • Audit existing dump files for potentially malicious object names before restoration
  • Restrict privileges for creating database objects on production servers to trusted users only
  • Review and validate backup files generated by affected PostgreSQL versions before restoring to sensitive systems

Patch Information

PostgreSQL has released security updates addressing this vulnerability. Organizations should upgrade to the following minimum versions:

BranchFixed Version
PostgreSQL 1717.6
PostgreSQL 1616.10
PostgreSQL 1515.14
PostgreSQL 1414.19
PostgreSQL 1313.22

Refer to the PostgreSQL Security Advisory CVE-2025-8715 for complete patch details and download information.

Workarounds

  • Use pg_dump with the --format=custom or --format=directory options and restore with pg_restore instead of plain SQL format, as these formats may have different parsing behavior
  • Implement a dump file validation script to scan for suspicious object names containing newline sequences before restoration
  • Perform restore operations in isolated environments with restricted network access and minimal privileges
  • Consider temporarily restricting CREATE privileges on production databases to prevent malicious object creation
bash
# Configuration example
# Verify PostgreSQL version to confirm patched status
psql --version

# Upgrade PostgreSQL on Debian/Ubuntu systems
sudo apt-get update && sudo apt-get install postgresql-17

# Upgrade PostgreSQL on RHEL/CentOS systems
sudo yum update postgresql17-server

# Scan dump file for suspicious newline sequences in object names (basic detection)
grep -P '\\n|\\r' database_backup.sql | head -20

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPostgresql

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.04%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-93
  • Technical References
  • PostgreSQL Security Advisory CVE-2025-8715
  • Related CVEs
  • CVE-2025-13957: Hard-coded Credentials RCE Vulnerability

  • CVE-2026-2004: PostgreSQL intarray Extension RCE Flaw

  • CVE-2026-2006: PostgreSQL RCE Vulnerability

  • CVE-2023-5869: PostgreSQL RCE 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