CVE-2024-7348 in 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 ...
Affects 1 product from 1 vendor. Facts below cite their sources.
Remotely exploitable over the network, high complexity, low privileges required, no user interaction needed, impact contained to the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Postgresql | Postgresql | < 12.20 |
| Abb | S Engineering | 2.2 2.3 2.4 |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
Vendor PSIRT: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
Exploitation
| CISA known-exploited | Not in the CISA KEV catalog |
|---|---|
| Public exploit | Not confirmed |
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.
Source: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2024-7348 |
|---|---|
| BreachSpider ID | BS-2024-GLOBAL-047709-H |
| CVSS vector | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H |
| Published | 2024-08-08 |
| Last modified | 2026-06-17 |
| Weakness (CWE) | |
| Source | NVD |
Weakness definitions
CWE-367: CWE-367
Related attack patterns (CAPEC)
CAPEC-27 Leveraging Race Conditions via Symbolic Links via CWE-367
CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions via CWE-367
Mapping is CWE to CAPEC per MITRE CAPEC 3.9.
Analysis AI-written, not human-reviewed
A 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, typically a superuser, by replacing another relation type with a view or foreign table.
The attack involves an attacker waiting for pg_dump to start and then replacing a relation type with a view or foreign table before pg_dump processes it, allowing the execution of arbitrary SQL functions.
Questions
What is CVE-2024-7348?
A 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, typically a superuser, by replacing another relation type with a view or foreign table.
What is the CVSS score for CVE-2024-7348?
CVE-2024-7348 has CVSS 7.5 (High). Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H. EPSS: 1.3%.
Is CVE-2024-7348 actively exploited?
No confirmed active exploitation of CVE-2024-7348 as of 2026-09-25.
How do I remediate CVE-2024-7348?
Priority: HIGH. Advisory: https://www.postgresql.org/support/security/CVE-2024-7348/ PSIRT: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
What systems are affected by CVE-2024-7348?
CVE-2024-7348 affects Postgresql Postgresql.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Postgresql","product":"Postgresql","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.