CVE-2024-0985

NameCVE-2024-0985
DescriptionLate privilege drop in REFRESH MATERIALIZED VIEW CONCURRENTLY in PostgreSQL allows an object creator to execute arbitrary SQL functions as the command issuer. The command intends to run SQL functions as the owner of the materialized view, enabling safe refresh of untrusted materialized views. The victim is a superuser or member of one of the attacker's roles. The attack requires luring the victim into running REFRESH MATERIALIZED VIEW CONCURRENTLY on the attacker's materialized view. As part of exploiting this vulnerability, the attacker creates functions that use CREATE RULE to convert the internally-built temporary table to a view. Versions before PostgreSQL 15.6, 14.11, 13.14, and 12.18 are affected. The only known exploit does not work in PostgreSQL 16 and later. For defense in depth, PostgreSQL 16.2 adds the protections that older branches are using to fix their vulnerability.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
ReferencesDSA-5622-1, DSA-5623-1

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
postgresql-11 (PTS)buster11.16-0+deb10u1vulnerable
buster (security)11.22-0+deb10u1vulnerable
postgresql-13 (PTS)bullseye13.13-0+deb11u1vulnerable
bullseye (security)13.14-0+deb11u1fixed
postgresql-15 (PTS)bookworm15.5-0+deb12u1vulnerable
bookworm (security)15.6-0+deb12u1fixed
postgresql-16 (PTS)sid, trixie16.2-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
postgresql-11source(unstable)(unfixed)
postgresql-13sourcebullseye13.14-0+deb11u1DSA-5622-1
postgresql-13source(unstable)(unfixed)
postgresql-15sourcebookworm15.6-0+deb12u1DSA-5623-1
postgresql-15source(unstable)(unfixed)
postgresql-16source(unstable)16.2-1

Notes

https://www.postgresql.org/support/security/CVE-2024-0985/
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d6a61cb3bef3c8fbc35c2a6182e75a8c1d351e41 (REL_16_2)
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=f2fdea198b3d0ab30b9e8478a762488ecebabd88 (REL_15_6)
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d541ce3b6f0582723150f45d52eab119985d3c19 (REL_13_14)
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2699fc035a75d0774c1f013e9320882287f78adb (REL_12_18)
Commits have wrong CVE mentioned but the correct one is CVE-2024-0985

Search for package or bug name: Reporting problems