Skip to content
eastbaycyber

CVE-2026-7816: pgAdmin 4 OS Command Injection

CVSS · High
8.8
In CISA KEV
No
Published
Nov 12
Patch SLA & TriageVector: Network
7 days

High CVSS (8.8) vulnerability; prioritize internet-facing assets.

Exposure:
Control:
CVSS v3.1 Blast RadiusScore: 8.8
Decode Vector & Sub-Scores →
CVE explainers 10 min read
Security Research Desk Source-checked
Auto-checked against the official CVE record · Human-reviewed after publishing · Updated 2026-11-12
▲ Escalation ViewOne CVE, briefed at three altitudes — skim the Brief, weigh the Impact, or work the Runbook. The way a SOC actually reads it.
CISOBrief · 30-second brief

TL;DR - CVE-2026-7816 is a high-severity authenticated OS command-injection flaw in pgAdmin 4 query export. - pgAdmin 4 versions before 9.15 are affected; upgrade to 9.15 or later. - No confirmed in-the-wild exploitation is established, and the CVE is not in CISA KEV, but the impact can include arbitrary command execution.

AnalystImpact · assess the risk

Are You Affected?

CVE-2026-7816 is a pgAdmin 4 vulnerability affecting the Import/Export query-export functionality. The vulnerable code path constructs a PostgreSQL psql \copy metacommand using user-controlled input without sufficient sanitization or validation. An authenticated user who can access the relevant functionality may be able to escape the intended query context and execute operating-system commands or write arbitrary files on the pgAdmin server.

Organizations reviewing this issue should also understand how network boundaries affect database administration systems. See our network segmentation glossary for background on separating administrative services from general user and production networks.

Field Details
CVE CVE-2026-7816
CVSS 8.8 High
Attack vector Network-based access to pgAdmin
Authentication Required
Privileges required Authenticated pgAdmin user; exact privilege boundary should be validated against local configuration
Vulnerability type OS command injection
CWE CWE-78
Affected product pgAdmin 4
Affected versions Before 9.15; reporting specifically identifies 9.4 through 9.14
Fixed version 9.15
Patch available Yes
CISA KEV No

Treat every pgAdmin 4 deployment below 9.15 as affected unless a vendor-supported downstream package explicitly documents a backported fix. This includes server-mode installations, container images, virtual appliances, and operating-system packages that may not use the upstream version number directly.

Assess exposure in addition to authentication. A pgAdmin instance exposed to the internet, reachable by contractors, shared among multiple teams, or accessible to semi-trusted database users presents greater practical risk than an isolated administrative workstation. Depending on deployment, the vulnerable process may have access to database credentials, configuration files, local sockets, cloud metadata, or sensitive filesystem paths.

Analyst’s Take: Patch first, then verify the privilege boundary and exposure of every instance. The absence of a CISA KEV entry and confirmed in-the-wild exploitation does not offset the potential for command execution when an authenticated user can reach the affected export functionality.

The Fix, If You’re in a Hurry

Upgrade pgAdmin 4 to 9.15 or later. The available reporting identifies 9.15 as the fixed release. Confirm the version after upgrading and verify that all instances have been updated, including replicas, staging environments, containers, and dormant administrative hosts.

For a package or container deployment, use the deployment system’s normal update process. Examples below are illustrative; package names and image references vary by distribution and organization:

# Debian or Ubuntu-style package installation, if pgAdmin is managed by APT
sudo apt-get update
sudo apt-get install --only-upgrade pgadmin4

# Container workflow: replace with your approved registry and image tag
docker pull <approved-pgadmin-image>:9.15
docker compose up -d --no-deps pgadmin

Do not assume that restarting an old process applies the fix. Check the running application or package inventory after deployment:

pgadmin4 --version 2>/dev/null || true
docker exec <pgadmin-container> pgadmin4 --version 2>/dev/null || true

If an immediate upgrade is impossible, restrict pgAdmin access to trusted administrative networks through firewall policy or an identity-aware proxy. Remove access for users who do not require query export, and avoid running pgAdmin under a privileged operating-system account. These controls reduce exposure but are not a substitute for the fixed release.

