The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-0985

CVE-2024-0985: PostgreSQL Privilege Escalation Vulnerability

CVE-2024-0985 is a privilege escalation flaw in PostgreSQL affecting REFRESH MATERIALIZED VIEW CONCURRENTLY. Attackers can execute arbitrary SQL as superusers. This article covers technical details, affected versions, and mitigation.

Published: January 28, 2026

CVE-2024-0985 Overview

CVE-2024-0985 is a privilege escalation vulnerability in PostgreSQL affecting the REFRESH MATERIALIZED VIEW CONCURRENTLY command. The vulnerability stems from a late privilege drop mechanism that allows a malicious object creator to execute arbitrary SQL functions with the privileges of the user who runs the refresh command. This flaw enables attackers to escalate privileges when a superuser or member of one of the attacker's roles is lured into refreshing a specially crafted materialized view.

The REFRESH MATERIALIZED VIEW CONCURRENTLY command is designed to run SQL functions as the owner of the materialized view, which should enable safe refresh operations on untrusted views. However, due to the timing of the privilege drop, an attacker who creates a malicious materialized view can exploit this to execute code with elevated privileges.

Critical Impact

Successful exploitation allows attackers to execute arbitrary SQL functions with superuser privileges, potentially leading to complete database compromise, data exfiltration, or lateral movement within the infrastructure.

Affected Products

  • PostgreSQL versions before 16.2
  • PostgreSQL versions before 15.6
  • PostgreSQL versions before 14.11
  • PostgreSQL versions before 13.14
  • PostgreSQL versions before 12.18

Discovery Timeline

  • 2024-02-08 - CVE-2024-0985 published to NVD
  • 2024-12-20 - Last updated in NVD database

Technical Details for CVE-2024-0985

Vulnerability Analysis

This vulnerability is classified under CWE-271 (Privilege Dropping / Lowering Errors), which describes situations where software fails to properly drop privileges before performing operations that should run with reduced permissions.

The core issue lies in how PostgreSQL handles privilege transitions during concurrent materialized view refresh operations. The REFRESH MATERIALIZED VIEW CONCURRENTLY command is intended to execute SQL functions with the privileges of the view owner rather than the command issuer. This design pattern exists to allow database administrators to safely refresh materialized views created by less privileged users.

However, the privilege drop occurs too late in the execution flow, creating a window where attacker-controlled SQL functions can execute with the privileges of the command issuer (typically a superuser or highly privileged user) rather than the view owner.

Root Cause

The root cause is a timing flaw in the privilege management logic of the REFRESH MATERIALIZED VIEW CONCURRENTLY operation. The privilege drop that should occur before executing view-defined SQL functions happens after certain operations have already been performed with elevated privileges. This late privilege drop creates an exploitable race condition where malicious functions embedded in the materialized view definition can capture and abuse the issuer's privileges.

The vulnerability specifically requires:

  1. An attacker with the ability to create materialized views
  2. A victim with superuser privileges or membership in the attacker's roles
  3. Social engineering to convince the victim to execute REFRESH MATERIALIZED VIEW CONCURRENTLY on the attacker's view

Attack Vector

The attack requires network access and user interaction, making it a social engineering-dependent exploit. An attacker must:

  1. Create a materialized view containing malicious SQL functions
  2. Convince a privileged user (superuser or role member) to refresh this view using the CONCURRENTLY option
  3. The malicious functions execute with the victim's privileges rather than the view owner's privileges

The attack is particularly dangerous in multi-tenant database environments or scenarios where database administrators routinely perform maintenance operations on views owned by other users.

The exploitation mechanism involves crafting a materialized view with embedded function calls that will execute during the refresh operation. When a superuser runs REFRESH MATERIALIZED VIEW CONCURRENTLY on this view, the late privilege drop allows these functions to run with superuser privileges instead of the intended restricted permissions.

For detailed technical analysis, see the Postgres CVE Analysis.

Detection Methods for CVE-2024-0985

Indicators of Compromise

  • Unusual REFRESH MATERIALIZED VIEW CONCURRENTLY commands executed by privileged users on views owned by lower-privileged accounts
  • Database audit logs showing privilege escalation patterns or unexpected superuser function executions
  • Materialized views containing suspicious or obfuscated function calls
  • Evidence of data exfiltration or unauthorized database modifications following view refresh operations

Detection Strategies

  • Enable PostgreSQL audit logging (log_statement = 'all') and monitor for REFRESH MATERIALIZED VIEW CONCURRENTLY commands executed by superusers
  • Implement query analysis rules to flag concurrent refresh operations on views owned by non-administrative users
  • Deploy database activity monitoring (DAM) solutions to track privilege usage patterns and anomalous function executions
  • Review materialized view definitions for embedded functions that could be exploited for privilege escalation

Monitoring Recommendations

  • Configure alerting for any REFRESH MATERIALIZED VIEW CONCURRENTLY operations performed by superuser accounts
  • Monitor the pg_stat_activity view for suspicious query patterns involving materialized view operations
  • Implement separation of duties by restricting which users can perform refresh operations on views they do not own
  • Regularly audit materialized view ownership and embedded function dependencies

How to Mitigate CVE-2024-0985

Immediate Actions Required

  • Upgrade PostgreSQL immediately to patched versions: 16.2, 15.6, 14.11, 13.14, or 12.18
  • Review all materialized views in the database and verify ownership and function dependencies
  • Restrict superuser account usage and implement least-privilege principles for routine maintenance operations
  • Audit recent REFRESH MATERIALIZED VIEW CONCURRENTLY commands to identify potential exploitation attempts

Patch Information

PostgreSQL has released security updates addressing this vulnerability. Organizations should upgrade to the following patched versions:

Current Version BranchUpgrade To
PostgreSQL 16.x16.2 or later
PostgreSQL 15.x15.6 or later
PostgreSQL 14.x14.11 or later
PostgreSQL 13.x13.14 or later
PostgreSQL 12.x12.18 or later

For official patch details, refer to the PostgreSQL Security Advisory.

Additional vendor advisories are available from Debian LTS and NetApp Security.

Workarounds

  • Avoid running REFRESH MATERIALIZED VIEW CONCURRENTLY with superuser privileges on views owned by other users until patching is complete
  • Use the non-concurrent REFRESH MATERIALIZED VIEW command as an alternative (note: this requires exclusive lock on the view)
  • Implement strict access controls preventing unprivileged users from creating materialized views in shared schemas
  • Require manual review and approval of materialized view definitions before privileged users perform refresh operations
bash
# Verify PostgreSQL version and check for vulnerable installations
psql -c "SELECT version();"

# Audit materialized views and their owners
psql -c "SELECT schemaname, matviewname, matviewowner FROM pg_matviews ORDER BY matviewowner;"

# Review recent refresh operations in logs
grep -i "REFRESH MATERIALIZED VIEW CONCURRENTLY" /var/log/postgresql/postgresql-*.log

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechPostgresql

  • SeverityHIGH

  • CVSS Score8.0

  • EPSS Probability0.62%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-271

  • NVD-CWE-noinfo
  • Technical References
  • Debian LTS Announcement

  • Postgres CVE Analysis

  • NetApp Security Advisory
  • Vendor Resources
  • PostgreSQL Security Advisory
  • Related CVEs
  • CVE-2026-2361: PostgreSQL Anonymizer Privilege Escalation

  • CVE-2026-2360: PostgreSQL Anonymizer Privilege Escalation

  • CVE-2024-10978: PostgreSQL Privilege Escalation Flaw

  • CVE-2022-1552: PostgreSQL Privilege Escalation Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English