Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to pgAdmin with tools_import_export_data
-
DeliveryCraft backslash-quote breakout query
-
ExploitSubmit to POST /import_export/job/<sid>
-
ExecutionBypass _is_query_parens_balanced checker
-
Persistpsql closes string, opens TO PROGRAM clause
-
Impactpopen() executes command on server host
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires an authenticated pgAdmin 4 session with the tools_import_export_data permission (described as ordinary and commonly granted) and access to the Import/Export Data tool's POST /import_export/job/<sid> endpoint; the pgAdmin server must be connected to a PostgreSQL server running with standard_conforming_strings=on, which is the default on every supported version (PostgreSQL 13-18). The attacker supplies a query where a backslash immediately precedes a single quote (e.g. 'a\') so psql, under scs=on, closes the string literal and exposes an injected TO PROGRAM clause. Limiting factors that reduce real-world risk: exploitation is not fully unauthenticated (PR:L - a valid pgAdmin login plus the tools_import_export_data permission is needed), the affected version must be earlier than 9.18, the pgAdmin web UI must be reachable by the attacker, and the injected command runs with the privileges of the OS account running the pgAdmin server. It does NOT require the query to be otherwise syntactically valid - RCE fires independent of a later syntax error on the same line. |
| Impact | This is a genuine high-priority issue, not a paper tiger. The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N with VC/VI/VA:H and SC/SI/SA:H, base 9.4) indicates network-reachable, low-complexity exploitation requiring only low privileges and no user interaction, resulting in full compromise of the affected and subsequent systems - consistent with server-side RCE. The PR:L is meaningful: exploitation requires an authenticated pgAdmin session holding tools_import_export_data, but that permission is described as ordinarily and commonly granted, so it is a weak barrier in typical multi-user deployments. Working exploit conditions and a concrete payload are public in the fix commit, which raises practical risk even though the vulnerability is NOT in CISA KEV (no confirmed active exploitation) and no EPSS score was supplied to gauge exploitation probability. Conflicting/missing signals to note: no EPSS and no KEV means widespread automated exploitation is unconfirmed; the CVSS 4.0 AV:N assumes the pgAdmin web interface is network-exposed, which for many internal admin deployments it is not, lowering real-world exposure. Overall: treat as a serious authenticated RCE to patch promptly, weighted by how exposed and how multi-tenant the pgAdmin instance is. |
| Exploit ScenarioDerived | An authenticated pgAdmin 4 user who holds the ordinary tools_import_export_data permission opens the Import/Export Data tool and submits a crafted query such as SELECT 'a\') TO PROGRAM 'echo pwned' x'; pgAdmin's balance checker accepts it, but the rendered psql \copy command line closes the string and subquery early and psql executes the attacker's TO PROGRAM command via popen() on the pgAdmin server host. Because the CVSS vector is AV:N/AC:L/PR:L/UI:N, no victim interaction is needed and complexity is low - the fix commit even ships the working payload as a regression test - making reliable RCE straightforward for any low-privileged pgAdmin account. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 31, 2026
OS command injection in pgAdmin 4 (all versions before 9.18) lets an authenticated user with the commonly-granted tools_import_export_data permission run arbitrary commands on the pgAdmin server host. The Import/Export Data tool renders a user-supplied query into a psql \copy (...) command line; its hand-written parenthesis-balance validator (_is_query_parens_balanced) wrongly assumes standard_conforming_strings=off, treating a backslash-quote (\') as an escaped quote, so a payload like SELECT 'a\') TO PROGRAM 'echo pwned' x' passes validation while real psql (scs=on, the default on PostgreSQL 13-18) closes the string early and executes an attacker-chosen TO PROGRAM clause via popen(). No CISA KEV listing and no standalone public exploit, but the fix commit's regression test discloses a fully working RCE payload; EPSS not provided.
RemediationAI
Upgrade to pgAdmin 4 version 9.18, which replaces the flawed backslash handling by rejecting any query containing a backslash inside a single-quoted string outright (a deliberately conservative fix, since the correct interpretation of \ depends on the target server's standard_conforming_strings setting that the validator cannot know); apply the change from commit 1496fabe28c9f825f6bac0f0d000d9d3276322c3 (see https://github.com/pgadmin-org/pgadmin4/issues/10213). If you cannot upgrade immediately, revoke the tools_import_export_data permission from all non-trusted pgAdmin roles so only fully trusted administrators can reach the POST /import_export/job/<sid> endpoint (trade-off: those users lose the Import/Export Data GUI feature), and restrict network access to the pgAdmin web interface to trusted admin networks/VPN only (trade-off: reduces convenience of remote access but sharply cuts the AV:N exposure). Because the command executes as the OS user running the pgAdmin server, additionally run pgAdmin under a least-privileged, sandboxed service account so a successful injection yields minimal host privileges.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The affected component is pgAdmin 4's Import/Export Data module (web/pgadmin/tools/import_export/__init__.py), which drives PostgreSQL's psql client. psql's \copy meta-command wraps a user query as \copy (<query>) TO ..., and psql supports a TO PROGRAM '<cmd>' clause that shells out via popen() on the machine running psql (the pgAdmin server). To prevent breakout from the (...) wrapper, pgAdmin interpolated the query into a Jinja template and pre-validated it with a custom parenthesis-balance checker instead of a real SQL tokenizer. The root cause (CWE-78, OS Command Injection) is that this checker's string-literal tokenizer used inverted backslash-escape semantics: it always treated \' as escaping the quote (standard_conforming_strings=off behavior), but PostgreSQL has defaulted standard_conforming_strings=on since 9.1 (2010) and it is on for every server version pgAdmin 4 supports (13-18). Under scs=on, psql treats \ as an ordinary character, so the quote after it closes the literal, the following ) ends the \copy subquery, and the TO PROGRAM clause becomes live. This is the same bug class as CVE-2025-12762/CVE-2025-13780 (psql meta-command/COPY injection during PLAIN-format restore), independently reintroduced in a different module with a different logic error.
Know when Pgadmin 4 gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network-reachable web endpoint (AV:N/AC:L), needs a low-privileged authenticated pgAdmin account with a commonly-granted permission (PR:L); breaking out of the app into OS command execution is a scope change (S:C) yielding full host compromise.
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Primary rating from Vendor (f86ef6dc-4d3a-42ad-8f28-e6d5547a5007).
CVSS VectorVendor: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
Lifecycle Timeline
2DescriptionCVE.org
pgAdmin 4's Import/Export Data tool builds a psql \copy (...) command line by interpolating a user-supplied SQL query into a Jinja template and passing the rendered line to psql via --command. To stop an attacker from breaking out of the (...) wrapper, create_import_export_job() (route POST /import_export/job/<sid>, gated only by the ordinary, commonly-granted tools_import_export_data permission) validated the query with a hand-written parenthesis-balance checker, _is_query_parens_balanced(). That checker always treated a backslash before a single quote (\') as escaping the quote, i.e. as if standard_conforming_strings were off. PostgreSQL has defaulted standard_conforming_strings to on since 9.1 (2010), the default on every PostgreSQL version pgAdmin 4 currently supports (13-18); under that default psql's own \copy tokenizer treats \ as an ordinary character, so a single quote immediately after it closes the string literal. A query such as SELECT 'a\') TO PROGRAM 'echo pwned' x' was therefore accepted as "balanced" by pgAdmin's checker (which believed the ) was still inside the string), while psql, run through the actual rendered command line, closes the string at that point and treats the following ) as the end of the wrapping \copy (...) subquery, exposing an attacker-chosen TO PROGRAM '<command>' clause that psql executes via popen() -- independent of a subsequent syntax error later on the same line. This is the same class of bug as CVE-2025-12762/CVE-2025-13780 (RCE via psql meta-command/COPY injection during PLAIN-format dump restore), reached through an independently written defense in a different module (Import/Export Data rather than Restore) that had its own, different logic bug (inverted backslash-escape semantics rather than a BOM-defeated regex anchor).
The fix rejects any backslash inside a single-quoted string in the query outright, rather than picking one of the two possible psql interpretations. This is intentionally conservative: because the correct interpretation of \ depends on the target server's standard_conforming_strings setting, which the checker cannot reliably know at validation time, refusing the query is safer than guessing.
This issue affects pgAdmin 4: from the introduction of _is_query_parens_balanced() before 9.18.
Articles & Coverage 2
Executive ViewAI
pgAdmin 4 contains a critical remote code execution vulnerability requiring authenticated user access that allows users with data tool privileges to execute arbitrary commands on the pgAdmin server. Organizations using pgAdmin face immediate risk of server compromise, data theft, and lateral movement to production databases.
No vendor-released patch identified at time of analysis. Restrict data import/export feature access to trusted administrators; disable the feature entirely if not required for operations; implement process-level monitoring and execution controls on pgAdmin servers; maintain network isolation to prevent lateral movement into production systems.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
pgAdmin <= 8.3 is affected by a path-traversal vulnerability while deserializing users’ sessions in the session handling
pgAdmin <= 8.4 is affected by a Remote Code Execution (RCE) vulnerability through the validate binary path API. Rated cr
Remote unauthenticated access to two SQL Editor endpoints in pgAdmin 4 server-mode deployments (versions 6.9 through 9.1
The pgAdmin server includes an HTTP API that is intended to be used to validate the path a user selects to external Post
pgAdmin versions 8.11 and earlier are vulnerable to a security flaw in OAuth2 authentication. Rated medium severity (CVS
Remote code execution in pgAdmin 4 (versions up to and including 9.9) lets an attacker who can get a crafted PLAIN-forma
Remote SQL injection via prompt injection in pgAdmin 4 versions 9.13 through 9.15 allows attackers who can write content
SQL injection sandbox escape in pgAdmin 4's AI Assistant (versions 9.13 through 9.16) lets an attacker break out of the
Authorization bypass and privilege escalation in pgAdmin 4 server mode allows authenticated users to access other users'
pgAdmin <= 8.5 is affected by XSS vulnerability in /settings/store API response json payload. Rated medium severity (CVS
Authentication bypass in pgAdmin 4 (versions 6.2 through 9.17) lets any client that can reach the pgAdmin web interface
Same weakness CWE-78 – OS Command Injection
View allSame technique Command Injection
View allVendor StatusVendor
SUSE
Severity: Critical| Product | Status |
|---|---|
| SUSE Linux Enterprise Desktop 15 SP7 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP7 | Not-Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP7 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP7 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Not-Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP6 | Not-Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP4 | Not-Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP5 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP4 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Not-Affected |
| SUSE Linux Enterprise Server 15 SP5 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Not-Affected |
| SUSE Linux Enterprise Server 15 SP6 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Not-Affected |
| SUSE Manager Proxy 4.3 | Not-Affected |
| SUSE Manager Proxy LTS 4.3 | Not-Affected |
| SUSE Manager Retail Branch Server 4.3 | Not-Affected |
| SUSE Manager Retail Branch Server LTS 4.3 | Not-Affected |
| SUSE Manager Server 4.3 | Not-Affected |
| SUSE Manager Server LTS 4.3 | Not-Affected |
| SUSE CaaS Platform 4.0 | Not-Affected |
| SUSE Enterprise Storage 6 | Not-Affected |
| SUSE Enterprise Storage 7 | Not-Affected |
| SUSE Enterprise Storage 7.1 | Not-Affected |
| SUSE Linux Enterprise Desktop 15 SP6 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1-LTSS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2-LTSS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3-LTSS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP6 | Not-Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP1 | Not-Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP2 | Not-Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP3 | Not-Affected |
| SUSE Linux Enterprise Real Time 15 SP2 | Not-Affected |
| SUSE Linux Enterprise Real Time 15 SP3 | Not-Affected |
| SUSE Linux Enterprise Real Time 15 SP4 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP1 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP1-BCL | Not-Affected |
| SUSE Linux Enterprise Server 15 SP1-LTSS | Not-Affected |
| SUSE Linux Enterprise Server 15 SP2 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP2-BCL | Not-Affected |
| SUSE Linux Enterprise Server 15 SP2-LTSS | Not-Affected |
| SUSE Linux Enterprise Server 15 SP3 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP3-BCL | Not-Affected |
| SUSE Linux Enterprise Server 15 SP3-LTSS | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP1 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP2 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP3 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Not-Affected |
| SUSE Manager Proxy 4.0 | Not-Affected |
| SUSE Manager Proxy 4.1 | Not-Affected |
| SUSE Manager Proxy 4.2 | Not-Affected |
| SUSE Manager Retail Branch Server 4.0 | Not-Affected |
| SUSE Manager Retail Branch Server 4.1 | Not-Affected |
| SUSE Manager Retail Branch Server 4.2 | Not-Affected |
| SUSE Manager Server 4.0 | Not-Affected |
| SUSE Manager Server 4.1 | Not-Affected |
| SUSE Manager Server 4.2 | Not-Affected |
| openSUSE Leap 15.3 | Not-Affected |
| openSUSE Leap 15.4 | Not-Affected |
| openSUSE Leap 15.5 | Not-Affected |
| openSUSE Leap 15.6 | Not-Affected |
EUVD-2026-51565
GHSA-3h25-h4m7-gr36
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB