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-2020-25695

CVE-2020-25695: PostgreSQL SQL Injection Vulnerability

CVE-2020-25695 is a SQL injection flaw in PostgreSQL that allows attackers to execute arbitrary SQL functions as a superuser. This article covers the technical details, affected versions, impact, and mitigation.

Published: March 4, 2026

CVE-2020-25695 Overview

A critical privilege escalation flaw was discovered in PostgreSQL versions before 13.1, 12.5, 11.10, 10.15, 9.6.20, and 9.5.24. This vulnerability allows an attacker with permission to create non-temporary objects in at least one schema to execute arbitrary SQL functions under the identity of a superuser. The exploitation of this flaw poses severe threats to data confidentiality, integrity, and overall system availability.

Critical Impact

Attackers can escalate privileges to superuser level and execute arbitrary SQL functions, potentially compromising the entire database system including sensitive data exfiltration, data manipulation, and service disruption.

Affected Products

  • PostgreSQL versions before 13.1
  • PostgreSQL versions before 12.5, 11.10, 10.15, 9.6.20, and 9.5.24
  • Debian Linux 9.0

Discovery Timeline

  • November 16, 2020 - CVE-2020-25695 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2020-25695

Vulnerability Analysis

This vulnerability stems from improper privilege handling within PostgreSQL's object creation and function execution mechanisms. When a user has permission to create non-temporary objects within at least one schema, they can craft malicious database objects that, when processed by the database engine, execute under the elevated privileges of a superuser context.

The flaw is classified under CWE-89 (SQL Injection), indicating that the vulnerability involves improper neutralization of special elements used in SQL commands. An attacker can leverage legitimate database functionality in an unintended manner to bypass normal access controls and assume superuser privileges.

The attack requires network access and low privileges (the ability to create objects in a schema), but requires no user interaction. Once exploited, the attacker gains complete control over database operations, enabling unauthorized access to all data, modification of database structures, and potential denial of service through destructive operations.

Root Cause

The root cause lies in PostgreSQL's handling of object ownership and privilege inheritance during SQL function execution. The database fails to properly validate and maintain privilege boundaries when certain database objects are created and subsequently referenced by system processes running under superuser context. This allows crafted objects to hijack the elevated execution context.

Attack Vector

The attack is network-accessible and can be executed by any authenticated user who has been granted the CREATE privilege on at least one schema. The attacker creates specially crafted database objects (such as functions, views, or operators) within their accessible schema. When these objects are subsequently accessed or processed by system operations running with superuser privileges, the malicious code executes in the superuser context.

The exploitation mechanism involves creating database objects that will be invoked during system operations such as autovacuum, ANALYZE, or other maintenance tasks that run with elevated privileges. This allows the attacker to effectively "trap" superuser operations and redirect them to execute attacker-controlled SQL code.

Detection Methods for CVE-2020-25695

Indicators of Compromise

  • Unexpected or unauthorized database objects (functions, views, operators) created by non-privileged users
  • Unusual SQL function executions logged under superuser identity that don't match expected administrative activities
  • New roles with elevated privileges created without administrator authorization
  • Database audit logs showing privilege escalation patterns or unauthorized data access

Detection Strategies

  • Enable PostgreSQL logging parameters log_statement = 'all' and log_connections = on to capture comprehensive query and connection activity
  • Monitor pg_stat_activity for suspicious queries executing under superuser context from unexpected sources
  • Implement role-based audit triggers on system catalogs like pg_proc, pg_class, and pg_namespace to detect unauthorized object creation
  • Use database activity monitoring solutions to detect anomalous privilege escalation patterns

Monitoring Recommendations

  • Configure alerts for creation of new functions, views, or operators by non-administrative users
  • Monitor for unusual autovacuum or maintenance operation failures that may indicate exploitation attempts
  • Regularly audit schema permissions to identify users with unnecessary CREATE privileges
  • Review pg_roles periodically for unexpected superuser memberships or privilege grants

How to Mitigate CVE-2020-25695

Immediate Actions Required

  • Upgrade PostgreSQL immediately to patched versions: 13.1, 12.5, 11.10, 10.15, 9.6.20, or 9.5.24 or later
  • Audit all schemas and revoke CREATE privileges from users who do not require them
  • Review recently created database objects for any suspicious functions, views, or operators
  • Enable comprehensive database logging to establish audit trails

Patch Information

PostgreSQL has released security updates addressing this vulnerability. Organizations should upgrade to the following minimum versions: PostgreSQL 13.1, 12.5, 11.10, 10.15, 9.6.20, or 9.5.24. Detailed patch information and release notes are available through the PostgreSQL Security Support Information page. Linux distribution users should also apply updates from their respective vendors, including Debian LTS Advisory December 2020 and Gentoo GLSA 202012-07.

Workarounds

  • Restrict CREATE privileges to only essential administrative accounts until patches can be applied
  • Implement strict schema isolation by preventing regular users from creating objects in shared schemas
  • Use search_path hardening by explicitly setting secure search paths for superuser functions
  • Consider temporarily disabling autovacuum on untrusted schemas if patching is delayed (note: this impacts performance)
bash
# Revoke CREATE privileges from public schema for all users
psql -c "REVOKE CREATE ON SCHEMA public FROM PUBLIC;"

# Review users with CREATE privileges on any schema
psql -c "SELECT grantee, table_schema, privilege_type FROM information_schema.schema_privileges WHERE privilege_type = 'CREATE';"

# Enable comprehensive logging for security monitoring
# Add to postgresql.conf:
# log_statement = 'all'
# log_connections = on
# log_disconnections = on

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

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechPostgresql

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability25.51%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-89
  • Technical References
  • Red Hat Bug Report #1894425

  • Debian LTS Advisory December 2020

  • Gentoo GLSA 202012-07

  • NetApp Security Advisory ntap-20201202-0003
  • Vendor Resources
  • PostgreSQL Security Support Information
  • Related CVEs
  • CVE-2024-1597: PostgreSQL JDBC Driver SQLi Vulnerability

  • CVE-2025-1094: PostgreSQL libpq SQL Injection Vulnerability

  • CVE-2023-39417: PostgreSQL SQL Injection Vulnerability

  • CVE-2021-23214: PostgreSQL SQLI Vulnerability
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