Impact
The vulnerability allows an attacker to inject a shell command into the psql \copy command line that pgAdmin 4 builds from a user‑supplied SQL query. A backslash before a single quote is incorrectly treated as escaping the quote, which causes the psql tokenizer to close the string literal early. This discrepancy lets the query contain a TO PROGRAM clause that executes arbitrary code via popen(). The flaw is a classic form string and command injection issue, represented by CWE‑115 and CWE‑78. The impact is full remote code execution on the machine running the pgAdmin 4 service.
Affected Systems
All versions of pgAdmin 4 that include the Import/Export Data tool are affected, up to and including the latest release prior to the fix that introduced stricter query validation. The vulnerability spans all PostgreSQL backend versions supported by pgAdmin (13‑18).
Risk and Exploitability
The CVSS score is 9.4, indicating critical severity. The EPSS score is under 1 %, showing a very low measured probability of exploitation today, and the vulnerability is not listed in CISA’s KEV catalog. A likely attack requires a user with the tools_import_export_data permission and access to the pgAdmin web interface to create a job with a malicious query. Because the flaw is tied to a specific parsing mismatch, exploitation is not trivial but is feasible for a skilled attacker with the necessary permissions. The overall risk is high due to the severe impact, but the low exploitation likelihood suggests monitoring for attempts.
OpenCVE Enrichment