{"id":"BIT-postgresql-2024-7348","summary":"PostgreSQL relation replacement during pg_dump executes arbitrary SQL","details":"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.","aliases":["CVE-2024-7348"],"modified":"2025-05-20T10:02:07.006Z","published":"2024-08-10T07:32:17.691Z","database_specific":{"cpes":["cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*"],"severity":"High"},"references":[{"type":"WEB","url":"https://www.postgresql.org/support/security/CVE-2024-7348/"},{"type":"WEB","url":"http://www.openwall.com/lists/oss-security/2024/08/11/1"},{"type":"WEB","url":"https://security.netapp.com/advisory/ntap-20240822-0002/"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-7348"}],"affected":[{"package":{"name":"postgresql","ecosystem":"Bitnami","purl":"pkg:bitnami/postgresql"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"12.20.0"},{"introduced":"13.0.0"},{"fixed":"13.16.0"},{"introduced":"14.0.0"},{"fixed":"14.13.0"},{"introduced":"15.0.0"},{"fixed":"15.8.0"},{"introduced":"16.0.0"},{"fixed":"16.4.0"}]}],"database_specific":{"source":"https://github.com/bitnami/vulndb/tree/main/data/postgresql/BIT-postgresql-2024-7348.json"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}],"schema_version":"1.7.3"}