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

Published Feb 8, 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.

Other sources

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.

NVD

Affected Software

21 affected componentsFixes available
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
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

Event History

Feb 8, 2024
CVE Published
via Ubuntu·12:00 AM
CVE Published
via MITRE·01:00 PM
Data Sourced
via MITRE·01:00 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·04:33 PM
DescriptionSeverityAffected Software
Mar 29, 2024
Data Sourced
via Launchpad·05:14 PM
Description

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2024-0985?

CVE-2024-0985 is classified as a medium severity vulnerability.

2

How do I fix CVE-2024-0985?

To fix CVE-2024-0985, upgrade your PostgreSQL installation to version 12.18, 14.11, 15.6, or 16.2 or later.

3

Who is affected by CVE-2024-0985?

CVE-2024-0985 affects various versions of PostgreSQL, including 12.x, 13.x, 14.x, 15.x, and 16.x.

4

What does CVE-2024-0985 exploit?

CVE-2024-0985 allows an object creator to execute arbitrary SQL functions as the command issuer during the refresh of materialized views.

5

What software packages are vulnerable to CVE-2024-0985?

The vulnerable software packages include postgresql-12, postgresql-13, postgresql-14, postgresql-15, and postgresql-16 across various operating systems.

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.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203