Vulnerability CVE-2024-0985: Information

Description

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.

Severity: HIGH (8.0) Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

Published: Feb. 8, 2024
Modified: Feb. 15, 2024

Fixed packages

Package name
Branch
Fixed in version
Version from repository
Errata ID
Task #
State
postgresql12sisyphus12.18-alt112.18-alt1ALT-PU-2024-2181-1340457Fixed
postgresql12sisyphus_e2k12.18-alt112.18-alt1ALT-PU-2024-2491-1-Fixed
postgresql12sisyphus_loongarch6412.18-alt112.18-alt1ALT-PU-2024-2234-1-Fixed
postgresql12p1012.18-alt0.p10.112.18-alt0.p10.1ALT-PU-2024-2204-2340531Fixed
postgresql12p10_e2k12.18-alt0.p10.112.18-alt0.p10.1ALT-PU-2024-2892-1-Fixed
postgresql12p912.18-alt0.M90P.112.18-alt0.M90P.1ALT-PU-2024-2508-2340804Fixed
postgresql12c9f212.18-alt0.c9f2.112.18-alt0.c9f2.1ALT-PU-2024-2191-2340511Fixed
postgresql12-1Cp912.17-alt0.M90P.212.17-alt0.M90P.2ALT-PU-2024-2506-2340804Fixed
postgresql12-1Cc9f212.17-alt0.c9f2.212.17-alt0.c9f2.2ALT-PU-2024-2193-2340511Fixed
postgresql13sisyphus13.14-alt113.14-alt1ALT-PU-2024-2177-1340457Fixed
postgresql13sisyphus_e2k13.14-alt113.14-alt1ALT-PU-2024-2492-1-Fixed
postgresql13sisyphus_loongarch6413.14-alt113.14-alt1ALT-PU-2024-2235-1-Fixed
postgresql13p1013.14-alt0.p10.113.14-alt0.p10.1ALT-PU-2024-2205-2340531Fixed
postgresql13p10_e2k13.14-alt0.p10.113.14-alt0.p10.1ALT-PU-2024-2893-1-Fixed
postgresql14sisyphus14.11-alt114.11-alt1ALT-PU-2024-2179-1340457Fixed
postgresql14sisyphus_e2k14.11-alt114.11-alt1ALT-PU-2024-2493-1-Fixed
postgresql14sisyphus_loongarch6414.11-alt114.11-alt1ALT-PU-2024-2236-1-Fixed
postgresql14p1014.11-alt0.p10.114.11-alt0.p10.1ALT-PU-2024-2206-2340531Fixed
postgresql14p10_e2k14.11-alt0.p10.114.11-alt0.p10.1ALT-PU-2024-2894-1-Fixed
postgresql15sisyphus15.6-alt115.6-alt1ALT-PU-2024-2182-1340457Fixed
postgresql15sisyphus_e2k15.6-alt115.6-alt1ALT-PU-2024-2494-1-Fixed
postgresql15sisyphus_loongarch6415.6-alt115.6-alt1ALT-PU-2024-2237-1-Fixed
postgresql15p1015.6-alt0.p10.115.6-alt0.p10.1ALT-PU-2024-2207-2340531Fixed
postgresql15p10_e2k15.6-alt0.p10.115.6-alt0.p10.1ALT-PU-2024-2895-1-Fixed
postgresql15-1Csisyphus15.5-alt415.5-alt4ALT-PU-2024-2183-1340457Fixed
postgresql15-1Csisyphus_e2k15.5-alt415.5-alt4ALT-PU-2024-2495-1-Fixed
postgresql15-1Csisyphus_loongarch6415.5-alt415.5-alt4ALT-PU-2024-2238-1-Fixed
postgresql15-1Cp1015.5-alt0.p10.315.5-alt0.p10.3ALT-PU-2024-2208-2340531Fixed
postgresql15-1Cp10_e2k15.5-alt0.p10.315.5-alt0.p10.3ALT-PU-2024-2896-1-Fixed
postgresql16sisyphus16.2-alt116.2-alt1ALT-PU-2024-2180-1340457Fixed
postgresql16sisyphus_e2k16.2-alt116.2-alt1ALT-PU-2024-2490-1-Fixed
postgresql16sisyphus_loongarch6416.2-alt116.2-alt1ALT-PU-2024-2233-1-Fixed
postgresql16p1016.2-alt0.p10.116.2-alt0.p10.1ALT-PU-2024-2202-2340531Fixed
postgresql16p10_e2k16.2-alt0.p10.116.2-alt0.p10.1ALT-PU-2024-2891-1-Fixed

References to Advisories, Solutions, and Tools

    1. Configuration 1

      cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
      Start including
      15.0
      End excliding
      15.6

      cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
      Start including
      14.0
      End excliding
      14.11

      cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
      Start including
      13.0
      End excliding
      13.14

      cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
      Start including
      12.0
      End excliding
      12.18