Technical Notes

The reported remediation includes parsing and validating parentheses using logic modeled on psql tokenization, allow-listing values such as format, on_error, and log_verbosity, rejecting null bytes, and normalizing line breaks so an input cannot terminate one \copy metacommand and begin another. Those protections are delivered by upgrading rather than by editing application code locally.

If compromise is suspected, isolate the host or container, preserve logs and process telemetry, and rotate credentials available to the pgAdmin service. A practical emergency sequence is:

# Restrict the service at the host firewall as appropriate for your environment
sudo ufw deny 80/tcp
sudo ufw deny 443/tcp

# Stop the service after collecting volatile evidence if incident response requires it
sudo systemctl stop pgadmin4

Use local change-control procedures before executing containment commands in production. The correct port and service name depend on the deployment.

How This Vulnerability Works

The affected feature exports query results through PostgreSQL’s psql \copy metacommand. In the vulnerable implementation, values supplied through the query-export request were reportedly interpolated into a command template without reliably proving that the resulting text remained inside the intended \copy (...) structure.

An attacker can abuse metacommand syntax by supplying input that closes the expected query or output expression and adds another clause. The reported examples include input shaped like ") TO PROGRAM 'cmd'", which can escape the intended context and invoke an operating-system command, or ") TO '/path'", which can cause file creation or overwrite. The exact command and resulting permissions depend on the operating system, PostgreSQL client behavior, pgAdmin process account, and deployment configuration.

Technical Notes

The root cause is an injection boundary between application data and a command language. This differs from conventional SQL injection because the dangerous interpreter is the PostgreSQL client’s psql command processor and, through PROGRAM, potentially the operating system.

Other query-export fields, including format, on_error, and log_verbosity, were also reportedly inserted without adequate validation. Null bytes and line breaks matter because they can alter parser behavior or terminate a metacommand. The remediation therefore combines structural parsing with strict allow-lists instead of attempting to block a small set of known malicious strings.

A successful exploit runs with the privileges of the pgAdmin server process or the associated command-execution component. Consequences may include reading configuration and credential material, modifying application files, creating persistence, damaging local data, or pivoting to database and cloud resources available to that account.

Severity, Explained

CVE-2026-7816 has a reported CVSS base score of 8.8, rated High. The score reflects a network-reachable administrative web application and potentially serious consequences after authentication. In practical terms, the requirement for an authenticated account lowers the likelihood of an unauthenticated opportunistic attack but does not eliminate risk in environments with broad user access, compromised credentials, weak account controls, or exposed login portals.

The supplied NVD result provides the score but not the complete CVSS vector string. Verify the current vector directly in the NVD record before using the score in a formal compliance report, risk register, or SLA calculation. The known facts support the following interpretation: network access is involved, authentication is required, and successful exploitation can affect confidentiality, integrity, and availability through command execution or arbitrary file writes.

Technical Notes

Do not treat “authenticated” as equivalent to “highly privileged.” The relevant question is which pgAdmin users can reach Import/Export query functionality and what operating-system and database permissions the pgAdmin service possesses. Review role mappings, shared accounts, single sign-on groups, and any reverse-proxy rules that expose the application to non-administrative users.

Risk is materially higher when pgAdmin runs:

  • As root, Administrator, or another highly privileged account
  • On a host containing database credentials or private keys
  • In a network segment with broad database and management access
  • With access to cloud metadata services or sensitive mounted volumes
  • Without process, file-integrity, or outbound-network monitoring

Is It Being Exploited?

The available assessment does not establish confirmed exploitation in the wild. CVE-2026-7816 is not listed in the CISA Known Exploited Vulnerabilities catalog. There is consequently no CISA KEV due date or required-action deadline associated with this CVE.

A public pgAdmin GitHub issue documents the vulnerability, so technical information is available to defenders and potential attackers. The supplied research did not identify a verified public exploit repository or weaponized proof-of-concept. A public issue can provide enough detail to reproduce or adapt an exploit without proving that exploitation is occurring at scale.

