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

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.

Published: 2024-08-08 Last update: 2024-11-21 Assigner: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007 Source: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007

Conclusion & alert: CVE-2024-7348 is rated Moderate Risk (61.2/100): CVSS High severity, with medium exploitation likelihood (EPSS 1.57%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2024-7348

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 0.74% 1.57% +0.82%
2 2026-06-04 0.76% 0.74% -0.02%
3 2026-05-22 0.76%

Full EPSS history (35 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2024-7348

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
8.8 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 5.9 f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
7.5 3.1 HIGH
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
1.6 5.9 [email protected]

Weakness enumeration for CVE-2024-7348

OS Trackers for CVE-2024-7348

vendor priority summary link
alpine high CVE-2024-7348: 4 source package rows (postgresql, postgresql14, postgresql15, postgresql16); 36 state rows across 11 repos (3.17-main, 3.18-main, 3.19-main, 3.20-community, 3.20-main, 3.21-community, 3.21-main, 3.22-community, 3.22-main, edge-community, edge-main); fixed 18, open 18. https://security.alpinelinux.org/vuln/CVE-2024-7348
debian not yet assigned CVE-2024-7348 not yet assigned priority: Debian including 2 source packages (postgresql-13, postgresql-15), 2 status rows across 2 suites (bookworm, bullseye): resolved 2. https://security-tracker.debian.org/tracker/CVE-2024-7348
gentoo high CVE-2024-7348: 1 GLSA(s) (202409-02), 1 atom(s) (dev-db/postgresql); latest impact high. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2024-7348
redhat high https://access.redhat.com/security/cve/CVE-2024-7348
suse high CVE-2024-7348 severity important: SUSE including 631 source package names (0.3.32-3.4:libpq5-16.4-150600.16.5.1, 15-30.1:libpq5-16.4-150200.5.16.1, …), 1806 product×package rows across 71 product lines (Container containers/open-webui, Container private-registry/harbor-db, … (71 product lines)): Fixed 1219, Known Not Affected 252, Known Affected 231, Will Not Fix 104. https://www.suse.com/security/cve/CVE-2024-7348/
ubuntu medium CVE-2024-7348 medium priority: Ubuntu including 7 source packages (postgresql-10, postgresql-12, …), 38 status rows across 8 suites (bionic, focal, jammy, noble, oracular, trusty, upstream, xenial): DNE 24, needs-triage 7, released 6, not-affected 1. https://ubuntu.com/security/CVE-2024-7348

Affected software / configurations for CVE-2024-7348

Vendor Product Version Raw CPE
postgresql postgresql >= 12.0, < 12.20 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
postgresql postgresql >= 13.0, < 13.16 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
postgresql postgresql >= 14.0, < 14.13 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
postgresql postgresql >= 15.0, < 15.8 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
postgresql postgresql >= 16.0, < 16.4 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*

References for CVE-2024-7348

cvelogic Threat Intelligence