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

- Severity: High 8.8 (CVSS:3.1, scored by PostgreSQL) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.57%, higher than 76% of CVEs (2026-12-01)
- Published: 2024-08-08T13:00:02.130Z
- Modified: 2026-09-10T16:01:45.904Z
- Also known as: BIT-POSTGRESQL-2024-7348
- Weaknesses: CWE-367
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: PostgreSQL

## 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.

(As written by CVE List.)

## Affected

- PostgreSQL: from 16 before 16.4; from 15 before 15.8; from 14 before 14.13; from 13 before 13.16; before 12.20
- postgresql postgresql: before 12.20; from 13 before 13.16; from 14 before 14.13; from 15 before 15.8; from 16 before 16.4; from 12.0 before 12.20; from 13.0 before 13.16; from 14.0 before 14.13; from 15.0 before 15.8; from 16.0 before 16.4
- postgresql (Bitnami): before 12.20.0; from 13.0.0 before 13.16.0; from 14.0.0 before 14.13.0; from 15.0.0 before 15.8.0; from 16.0.0 before 16.4.0

## Every score

- PostgreSQL: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating High

## References

- <https://www.postgresql.org/support/security/CVE-2024-7348/> (advisory, vendor-advisory)
- <http://www.openwall.com/lists/oss-security/2024/08/11/1> (web)
- <https://security.netapp.com/advisory/ntap-20240822-0002/> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-7348> (web)

## Sources

- CVE List: [CVE-2024-7348](https://www.cve.org/CVERecord?id=CVE-2024-7348), CVE Terms of Use, modified 2024-08-22
- NVD: [CVE-2024-7348](https://nvd.nist.gov/vuln/detail/CVE-2024-7348), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-POSTGRESQL-2024-7348](https://osv.dev/vulnerability/BIT-POSTGRESQL-2024-7348), Apache-2.0, modified 2026-09-10

---

Page: https://cve.day/CVE-2024-7348 · Whole record: https://cve.day/CVE-2024-7348.json · Rebuilt by cve.day 2026-11-25T22:58:44.144Z
