CVE-2024-7348

published 8 Aug 2024 · updated 12 Aug 2026

PostgreSQL relation replacement during pg_dump executes arbitrary SQL

8.8HighCVSS 8.8EPSS 2%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 2%. Fixed in 12.20, 13.16, 14.13 and 2 more.

Time-of-check Time-of-use (TOCTOU) race condition in pg_dump in PostgreSQL allows an object creator to execute arbitrary SQL functions as the user running pg_dump, which is often a superuser. The attack involves replacing another relation type with a view or foreign table. The attack requires waiting for pg_dump to start, but winning the race condition is trivial if the attacker retains an open transaction. Versions before PostgreSQL 16.4, 15.8, 14.13, 13.16, and 12.20 are affected.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
<12.20, >=13 <13.16, >=14 <14.13, >=15 <15.8, >=16 <16.412.20, 13.16, 14.13, 15.8, 16.4

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

CVE-2024-7348 severity on Zeptric[![CVE-2024-7348](https://zeptric.io/badge/cve/CVE-2024-7348.svg)](https://zeptric.io/cve/CVE-2024-7348)