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.