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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | pg_repack | 1.4.6-3.module_el8.6.0+2760+1746ec94 | ALSA-2024:0975 |
| AlmaLinux:8 | pg_repack | 1.4.6-3.module_el8.6.0+3095+ee60d910 | ALSA-2024:0975 |
| AlmaLinux:8 | pg_repack | 1.4.6-3.module_el8.9.0+3704+f1f917ce | ALSA-2024:0974 |
| AlmaLinux:8 | pg_repack | 1.4.6-3.module_el8.6.0+2758+4f4474df | ALSA-2024:0974 |
| AlmaLinux:8 | pg_repack | 1.4.6-3.module_el8.6.0+3094+eb237fb8 | ALSA-2024:0974 |
| AlmaLinux:8 | pg_repack | 1.4.8-1.module_el8.8.0+3487+43ec1b9f | ALSA-2024:0973 |
| AlmaLinux:9 | pg_repack | 1.4.8-1.module_el9.2.0+22+09653793 | ALSA-2024:0950 |
| AlmaLinux:8 | pgaudit | 1.5.0-1.module_el8.6.0+3095+ee60d910 | ALSA-2024:0975 |
| AlmaLinux:8 | pgaudit | 1.7.0-1.module_el8.8.0+3487+43ec1b9f | ALSA-2024:0973 |
| AlmaLinux:8 | pgaudit | 1.5.0-1.module_el8.6.0+2760+1746ec94 | ALSA-2024:0975 |
| AlmaLinux:8 | pgaudit | 1.4.0-7.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:9 | pgaudit | 1.7.0-1.module_el9.2.0+22+09653793 | ALSA-2024:0950 |
| AlmaLinux:8 | postgres-decoderbufs | 1.9.7-1.Final.module_el8.8.0+3487+43ec1b9f | ALSA-2024:0973 |
| AlmaLinux:8 | postgres-decoderbufs | 0.10.0-2.module_el8.6.0+3094+eb237fb8 | ALSA-2024:0974 |
| AlmaLinux:8 | postgres-decoderbufs | 0.10.0-2.module_el8.6.0+2758+4f4474df | ALSA-2024:0974 |
| AlmaLinux:8 | postgres-decoderbufs | 0.10.0-2.module_el8.6.0+3095+ee60d910 | ALSA-2024:0975 |
| AlmaLinux:8 | postgres-decoderbufs | 0.10.0-2.module_el8.6.0+2760+1746ec94 | ALSA-2024:0975 |
| AlmaLinux:8 | postgres-decoderbufs | 0.10.0-2.module_el8.9.0+3704+f1f917ce | ALSA-2024:0974 |
| AlmaLinux:9 | postgres-decoderbufs | 1.9.7-1.Final.module_el9.2.0+22+09653793 | ALSA-2024:0950 |
| AlmaLinux:8 | postgresql | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:8 | postgresql | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:9 | postgresql | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:9 | postgresql | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:8 | postgresql-contrib | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:8 | postgresql-contrib | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-contrib | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:8 | postgresql-contrib | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:9 | postgresql-contrib | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:9 | postgresql-contrib | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:8 | postgresql-docs | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:8 | postgresql-docs | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql-docs | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:8 | postgresql-docs | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:9 | postgresql-docs | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:9 | postgresql-docs | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:8 | postgresql-plperl | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-plperl | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:8 | postgresql-plperl | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql-plperl | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:9 | postgresql-plperl | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:9 | postgresql-plperl | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:8 | postgresql-plpython3 | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql-plpython3 | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:8 | postgresql-plpython3 | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:8 | postgresql-plpython3 | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:9 | postgresql-plpython3 | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:9 | postgresql-plpython3 | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:8 | postgresql-pltcl | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-pltcl | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql-pltcl | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:8 | postgresql-pltcl | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:9 | postgresql-pltcl | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:9 | postgresql-pltcl | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:8 | postgresql-private-devel | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:9 | postgresql-private-devel | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:9 | postgresql-private-devel | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:8 | postgresql-private-libs | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:9 | postgresql-private-libs | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:9 | postgresql-private-libs | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:8 | postgresql-server | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:8 | postgresql-server | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:8 | postgresql-server | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-server | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:9 | postgresql-server | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:9 | postgresql-server | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:8 | postgresql-server-devel | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:8 | postgresql-server-devel | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql-server-devel | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-server-devel | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:9 | postgresql-server-devel | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:9 | postgresql-server-devel | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:8 | postgresql-static | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql-static | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:8 | postgresql-static | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-static | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:9 | postgresql-static | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:9 | postgresql-static | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:8 | postgresql-test | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql-test | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:8 | postgresql-test | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-test | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:9 | postgresql-test | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:9 | postgresql-test | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:8 | postgresql-test-rpm-macros | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:8 | postgresql-test-rpm-macros | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-test-rpm-macros | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:8 | postgresql-test-rpm-macros | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:9 | postgresql-test-rpm-macros | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:8 | postgresql-upgrade | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql-upgrade | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-upgrade | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:8 | postgresql-upgrade | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:9 | postgresql-upgrade | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| AlmaLinux:9 | postgresql-upgrade | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:8 | postgresql-upgrade-devel | 15.6-1.module_el8.9.0+3739+514705ed.alma.1 | ALSA-2024:0973 |
| AlmaLinux:8 | postgresql-upgrade-devel | 10.23-4.module_el8.9.0+3736+952d0ed7.alma.1 | ALSA-2024:0956 |
| AlmaLinux:8 | postgresql-upgrade-devel | 13.14-1.module_el8.9.0+3738+d55e2165.alma.1 | ALSA-2024:0975 |
| AlmaLinux:8 | postgresql-upgrade-devel | 12.18-1.module_el8.9.0+3740+0e74851f.alma.1 | ALSA-2024:0974 |
| AlmaLinux:9 | postgresql-upgrade-devel | 13.14-1.el9_3 | ALSA-2024:0951 |
| AlmaLinux:9 | postgresql-upgrade-devel | 15.6-1.module_el9.3.0+55+d62f4779 | ALSA-2024:0950 |
| Alpine:v3.20 | postgresql14 | 14.11-r0 | ALPINE-CVE-2024-0985 |
| Alpine:v3.20 | postgresql15 | 15.6-r0 | ALPINE-CVE-2024-0985 |
| Alpine:v3.21 | postgresql15 | 15.6-r0 | ALPINE-CVE-2024-0985 |
| Alpine:v3.22 | postgresql15 | 15.6-r0 | ALPINE-CVE-2024-0985 |
| Alpine:v3.20 | postgresql16 | 16.2-r0 | ALPINE-CVE-2024-0985 |
| Alpine:v3.21 | postgresql16 | 16.2-r0 | ALPINE-CVE-2024-0985 |
| Alpine:v3.22 | postgresql16 | 16.2-r0 | ALPINE-CVE-2024-0985 |
| Alpine:v3.23 | postgresql16 | 16.2-r0 | ALPINE-CVE-2024-0985 |
| Alpine:v3.24 | postgresql16 | 16.2-r0 | ALPINE-CVE-2024-0985 |
| Debian:12 | postgresql-15 | 15.6-0+deb12u1 | DEBIAN-CVE-2024-0985 |
| Debian:12 | postgresql-15 | 15.6-0+deb12u1 | DSA-5623-1 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.9.0+1594+4a6adae9 | RLSA-2024:0974 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.9.0+1603+444d1b54 | RLSA-2024:0974 |
| Rocky Linux:8 | pg_repack | 0:1.4.8-1.module+el8.10.0+1622+bd25b19c | RLSA-2024:0973 |
| Rocky Linux:8 | pg_repack | 0:1.4.8-1.module+el8.9.0+1525+fc91df60 | RLSA-2024:0973 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.10.0+1862+29bef648 | RLSA-2024:0975 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.9.0+1594+4a6adae9 | RLSA-2024:0975 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.9.0+1603+444d1b54 | RLSA-2024:0975 |
| Rocky Linux:8 | pg_repack | 0:1.4.8-1.module+el8.10.0+1858+fcc46a79 | RLSA-2024:0973 |
| Rocky Linux:8 | pg_repack | 0:1.4.6-3.module+el8.10.0+1862+29bef648 | RLSA-2024:0974 |
| Rocky Linux:8 | pgaudit | 0:1.4.0-7.module+el8.9.0+1735+a332307b | RLSA-2024:0974 |
| Rocky Linux:8 | pgaudit | 0:1.5.0-1.module+el8.9.0+1594+4a6adae9 | RLSA-2024:0975 |
| Rocky Linux:8 | pgaudit | 0:1.7.0-1.module+el8.9.0+1525+fc91df60 | RLSA-2024:0973 |
| Rocky Linux:9 | pgaudit | 0:1.7.0-1.module+el9.5.0+30637+4391fcca | RLSA-2024:0950 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.10.0+1862+29bef648 | RLSA-2024:0975 |
| Rocky Linux:8 | postgres-decoderbufs | 0:1.9.7-1.Final.module+el8.9.0+1525+fc91df60 | RLSA-2024:0973 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.10.0+1862+29bef648 | RLSA-2024:0974 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.9.0+1594+4a6adae9 | RLSA-2024:0974 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.9.0+1603+444d1b54 | RLSA-2024:0974 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.9.0+1594+4a6adae9 | RLSA-2024:0975 |
| Rocky Linux:8 | postgres-decoderbufs | 0:0.10.0-2.module+el8.9.0+1603+444d1b54 | RLSA-2024:0975 |
| Rocky Linux:9 | postgres-decoderbufs | 0:1.9.7-1.Final.module+el9.5.0+30637+4391fcca | RLSA-2024:0950 |
| Rocky Linux:8 | postgresql | 0:10.23-4.module+el8.9.0+1734+74bd286c | RLSA-2024:0956 |
| Rocky Linux:8 | postgresql | 0:13.14-1.module+el8.9.0+1736+ef8fa13a | RLSA-2024:0975 |
| Rocky Linux:8 | postgresql | 0:12.18-1.module+el8.9.0+1735+a332307b | RLSA-2024:0974 |
| Rocky Linux:8 | postgresql | 0:15.6-1.module+el8.9.0+1737+de0a3665 | RLSA-2024:0973 |
| Rocky Linux:9 | postgresql | 0:13.14-1.el9_3 | RLSA-2024:0951 |
| Ubuntu:22.04:LTS | postgresql-14 | 14.11-0ubuntu0.22.04.1 | UBUNTU-CVE-2024-0985 |
| Ubuntu:22.04:LTS | postgresql-14 | 14.11-0ubuntu0.22.04.1 | USN-6656-1 |
| Ubuntu:24.04:LTS | postgresql-16 | 16.2-1 | UBUNTU-CVE-2024-0985 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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