Skip to main content
EPSS 1.6%top 26%

PostgreSQL relation replacement during pg_dump executes arbitrary SQL (CVE-2024-7348)

0
High
Published: 08/10/2024 (08/10/2024, 07:32:17 UTC)
Source: GCVE Database
Product: postgresql

Description

A TOCTOU race condition vulnerability in PostgreSQL's pg_dump utility allows an attacker who can create database objects to execute arbitrary SQL commands with the privileges of the pg_dump user, often a superuser. The attack involves replacing a relation with a view or foreign table during the dump process. This vulnerability affects multiple PostgreSQL versions prior to 12.20, 13.16, 14.13, 15.8, and 16.4. A patch is available to address this issue.

Affected software

redhat/postgresql
pkg:rpm/redhat/postgresql
Affected versions
=9.2.24-9.el7_9.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/08/2026, 15:16:04 UTC

Technical Analysis

CVE-2024-7348 describes a time-of-check to time-of-use (TOCTOU) race condition in the pg_dump utility of PostgreSQL. An attacker capable of creating objects in the database can exploit this by replacing a relation type with a view or foreign table during the dump process, causing arbitrary SQL functions to be executed as the user running pg_dump, which is often a superuser. The race condition is trivial to win if the attacker maintains an open transaction. Affected versions include all PostgreSQL releases before 12.20, 13.16, 14.13, 15.8, and 16.4. Red Hat has issued an important security advisory with patches for affected packages.

Potential Impact

Successful exploitation allows an attacker with the ability to create objects in the database to execute arbitrary SQL commands with the privileges of the pg_dump user, which is typically a superuser. This could lead to unauthorized data access, modification, or other privileged actions within the database environment.

Mitigation Recommendations

A patch is available and should be applied to affected PostgreSQL versions as soon as possible. Refer to the Red Hat advisory RHSA-2024:8495 and the PostgreSQL update channels for the appropriate security updates. No additional mitigation steps are required beyond applying the official fixes.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Csaf Category
csaf_security_advisory
Csaf Version
2.0
Publisher
Red Hat Product Security
Advisory Id
RHSA-2024:8495
Cve Count
1

Threat ID: 6a3da1ed4853345fc1830fa1

Added to database: 06/25/2026, 21:47:25 UTC

Last enriched: 09/08/2026, 15:16:04 UTC

Last updated: 09/10/2026, 19:36:49 UTC

Views: 67

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses