PatchSiren

PatchSiren cyber security CVE debrief

CVE-2026-7816 pgadmin.org CVE debrief

CVE-2026-7816 is a high-severity OS command injection vulnerability (CWE-78) in pgAdmin 4's Import/Export query export functionality, published 2026-05-11 and last modified 2026-05-26. The vulnerability exists because user-supplied input was interpolated directly into a psql `COPY` metacommand template without proper sanitization. An authenticated attacker could inject `) TO PROGRAM 'cmd'` to break out of the `COPY (...)` context and achieve arbitrary command execution on the pgAdmin server, or `) TO '/path'` for arbitrary file write. Additional fields including format, on_error, and log_verbosity were also raw-interpolated and exploitable. The fix implements a parentheses-balance parser modeled on psql's strtokx tokenizer, allow-lists for format/on_error/log_verbosity values, rejection of null bytes in queries, and tightened type and gating checks. Affected versions are pgAdmin 4 from 9.4 up to but not including 9.15.

Vendor
pgadmin.org
Product
pgAdmin 4
CVSS
HIGH 8.7
CISA KEV
Not listed in stored evidence
Original CVE published
2026-05-11
Original CVE updated
2026-05-26
Advisory published
2026-05-11
Advisory updated
2026-05-26

Who should care

Organizations running pgAdmin 4 versions 9.4 through 9.14 for PostgreSQL database administration; security teams managing database access tools; DevOps and platform engineering teams with self-hosted pgAdmin deployments; compliance officers tracking CVE remediation for database infrastructure

Technical summary

The vulnerability stems from improper neutralization of special elements in OS commands (CWE-78). The pgAdmin 4 Import/Export feature constructs psql `COPY` metacommands using string interpolation with unsanitized user input. The `COPY` command in PostgreSQL supports `TO PROGRAM` and `TO filename` syntax that, when injected through unbalanced parentheses, allows escaping the intended query context. The attack vector requires authenticated access to pgAdmin 4. The remediation implements defense-in-depth: a parentheses-balancing parser prevents context escape, allow-listing restricts valid values for enumerated parameters, null byte rejection blocks injection attempts, and enhanced type checking provides additional validation layers.

Defensive priority

HIGH

Recommended defensive actions

  • Upgrade pgAdmin 4 to version 9.15 or later to remediate this vulnerability
  • If immediate patching is not possible, restrict access to the Import/Export query export functionality to trusted administrative users only
  • Monitor pgAdmin server logs for suspicious COPY command patterns or unexpected file system activity
  • Review and audit user accounts with access to pgAdmin 4 Import/Export features for signs of compromise
  • Validate that pgAdmin 4 deployments are not exposed to untrusted networks without additional access controls

Evidence notes

Vulnerability description and fix details sourced from NVD record. Affected version range confirmed via CPE criteria in source metadata. CVSS 4.0 vector and severity from official NVD entry. Vendor advisory and patch reference identified in source references.

Sources and references

Verified primary and authoritative sources

  • CVE-2026-7816 CVE Program record

    Publisher, destination, and source semantics verified

    URL: https://www.cve.org/CVERecord?id=CVE-2026-7816

    CVE Program - Official CVE Program record with source-provided CVE metadata.

  • CVE-2026-7816 NVD vulnerability detail

    Publisher, destination, and source semantics verified

    URL: https://nvd.nist.gov/vuln/detail/CVE-2026-7816

    NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.

Supplemental references

  • Mitigation or vendor reference

    Unverified legacy reference

    URL: https://github.com/pgadmin-org/pgadmin4/issues/9899

    f86ef6dc-4d3a-42ad-8f28-e6d5547a5007 - Issue Tracking, Patch, Vendor Advisory

Methodology and review provenance

AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.