CVE-2024-0985

PostgreSQL non-owner REFRESH MATERIALIZED VIEW CONCURRENTLY executes arbitrary SQL

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. Versions before PostgreSQL 16.2, 15.6, 14.11, 13.14, and 12.18 are affected.

Remediation

Workaround:

  • Use REFRESH MATERIALIZED VIEW without CONCURRENTLY.
  • In a new database connection, authenticate as the materialized view owner.

Category

8.0
CVSS
Severity: High
CVSS 3.1 •
EPSS 0.24%
Vendor Advisory postgresql.org
Affected: n/a PostgreSQL
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2024-0985?
CVE-2024-0985 has been scored as a high severity vulnerability.
How to fix CVE-2024-0985?
As a workaround for remediating CVE-2024-0985: Use REFRESH MATERIALIZED VIEW without CONCURRENTLY.
Is CVE-2024-0985 being actively exploited in the wild?
As for now, there are no information to confirm that CVE-2024-0985 is being actively exploited. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2024-0985?
CVE-2024-0985 affects n/a PostgreSQL.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.