---
title: "CVE-2024-0985"
canonical_url: "https://pkgseek.com/security/CVE-2024-0985"
locale: "en"
source: "pkgseek"
entity_type: "cve"
severity: "high"
---

# CVE-2024-0985

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.

CVE-2024-0985 is rated HIGH (8.0), with 101 indexed affected package builds across 6 distributions.

- **Severity / Score**: HIGH (8.0)
- **Affected builds**: 101
- **Affected distros**: 6
- **Distros with fixed_in**: Alibaba Cloud Linux, AlmaLinux, Oracle Linux, Red Hat Enterprise Linux, Rocky Linux, Ubuntu

## Affected Packages

| Distribution | Release | Package | Version | Fixed In |
| --- | --- | --- | --- | --- |
| Alibaba Cloud Linux | 3 | postgresql | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-contrib | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-docs | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-plperl | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-plpython3 | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-pltcl | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-server | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-server-devel | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-static | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-test | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-test-rpm-macros | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-upgrade | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| Alibaba Cloud Linux | 3 | postgresql-upgrade-devel | 13.13-1.0.1.al8 | 13.14-1.0.1.al8 |
| AlmaLinux | 9 | pgaudit | 1.5.0-6.el9 | 1.7.0-1.module_el9.2.0+22+09653793 |
| AlmaLinux | 9 | pg_repack | 1.4.6-4.el9 | 1.4.8-1.module_el9.2.0+22+09653793 |
| AlmaLinux | 9 | postgres-decoderbufs | 1.4.0-4.Final.el9 | 1.9.7-1.Final.module_el9.2.0+22+09653793 |
| AlmaLinux | 9 | postgresql | 13.23-9.el9_9 | 15.6-1.module_el9.3.0+55+d62f4779 |
| AlmaLinux | 9 | postgresql-contrib | 13.23-9.el9_9 | 15.6-1.module_el9.3.0+55+d62f4779 |
| AlmaLinux | 9 | postgresql-plperl | 13.23-9.el9_9 | 15.6-1.module_el9.3.0+55+d62f4779 |
| AlmaLinux | 9 | postgresql-plpython3 | 13.23-9.el9_9 | 15.6-1.module_el9.3.0+55+d62f4779 |
| AlmaLinux | 9 | postgresql-pltcl | 13.23-9.el9_9 | 15.6-1.module_el9.3.0+55+d62f4779 |
| AlmaLinux | 9 | postgresql-private-libs | 13.23-9.el9_9 | 15.6-1.module_el9.3.0+55+d62f4779 |
| AlmaLinux | 9 | postgresql-server | 13.23-9.el9_9 | 15.6-1.module_el9.3.0+55+d62f4779 |
| AlmaLinux | 9 | postgresql-upgrade | 13.23-9.el9_9 | 15.6-1.module_el9.3.0+55+d62f4779 |
| Oracle Linux | 8 | pgaudit | 1.4.0-7.module+el8.10.0+90397+67dad74f | 1.7.0-1.module+el8.9.0+90110+d8a562d5 |
| Oracle Linux | 8 | pg_repack | 1.4.6-3.module+el8.9.0+90107+c48bae1a | 1.4.8-1.module+el8.9.0+90110+d8a562d5 |
| Oracle Linux | 8 | postgres-decoderbufs | 0.10.0-2.module+el8.9.0+90107+c48bae1a | 1.9.7-1.Final.module+el8.9.0+90110+d8a562d5 |
| Oracle Linux | 8 | postgresql | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-contrib | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-docs | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-plperl | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-plpython3 | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-pltcl | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-private-devel | 15.5-1.module+el8.9.0+90110+d8a562d5 | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-private-libs | 15.5-1.module+el8.9.0+90110+d8a562d5 | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-server | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-server-devel | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-static | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-test | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-test-rpm-macros | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-upgrade | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 8 | postgresql-upgrade-devel | 12.22-12.module+el8.10.0+91045+f9258fff | 15.6-1.module+el8.9.0+90160+417c9f54 |
| Oracle Linux | 9 | pgaudit | 1.7.0-1.module+el9.2.0+20961+53e4336c | 1.7.0-1.module+el9.2.0+21134+ceb95ed9 |
| Oracle Linux | 9 | pg_repack | 1.4.8-1.module+el9.4.0+90394+9e4f3cba | 1.4.8-2.module+el9.5.0+90424+300303e9 |
| Oracle Linux | 9 | postgres-decoderbufs | 1.9.7-1.Final.module+el9.2.0+20961+53e4336c | 1.9.7-1.Final.module+el9.2.0+21134+ceb95ed9 |
| Oracle Linux | 9 | postgresql | 13.23-9.el9_9 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-contrib | 13.23-9.el9_9 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-docs | 15.12-1.module+el9.5.0+90527+e70c9846 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-plperl | 13.23-9.el9_9 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-plpython3 | 13.23-9.el9_9 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-pltcl | 13.23-9.el9_9 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-private-devel | 15.12-1.module+el9.5.0+90527+e70c9846 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-private-libs | 13.23-9.el9_9 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-server | 13.23-9.el9_9 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-server-devel | 15.12-1.module+el9.5.0+90527+e70c9846 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-static | 15.12-1.module+el9.5.0+90527+e70c9846 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-test | 15.12-1.module+el9.5.0+90527+e70c9846 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-test-rpm-macros | 15.12-1.module+el9.5.0+90527+e70c9846 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-upgrade | 13.23-9.el9_9 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Oracle Linux | 9 | postgresql-upgrade-devel | 15.12-1.module+el9.5.0+90527+e70c9846 | 15.8-1.module+el9.4.0+90399+63b2ad7b |
| Red Hat Enterprise Linux | 9.8 | pgaudit | 1.5.0-6.el9 | 1.7.0-1.module+el9.2.0+17405+aeb9ec60 |
| Red Hat Enterprise Linux | 9.8 | pg_repack | 1.4.6-4.el9 | 1.4.8-1.module+el9.2.0+17405+aeb9ec60 |
| Red Hat Enterprise Linux | 9.8 | postgres-decoderbufs | 1.4.0-4.Final.el9 | 1.9.7-1.Final.module+el9.2.0+17405+aeb9ec60 |
| Red Hat Enterprise Linux | 9.8 | postgresql | 13.23-3.el9_8 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-contrib | 13.23-3.el9_8 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-docs | 15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-plperl | 13.23-3.el9_8 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-plpython3 | 13.23-3.el9_8 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-pltcl | 13.23-3.el9_8 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-private-devel | 15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-private-libs | 13.23-3.el9_8 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-server | 13.23-3.el9_8 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-server-devel | 15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-static | 15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-test | 15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-test-rpm-macros | 15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-upgrade | 13.23-3.el9_8 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Red Hat Enterprise Linux | 9.8 | postgresql-upgrade-devel | 15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | 15.6-1.module+el9.3.0+21283+b0ea34b6 |
| Rocky Linux | 9 | pgaudit | 1.5.0-6.el9 | 0:1.7.0-1.module+el9.5.0+30637+4391fcca |
| Rocky Linux | 9 | postgres-decoderbufs | 1.4.0-4.Final.el9 | 0:1.9.7-1.Final.module+el9.5.0+30637+4391fcca |
| Ubuntu | focal | libecpg6 | 12.2-4 | 12.18-0ubuntu0.20.04.1 |
| Ubuntu | focal | libecpg-compat3 | 12.2-4 | 12.18-0ubuntu0.20.04.1 |
| Ubuntu | focal | libecpg-dev | 12.2-4 | 12.18-0ubuntu0.20.04.1 |
| Ubuntu | focal | libpgtypes3 | 12.2-4 | 12.18-0ubuntu0.20.04.1 |
| Ubuntu | focal | libpq5 | 12.2-4 | 12.18-0ubuntu0.20.04.1 |
| Ubuntu | focal | libpq-dev | 12.2-4 | 12.18-0ubuntu0.20.04.1 |
| Ubuntu | focal | postgresql-12 | 12.2-4 | 12.18-0ubuntu0.20.04.1 |
| Ubuntu | focal | postgresql-client-12 | 12.2-4 | 12.18-0ubuntu0.20.04.1 |
| Ubuntu | focal | postgresql-doc-12 | 12.2-4 | 12.18-0ubuntu0.20.04.1 |
| Ubuntu | jammy | libecpg6 | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | libecpg-compat3 | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | libecpg-dev | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | libpgtypes3 | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | libpq5 | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | libpq-dev | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | postgresql-14 | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | postgresql-client-14 | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | postgresql-doc-14 | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | postgresql-plperl-14 | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |
| Ubuntu | jammy | postgresql-plpython3-14 | 14.2-1ubuntu1 | 14.11-0ubuntu0.22.04.1 |

_Showing 100 of 101 total affected builds._