Classify the vulnerability as technically high impact even though active exploitation is unconfirmed. Internet exposure, weak authentication, evidence of suspicious export requests, or compromised pgAdmin credentials should increase priority beyond what the KEV status alone suggests.

Technical Notes

Monitor changes in exploitation status through the NVD record, the pgAdmin project’s security communications, CISA KEV updates, and internal threat-intelligence sources. Absence from KEV is not evidence that a deployment is safe; KEV coverage is selective and may lag discovery or reporting.

If an affected instance is internet-facing, prioritize patching as though exploitation could begin after public disclosure. Restrict access while patching, preserve relevant telemetry, and investigate before rotating or deleting logs.

ResponderRunbook · act now

Detecting It in Your Environment

Detection should combine application logs, reverse-proxy telemetry, operating-system process events, and filesystem monitoring. A successful attack may not produce a distinctive CVE string. The most valuable indicators are unusual query-export requests followed by psql child processes, shell interpreters, unexpected outbound connections, or file creation by the pgAdmin service account.

Review pgAdmin access logs for requests to the Import/Export or query-export endpoint, especially from users who do not normally perform exports. Correlate the request timestamp with process creation and file activity on the host. Endpoint names and log formats vary by pgAdmin version and deployment, so validate the examples below against a known-good request in your environment.

For broader validation, compare your SIEM and EDR coverage against expected process and web-request telemetry. Our guide on validating SIEM and EDR detections provides a practical testing framework.

Technical Notes

A generic web-log search can identify likely export activity, but it is not a complete detection rule:

# Search compressed and uncompressed web logs for likely export-related requests
zgrep -Ei 'export|import|query' /var/log/nginx/access.log* 2>/dev/null
grep -Ei 'export|import|query' /var/log/pgadmin/pgadmin4.log 2>/dev/null

Investigate records resembling this pattern, adapting the path and field positions to local logs:

<timestamp> <user-or-session> POST /<pgadmin-export-endpoint> 200
<same-time-window> pgadmin4 -> psql
<same-time-window> pgadmin4 -> sh|bash|cmd.exe|powershell.exe

The presence of psql alone is not proof of exploitation because legitimate exports may invoke it. Escalate when it is paired with a shell child process, unusual arguments, a PROGRAM token, unexpected output paths, or a request from an atypical account.

For Linux auditd, a focused process-execution rule can provide useful telemetry:

sudo auditctl -a always,exit -F arch=b64 -S execve \
  -F exe=/usr/bin/psql -k pgadmin-psql
sudo auditctl -a always,exit -F arch=b64 -S execve \
  -F exe=/bin/sh -k pgadmin-shell

Executable paths vary, and audit rules should be managed through the organization’s persistent configuration rather than applied ad hoc. Query events with:

sudo ausearch -k pgadmin-psql -i
sudo ausearch -k pgadmin-shell -i

Also inspect files created or modified by the pgAdmin service account, particularly in temporary directories, application directories, web roots, home directories, and mounted secret locations. In containerized deployments, review container exec events, image changes, mounted-volume writes, and unexpected outbound connections.

References and Further Reading

The primary vulnerability record is the NVD entry for CVE-2026-7816:

The pgAdmin project’s public issue provides project-specific technical context and remediation details:

A third-party technical analysis identifies the affected release range and fixed version. Treat third-party details as supplementary and verify package status against the pgAdmin project and NVD records:

For operational response, consult the current CISA Known Exploited Vulnerabilities catalog and confirm whether the status changes. At the time of this assessment, CVE-2026-7816 was not listed. The absence of a KEV entry does not remove the need to patch an exposed or broadly accessible pgAdmin deployment.

Validate the installed version independently across every deployment form. A patched workstation does not remediate an older container, server-mode instance, test environment, or bundled appliance. The required target is pgAdmin 4 version 9.15 or later, with access restricted and credentials rotated when investigation indicates possible compromise.

This article may contain affiliate links. We earn a commission on qualifying purchases at no extra cost to you.

Last verified: 2026-11-12

Disclaimer: This article may contain affiliate links. We earn a commission on qualifying purchases at no extra cost to you.