Skip to main content

pgAdmin 4 CVE-2026-12046

| EUVDEUVD-2026-37966 CRITICAL
Missing Authentication for Critical Function (CWE-306)
2026-06-18 PostgreSQL GHSA-mmqg-h4qx-g8qv
9.5
CVSS 4.0 · Vendor: PostgreSQL
View

Attack ChainAIDerived

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

  1. Access
    Obtain SECRET_KEY and sessions/ write access out-of-band
  2. Delivery
    Harvest CSRF token from GET /login
  3. Exploit
    Plant forged session file with malicious pickle in gridData
  4. Execution
    Send unauthenticated DELETE /sqleditor/close/<trans_id>
  5. Persist
    pickle.loads executes payload in pgAdmin process
  6. Impact
    Code execution as pgAdmin service account

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Authentication required for critical functions
MITRE ATT&CK

1 technique across 1 tactic: Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Target must be running pgAdmin 4 between 6.9 and 9.15 inclusive in SERVER mode (DESKTOP mode is immune because the before_request hook re-authenticates DESKTOP_USER on every request). The attacker reaches the vulnerable routes with only a CSRF token harvested from an unauthenticated GET /login and no pgAdmin session cookie. To escalate from reaching the pickle.loads sink to actual code execution the attacker must independently possess (a) the Flask SECRET_KEY used to sign session files and (b) write access to pgAdmin's sessions/ directory on the host so a forged session containing a malicious gridData[trans_id]['command_obj'] pickle is loaded; neither precondition is granted by this defect alone, and the CVSS 4.0 AT:P metric reflects exactly this.

Impact

The CVSS 4.0 score of 9.5 (AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H) leans heavily on full-system impact and AT:P (attack requirements present), which correctly captures that exploitation depends on SECRET_KEY knowledge plus write access to sessions/ - neither granted by this defect alone. In isolation the missing auth gate only exposes a pickle sink; weaponized RCE requires a separate prior compromise (misconfigured deployment, leaked configuration, host-side write access). There is no EPSS score, no KEV listing, and no public exploit identified at time of analysis, so real-world risk is meaningful for server-mode operators with weak SECRET_KEY hygiene or co-tenanted hosts but is unlikely to drive mass exploitation. Desktop-mode installs are unaffected because the before_request hook re-authenticates DESKTOP_USER on every request, making the decorator absence inert there - this is an explicit limit, not an inference.

Exploit ScenarioDerived

An attacker who has separately obtained the target's Flask SECRET_KEY (e.g., from a leaked config dump or backup) and has write access to the pgAdmin sessions/ directory (e.g., shared host, prior foothold, misconfigured volume mount) crafts a Flask session file whose gridData[trans_id]['command_obj'] is a malicious pickle payload, then sends an unauthenticated DELETE to /sqleditor/close/<trans_id> with only a CSRF token harvested from GET /login. The missing @pga_login_required decorator lets the request reach close_sqleditor_session(), pickle.loads fires on the planted payload, and arbitrary code runs as the pgAdmin process user. No public exploit is identified at time of analysis.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.7% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jun 19, 2026

Remote unauthenticated access to two SQL Editor endpoints in pgAdmin 4 server-mode deployments (versions 6.9 through 9.15) exposes a pickle.loads sink that can be reached without a valid pgAdmin session. The defect is the missing @pga_login_required decorator on DELETE /sqleditor/close/<trans_id> and POST /sqleditor/initialize/sqleditor/update_connection/<sgid>/<sid>/<did>; turning this into code execution additionally requires an attacker to possess the Flask SECRET_KEY and write access to the sessions/ directory from a separate channel. No public exploit identified at time of analysis, and the issue does not appear on CISA KEV.

RemediationAI

