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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2026-7816

CVE-2026-7816: pgAdmin 4 RCE Vulnerability Explained

CVE-2026-7816 is an OS command injection flaw in pgAdmin 4 that allows authenticated attackers to execute arbitrary commands on the server. This article covers technical details, affected versions, and mitigation.

Published: May 18, 2026

CVE-2026-7816 Overview

CVE-2026-7816 is an OS command injection vulnerability [CWE-78] in the pgAdmin 4 Import/Export query export feature. User-supplied input is interpolated directly into a psql \copy metacommand template without sanitization. Authenticated attackers can break out of the \copy (...) context and execute arbitrary operating system commands on the pgAdmin server. The same flaw also allows arbitrary file writes through TO '/path' constructs. Additional fields including format, on_error, and log_verbosity are also raw-interpolated and exploitable. The issue affects pgAdmin 4 versions before 9.15.

Critical Impact

Authenticated users can achieve arbitrary command execution and arbitrary file write on the pgAdmin server, leading to full host compromise.

Affected Products

  • pgAdmin 4 versions prior to 9.15
  • pgAdmin 4 Import/Export query export component
  • Deployments exposing pgAdmin 4 to authenticated multi-tenant users

Discovery Timeline

  • 2026-05-11 - CVE-2026-7816 published to NVD
  • 2026-05-13 - Last updated in NVD database

Technical Details for CVE-2026-7816

Vulnerability Analysis

The vulnerability resides in pgAdmin 4's Import/Export query export workflow. The application constructs a psql \copy metacommand by embedding user-controlled values directly into the template string. Because \copy supports a TO PROGRAM 'cmd' clause that pipes results into an arbitrary shell command, an authenticated attacker can close the parenthesized query expression and append a TO PROGRAM directive. The injected command then runs under the privileges of the pgAdmin server process.

An alternate exploitation path uses TO '/path' to write attacker-controlled output to any file path the pgAdmin process can access. This enables persistence through configuration file overwrites, SSH key planting, or web shell deployment in served directories.

Root Cause

The root cause is missing input sanitization and missing structural validation when building the \copy metacommand. The query string and the format, on_error, and log_verbosity parameters are concatenated into the command template as raw text. No parser tracks parenthesis balance, no allow-list constrains enumeration parameters, and null bytes are not rejected. This permits attackers to escape the intended SQL COPY query context.

Attack Vector

Exploitation requires an authenticated session on the pgAdmin 4 server. The attacker submits a crafted query export request where the query body terminates the \copy (...) parenthesized expression and appends TO PROGRAM 'cmd'. The injected payload is forwarded to psql, which executes the program clause on the server hosting pgAdmin. Because the attack surface is reachable over the network and the parameters used are functional pgAdmin features, no unusual privilege or user interaction is required beyond standard authenticated access. Refer to the GitHub Issue Report for technical context.

Detection Methods for CVE-2026-7816

Indicators of Compromise

  • Unexpected child processes spawned by the pgAdmin 4 Python process or psql binary, particularly shell interpreters, curl, wget, or scripting runtimes
  • pgAdmin server logs containing \copy metacommands with TO PROGRAM clauses or unexpected TO '/path' constructs
  • New or modified files in pgAdmin-writable directories not corresponding to legitimate export operations
  • Outbound network connections originating from the pgAdmin host immediately following Import/Export operations

Detection Strategies

  • Monitor process ancestry for psql or pgAdmin processes spawning interactive shells, /bin/sh, cmd.exe, or PowerShell
  • Inspect pgAdmin Import/Export request payloads for parenthesis imbalance, embedded null bytes, or non-allow-listed values in format, on_error, and log_verbosity
  • Audit filesystem write activity by the pgAdmin service account against an allow-list of legitimate export destinations

Monitoring Recommendations

  • Forward pgAdmin application logs and host process telemetry to a centralized analytics platform and alert on TO PROGRAM strings
  • Track authenticated session activity on pgAdmin for anomalous Import/Export operation volume or off-hours usage
  • Baseline expected outbound connections from the pgAdmin host and alert on deviations following query export events

How to Mitigate CVE-2026-7816

Immediate Actions Required

  • Upgrade pgAdmin 4 to version 9.15 or later, which adds a parenthesis-balance parser, allow-lists enumeration parameters, and rejects null bytes in queries
  • Restrict network access to pgAdmin 4 management interfaces to trusted administrative networks only
  • Audit pgAdmin user accounts and remove unnecessary authenticated access
  • Review pgAdmin host logs for evidence of TO PROGRAM or unexpected file write activity prior to patching

Patch Information

The upstream fix is included in pgAdmin 4 version 9.15. The patch introduces a parser modeled on psql's strtokx tokenizer to enforce parenthesis balance, applies allow-lists to the format, on_error, and log_verbosity fields, rejects null bytes in the query body, and tightens type and gating checks. Details are tracked in the pgAdmin GitHub Issue.

Workarounds

  • Run pgAdmin 4 under a least-privileged service account with no write access to sensitive paths and no shell available
  • Disable or restrict the Import/Export query export functionality for non-administrative users where feasible
  • Place pgAdmin behind a reverse proxy that filters request bodies containing TO PROGRAM or unbalanced parentheses in export parameters
bash
# Configuration example: verify installed pgAdmin 4 version and upgrade via pip
pip show pgadmin4 | grep -i version
pip install --upgrade "pgadmin4>=9.15"

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPgadmin

  • SeverityHIGH

  • CVSS Score8.7

  • EPSS Probability0.20%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-89
  • Technical References
  • GitHub Issue Report
  • Related CVEs
  • CVE-2026-7818: pgAdmin 4 Deserialization RCE Vulnerability

  • CVE-2025-13780: pgAdmin 4 RCE Vulnerability

  • CVE-2025-12763: pgAdmin 4 RCE Vulnerability on Windows

  • CVE-2025-12762: Pgadmin 4 RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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