CVE-2026-116241

pgAdmin 4: Import/Export Data query export runs a command through a backslash in a double-quoted identifier

Published Oct 30, 2026 CVSS 4.0 · 9.4 Critical EPSS < 1% KEV · Not listed
Description
pgAdmin 4's Import/Export Data tool wraps a user's query export in a psql \copy (...) TO command and checks that the query's parentheses are balanced so that nothing can escape the wrapper. The check rejected a backslash inside a single-quoted string, but not inside a double-quoted identifier, where it treated the next double quote as closing the identifier. psql's \copy parser applies the connection's escape character to whichever quote opened a token, so with standard_conforming_strings off a backslash-escaped double quote does not close the identifier. pgAdmin's and psql's view of the quoting then diverged, a closing parenthesis hidden from the check ended the \copy (...) wrapper, and a following TO PROGRAM clause was executed by psql on the pgAdmin host, as the operating-system account running pgAdmin, before the server rejected the statement. An ordinary database role can turn standard_conforming_strings off for itself, and the Import/Export Data permission is granted to non-administrators by default.

This is a bypass of the fix for CVE-2026-17566. The fix rejects any backslash inside a double-quoted identifier, as was already done for single-quoted strings, since its meaning depends on a server setting that cannot be known reliably when the query is validated.

This issue affects pgAdmin 4: before 9.19.

Analysis

AI-generated

Technical impact

pgAdmin 4’s Import/Export Data tool closes a user’s export query inside a psql \copy (...) TO command. The tool attempts to balance parentheses to prevent escape, but it incorrectly rejects a backslash in a single‑quoted string while allowing one in a double‑quoted identifier. When standard_conforming_strings is off, a backslash‑escaped double quote does not actually close the identifier, so the tool’s parsing diverges from psql’s. This allows a closing parenthesis to be hidden from the tool’s check, letting the wrapped command finish and a following TO PROGRAM clause execute on the host running pgAdmin under the operating‑system account that runs the application. The attacker can run arbitrary commands on the system from an ordinary database role that has Import/Export Data permission, which is granted to non‑administrators by default.

Affected Systems

The vulnerability affects pgAdmin 4 from pgadmin.org, specifically all releases before version 9.19. Users running any earlier version of the tool are potentially exposed to this flaw.

Risk and Exploitability

The flaw has a CVSS score of 9.4, indicating high severity. EPSS data is not available, but the vulnerability is not listed in the CISA KEV catalog. Exploitation requires that a user runs the Import/Export Data function in a client that is installed on a machine where pgAdmin runs, and that the user’s role in PostgreSQL can set standard_conforming_strings OFF. Therefore the attack vector is a local or authorized‑user‑based local execution scenario, not a pure remote exploitation. With this precondition met, the attacker can execute arbitrary OS commands on the host as the pgAdmin process user, compromising confidentiality and integrity of the host system.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade pgAdmin 4 to version 9.19 or later, which rejects backslashes in double‑quoted identifiers during import/export.
  • Configure the PostgreSQL server to keep standard_conforming_strings ON for all users that will use Import/Export Data, preventing the backslash from escaping the identifier.
  • Restrict the Import/Export Data permission to administrative roles only, removing it from standard database users that can set server parameters.

Generated by OpenCVE AI on October 30, 2026 at 21:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
CPEs cpe:2.3:a:pgadmin:pgadmin_4:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Pgadmin
Pgadmin pgadmin 4
Vendors & Products Pgadmin
Pgadmin pgadmin 4
Type Values Removed Values Added
Description pgAdmin 4's Import/Export Data tool wraps a user's query export in a psql \copy (...) TO command and checks that the query's parentheses are balanced so that nothing can escape the wrapper. The check rejected a backslash inside a single-quoted string, but not inside a double-quoted identifier, where it treated the next double quote as closing the identifier. psql's \copy parser applies the connection's escape character to whichever quote opened a token, so with standard_conforming_strings off a backslash-escaped double quote does not close the identifier. pgAdmin's and psql's view of the quoting then diverged, a closing parenthesis hidden from the check ended the \copy (...) wrapper, and a following TO PROGRAM clause was executed by psql on the pgAdmin host, as the operating-system account running pgAdmin, before the server rejected the statement. An ordinary database role can turn standard_conforming_strings off for itself, and the Import/Export Data permission is granted to non-administrators by default. This is a bypass of the fix for CVE-2026-17566. The fix rejects any backslash inside a double-quoted identifier, as was already done for single-quoted strings, since its meaning depends on a server setting that cannot be known reliably when the query is validated. This issue affects pgAdmin 4: before 9.19.
Title pgAdmin 4: Import/Export Data query export runs a command through a backslash in a double-quoted identifier
Weaknesses CWE-115
CWE-78
References
Metrics cvssV3_1

{'score': 9.9, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H'}

cvssV4_0

{'score': 9.4, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H'}

Weaknesses
  • CWE-115

    Misinterpretation of Input

  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Sources

Status
PUBLISHED
Assigner
PostgreSQL
Published
Updated
Nov 6, 2026, 4:10 PM
Reserved
Oct 25, 2026, 4:26 PM
Status
Analyzed
Published
Oct 30, 2026, 8:17 PM
Modified
Nov 6, 2026, 5:17 PM
Severity
Important
Public date
Oct 30, 2026, 7:55 PM