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-2024-7348

CVE-2024-7348: PostgreSQL pg_dump Race Condition Flaw

CVE-2024-7348 is a Time-of-check Time-of-use race condition in PostgreSQL pg_dump that enables attackers to execute arbitrary SQL functions as superuser. This article covers technical details, affected versions, and mitigation.

Published: January 28, 2026

CVE-2024-7348 Overview

A Time-of-check Time-of-use (TOCTOU) race condition vulnerability has been identified in PostgreSQL's pg_dump utility. This critical flaw allows an object creator to execute arbitrary SQL functions as the user running pg_dump, which is often a superuser with elevated database privileges. The attack involves replacing another relation type with a view or foreign table during the dump operation.

Critical Impact

An attacker with database object creation privileges can exploit this race condition to execute arbitrary SQL functions with superuser privileges, potentially leading to complete database compromise, data exfiltration, or further lateral movement within the infrastructure.

Affected Products

  • PostgreSQL versions before 16.4
  • PostgreSQL versions before 15.8
  • PostgreSQL versions before 14.13
  • PostgreSQL versions before 13.16
  • PostgreSQL versions before 12.20

Discovery Timeline

  • August 8, 2024 - CVE-2024-7348 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2024-7348

Vulnerability Analysis

This vulnerability stems from a classic Time-of-check Time-of-use (TOCTOU) race condition in the pg_dump utility. The flaw occurs during the database backup process when pg_dump checks and then subsequently uses database objects. Between these two operations, an attacker with object creation privileges can replace a legitimate relation type (such as a table) with a malicious view or foreign table.

The attack requires the attacker to retain an open transaction, which makes winning the race condition trivial. When pg_dump processes the substituted object, it executes any associated SQL functions in the context of the user running the dump operation—typically a superuser account. This privilege escalation can lead to arbitrary code execution within the database context, unauthorized data access, or complete database compromise.

Root Cause

The root cause is a TOCTOU race condition in pg_dump's object handling logic. The utility performs a check on database objects at one point in time but then operates on them at a later point without re-verifying their state. This temporal gap between checking and using creates a window of opportunity for an attacker to substitute a malicious object. The design flaw fails to implement proper locking mechanisms or atomic operations that would prevent object modification during the critical dump operation window.

Attack Vector

The attack is network-accessible and requires the attacker to have low-level privileges (specifically, the ability to create database objects). While the attack complexity is high due to the race condition timing requirement, the attacker can trivially win the race by maintaining an open database transaction.

The attack sequence involves:

  1. An attacker with object creation privileges monitors for pg_dump operations to begin
  2. The attacker maintains an open transaction to extend the race window
  3. When pg_dump starts processing objects, the attacker replaces a legitimate relation with a malicious view or foreign table containing arbitrary SQL functions
  4. pg_dump executes the malicious SQL functions with elevated privileges (typically superuser)

The vulnerability mechanism involves object substitution during the pg_dump process. When pg_dump enumerates database objects, an attacker can replace a relation with a view containing malicious function calls. Since the attacker can hold an open transaction, the timing window becomes exploitable. For detailed technical information, refer to the PostgreSQL Security Advisory CVE-2024-7348.

Detection Methods for CVE-2024-7348

Indicators of Compromise

  • Unexpected creation or modification of views or foreign tables coinciding with pg_dump operations
  • Unusual superuser activity or privilege escalation events in PostgreSQL logs
  • Database objects being replaced or altered during backup windows
  • Open transactions held by untrusted users during backup operations

Detection Strategies

  • Monitor PostgreSQL logs for suspicious DDL operations (CREATE VIEW, CREATE FOREIGN TABLE) occurring during pg_dump execution windows
  • Implement auditing on database object creation and modification events, particularly for relation replacements
  • Track long-running or open transactions from non-administrative users that coincide with backup schedules
  • Use PostgreSQL's log_statement = 'ddl' configuration to capture all DDL operations for forensic analysis

Monitoring Recommendations

  • Configure alerts for backup job anomalies or failures that may indicate exploitation attempts
  • Monitor process execution to detect concurrent pg_dump operations and suspicious database sessions
  • Implement real-time monitoring of database privilege usage patterns, especially superuser function execution
  • Review backup logs for unexpected object types or content that differs from baseline expectations

How to Mitigate CVE-2024-7348

Immediate Actions Required

  • Upgrade PostgreSQL to patched versions: 16.4, 15.8, 14.13, 13.16, or 12.20 immediately
  • Restrict database object creation privileges to trusted users only
  • Review and audit existing database objects for unauthorized modifications before running pg_dump
  • Consider running backups during maintenance windows with restricted user access

Patch Information

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

Current Version BranchUpgrade To
PostgreSQL 16.x16.4 or later
PostgreSQL 15.x15.8 or later
PostgreSQL 14.x14.13 or later
PostgreSQL 13.x13.16 or later
PostgreSQL 12.x12.20 or later

For complete patch details and download links, refer to the PostgreSQL Security Advisory CVE-2024-7348.

Workarounds

  • Restrict CREATE privileges on schemas to prevent unauthorized object creation during dump operations
  • Schedule pg_dump operations during maintenance windows when user activity is minimal
  • Run pg_dump with a dedicated user that has read-only access rather than superuser privileges where feasible
  • Implement network isolation for backup operations to limit attacker access during vulnerable windows
bash
# Restrict object creation privileges - revoke from public
psql -c "REVOKE CREATE ON SCHEMA public FROM PUBLIC;"

# Configure enhanced logging for DDL operations
# Add to postgresql.conf:
# log_statement = 'ddl'
# log_min_duration_statement = 0

# Run pg_dump with specific user instead of superuser where possible
pg_dump -U backup_readonly_user -d mydatabase > backup.sql

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

  • Vulnerability Details
  • TypeRace Condition

  • Vendor/TechPostgresql

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.76%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-367
  • Technical References
  • OpenWall OSS Security List Discussion

  • NetApp Security Advisory ntap-20240822-0002
  • Vendor Resources
  • PostgreSQL Security Advisory CVE-2024-7348
  • Related CVEs
  • CVE-2026-32286: PostgreSQL DataRow DoS Vulnerability

  • CVE-2026-4427: pgproto3 Denial of Service Vulnerability

  • CVE-2025-13957: Hard-coded Credentials RCE Vulnerability

  • CVE-2026-2361: PostgreSQL Anonymizer Privilege Escalation
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