CVE-2026-7816: pgAdmin 4 OS Command Injection Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-j74f-g7vx-fh4x
CVSS 8.8
CWE-89 CWE-78
Published
Advisory Summary

CVE-2026-7816 is a HIGH (CVSS 8.8) os command injection vulnerability vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting pgAdmin 4 libraries in the PyPI ecosystem. The issue involves os command injection vulnerability in import/export query export. Remediation is available by upgrading affected packages to version 9.15.

CVE-2026-7816 at a Glance

CVE Identifier CVE-2026-7816
GHSA Identifier GHSA-j74f-g7vx-fh4x
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product pgAdmin 4
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-7816

To remediate this vulnerability, upgrade all affected pgAdmin 4 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pgadmin4 fixed: 9.15
pip install pgadmin4>=9.15
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pgadmin4

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-7816, inspect your installed packages using pip:

pip show pgadmin4

Analyze the terminal output to locate any version of pgAdmin 4 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.15), your application is affected.

Note: The pip show pgadmin4 command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In pgAdmin 4, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

OS command injection (CWE-78) vulnerability in pgAdmin 4 Import/Export query export. User-supplied input was interpolated directly into a psql \copy metacommand template without sanitization. An authenticated user 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 (format, on_error, log_verbosity) were also raw-interpolated and exploitable. Fix adds a parens-balance parser modeled on psql's strtokx tokenizer, allow-lists format/on_error/log_verbosity, rejects null bytes in the query, and tightens type and gating checks. This issue affects pgAdmin 4: before 9.15.

CVE-2026-7816 Affected pgAdmin 4 Versions

1 component(s)
Fixed Versions:
9.15
Product / Package Ecosystem Affected Versions Fixed Version
pgadmin4
PyPI
< 9.15
9.15

References

Frequently Asked Questions

What is CVE-2026-7816?
CVE-2026-7816 is a security vulnerability in pgAdmin 4 involving OS command injection vulnerability in Import/Export query export under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which pgAdmin 4 versions are affected?
Affected versions include releases prior to 9.15 across affected packages: pgadmin4.
What version fixes CVE-2026-7816?
Upgrading to 9.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pgadmin4 affected?
Yes, pgadmin4 is affected in releases prior to 9.15. Upgrade your dependency to 9.15 or later.
What is the CVSS score of CVE-2026-7816?
CVE-2026-7816 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-7816?
CVE-2026-7816 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check PyPI dependencies for CVE-2026-7816?
Run the dependency tree command: 'pip show pgadmin4'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-j74f-g7vx-fh4x",
  "modified" : "2026-05-18T14:31:21Z",
  "published" : "2026-05-11T18:31:44Z",
  "aliases" : [ "CVE-2026-7816" ],
  "summary" : "pgAdmin 4: OS command injection vulnerability in Import/Export query export",
  "details" : "OS command injection (CWE-78) vulnerability in pgAdmin 4 Import/Export query export.\n\nUser-supplied input was interpolated directly into a psql \\copy metacommand template without sanitization. An authenticated user 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 (format, on_error, log_verbosity) were also raw-interpolated and exploitable.\n\nFix adds a parens-balance parser modeled on psql's strtokx tokenizer, allow-lists format/on_error/log_verbosity, rejects null bytes in the query, and tightens type and gating checks.\n\nThis issue affects pgAdmin 4: before 9.15.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pgadmin4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.15"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-7816"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pgadmin-org/pgadmin4/issues/9899"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pgadmin-org/pgadmin4/commit/13badc62c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pgadmin-org/pgadmin4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78", "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-18T14:31:21Z",
    "nvd_published_at" : "2026-05-11T16:17:38Z"
  }
}