Vendor-released patch: upgrade pgAdmin 4 to version 9.16 or later, which adds @pga_login_required to both DELETE /sqleditor/close/<trans_id> and POST /sqleditor/initialize/sqleditor/update_connection/<sgid>/<sid>/<did> (commit f81433ae at https://github.com/pgadmin-org/pgadmin4/commit/f81433ae2f998f95bb17f27f53b4e99ebcc1df9c). If you cannot upgrade immediately, block external access to /sqleditor/close/ and /sqleditor/initialize/sqleditor/update_connection/ at a reverse proxy or WAF (this will break the SQL Editor's tab-close and connection-switch behavior for legitimate users while in place), rotate the Flask SECRET_KEY and ensure it is not stored in a world-readable file, and restrict filesystem permissions on the sessions/ directory to the pgAdmin process user only so that the secondary preconditions for pickle payload injection cannot be met. Switching to DESKTOP mode is also an effective mitigation where deployment constraints allow, since the before_request re-authentication renders these routes safe.

Affected VersionsENISA

pgAdmin 4 6.9 <9.16

Affected Packages

euvd pgadmin_4 fix: 9.16

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 Flask-based PostgreSQL administration web app whose SQL Editor blueprint stores transient query-tool state in server-side Flask sessions, with the per-transaction object pickled into session['gridData'][<trans_id>]['command_obj']. The two affected routes call close_sqleditor_session() and check_transaction_status(), each of which dereferences that key via pickle.loads - a textbook CWE-502 deserialization sink. The root-cause defect is CWE-306 (missing authentication on a critical function): every other route in the blueprint carries @pga_login_required, which runs the is_authenticated / MFA chain before any trans_id lookup, but these two were inadvertently omitted. CPE cpe:2.3:a:pgadmin.org:pgadmin_4:*:*:*:*:*:*:*:* confirms the pgadmin.org pgadmin_4 product is in scope, and the upstream commit f81433ae adds the decorator to both routes and ships a regression test wired into the server-mode CI workflow.

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 (PostgreSQL) PRIMARY 9.5 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
vuln.today AI 8.1 HIGH

Network-reachable and unauthenticated (AV:N/PR:N/UI:N), but RCE requires attacker-supplied SECRET_KEY and sessions/ write access from another channel, so AC:H; full host impact gives C:H/I:H/A:H.

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

Primary rating from Vendor (PostgreSQL).

CVSS VectorVendor: PostgreSQL

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

Lifecycle Timeline

1
CVSS changed
Jun 19, 2026 - 00:22 NVD
9.0 (CRITICAL) 9.5 (CRITICAL)

DescriptionCVE.org

Two state-mutating endpoints in pgAdmin 4's SQL Editor blueprint -- DELETE /sqleditor/close/<trans_id> and POST /sqleditor/initialize/sqleditor/update_connection/<sgid>/<sid>/<did> -- were the only routes in the module missing the @pga_login_required decorator. Both reach a pickle.loads sink on session['gridData'][<trans_id>]['command_obj']: the close endpoint via close_sqleditor_session(), and update_sqleditor_connection via check_transaction_status(). In server mode these endpoints were reachable without any authenticated pgAdmin session.

The defect is a missing-authentication-on-critical-function (CWE-306) wrapper around a deserialization-of-untrusted-data sink (CWE-502). Exploiting it for remote code execution requires the attacker to also forge a server-side session file whose gridData entry contains a malicious pickle payload, which in turn requires both (a) knowledge of pgAdmin's Flask SECRET_KEY (no chain to leak it is described here -- the attacker must already possess it) and (b) write access to pgAdmin's sessions/ directory on the host. Neither precondition is granted by this defect on its own. When those preconditions are met from another channel (misconfigured deployment, prior compromise, leaked configuration), the missing auth gate is the final hop that turns an existing partial compromise into unauthenticated code execution in the pgAdmin process -- and, by extension, on the host under whatever account runs pgAdmin.

Fix is a one-line @pga_login_required decorator on each of the two endpoints, matching the convention used by every other route in the module. The is_authenticated / MFA chain now runs before the trans_id is dereferenced, so an unauthenticated request is rejected before reaching the deserialization path.

The defect is server-mode only. In DESKTOP mode pgAdmin's before_request hook re-authenticates DESKTOP_USER on every request, so no endpoint can be exercised in an unauthenticated state and no auth decorator (or its absence) is meaningful. The accompanying regression test mirrors the attacker's path -- harvests an X-pgA-CSRFToken from GET /login and replays it against both endpoints -- and self-skips outside server mode for that reason; it is wired into the existing server-mode CI workflow alongside the data-isolation tests.

This issue affects pgAdmin 4: from 6.9 before 9.16.

Executive ViewAI

Why It Matters

pgAdmin 4 server-mode deployments (versions 6.9 through 9.15) contain a critical remote code execution vulnerability in SQL Editor endpoints that lack proper authentication enforcement. An unauthenticated attacker can access administrative SQL editing functions without a valid session, creating direct risk to database infrastructure and credentials. Immediate patching is required to restore proper access controls.

Business Impact: Severe
Compensating Controls

Pending patch deployment, restrict network access via firewall to pgAdmin instances, limiting source IPs to authorized administrative networks; implement WAF rules to block requests to vulnerable SQL Editor endpoints; enforce strict file permissions and access auditing on the sessions/ directory and Flask configuration. Apply vendor patch for permanent remediation.

Threat Intelligence Overview

EPSS Score
0.7%
Top 51% exploitable
Exploit
POC
Public exploit code exists
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 CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.7%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
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
Very High
Technical Impact
Total

Priority Score

69
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +48
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

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-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

CVE-2026-86863 CRITICAL
9.3 Sep 17

Authentication bypass in pgAdmin 4 (versions 6.2 through 9.17) lets any client that can reach the pgAdmin web interface

Vendor 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

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