CVE-2024-7348
PostgreSQL relation replacement during pg_dump executes arbitrary SQL
Reported by postgresql · Published August 8, 2024
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| postgresql15-plpython3 | Amazon Linux | 15.8-1.amzn2023.0.1 |
| postgresql15-plperl | Amazon Linux | 15.8-1.amzn2023.0.1 |
| postgresql-upgrade | Amazon Linux | 9.2.24-8.amzn2.0.4 |
| postgresql15 | Alpine | 15.8-r0 |
| postgresql-docs | Amazon Linux | 9.2.24-8.amzn2.0.4 |
| postgresql15-static | Amazon Linux | 15.8-1.amzn2023.0.1 |
| postgresql15 | Amazon Linux | 15.8-1.amzn2023.0.1 |
| postgresql-14 | Chainguard | 14.24-r2, 14.19-r1 |
| postgresql15-upgrade-devel | Amazon Linux | 15.8-1.amzn2023.0.1 |
| postgresql-plpython | Amazon Linux | 9.2.24-8.amzn2.0.4 |
| postgresql-contrib | Amazon Linux | 9.2.24-8.amzn2.0.4 |
| postgresql12 | Alpine | 12.20-r0 |
31 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | PostgreSQL | 16, 15, 14 |
| amazon:2023 | postgresql15-plpython3 | 0 |
| amazon:2023 | postgresql15-plperl | 0 |
| amazon:2 | postgresql-upgrade | 0 |
| alpine | postgresql15 | 0 |
| amazon:2 | postgresql-docs | 0 |
| amazon:2023 | postgresql15-static | 0 |
| amazon:2023 | postgresql15 | 0 |
| chainguard | postgresql-14 | 0, 0 |
| amazon:2023 | postgresql15-upgrade-devel | 0 |
| amazon:2 | postgresql-plpython | 0 |
| amazon:2 | postgresql-contrib | 0 |
| alpine | postgresql12 | 0 |
| alpine | postgresql14 | 0 |
| wolfi | postgresql-14 | 0, 0 |
| amazon:2023 | postgresql15-llvmjit | 0 |
| amazon:2 | postgresql-static | 0 |
| amazon:2 | postgresql-plperl | 0 |
| amazon:2023 | postgresql15-private-libs | 0 |
| alpine | postgresql13 | 0 |
…and 22 more
Timeline
- Aug 8, 2024 CVE Published
- Aug 13, 2024 EPSS Score (30 in total, the first dated here)
- Aug 22, 2024 CVE Updated
- Oct 5, 2024 Coalition ESS Score (12 in total, the first dated here)
- Apr 14, 2026 Security Advisory (36 in total, the first dated here)
- Nov 16, 2026 Distribution Patch (20 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-7348
vulnetix vdb fixes CVE-2024-7348
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-7348/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart