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 Software | Affected Version | How 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.3-1 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.