Automated Threat Modeling

Brief Summary: pgAdmin 4 CVE-2026-7815 SQL Injection in Maintenance Tool Enables OS Command Execution

A short review of CVE-2026-7815, a high-severity SQL injection in pgAdmin 4's Maintenance Tool that lets authenticated users escalate from SQL injection to operating system command execution on the database host via COPY TO PROGRAM.

CVE Analysis

5 min read

ZeroPath CVE Analysis
ZeroPath CVE Analysis

2026-05-11

Brief Summary: pgAdmin 4 CVE-2026-7815 SQL Injection in Maintenance Tool Enables OS Command Execution
Experimental AI-Generated Content

This CVE analysis is an experimental publication that is completely AI-generated. The content may contain errors or inaccuracies and is subject to change as more information becomes available. We are continuously refining our process.

If you have feedback, questions, or notice any errors, please reach out to us.

[email protected]

Introduction

A SQL injection flaw in pgAdmin 4's Maintenance Tool lets an authenticated user turn a simple parameter injection into full operating system command execution on the database host. For organizations that rely on pgAdmin as their primary PostgreSQL management interface, this vulnerability (scored CVSS 8.8) is a direct path from a web application compromise to control of the underlying server.

pgAdmin is the most popular and feature-rich open-source administration and development platform for PostgreSQL. It is the default graphical management tool for PostgreSQL deployments across enterprises, cloud environments, and development teams worldwide. Because it is the primary administrative interface for one of the most widely deployed open-source databases, security issues in pgAdmin have outsized impact.

Technical Information

The root cause of CVE-2026-7815 is how the pgAdmin 4 Maintenance Tool builds SQL commands for VACUUM, ANALYZE, and REINDEX operations. Four user-supplied JSON fields are concatenated directly into the rendered command string and passed to psql --command without sanitization or validation:

Vulnerable JSON FieldAffected Commands
buffer_usage_limitVACUUM, ANALYZE, REINDEX
vacuum_parallelVACUUM, ANALYZE, REINDEX
vacuum_index_cleanupVACUUM, ANALYZE, REINDEX
reindex_tablespaceVACUUM, ANALYZE, REINDEX

When a user triggers a maintenance operation through the pgAdmin web interface, the backend takes the values from these JSON fields and embeds them directly into the SQL command string. It does no allow listing and no parameterized construction. For reindex_tablespace, it applies only manual quoting, which can be bypassed.

Attack Flow

Exploitation takes five steps:

  1. The attacker authenticates to the pgAdmin 4 web interface. They must hold the tools_maintenance permission, which grants access to the Maintenance Tool.

  2. The attacker starts a maintenance operation (for example, a VACUUM) and supplies a crafted value in one of the four vulnerable JSON fields. The payload is designed to break out of the expected option syntax.

  3. The pgAdmin backend concatenates the attacker-controlled value directly into the SQL command string without validation.

  4. pgAdmin passes the command to psql --command, which runs it against the connected PostgreSQL server. The injected SQL executes with the privileges of the active database connection.

  5. To escalate beyond database-level access, the attacker uses PostgreSQL's COPY ... TO PROGRAM statement. This built-in PostgreSQL feature, available to superusers, runs arbitrary operating system commands on the database host with the privileges of the PostgreSQL service account.

The COPY ... TO PROGRAM escalation path is well documented and requires no novel techniques. If the pgAdmin connection uses a superuser role, which is common in administrative deployments, the path from SQL injection to full OS command execution is direct.

The CVSS 3.1 vector is CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Low attack complexity and no required user interaction, combined with high impact on all three CIA triad dimensions, justify the 8.8 score.

Fix Details

Version 9.15 (commit cf53953d9) fixes the issue with two changes:

  1. The server now allow lists all four vulnerable JSON fields, so only expected values pass through.
  2. The qtIdent filter replaces the manual quoting of reindex_tablespace and applies proper PostgreSQL identifier escaping.

Affected Systems and Versions

The vulnerability affects pgAdmin 4 versions from 7.6 up to (but not including) 9.15. Any deployment in this range is vulnerable if users holding the tools_maintenance permission can reach the Maintenance Tool.

The fixed version is pgAdmin 4 9.15.

Vendor Security History

pgAdmin's operational tooling has a pattern of command execution vulnerabilities:

CVE IdentifierAffected VersionVulnerability TypeImpact
CVE-2026-78157.6 to before 9.15SQL InjectionOS Command Execution via COPY TO PROGRAM
CVE-2026-17079.11Restore Restriction BypassCommand execution during restore operations

CVE-2026-1707 let attackers with web interface access extract a restriction key and overwrite restore scripts, which gave them reliable command execution on the pgAdmin host. Command execution risks have now recurred in pgAdmin's administrative tooling, so treat pgAdmin instances as high-value targets and apply updates promptly.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization