Skip to content
Fencer Vulns
high 8.8

CVE-2024-7348 json

PostgreSQL relation replacement during pg_dump executes arbitrary SQL

published 2024-08-08 2 y ago modified 2026-09-10 59 d ago also BIT-postgresql-2024-7348 , EUVD-2024-48286 , JLSEC-2026-52

cvss
8.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.6%
EPSS 1.6% chance of exploitation in 30 days, percentile 75%
public exploits
0
none known

Summary

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.

Patch / fix

  • bitnami postgresql 12.20.0, 13.16.0, 14.13.0, 15.8.0, 16.4.0
  • julia LibPQ_jll 16.8.0+0
  • n/a PostgreSQL 12.20, 13.16, 14.13, 15.8, 16.4
  • postgresql postgresql 12.20, 13.16, 14.13, 15.8, 16.4
  • postgresql-15 Debian 12 15.8-0+deb12u1

debian advisories DEBIAN-CVE-2024-7348

  • postgresql-12 Ubuntu 20.04 LTS 12.20-0ubuntu0.20.04.1
  • postgresql-14 Ubuntu 22.04 LTS 14.13-0ubuntu0.22.04.1
  • postgresql-16 Ubuntu 24.04 LTS 16.4-0ubuntu0.24.04.1
  • postgresql-10 Ubuntu Pro 18.04 LTS 10.23-0ubuntu0.18.04.2+esm2
  • postgresql-9.3 Ubuntu Pro 14.04 LTS 9.3.24-0ubuntu0.14.04+esm1
  • postgresql-9.5 Ubuntu Pro 16.04 LTS 9.5.25-0ubuntu0.16.04.1+esm8

ubuntu advisories UBUNTU-CVE-2024-7348

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • pgaudit RHEL 8 1.4.0-7.module+el8.10.0+22214+9beb89d6
  • pg_repack RHEL 8 1.4.6-3.module+el8.9.0+19330+c97ddbdf
  • postgresql RHEL 8 12.20-1.module+el8.10.0+22214+9beb89d6
  • postgresql-test RHEL 8 12.20-1.module+el8.10.0+22214+9beb89d6
  • postgresql-pltcl RHEL 8 12.20-1.module+el8.10.0+22214+9beb89d6
  • postgresql-plperl RHEL 8 12.20-1.module+el8.10.0+22214+9beb89d6
  • postgresql-server RHEL 8 12.20-1.module+el8.10.0+22214+9beb89d6
  • postgresql-contrib RHEL 8 12.20-1.module+el8.10.0+22214+9beb89d6

red hat advisories RHSA-2024:8495RHSA-2024:6137RHSA-2024:6138RHSA-2024:6559RHSA-2024:6139RHSA-2024:6000

  • postgresql16 SLE Module for Server Applications 15 SP6, SLE Module for Package Hub 15 SP6, SLE Module for Basesystem 15 SP6 +1 more 16.4-150600.16.5.1
  • postgresql15 SLE Module for Legacy 15 SP6, openSUSE Leap 15.6 15.8-150600.16.6.1
  • postgresql15 SLES for SAP 12 SP5, SLES 12 SP5, SLE Software Development Kit 12 SP5 15.8-3.28.1
  • postgresql13 SLES for SAP 12 SP5, SLES 12 SP5, SLE Software Development Kit 12 SP5 13.16-3.52.1
  • postgresql12 SLES for SAP 12 SP5, SLES 12 SP5, SLE Software Development Kit 12 SP5 12.20-3.58.1
  • postgresql16 SLES for SAP 12 SP5, SLES 12 SP5, SLE Software Development Kit 12 SP5 16.4-3.16.1
  • postgresql13 SLES for SAP 15 SP4, SLES for SAP 15 SP3, SLES for SAP 15 SP2 +10 more 13.16-150200.5.61.1
  • postgresql16 SLES for SAP 15 SP4, SLES for SAP 15 SP3, SLES for SAP 15 SP2 +14 more 16.4-150200.5.16.1

