PortGate

Advisories · Databases

CVE-2024-7348 High CVSS 8.8

PostgreSQL pg_dump race

Disclosed 2024 · Last reviewed 2 Dec 2026

A user who could already run SQL could replace an object while pg_dump was reading it and execute code as the operating-system user running pg_dump.

What happened

pg_dump followed an object that changed between the check and the read.

Affected and patched versions

Affected
PostgreSQL before 16.4, 15.8, 14.13, 13.16, and 12.20.
Patched
Those minor releases and later on each major.

How to check your server

Check

psql -c "SHOW server_version"

How to fix and harden

  1. Install the minor update for the major you run.
  2. Run pg_dump as a role that application users cannot become, from a client that is already patched.

Fix

psql -c "SHOW server_version"

Sources

Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON