CVE Vulnerabilities

CVE-2024-7348

Time-of-check Time-of-use (TOCTOU) Race Condition

Published: Aug 08, 2024 | Modified: Nov 21, 2024
CVSS 3.x
7.5
HIGH
Source:
NVD
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
7.5 IMPORTANT
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

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.

Weakness

The product checks the state of a resource before using that resource, but the resource’s state can change between the check and the use in a way that invalidates the results of the check.

Affected Software

NameVendorStart VersionEnd Version
PostgresqlPostgresql12.0 (including)12.20 (excluding)
PostgresqlPostgresql13.0 (including)13.16 (excluding)
PostgresqlPostgresql14.0 (including)14.13 (excluding)
PostgresqlPostgresql15.0 (including)15.8 (excluding)
PostgresqlPostgresql16.0 (including)16.4 (excluding)
Red Hat Enterprise Linux 7 Extended Lifecycle SupportRedHatpostgresql-0:9.2.24-9.el7_9.1*
Red Hat Enterprise Linux 8RedHatpostgresql:16-8100020240814094432.489197e6*
Red Hat Enterprise Linux 8RedHatpostgresql:12-8100020240814102525.489197e6*
Red Hat Enterprise Linux 8RedHatpostgresql:15-8100020240814101911.489197e6*
Red Hat Enterprise Linux 8RedHatpostgresql:13-8100020240814102212.489197e6*
Red Hat Enterprise Linux 8.2 Advanced Update SupportRedHatpostgresql:12-8020020240828083606.4cda2c84*
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update SupportRedHatpostgresql:12-8040020240827125019.522a0ee4*
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update SupportRedHatpostgresql:13-8040020240830114010.522a0ee4*
Red Hat Enterprise Linux 8.4 Telecommunications Update ServiceRedHatpostgresql:12-8040020240827125019.522a0ee4*
Red Hat Enterprise Linux 8.4 Telecommunications Update ServiceRedHatpostgresql:13-8040020240830114010.522a0ee4*
Red Hat Enterprise Linux 8.4 Update Services for SAP SolutionsRedHatpostgresql:12-8040020240827125019.522a0ee4*
Red Hat Enterprise Linux 8.4 Update Services for SAP SolutionsRedHatpostgresql:13-8040020240830114010.522a0ee4*
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update SupportRedHatpostgresql:13-8060020240903094008.ad008a3a*
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update SupportRedHatpostgresql:12-8060020240903093929.ad008a3a*
Red Hat Enterprise Linux 8.6 Telecommunications Update ServiceRedHatpostgresql:13-8060020240903094008.ad008a3a*
Red Hat Enterprise Linux 8.6 Telecommunications Update ServiceRedHatpostgresql:12-8060020240903093929.ad008a3a*
Red Hat Enterprise Linux 8.6 Update Services for SAP SolutionsRedHatpostgresql:13-8060020240903094008.ad008a3a*
Red Hat Enterprise Linux 8.6 Update Services for SAP SolutionsRedHatpostgresql:12-8060020240903093929.ad008a3a*
Red Hat Enterprise Linux 8.8 Extended Update SupportRedHatpostgresql:12-8080020240828084611.63b34585*
Red Hat Enterprise Linux 8.8 Extended Update SupportRedHatpostgresql:13-8080020240830064706.63b34585*
Red Hat Enterprise Linux 8.8 Extended Update SupportRedHatpostgresql:15-8080020240826125709.63b34585*
Red Hat Enterprise Linux 9RedHatpostgresql:16-9040020240812093225.rhel9*
Red Hat Enterprise Linux 9RedHatpostgresql-0:13.16-1.el9_4*
Red Hat Enterprise Linux 9RedHatpostgresql:15-9040020240812115436.rhel9*
Red Hat Enterprise Linux 9.0 Update Services for SAP SolutionsRedHatpostgresql-0:13.16-1.el9_0*
Red Hat Enterprise Linux 9.2 Extended Update SupportRedHatpostgresql:15-9020020240827093843.rhel9*
Red Hat Enterprise Linux 9.2 Extended Update SupportRedHatpostgresql-0:13.16-1.el9_2*
Postgresql-10Ubuntuesm-infra/bionic*
Postgresql-12Ubuntuesm-infra/focal*
Postgresql-12Ubuntufocal*
Postgresql-14Ubuntujammy*
Postgresql-16Ubuntunoble*
Postgresql-9.3Ubuntuesm-infra-legacy/trusty*
Postgresql-9.3Ubuntutrusty/esm*
Postgresql-9.5Ubuntuesm-infra/xenial*

Potential Mitigations

References