suse advisories SUSE-SU-2024:3159-2SUSE-SU-2024:3158-2SUSE-SU-2024:3158-3SUSE-SU-2024:3224-1SUSE-SU-2024:3192-1SUSE-SU-2024:3191-1

  • postgresql16 openSUSE Tumbleweed 16.4-1.1
  • postgresql17 openSUSE Tumbleweed 17~rc1-1.1
  • postgresql12 openSUSE Tumbleweed 12.20-1.1
  • postgresql13 openSUSE Tumbleweed 13.16-1.1
  • postgresql14 openSUSE Tumbleweed 14.13-1.1
  • postgresql15 openSUSE Tumbleweed 15.8-1.1

opensuse advisories openSUSE-SU-2024:14360-1openSUSE-SU-2024:14361-1openSUSE-SU-2024:14348-1openSUSE-SU-2024:14349-1openSUSE-SU-2024:14350-1openSUSE-SU-2024:14351-1

  • postgresql AlmaLinux 9 13.16-1.el9_4
  • postgresql-test AlmaLinux 9 13.16-1.el9_4
  • postgresql-pltcl AlmaLinux 9 13.16-1.el9_4
  • postgresql-plperl AlmaLinux 9 13.16-1.el9_4
  • postgresql-server AlmaLinux 9 13.16-1.el9_4
  • postgresql-contrib AlmaLinux 9 13.16-1.el9_4
  • postgresql-upgrade AlmaLinux 9 13.16-1.el9_4
  • postgresql-plpython3 AlmaLinux 9 13.16-1.el9_4

almalinux advisories ALSA-2024:5999ALSA-2024:6000ALSA-2024:6001ALSA-2024:6018ALSA-2024:6020ALSA-2024:5927

  • pgaudit Rocky Linux 9 1.7.0-1.module+el9.5.0+30637+4391fcca
  • postgres-decoderbufs Rocky Linux 9 1.9.7-1.Final.module+el9.5.0+30637+4391fcca
  • pgaudit Rocky Linux 8 1.7.0-1.module+el8.9.0+1525+fc91df60
  • pg_repack Rocky Linux 8 1.4.8-1.module+el8.10.0+1622+bd25b19c
  • pg_repack Rocky Linux 8 1.4.8-1.module+el8.10.0+1858+fcc46a79
  • pg_repack Rocky Linux 8 1.4.8-1.module+el8.9.0+1525+fc91df60
  • postgresql Rocky Linux 8 15.8-1.module+el8.10.0+1864+f5aa9248
  • postgres-decoderbufs Rocky Linux 8 1.9.7-1.Final.module+el8.9.0+1525+fc91df60

rocky linux advisories RLSA-2024:6020RLSA-2024:6001RLSA-2024:6018RLSA-2024:5929RLSA-2024:5999RLSA-2024:5927

  • postgresql12 Alpine 3.18, Alpine 3.17 12.20-r0
  • postgresql13 Alpine 3.19, Alpine 3.18, Alpine 3.17 13.16-r0
  • postgresql14 Alpine 3.20, Alpine 3.19, Alpine 3.18 +1 more 14.13-r0
  • postgresql15 Alpine 3.22, Alpine 3.21, Alpine 3.20 +3 more 15.8-r0
  • postgresql16 Alpine 3.24, Alpine 3.23, Alpine 3.22 +3 more 16.4-r0

alpine advisories ALPINE-CVE-2024-7348

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • postgresql Azure Linux 3.0 16.4-1
  • postgresql CBL-Mariner 2.0 14.13-1

azure linux advisories AZL-47636AZL-47690

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2024-7348 updated cvss 7.5

