CVE-2026-7816: pgAdmin 4: OS command injection in Import/Export query export via psql metacommand breakout

Published May 11, 2026
·
Updated

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, onerror, logverbosity) were also raw-interpolated and exploitable.

Fix adds a parens-balance parser modeled on psql's strtokx tokenizer, allow-lists format/onerror/logverbosity, rejects null bytes in the query, and tightens type and gating checks.

This issue affects pgAdmin 4: before 9.15.

Affected Software

2 affected components
pgAdmin pgAdmin 4<9.15
pgAdmin Pgadmin 4 Postgresql>=9.4<9.15

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pgAdmin 4 to a version that resolves this vulnerability.

    Fixed in 9.15
  2. Configuration

    Upgrade pgAdmin 4 to apply the fix: use a parens-balance parser (modeled on psql's strtokx tokenizer) for the psql \copy metacommand template, allow-list format/on_error/log_verbosity, reject null bytes in the query, and tighten type and gating checks to prevent psql metacommand breakout.

    pgAdmin 4 Import/Export (query export) Input handling for format/on_error/log_verbosity = allow-listed and parsed with a parens-balance parser modeled on psql's strtokx tokenizer; reject null bytes in the query

Event History

May 11, 2026
CVE Published
via MITRE·02:35 PM
Data Sourced
via MITRE·02:35 PM
DescriptionSeverity
Data Sourced
via NVD·04:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jun 23, 58372
Event
via FIRST·03:20 AM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-7816?

CVE-2026-7816 has a high severity rating of 8.7.

2

How do I fix CVE-2026-7816?

You can fix CVE-2026-7816 by applying the available patch from pgAdmin.

3

What kind of vulnerability is CVE-2026-7816?

CVE-2026-7816 is an OS command injection vulnerability.

4

Can CVE-2026-7816 be exploited without authentication?

No, CVE-2026-7816 requires an authenticated user to exploit the vulnerability.

5

What impact does CVE-2026-7816 have on data security?

CVE-2026-7816 allows an attacker to potentially execute arbitrary commands on the server, compromising data security.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203