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

- Priority: **Routine**
- Reason: Not severe (CVSS 8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-02-08 · Modified: 2025-06-13
- Aliases: ALPINE-CVE-2024-0985, MGASA-2024-0043, SUSE-SU-2024:0520-1, SUSE-SU-2024:0522-1, SUSE-SU-2024:0523-1, SUSE-SU-2024:0540-1, SUSE-SU-2024:0541-1, SUSE-SU-2024:0542-1, SUSE-SU-2024:0546-1, SUSE-SU-2024:0550-1, SUSE-SU-2024:0551-1, SUSE-SU-2024:0552-1, RHSA-2024:0950, RHSA-2024:0951, RHSA-2024:0956, RHSA-2024:0973, RHSA-2024:0974, RHSA-2024:0975, RHSA-2024:0988, RHSA-2024:0990, RHSA-2024:0992, RHSA-2024:1017, RHSA-2024:1069, RHSA-2024:1070, RHSA-2024:1071, RHSA-2024:1195, RHSA-2024:1240, RHSA-2024:1241, RHSA-2024:1314, RHSA-2024:1315, RHSA-2024:1348, RHSA-2024:1422, RHSA-2024:1426, RHSA-2024:1428, RHSA-2024:1429, RHSA-2024:1437, UBUNTU-CVE-2024-0985, USN-6656-1, USN-6656-2, DEBIAN-CVE-2024-0985, DLA-3764-1, DSA-5622-1, DSA-5623-1, CGA-75g3-q279-7843, CGA-943v-rchv-4gfp, CGA-9pfp-3vrr-5vmc, CGA-c44r-jj4q-jq8c, CGA-ghq9-x9vm-26xw, CGA-gv6r-75rf-4xgc, CGA-x53j-6wpw-5222, CGA-x5wc-wvcw-9p43, openSUSE-SU-2024:13669-1, openSUSE-SU-2024:13670-1, openSUSE-SU-2024:13671-1, openSUSE-SU-2024:13672-1
- Record: https://cvemate.com/vulnerability/CVE-2024-0985 · JSON: https://cvemate.com/vulnerability/CVE-2024-0985/json

## Description

```text
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.
```

## Signals

- CVSS: 8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
- EPSS: 1.808%, percentile 79.341%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 194)

- alpine postgresql12 (Alpine Linux): \< 12.18-r0
- alpine postgresql13 (Alpine Linux): \< 13.14-r0
- alpine postgresql14 (Alpine Linux): \< 14.11-r0
- alpine postgresql15 (Alpine Linux): \< 15.6-r0
- alpine postgresql16 (Alpine Linux): \< 16.2-r0
- chainguard postgresql-12 (Chainguard): \< 12.18-r0
- chainguard postgresql-13 (Chainguard): \< 13.14-r0
- chainguard postgresql-14 (Chainguard): \< 14.11-r0
- chainguard postgresql-15 (Chainguard): \< 15.6-r0
- wolfi postgresql-12 (Wolfi): \< 12.18-r0
- wolfi postgresql-13 (Wolfi): \< 13.14-r0
- wolfi postgresql-14 (Wolfi): \< 14.11-r0
- wolfi postgresql-15 (Wolfi): \< 15.6-r0
- debian postgresql-11 (Debian): \< 11.22-0+deb10u2
- debian postgresql-13 (Debian): \< 13.14-0+deb11u1
- debian postgresql-15 (Debian): \< 15.6-0+deb12u1
- ubuntu postgresql-10 (Ubuntu): All versions (No fix recorded)
- ubuntu postgresql-12 (Ubuntu): \< 12.18-0ubuntu0.20.04.1
- ubuntu postgresql-14 (Ubuntu): \< 14.11-0ubuntu0.22.04.1
- ubuntu postgresql-16 (Ubuntu): \< 16.2-1

## References (first 20 of 77)

- <https://www.postgresql.org/support/security/CVE-2024-0985/>
- <https://lists.debian.org/debian-lts-announce/2024/03/msg00017.html>
- <https://saites.dev/projects/personal/postgres-cve-2024-0985/>
- <https://security.netapp.com/advisory/ntap-20241220-0005/>
- <https://security.alpinelinux.org/vuln/CVE-2024-0985>
- <https://advisories.mageia.org/MGASA-2024-0043.html>
- <https://bugs.mageia.org/show_bug.cgi?id=32823>
- <https://www.postgresql.org/about/news/postgresql-162-156-1411-1314-and-1218-released-2807/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240520-1/>
- <https://bugzilla.suse.com/1219679>
- <https://www.suse.com/security/cve/CVE-2024-0985>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240522-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240523-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240540-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240541-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240542-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240546-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240550-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240551-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20240552-1/>

---

Data as of 2026-12-05T06:41:05.709Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
