VDB

CVE-2024-7348

CVE-2024-7348 PUBLISHED CVSS 8.8 HIGH

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.

PackageEcosystemFixed in
postgresql15-plpython3Amazon Linux15.8-1.amzn2023.0.1
postgresql15-plperlAmazon Linux15.8-1.amzn2023.0.1
postgresql-upgradeAmazon Linux9.2.24-8.amzn2.0.4
postgresql15Alpine15.8-r0
postgresql-docsAmazon Linux9.2.24-8.amzn2.0.4
postgresql15-staticAmazon Linux15.8-1.amzn2023.0.1
postgresql15Amazon Linux15.8-1.amzn2023.0.1
postgresql-14Chainguard14.24-r2, 14.19-r1
postgresql15-upgrade-develAmazon Linux15.8-1.amzn2023.0.1
postgresql-plpythonAmazon Linux9.2.24-8.amzn2.0.4
postgresql-contribAmazon Linux9.2.24-8.amzn2.0.4
postgresql12Alpine12.20-r0

31 more packages have a fixed version. See every fix in Lookup.

Risk scores

CVSS 3.1
8.8
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected products

VendorProductVersions
n/aPostgreSQL16, 15, 14
amazon:2023postgresql15-plpython30
amazon:2023postgresql15-plperl0
amazon:2postgresql-upgrade0
alpinepostgresql150
amazon:2postgresql-docs0
amazon:2023postgresql15-static0
amazon:2023postgresql150
chainguardpostgresql-140, 0
amazon:2023postgresql15-upgrade-devel0
amazon:2postgresql-plpython0
amazon:2postgresql-contrib0
alpinepostgresql120
alpinepostgresql140
wolfipostgresql-140, 0
amazon:2023postgresql15-llvmjit0
amazon:2postgresql-static0
amazon:2postgresql-plperl0
amazon:2023postgresql15-private-libs0
alpinepostgresql130

…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

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›