CWE
271
Advisory Published
CVE Published
Updated

CVE-2024-0985: PostgreSQL non-owner REFRESH MATERIALIZED VIEW CONCURRENTLY executes arbitrary SQL

First published: Thu Feb 08 2024(Updated: )

Late 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.

Credit: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007 f86ef6dc-4d3a-42ad-8f28-e6d5547a5007

Affected SoftwareAffected VersionHow to fix
PostgreSQL PostgreSQL>=12.0<12.18
PostgreSQL PostgreSQL>=13.0<13.14
PostgreSQL PostgreSQL>=14.0<14.11
PostgreSQL PostgreSQL>=15.0<15.6
redhat/postgresql<12.18
12.18
redhat/postgresql<13.14
13.14
redhat/postgresql<14.11
14.11
redhat/postgresql<15.6
15.6
ubuntu/postgresql-12<12.18-0ubuntu0.20.04.1
12.18-0ubuntu0.20.04.1
ubuntu/postgresql-12<12.18
12.18
ubuntu/postgresql-14<14.11-0ubuntu0.22.04.1
14.11-0ubuntu0.22.04.1
ubuntu/postgresql-14<14.11
14.11
ubuntu/postgresql-15<15.6-0ubuntu0.23.10.1
15.6-0ubuntu0.23.10.1
ubuntu/postgresql-15<15.6
15.6
ubuntu/postgresql-16<16.2-1
16.2-1
ubuntu/postgresql-16<16.2
16.2
ubuntu/postgresql-9.5<9.5.25-0ubuntu0.16.04.1+
9.5.25-0ubuntu0.16.04.1+
debian/postgresql-11<=11.16-0+deb10u1
11.22-0+deb10u2
debian/postgresql-13<=13.13-0+deb11u1
13.14-0+deb11u1
debian/postgresql-15<=15.5-0+deb12u1
15.6-0+deb12u1
debian/postgresql-16
16.2-2

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Reference Links

Parent vulnerabilities

(Appears in the following advisories)

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2024 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203