Vulnerability · Published Feb 8, 2024 · Assigned by PostgreSQL

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

High 8.0

In plain English

A high-severity security flaw in PostgreSQL. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.8% (higher than 79% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.0High
Exploit odds (30 days)1.8%top 21.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8pg_repack1.4.6-3.module_el8.6.0+2760+1746ec94ALSA-2024:0975
AlmaLinux:8pg_repack1.4.6-3.module_el8.6.0+3095+ee60d910ALSA-2024:0975
AlmaLinux:8pg_repack1.4.6-3.module_el8.9.0+3704+f1f917ceALSA-2024:0974
AlmaLinux:8pg_repack1.4.6-3.module_el8.6.0+2758+4f4474dfALSA-2024:0974
AlmaLinux:8pg_repack1.4.6-3.module_el8.6.0+3094+eb237fb8ALSA-2024:0974
AlmaLinux:8pg_repack1.4.8-1.module_el8.8.0+3487+43ec1b9fALSA-2024:0973
AlmaLinux:9pg_repack1.4.8-1.module_el9.2.0+22+09653793ALSA-2024:0950
AlmaLinux:8pgaudit1.5.0-1.module_el8.6.0+3095+ee60d910ALSA-2024:0975
AlmaLinux:8pgaudit1.7.0-1.module_el8.8.0+3487+43ec1b9fALSA-2024:0973
AlmaLinux:8pgaudit1.5.0-1.module_el8.6.0+2760+1746ec94ALSA-2024:0975
AlmaLinux:8pgaudit1.4.0-7.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:9pgaudit1.7.0-1.module_el9.2.0+22+09653793ALSA-2024:0950
AlmaLinux:8postgres-decoderbufs1.9.7-1.Final.module_el8.8.0+3487+43ec1b9fALSA-2024:0973
AlmaLinux:8postgres-decoderbufs0.10.0-2.module_el8.6.0+3094+eb237fb8ALSA-2024:0974
AlmaLinux:8postgres-decoderbufs0.10.0-2.module_el8.6.0+2758+4f4474dfALSA-2024:0974
AlmaLinux:8postgres-decoderbufs0.10.0-2.module_el8.6.0+3095+ee60d910ALSA-2024:0975
AlmaLinux:8postgres-decoderbufs0.10.0-2.module_el8.6.0+2760+1746ec94ALSA-2024:0975
AlmaLinux:8postgres-decoderbufs0.10.0-2.module_el8.9.0+3704+f1f917ceALSA-2024:0974
AlmaLinux:9postgres-decoderbufs1.9.7-1.Final.module_el9.2.0+22+09653793ALSA-2024:0950
AlmaLinux:8postgresql15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:8postgresql10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:9postgresql15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:9postgresql13.14-1.el9_3ALSA-2024:0951
AlmaLinux:8postgresql-contrib12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:8postgresql-contrib15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-contrib10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:8postgresql-contrib13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:9postgresql-contrib15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:9postgresql-contrib13.14-1.el9_3ALSA-2024:0951
AlmaLinux:8postgresql-docs10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:8postgresql-docs13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql-docs12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:8postgresql-docs15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:9postgresql-docs15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:9postgresql-docs13.14-1.el9_3ALSA-2024:0951
AlmaLinux:8postgresql-plperl15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-plperl12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:8postgresql-plperl13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql-plperl10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:9postgresql-plperl15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:9postgresql-plperl13.14-1.el9_3ALSA-2024:0951
AlmaLinux:8postgresql-plpython313.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql-plpython312.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:8postgresql-plpython310.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:8postgresql-plpython315.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:9postgresql-plpython313.14-1.el9_3ALSA-2024:0951
AlmaLinux:9postgresql-plpython315.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:8postgresql-pltcl15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-pltcl13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql-pltcl12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:8postgresql-pltcl10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:9postgresql-pltcl13.14-1.el9_3ALSA-2024:0951
AlmaLinux:9postgresql-pltcl15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:8postgresql-private-devel15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:9postgresql-private-devel13.14-1.el9_3ALSA-2024:0951
AlmaLinux:9postgresql-private-devel15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:8postgresql-private-libs15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:9postgresql-private-libs15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:9postgresql-private-libs13.14-1.el9_3ALSA-2024:0951
AlmaLinux:8postgresql-server12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:8postgresql-server10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:8postgresql-server15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-server13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:9postgresql-server15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:9postgresql-server13.14-1.el9_3ALSA-2024:0951
AlmaLinux:8postgresql-server-devel10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:8postgresql-server-devel13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql-server-devel15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-server-devel12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:9postgresql-server-devel13.14-1.el9_3ALSA-2024:0951
AlmaLinux:9postgresql-server-devel15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:8postgresql-static13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql-static12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:8postgresql-static15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-static10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:9postgresql-static15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:9postgresql-static13.14-1.el9_3ALSA-2024:0951
AlmaLinux:8postgresql-test13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql-test10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:8postgresql-test15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-test12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:9postgresql-test13.14-1.el9_3ALSA-2024:0951
AlmaLinux:9postgresql-test15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:8postgresql-test-rpm-macros12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:8postgresql-test-rpm-macros15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-test-rpm-macros10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:8postgresql-test-rpm-macros13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:9postgresql-test-rpm-macros15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:8postgresql-upgrade13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql-upgrade15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-upgrade10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:8postgresql-upgrade12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:9postgresql-upgrade15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
AlmaLinux:9postgresql-upgrade13.14-1.el9_3ALSA-2024:0951
AlmaLinux:8postgresql-upgrade-devel15.6-1.module_el8.9.0+3739+514705ed.alma.1ALSA-2024:0973
AlmaLinux:8postgresql-upgrade-devel10.23-4.module_el8.9.0+3736+952d0ed7.alma.1ALSA-2024:0956
AlmaLinux:8postgresql-upgrade-devel13.14-1.module_el8.9.0+3738+d55e2165.alma.1ALSA-2024:0975
AlmaLinux:8postgresql-upgrade-devel12.18-1.module_el8.9.0+3740+0e74851f.alma.1ALSA-2024:0974
AlmaLinux:9postgresql-upgrade-devel13.14-1.el9_3ALSA-2024:0951
AlmaLinux:9postgresql-upgrade-devel15.6-1.module_el9.3.0+55+d62f4779ALSA-2024:0950
Alpine:v3.20postgresql1414.11-r0ALPINE-CVE-2024-0985
Alpine:v3.20postgresql1515.6-r0ALPINE-CVE-2024-0985
Alpine:v3.21postgresql1515.6-r0ALPINE-CVE-2024-0985
Alpine:v3.22postgresql1515.6-r0ALPINE-CVE-2024-0985
Alpine:v3.20postgresql1616.2-r0ALPINE-CVE-2024-0985
Alpine:v3.21postgresql1616.2-r0ALPINE-CVE-2024-0985
Alpine:v3.22postgresql1616.2-r0ALPINE-CVE-2024-0985
Alpine:v3.23postgresql1616.2-r0ALPINE-CVE-2024-0985
Alpine:v3.24postgresql1616.2-r0ALPINE-CVE-2024-0985
Debian:12postgresql-1515.6-0+deb12u1DEBIAN-CVE-2024-0985
Debian:12postgresql-1515.6-0+deb12u1DSA-5623-1
Rocky Linux:8pg_repack0:1.4.6-3.module+el8.9.0+1594+4a6adae9RLSA-2024:0974
Rocky Linux:8pg_repack0:1.4.6-3.module+el8.9.0+1603+444d1b54RLSA-2024:0974
Rocky Linux:8pg_repack0:1.4.8-1.module+el8.10.0+1622+bd25b19cRLSA-2024:0973
Rocky Linux:8pg_repack0:1.4.8-1.module+el8.9.0+1525+fc91df60RLSA-2024:0973
Rocky Linux:8pg_repack0:1.4.6-3.module+el8.10.0+1862+29bef648RLSA-2024:0975
Rocky Linux:8pg_repack0:1.4.6-3.module+el8.9.0+1594+4a6adae9RLSA-2024:0975
Rocky Linux:8pg_repack0:1.4.6-3.module+el8.9.0+1603+444d1b54RLSA-2024:0975
Rocky Linux:8pg_repack0:1.4.8-1.module+el8.10.0+1858+fcc46a79RLSA-2024:0973
Rocky Linux:8pg_repack0:1.4.6-3.module+el8.10.0+1862+29bef648RLSA-2024:0974
Rocky Linux:8pgaudit0:1.4.0-7.module+el8.9.0+1735+a332307bRLSA-2024:0974
Rocky Linux:8pgaudit0:1.5.0-1.module+el8.9.0+1594+4a6adae9RLSA-2024:0975
Rocky Linux:8pgaudit0:1.7.0-1.module+el8.9.0+1525+fc91df60RLSA-2024:0973
Rocky Linux:9pgaudit0:1.7.0-1.module+el9.5.0+30637+4391fccaRLSA-2024:0950
Rocky Linux:8postgres-decoderbufs0:0.10.0-2.module+el8.10.0+1862+29bef648RLSA-2024:0975
Rocky Linux:8postgres-decoderbufs0:1.9.7-1.Final.module+el8.9.0+1525+fc91df60RLSA-2024:0973
Rocky Linux:8postgres-decoderbufs0:0.10.0-2.module+el8.10.0+1862+29bef648RLSA-2024:0974
Rocky Linux:8postgres-decoderbufs0:0.10.0-2.module+el8.9.0+1594+4a6adae9RLSA-2024:0974
Rocky Linux:8postgres-decoderbufs0:0.10.0-2.module+el8.9.0+1603+444d1b54RLSA-2024:0974
Rocky Linux:8postgres-decoderbufs0:0.10.0-2.module+el8.9.0+1594+4a6adae9RLSA-2024:0975
Rocky Linux:8postgres-decoderbufs0:0.10.0-2.module+el8.9.0+1603+444d1b54RLSA-2024:0975
Rocky Linux:9postgres-decoderbufs0:1.9.7-1.Final.module+el9.5.0+30637+4391fccaRLSA-2024:0950
Rocky Linux:8postgresql0:10.23-4.module+el8.9.0+1734+74bd286cRLSA-2024:0956
Rocky Linux:8postgresql0:13.14-1.module+el8.9.0+1736+ef8fa13aRLSA-2024:0975
Rocky Linux:8postgresql0:12.18-1.module+el8.9.0+1735+a332307bRLSA-2024:0974
Rocky Linux:8postgresql0:15.6-1.module+el8.9.0+1737+de0a3665RLSA-2024:0973
Rocky Linux:9postgresql0:13.14-1.el9_3RLSA-2024:0951
Ubuntu:22.04:LTSpostgresql-1414.11-0ubuntu0.22.04.1UBUNTU-CVE-2024-0985
Ubuntu:22.04:LTSpostgresql-1414.11-0ubuntu0.22.04.1USN-6656-1
Ubuntu:24.04:LTSpostgresql-1616.2-1UBUNTU-CVE-2024-0985

Affected products (as reported)

VendorProductVersions
n/a PostgreSQL 16 – before 16.215 – before 15.614 – before 14.1113 – before 13.140 – before 12.18

Weakness: CWE-271 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

References