# CVE-2024-7348: PostgreSQL relation replacement during pg\_dump executes arbitrary SQL

- Priority: **Routine**
- Reason: Not severe (CVSS 8.8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-08-08 · Modified: 2024-08-22
- Aliases: ALPINE-CVE-2024-7348, MGASA-2024-0301, SUSE-SU-2024:3153-1, SUSE-SU-2024:3154-1, SUSE-SU-2024:3158-1, SUSE-SU-2024:3158-2, SUSE-SU-2024:3158-3, SUSE-SU-2024:3160-1, SUSE-SU-2024:3168-1, SUSE-SU-2024:3169-1, SUSE-SU-2024:3170-1, SUSE-SU-2024:3171-1, SUSE-SU-2024:3181-1, SUSE-SU-2024:3191-1, SUSE-SU-2024:3192-1, SUSE-SU-2024:3224-1, RHSA-2024:5999, RHSA-2024:6000, RHSA-2024:6018, RHSA-2024:6137, RHSA-2024:6138, RHSA-2024:6139, RHSA-2024:6140, RHSA-2024:6141, RHSA-2024:6144, RHSA-2024:6145, RHSA-2024:6557, RHSA-2024:6558, RHSA-2024:6559, RHSA-2024:8495, UBUNTU-CVE-2024-7348, USN-6968-1, USN-6968-2, USN-6968-3, DEBIAN-CVE-2024-7348, DSA-5745-1, DSA-5746-1, CGA-65j7-84v4-2mv3, CGA-7pmh-gw4r-89gc, CGA-93wj-f6hc-6jj3, CGA-grw4-jj4h-h5v3, CGA-mwwj-wwqc-8pw3, CGA-qp8r-jvff-gx8w, CGA-r8fx-qvm3-x785, CGA-x35m-3x8r-wxpq, CGA-xgx6-h6pc-gggq, openSUSE-SU-2024:14348-1, openSUSE-SU-2024:14349-1, openSUSE-SU-2024:14350-1, openSUSE-SU-2024:14351-1, openSUSE-SU-2024:14361-1
- Record: https://cvemate.com/vulnerability/CVE-2024-7348 · JSON: https://cvemate.com/vulnerability/CVE-2024-7348/json

## Description

```text
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.
```

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 1.565%, percentile 76.149%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 160)

- alpine postgresql12 (Alpine Linux): \< 12.20-r0
- alpine postgresql13 (Alpine Linux): \< 13.16-r0
- alpine postgresql14 (Alpine Linux): \< 14.13-r0
- alpine postgresql15 (Alpine Linux): \< 15.8-r0
- alpine postgresql16 (Alpine Linux): \< 16.4-r0
- chainguard postgresql-13 (Chainguard): \< 13.22-r1
- chainguard postgresql-14 (Chainguard): \< 14.19-r1
- chainguard postgresql-14-client (Chainguard): \< 14.24-r2
- chainguard postgresql-15 (Chainguard): \< 15.14-r0
- chainguard postgresql-15-client (Chainguard): All versions (No fix recorded) \| \< 15.19-r2
- wolfi postgresql-13 (Wolfi): \< 13.22-r1
- wolfi postgresql-14 (Wolfi): \< 14.19-r1
- wolfi postgresql-14-client (Wolfi): \< 14.24-r2
- wolfi postgresql-15 (Wolfi): \< 15.14-r0
- wolfi postgresql-15-client (Wolfi): All versions (No fix recorded) \| \< 15.19-r2
- debian postgresql-13 (Debian): \< 13.16-0+deb11u1
- debian postgresql-15 (Debian): \< 15.8-0+deb12u1
- ubuntu postgresql-10 (Ubuntu): \< 10.23-0ubuntu0.18.04.2+esm2
- ubuntu postgresql-12 (Ubuntu): \< 12.20-0ubuntu0.20.04.1
- ubuntu postgresql-14 (Ubuntu): \< 14.13-0ubuntu0.22.04.1

## References (first 20 of 66)

- <https://www.postgresql.org/support/security/CVE-2024-7348/>
- <http://www.openwall.com/lists/oss-security/2024/08/11/1>
- <https://security.netapp.com/advisory/ntap-20240822-0002/>
- <https://security.alpinelinux.org/vuln/CVE-2024-7348>
- <https://advisories.mageia.org/MGASA-2024-0301.html>
- <https://bugs.mageia.org/show_bug.cgi?id=33503>
- <https://www.postgresql.org/about/news/postgresql-164-158-1413-1316-1220-and-17-beta-3-released-2910/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243153-1/>
- <https://bugzilla.suse.com/1229013>
- <https://www.suse.com/security/cve/CVE-2024-7348>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243154-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243158-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243158-2/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243158-3/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243160-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243168-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243169-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243170-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243171-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20243181-1/>

---

Data as of 2026-12-05T08:00:56.550Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
