CVE Database›CVE-2024-0985

CVE-2024-0985

postgresql: non-owner 'REFRESH MATERIALIZED VIEW CONCURRENTLY' executes arbitrary SQL

Loading…

Severity

Important

Red Hat Product Security

8

CVSS 3.1

Review impact separately from score.

Published · February 8, 2024

Updated · August 5, 2026

Description

A flaw was found in PostgreSQL. A late privilege drop in REFRESH MATERIALIZED VIEW CONCURRENTLY in PostgreSQL can allow 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 a safe refresh of untrusted materialized views. The attack requires luring the victim, a superuser or member of one of the attacker's roles, into running REFRESH MATERIALIZED VIEW CONCURRENTLY on the attacker's materialized view.

Statement

This PostgreSQL vulnerability poses a significant risk due to its potential for unauthorized access and manipulation of data. Essentially, it allows attackers to execute arbitrary SQL functions using the REFRESH MATERIALIZED VIEW CONCURRENTLY command, especially when the victim is a superuser or holds a role within the attacker's control. By luring victims into running this command on a maliciously crafted materialized view, attackers can exploit the system. This could lead to serious consequences, such as data breaches or data corruption, compromising the integrity and confidentiality of the database.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

CVSS / CWE

CVSS 3.1 · 8
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

CWE-271 · Privilege Dropping / Lowering Errors