postgresql: PostgreSQL relation replacement during pg_dump executes arbitrary SQL

  • Red Hat CodeReady Linux Builder EUS (v.9.2) postgresql-test 13.16-1.el9_2
    fixed: vendor fix RHSA-2024:6145
  • Red Hat Enterprise Linux AppStream (v. 8) pgaudit 1.5.0-1.module+el8.9.0+20664+9c30cf7f, pgaudit 1.7.0-1.module+el8.9.0+19797+c4ce5969, pgaudit 16.0-1.module+el8.10.0+20413+d8116364, pgaudit 1.4.0-7.module+el8.10.0+22214+9beb89d6, pg_repack 1.4.6-3.module+el8.9.0+19330+c97ddbdf, pg_repack 1.4.6-3.module+el8.9.0+20664+9c30cf7f, +44 more
    fixed: vendor fix RHSA-2024:6000
  • Red Hat Enterprise Linux AppStream (v. 9) postgresql 13.16-1.el9_4, postgresql-pltcl 13.16-1.el9_4, postgresql-plperl 13.16-1.el9_4, postgresql-server 13.16-1.el9_4, postgresql-contrib 13.16-1.el9_4, postgresql-upgrade 13.16-1.el9_4, +28 more
    fixed: vendor fix RHSA-2024:6020
  • Red Hat Enterprise Linux AppStream AUS (v. 8.2) pgaudit 1.4.0-4.module+el8.2.0+9043+1dbb5661, postgresql 12.20-1.module+el8.2.0+22244+976eca25, postgresql-test 12.20-1.module+el8.2.0+22244+976eca25, postgresql-pltcl 12.20-1.module+el8.2.0+22244+976eca25, postgresql-plperl 12.20-1.module+el8.2.0+22244+976eca25, postgresql-server 12.20-1.module+el8.2.0+22244+976eca25, +5 more
    fixed: vendor fix RHSA-2024:6138
  • Red Hat Enterprise Linux AppStream AUS (v.8.4) pgaudit 1.5.0-1.module+el8.4.0+8873+b821c30a, pgaudit 1.4.0-6.module+el8.4.0+11288+c193d6d7, postgresql 12.20-1.module+el8.4.0+22243+33bf1bc8, postgresql 13.16-1.module+el8.4.0+22254+6164d1ea, postgresql-test 12.20-1.module+el8.4.0+22243+33bf1bc8, postgresql-test 13.16-1.module+el8.4.0+22254+6164d1ea, +16 more
    fixed: vendor fix RHSA-2024:6139
  • Red Hat Enterprise Linux AppStream AUS (v.8.6) pgaudit 1.5.0-1.module+el8.4.0+8873+b821c30a, pgaudit 1.4.0-5.module+el8.5.0+11354+78b3c9c5, pg_repack 1.4.6-3.module+el8.5.0+11354+78b3c9c5, pg_repack 1.4.6-3.module+el8.5.0+11357+bcc62552, postgresql 12.20-1.module+el8.6.0+22262+7cfee20c, postgresql 13.16-1.module+el8.6.0+22263+b155edfd, +18 more
    fixed: vendor fix RHSA-2024:6559
  • Red Hat Enterprise Linux AppStream E4S (v.8.4) pgaudit 1.5.0-1.module+el8.4.0+8873+b821c30a, pgaudit 1.4.0-6.module+el8.4.0+11288+c193d6d7, postgresql 12.20-1.module+el8.4.0+22243+33bf1bc8, postgresql 13.16-1.module+el8.4.0+22254+6164d1ea, postgresql-test 12.20-1.module+el8.4.0+22243+33bf1bc8, postgresql-test 13.16-1.module+el8.4.0+22254+6164d1ea, +16 more
    fixed: vendor fix RHSA-2024:6139
  • Red Hat Enterprise Linux AppStream E4S (v.8.6) pgaudit 1.5.0-1.module+el8.4.0+8873+b821c30a, pgaudit 1.4.0-5.module+el8.5.0+11354+78b3c9c5, pg_repack 1.4.6-3.module+el8.5.0+11354+78b3c9c5, pg_repack 1.4.6-3.module+el8.5.0+11357+bcc62552, postgresql 12.20-1.module+el8.6.0+22262+7cfee20c, postgresql 13.16-1.module+el8.6.0+22263+b155edfd, +18 more
    fixed: vendor fix RHSA-2024:6559
