Vulnerability · Published Aug 8, 2024 · Assigned by PostgreSQL
CVE-2024-7348PostgreSQL relation replacement during pg_dump executes arbitrary SQL
High 8.8
In plain English
A high-severity security flaw in PostgreSQL. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.6% (higher than 75% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | pg_repack | 1.4.6-3.module_el8.6.0+3095+ee60d910 | ALSA-2024:6018 |
| AlmaLinux:8 | pg_repack | 1.4.6-3.module_el8.9.0+3704+f1f917ce | ALSA-2024:6000 |
| AlmaLinux:8 | pg_repack | 1.4.8-1.module_el8.9.0+3706+885c732e | ALSA-2024:6001 |
| AlmaLinux:8 | pg_repack | 1.4.8-1.module_el8.10.0+3798+606ebb9f | ALSA-2024:5927 |
| AlmaLinux:8 | pg_repack | 1.4.6-3.module_el8.6.0+2760+1746ec94 | ALSA-2024:6018 |
| AlmaLinux:9 | pg_repack | 1.4.8-1.module_el9.4.0+66+eb9878bc | ALSA-2024:5929 |
| AlmaLinux:9 | pg_repack | 1.4.8-1.module_el9.3.0+52+21733919 | ALSA-2024:6020 |
| AlmaLinux:8 | pgaudit | 1.4.0-7.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:6000 |
| AlmaLinux:8 | pgaudit | 1.7.0-1.module_el8.9.0+3706+885c732e | ALSA-2024:6001 |
| AlmaLinux:8 | pgaudit | 1.5.0-1.module_el8.6.0+3095+ee60d910 | ALSA-2024:6018 |
| AlmaLinux:8 | pgaudit | 1.5.0-1.module_el8.6.0+2760+1746ec94 | ALSA-2024:6018 |
| AlmaLinux:8 | pgaudit | 16.0-1.module_el8.10.0+3798+606ebb9f | ALSA-2024:5927 |
| AlmaLinux:9 | pgaudit | 16.0-1.module_el9.4.0+66+eb9878bc | ALSA-2024:5929 |
| AlmaLinux:9 | pgaudit | 1.7.0-1.module_el9.3.0+52+21733919 | ALSA-2024:6020 |
| AlmaLinux:8 | postgres-decoderbufs | 1.9.7-1.Final.module_el8.9.0+3706+885c732e | ALSA-2024:6001 |
| AlmaLinux:8 | postgres-decoderbufs | 2.4.0-1.Final.module_el8.10.0+3798+606ebb9f | ALSA-2024:5927 |
| AlmaLinux:8 | postgres-decoderbufs | 0.10.0-2.module_el8.9.0+3704+f1f917ce | ALSA-2024:6000 |
| AlmaLinux:8 | postgres-decoderbufs | 0.10.0-2.module_el8.6.0+2760+1746ec94 | ALSA-2024:6018 |
| AlmaLinux:8 | postgres-decoderbufs | 0.10.0-2.module_el8.6.0+3095+ee60d910 | ALSA-2024:6018 |
| AlmaLinux:9 | postgres-decoderbufs | 1.9.7-1.Final.module_el9.3.0+52+21733919 | ALSA-2024:6020 |
| AlmaLinux:9 | postgres-decoderbufs | 2.4.0-1.Final.module_el9.4.0+66+eb9878bc | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:9 | postgresql | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:9 | postgresql | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:8 | postgresql-contrib | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-contrib | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql-contrib | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:8 | postgresql-contrib | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:9 | postgresql-contrib | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-contrib | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-contrib | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql-docs | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql-docs | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-docs | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql-docs | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:9 | postgresql-docs | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-docs | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:9 | postgresql-docs | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:8 | postgresql-plperl | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql-plperl | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:8 | postgresql-plperl | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-plperl | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:9 | postgresql-plperl | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-plperl | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-plperl | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql-plpython3 | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql-plpython3 | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-plpython3 | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql-plpython3 | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:9 | postgresql-plpython3 | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-plpython3 | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-plpython3 | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql-pltcl | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-pltcl | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:8 | postgresql-pltcl | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql-pltcl | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:9 | postgresql-pltcl | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-pltcl | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-pltcl | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql-private-devel | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-private-devel | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:9 | postgresql-private-devel | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-private-devel | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-private-devel | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql-private-libs | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-private-libs | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:9 | postgresql-private-libs | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-private-libs | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-private-libs | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql-server | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-server | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:8 | postgresql-server | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql-server | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:9 | postgresql-server | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-server | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:9 | postgresql-server | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:8 | postgresql-server-devel | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:8 | postgresql-server-devel | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql-server-devel | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql-server-devel | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:9 | postgresql-server-devel | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-server-devel | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-server-devel | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql-static | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql-static | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:8 | postgresql-static | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql-static | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:9 | postgresql-static | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:9 | postgresql-static | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-static | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:8 | postgresql-test | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-test | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql-test | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql-test | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:9 | postgresql-test | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:9 | postgresql-test | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-test | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:8 | postgresql-test-rpm-macros | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-test-rpm-macros | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql-test-rpm-macros | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:8 | postgresql-test-rpm-macros | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:9 | postgresql-test-rpm-macros | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-test-rpm-macros | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql-upgrade | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:8 | postgresql-upgrade | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-upgrade | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql-upgrade | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:9 | postgresql-upgrade | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| AlmaLinux:9 | postgresql-upgrade | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-upgrade | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:8 | postgresql-upgrade-devel | 15.8-1.module_el8.10.0+3888+1aead837 | ALSA-2024:6001 |
| AlmaLinux:8 | postgresql-upgrade-devel | 12.20-1.module_el8.10.0+3886+1dfe41d7 | ALSA-2024:6000 |
| AlmaLinux:8 | postgresql-upgrade-devel | 13.16-1.module_el8.10.0+3887+93e5d125 | ALSA-2024:6018 |
| AlmaLinux:8 | postgresql-upgrade-devel | 16.4-1.module_el8.10.0+3884+a79fbae6 | ALSA-2024:5927 |
| AlmaLinux:9 | postgresql-upgrade-devel | 16.4-1.module_el9.4.0+109+624ac33a | ALSA-2024:5929 |
| AlmaLinux:9 | postgresql-upgrade-devel | 13.16-1.el9_4 | ALSA-2024:5999 |
| AlmaLinux:9 | postgresql-upgrade-devel | 15.8-1.module_el9.4.0+111+667b9e9e | ALSA-2024:6020 |
| Alpine:v3.20 | postgresql14 | 14.13-r0 | ALPINE-CVE-2024-7348 |
| Alpine:v3.20 | postgresql15 | 15.8-r0 | ALPINE-CVE-2024-7348 |
| Alpine:v3.21 | postgresql15 | 15.8-r0 | ALPINE-CVE-2024-7348 |
| Alpine:v3.22 | postgresql15 | 15.8-r0 | ALPINE-CVE-2024-7348 |
| Alpine:v3.20 | postgresql16 | 16.4-r0 | ALPINE-CVE-2024-7348 |
| Alpine:v3.21 | postgresql16 | 16.4-r0 | ALPINE-CVE-2024-7348 |
| Alpine:v3.22 | postgresql16 | 16.4-r0 | ALPINE-CVE-2024-7348 |
| Alpine:v3.23 | postgresql16 | 16.4-r0 | ALPINE-CVE-2024-7348 |
| Alpine:v3.24 | postgresql16 | 16.4-r0 | ALPINE-CVE-2024-7348 |
| Debian:12 | postgresql-15 | 15.8-0+deb12u1 | DEBIAN-CVE-2024-7348 |
| Debian:12 | postgresql-15 | 15.8-0+deb12u1 | DSA-5745-1 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.9.0+1603+444d1b54 | RLSA-2024:6018 |
| Rocky Linux:8 | pg_repack | 0:1.4.8-1.module+el8.10.0+1622+bd25b19c | RLSA-2024:5927 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.10.0+1862+29bef648 | RLSA-2024:6000 |
| Rocky Linux:8 | pg_repack | 0:1.4.8-1.module+el8.10.0+1622+bd25b19c | RLSA-2024:6001 |
| Rocky Linux:8 | pg_repack | 0:1.4.8-1.module+el8.10.0+1858+fcc46a79 | RLSA-2024:6001 |
| Rocky Linux:8 | pg_repack | 0:1.4.8-1.module+el8.9.0+1525+fc91df60 | RLSA-2024:6001 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.10.0+1862+29bef648 | RLSA-2024:6018 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.9.0+1594+4a6adae9 | RLSA-2024:6018 |
| Rocky Linux:8 | pgaudit | 0:1.4.0-7.module+el8.9.0+1735+a332307b | RLSA-2024:6000 |
| Rocky Linux:8 | pgaudit | 0:1.7.0-1.module+el8.9.0+1525+fc91df60 | RLSA-2024:6001 |
| Rocky Linux:8 | pgaudit | 0:1.5.0-1.module+el8.9.0+1594+4a6adae9 | RLSA-2024:6018 |
| Rocky Linux:8 | pgaudit | 0:16.0-1.module+el8.10.0+1622+bd25b19c | RLSA-2024:5927 |
| Rocky Linux:9 | pgaudit | 0:1.7.0-1.module+el9.5.0+30637+4391fcca | RLSA-2024:6020 |
| Rocky Linux:9 | pgaudit | 0:16.0-1.module+el9.5.0+30638+72f697e1 | RLSA-2024:5929 |
| Rocky Linux:8 | postgres-decoderbufs | 0:2.4.0-1.Final.module+el8.10.0+1622+bd25b19c | RLSA-2024:5927 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.10.0+1862+29bef648 | RLSA-2024:6018 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.9.0+1594+4a6adae9 | RLSA-2024:6018 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.9.0+1603+444d1b54 | RLSA-2024:6018 |
| Rocky Linux:8 | postgres-decoderbufs | 0:1.9.7-1.Final.module+el8.9.0+1525+fc91df60 | RLSA-2024:6001 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.10.0+1862+29bef648 | RLSA-2024:6000 |
| Rocky Linux:9 | postgres-decoderbufs | 0:1.9.7-1.Final.module+el9.5.0+30637+4391fcca | RLSA-2024:6020 |
| Rocky Linux:9 | postgres-decoderbufs | 0:2.4.0-1.Final.module+el9.5.0+30638+72f697e1 | RLSA-2024:5929 |
| Rocky Linux:8 | postgresql | 0:15.8-1.module+el8.10.0+1864+f5aa9248 | RLSA-2024:6001 |
| Rocky Linux:8 | postgresql | 0:16.4-1.module+el8.10.0+1858+fcc46a79 | RLSA-2024:5927 |
| Rocky Linux:8 | postgresql | 0:12.20-1.module+el8.10.0+1862+29bef648 | RLSA-2024:6000 |
| Rocky Linux:8 | postgresql | 0:13.16-1.module+el8.10.0+1863+86f282f3 | RLSA-2024:6018 |
| Rocky Linux:9 | postgresql | 0:13.16-1.el9_4 | RLSA-2024:5999 |
| Ubuntu:22.04:LTS | postgresql-14 | 14.13-0ubuntu0.22.04.1 | UBUNTU-CVE-2024-7348 |
| Ubuntu:22.04:LTS | postgresql-14 | 14.13-0ubuntu0.22.04.1 | USN-6968-1 |
| Ubuntu:24.04:LTS | postgresql-16 | 16.4-0ubuntu0.24.04.1 | USN-6968-1 |
| Ubuntu:24.04:LTS | postgresql-16 | 16.4-0ubuntu0.24.04.1 | UBUNTU-CVE-2024-7348 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| n/a | PostgreSQL | 16 – before 16.415 – before 15.814 – before 14.1313 – before 13.160 – before 12.20 |
Weakness: CWE-367 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H