CVEfocus › CVE database › CVE-2024-7348

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

CVSS 8.8 HighEPSS 1.6% (higher than 76% of CVEs)Published 2024-08-08Updated 2024-08-22Assigner: PostgreSQL

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.

CWE-367

What to do

Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

104Fixed
3Fix pending
26Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04postgresql-16Fixed16.4-0ubuntu0.24.04.1UBUNTU-CVE-2024-7348
Ubuntu 22.04postgresql-14Fixed14.13-0ubuntu0.22.04.1UBUNTU-CVE-2024-7348
Ubuntu 20.04postgresql-12Fixed12.20-0ubuntu0.20.04.1UBUNTU-CVE-2024-7348
Ubuntu 18.04postgresql-10Fix pending10.23-0ubuntu0.18.04.2+esm2 (Ubuntu Pro)UBUNTU-CVE-2024-7348
Ubuntu 16.04postgresql-9.5Fix pending9.5.25-0ubuntu0.16.04.1+esm8 (Ubuntu Pro)UBUNTU-CVE-2024-7348
Ubuntu 14.04postgresql-9.3Fix pending9.3.24-0ubuntu0.14.04+esm1 (Ubuntu Pro)UBUNTU-CVE-2024-7348
Debian 12postgresql-15Fixed15.8-0+deb12u1DEBIAN-CVE-2024-7348
Red Hat Enterprise Linux 10postgresqlNot affected
Red Hat Enterprise Linux 10postgresql-contribNot affected
Red Hat Enterprise Linux 10postgresql-docsNot affected
Red Hat Enterprise Linux 10postgresql-plperlNot affected
Red Hat Enterprise Linux 10postgresql-plpython3Not affected
Red Hat Enterprise Linux 10postgresql-pltclNot affected
Red Hat Enterprise Linux 10postgresql-private-develNot affected
Red Hat Enterprise Linux 10postgresql-private-libsNot affected
Red Hat Enterprise Linux 10postgresql-serverNot affected
Red Hat Enterprise Linux 10postgresql-server-develNot affected
Red Hat Enterprise Linux 10postgresql-staticNot affected
Red Hat Enterprise Linux 10postgresql-testNot affected
Red Hat Enterprise Linux 10postgresql-test-rpm-macrosNot affected
Red Hat Enterprise Linux 10postgresql-upgradeNot affected
Red Hat Enterprise Linux 10postgresql-upgrade-develNot affected
Red Hat Enterprise Linux 10postgresql16Not affected
Red Hat Enterprise Linux 9pg_repackFixed0:1.4.8-1.module+el9.2.0+17405+aeb9ec60RHSA-2024:5929
Red Hat Enterprise Linux 9pgauditFixed0:16.0-1.module+el9.4.0+20427+07482b8cRHSA-2024:6020
Red Hat Enterprise Linux 9postgres-decoderbufsFixed0:2.4.0-1.Final.module+el9.4.0+20427+07482b8cRHSA-2024:6020
Red Hat Enterprise Linux 9postgresqlFixed0:13.16-1.el9_4RHSA-2024:5929
Red Hat Enterprise Linux 9postgresql-contribFixed0:13.16-1.el9_4RHSA-2024:5929
Red Hat Enterprise Linux 9postgresql-docsFixed0:15.8-1.module+el9.4.0+22208+cd6b92ffRHSA-2024:5999
Red Hat Enterprise Linux 9postgresql-plperlFixed0:16.4-1.module+el9.4.0+22207+8466e31fRHSA-2024:5999
Red Hat Enterprise Linux 9postgresql-plpython3Fixed0:13.16-1.el9_4RHSA-2024:5929
Red Hat Enterprise Linux 9postgresql-pltclFixed0:15.8-1.module+el9.4.0+22208+cd6b92ffRHSA-2024:5999
Red Hat Enterprise Linux 9postgresql-private-develFixed0:13.16-1.el9_4RHSA-2024:6020
Red Hat Enterprise Linux 9postgresql-private-libsFixed0:15.8-1.module+el9.4.0+22208+cd6b92ffRHSA-2024:5929
Red Hat Enterprise Linux 9postgresql-serverFixed0:13.16-1.el9_4RHSA-2024:6020
Red Hat Enterprise Linux 9postgresql-server-develFixed0:16.4-1.module+el9.4.0+22207+8466e31fRHSA-2024:5999
Red Hat Enterprise Linux 9postgresql-staticFixed0:15.8-1.module+el9.4.0+22208+cd6b92ffRHSA-2024:5929
Red Hat Enterprise Linux 9postgresql-testFixed0:16.4-1.module+el9.4.0+22207+8466e31fRHSA-2024:6020
Red Hat Enterprise Linux 9postgresql-test-rpm-macrosFixed0:16.4-1.module+el9.4.0+22207+8466e31fRHSA-2024:6020
Red Hat Enterprise Linux 9postgresql-upgradeFixed0:15.8-1.module+el9.4.0+22208+cd6b92ffRHSA-2024:5999
Red Hat Enterprise Linux 9postgresql-upgrade-develFixed0:13.16-1.el9_4RHSA-2024:5929
Red Hat Enterprise Linux 8pg_repackFixed0:1.4.8-1.module+el8.9.0+19797+c4ce5969RHSA-2024:6000
Red Hat Enterprise Linux 8pgauditFixed0:1.7.0-1.module+el8.9.0+19797+c4ce5969RHSA-2024:6000
Red Hat Enterprise Linux 8postgres-decoderbufsFixed0:0.10.0-2.module+el8.9.0+20664+9c30cf7fRHSA-2024:6001
Red Hat Enterprise Linux 8postgresqlFixed0:13.16-1.module+el8.10.0+22213+5adc94feRHSA-2024:5927
Red Hat Enterprise Linux 8postgresql-contribFixed0:15.8-1.module+el8.10.0+22212+a51fe170RHSA-2024:5927
Red Hat Enterprise Linux 8postgresql-docsFixed0:15.8-1.module+el8.10.0+22212+a51fe170RHSA-2024:6018
Red Hat Enterprise Linux 8postgresql-plperlFixed0:16.4-1.module+el8.10.0+22209+060d7a0aRHSA-2024:6018
Red Hat Enterprise Linux 8postgresql-plpython3Fixed0:16.4-1.module+el8.10.0+22209+060d7a0aRHSA-2024:6001
Red Hat Enterprise Linux 8postgresql-pltclFixed0:13.16-1.module+el8.10.0+22213+5adc94feRHSA-2024:6000
Red Hat Enterprise Linux 8postgresql-private-develFixed0:15.8-1.module+el8.10.0+22212+a51fe170RHSA-2024:5927
Red Hat Enterprise Linux 8postgresql-private-libsFixed0:16.4-1.module+el8.10.0+22209+060d7a0aRHSA-2024:6001
Red Hat Enterprise Linux 8postgresql-serverFixed0:16.4-1.module+el8.10.0+22209+060d7a0aRHSA-2024:6000
Red Hat Enterprise Linux 8postgresql-server-develFixed0:15.8-1.module+el8.10.0+22212+a51fe170RHSA-2024:6018
Red Hat Enterprise Linux 8postgresql-staticFixed0:13.16-1.module+el8.10.0+22213+5adc94feRHSA-2024:5927
Red Hat Enterprise Linux 8postgresql-testFixed0:16.4-1.module+el8.10.0+22209+060d7a0aRHSA-2024:6000
Red Hat Enterprise Linux 8postgresql-test-rpm-macrosFixed0:13.16-1.module+el8.10.0+22213+5adc94feRHSA-2024:6001
Red Hat Enterprise Linux 8postgresql-upgradeFixed0:15.8-1.module+el8.10.0+22212+a51fe170RHSA-2024:6018
Red Hat Enterprise Linux 8postgresql-upgrade-develFixed0:13.16-1.module+el8.10.0+22213+5adc94feRHSA-2024:6000
Red Hat Enterprise Linux 6postgresqlNot affected
Red Hat Enterprise Linux 6postgresql-contribNot affected
Red Hat Enterprise Linux 6postgresql-develNot affected
Red Hat Enterprise Linux 6postgresql-docsNot affected
Red Hat Enterprise Linux 6postgresql-libsNot affected
Red Hat Enterprise Linux 6postgresql-plperlNot affected
Red Hat Enterprise Linux 6postgresql-plpythonNot affected
Red Hat Enterprise Linux 6postgresql-pltclNot affected
Red Hat Enterprise Linux 6postgresql-serverNot affected
Red Hat Enterprise Linux 6postgresql-testNot affected
AlmaLinux 9pg_repackFixed1.4.8-1.module_el9.4.0+66+eb9878bcALSA-2024:6020
AlmaLinux 9pgauditFixed1.7.0-1.module_el9.3.0+52+21733919ALSA-2024:5929
AlmaLinux 9postgres-decoderbufsFixed1.9.7-1.Final.module_el9.3.0+52+21733919ALSA-2024:5929
AlmaLinux 9postgresqlFixed16.4-1.module_el9.4.0+109+624ac33aALSA-2024:6020
AlmaLinux 9postgresql-contribFixed15.8-1.module_el9.4.0+111+667b9e9eALSA-2024:5999
AlmaLinux 9postgresql-docsFixed15.8-1.module_el9.4.0+111+667b9e9eALSA-2024:5929
AlmaLinux 9postgresql-plperlFixed15.8-1.module_el9.4.0+111+667b9e9eALSA-2024:5929
AlmaLinux 9postgresql-plpython3Fixed16.4-1.module_el9.4.0+109+624ac33aALSA-2024:6020
AlmaLinux 9postgresql-pltclFixed13.16-1.el9_4ALSA-2024:5929
AlmaLinux 9postgresql-private-develFixed15.8-1.module_el9.4.0+111+667b9e9eALSA-2024:5999
AlmaLinux 9postgresql-private-libsFixed13.16-1.el9_4ALSA-2024:5929
AlmaLinux 9postgresql-serverFixed13.16-1.el9_4ALSA-2024:5929
AlmaLinux 9postgresql-server-develFixed16.4-1.module_el9.4.0+109+624ac33aALSA-2024:6020
AlmaLinux 9postgresql-staticFixed13.16-1.el9_4ALSA-2024:6020
AlmaLinux 9postgresql-testFixed15.8-1.module_el9.4.0+111+667b9e9eALSA-2024:5999
AlmaLinux 9postgresql-test-rpm-macrosFixed16.4-1.module_el9.4.0+109+624ac33aALSA-2024:6020
AlmaLinux 9postgresql-upgradeFixed15.8-1.module_el9.4.0+111+667b9e9eALSA-2024:5999
AlmaLinux 9postgresql-upgrade-develFixed16.4-1.module_el9.4.0+109+624ac33aALSA-2024:5999
AlmaLinux 8pg_repackFixed1.4.6-3.module_el8.9.0+3704+f1f917ceALSA-2024:5927
AlmaLinux 8pgauditFixed16.0-1.module_el8.10.0+3798+606ebb9fALSA-2024:6018
AlmaLinux 8postgres-decoderbufsFixed0.10.0-2.module_el8.6.0+2760+1746ec94ALSA-2024:6001
AlmaLinux 8postgresqlFixed12.20-1.module_el8.10.0+3886+1dfe41d7ALSA-2024:6001
AlmaLinux 8postgresql-contribFixed16.4-1.module_el8.10.0+3884+a79fbae6ALSA-2024:6018
AlmaLinux 8postgresql-docsFixed15.8-1.module_el8.10.0+3888+1aead837ALSA-2024:6018
AlmaLinux 8postgresql-plperlFixed15.8-1.module_el8.10.0+3888+1aead837ALSA-2024:5927
AlmaLinux 8postgresql-plpython3Fixed15.8-1.module_el8.10.0+3888+1aead837ALSA-2024:6000
AlmaLinux 8postgresql-pltclFixed12.20-1.module_el8.10.0+3886+1dfe41d7ALSA-2024:6018
AlmaLinux 8postgresql-private-develFixed15.8-1.module_el8.10.0+3888+1aead837ALSA-2024:5927
AlmaLinux 8postgresql-private-libsFixed15.8-1.module_el8.10.0+3888+1aead837ALSA-2024:5927
AlmaLinux 8postgresql-serverFixed15.8-1.module_el8.10.0+3888+1aead837ALSA-2024:5927
AlmaLinux 8postgresql-server-develFixed16.4-1.module_el8.10.0+3884+a79fbae6ALSA-2024:6001
AlmaLinux 8postgresql-staticFixed12.20-1.module_el8.10.0+3886+1dfe41d7ALSA-2024:5927
AlmaLinux 8postgresql-testFixed15.8-1.module_el8.10.0+3888+1aead837ALSA-2024:6000
AlmaLinux 8postgresql-test-rpm-macrosFixed12.20-1.module_el8.10.0+3886+1dfe41d7ALSA-2024:6001
AlmaLinux 8postgresql-upgradeFixed13.16-1.module_el8.10.0+3887+93e5d125ALSA-2024:6001
AlmaLinux 8postgresql-upgrade-develFixed16.4-1.module_el8.10.0+3884+a79fbae6ALSA-2024:6001
Rocky Linux 9pgauditFixed0:16.0-1.module+el9.5.0+30638+72f697e1RLSA-2024:6020
Rocky Linux 9postgres-decoderbufsFixed0:1.9.7-1.Final.module+el9.5.0+30637+4391fccaRLSA-2024:5929
Rocky Linux 9postgresqlFixed0:13.16-1.el9_4RLSA-2024:5999
Rocky Linux 8pg_repackFixed0:1.4.6-3.module+el8.10.0+1862+29bef648RLSA-2024:6000
Rocky Linux 8pgauditFixed0:1.7.0-1.module+el8.9.0+1525+fc91df60RLSA-2024:6000
Rocky Linux 8postgres-decoderbufsFixed0:1.9.7-1.Final.module+el8.9.0+1525+fc91df60RLSA-2024:6000
Rocky Linux 8postgresqlFixed0:16.4-1.module+el8.10.0+1858+fcc46a79RLSA-2024:6001
Alpine Linux 3.24postgresql16Fixed16.4-r0ALPINE-CVE-2024-7348
Alpine Linux 3.23postgresql16Fixed16.4-r0ALPINE-CVE-2024-7348
Alpine Linux 3.22postgresql15Fixed15.8-r0ALPINE-CVE-2024-7348
Alpine Linux 3.22postgresql16Fixed16.4-r0ALPINE-CVE-2024-7348
Alpine Linux 3.21postgresql15Fixed15.8-r0ALPINE-CVE-2024-7348
Alpine Linux 3.21postgresql16Fixed16.4-r0ALPINE-CVE-2024-7348
Alpine Linux 3.20postgresql14Fixed14.13-r0ALPINE-CVE-2024-7348
Alpine Linux 3.20postgresql15Fixed15.8-r0ALPINE-CVE-2024-7348
Alpine Linux 3.20postgresql16Fixed16.4-r0ALPINE-CVE-2024-7348
Alpine Linux 3.19postgresql13Fixed13.16-r0ALPINE-CVE-2024-7348
Alpine Linux 3.19postgresql14Fixed14.13-r0ALPINE-CVE-2024-7348
Alpine Linux 3.19postgresql15Fixed15.8-r0ALPINE-CVE-2024-7348
Alpine Linux 3.19postgresql16Fixed16.4-r0ALPINE-CVE-2024-7348
Alpine Linux 3.18postgresql12Fixed12.20-r0ALPINE-CVE-2024-7348
Alpine Linux 3.18postgresql13Fixed13.16-r0ALPINE-CVE-2024-7348
Alpine Linux 3.18postgresql14Fixed14.13-r0ALPINE-CVE-2024-7348
Alpine Linux 3.18postgresql15Fixed15.8-r0ALPINE-CVE-2024-7348
Alpine Linux 3.17postgresql12Fixed12.20-r0ALPINE-CVE-2024-7348
Alpine Linux 3.17postgresql13Fixed13.16-r0ALPINE-CVE-2024-7348
Alpine Linux 3.17postgresql14Fixed14.13-r0ALPINE-CVE-2024-7348
Alpine Linux 3.17postgresql15Fixed15.8-r0ALPINE-CVE-2024-7348

What the vendor says

As published in the CVE record by PostgreSQL, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.