show 8 more
  • Red Hat Enterprise Linux AppStream E4S (v.9.0) postgresql 13.16-1.el9_0, postgresql-pltcl 13.16-1.el9_0, postgresql-plperl 13.16-1.el9_0, postgresql-server 13.16-1.el9_0, postgresql-contrib 13.16-1.el9_0, postgresql-upgrade 13.16-1.el9_0, +2 more
    fixed: vendor fix RHSA-2024:6144
  • Red Hat Enterprise Linux AppStream EUS (v.8.8) pgaudit 1.5.0-1.module+el8.4.0+8873+b821c30a, pgaudit 1.4.0-5.module+el8.5.0+11354+78b3c9c5, pgaudit 1.7.0-1.module+el8.8.0+17071+aaaceaa4, pg_repack 1.4.6-3.module+el8.5.0+11354+78b3c9c5, pg_repack 1.4.6-3.module+el8.5.0+11357+bcc62552, pg_repack 1.4.8-1.module+el8.8.0+17071+aaaceaa4, +31 more
    fixed: vendor fix RHSA-2024:6137
  • Red Hat Enterprise Linux AppStream EUS (v.9.2) postgresql 13.16-1.el9_2, postgresql-pltcl 13.16-1.el9_2, postgresql-plperl 13.16-1.el9_2, postgresql-server 13.16-1.el9_2, postgresql-contrib 13.16-1.el9_2, postgresql-upgrade 13.16-1.el9_2, +15 more
    fixed: vendor fix RHSA-2024:6140
  • Red Hat Enterprise Linux AppStream TUS (v.8.4) pgaudit 1.5.0-1.module+el8.4.0+8873+b821c30a, pgaudit 1.4.0-6.module+el8.4.0+11288+c193d6d7, postgresql 12.20-1.module+el8.4.0+22243+33bf1bc8, postgresql 13.16-1.module+el8.4.0+22254+6164d1ea, postgresql-test 12.20-1.module+el8.4.0+22243+33bf1bc8, postgresql-test 13.16-1.module+el8.4.0+22254+6164d1ea, +16 more
    fixed: vendor fix RHSA-2024:6139
  • Red Hat Enterprise Linux AppStream TUS (v.8.6) pgaudit 1.5.0-1.module+el8.4.0+8873+b821c30a, pgaudit 1.4.0-5.module+el8.5.0+11354+78b3c9c5, pg_repack 1.4.6-3.module+el8.5.0+11354+78b3c9c5, pg_repack 1.4.6-3.module+el8.5.0+11357+bcc62552, postgresql 12.20-1.module+el8.6.0+22262+7cfee20c, postgresql 13.16-1.module+el8.6.0+22263+b155edfd, +18 more
    fixed: vendor fix RHSA-2024:6559
  • Red Hat Enterprise Linux CRB (v. 9) postgresql-test 13.16-1.el9_4
    fixed: vendor fix RHSA-2024:5999
  • Red Hat Enterprise Linux Server (v. 7 ELS) postgresql 9.2.24-9.el7_9.1, postgresql-libs 9.2.24-9.el7_9.1, postgresql-test 9.2.24-9.el7_9.1, postgresql-pltcl 9.2.24-9.el7_9.1, postgresql-plperl 9.2.24-9.el7_9.1, postgresql-server 9.2.24-9.el7_9.1, +2 more Red Hat Enterprise Linux Server Optional (v. 7 ELS) postgresql-upgrade 9.2.24-9.el7_9.1
    fixed: vendor fix RHSA-2024:8495
  • Red Hat Enterprise Linux 6 postgresql, postgresql-libs, postgresql-test, postgresql-pltcl, postgresql-plperl, postgresql-server, +2 more Red Hat Enterprise Linux 10 postgresql16
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

cisa ICSA-26-120-06 updated cvss 8.8

ABB Ability Symphony Plus Engineering

  • ABB S+ Engineering 2.2, 2.3, 2.3_RU1, 2.3_RU2
    affected: vendor fix, workaround, mitigation
  • ABB S+ Engineering 2.4_SP2_RU1
    fixed

Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
total
Assessed
2 y ago

Exploit prediction

1.57% chance of exploitation in the next 30 days, higher than 75% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD 3.1 7.5 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
OSV 3.1 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
OSV 3.1 7.5 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
bitnami postgresql
<12.20.0
>=13.0.0, <13.16.0
>=14.0.0, <14.13.0
>=15.0.0, <15.8.0
>=16.0.0, <16.4.0
12.20.0
13.16.0
14.13.0
15.8.0
16.4.0
julia LibPQ_jll
<16.8.0+0
16.8.0+0

Affected products

  • n/a PostgreSQL
  • postgresql postgresql

Classification

Weakness
  • CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition
Technology feeds

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.

CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.