Skip to main content

pgAdmin 4 CVE-2026-12045

| EUVDEUVD-2026-37965 CRITICAL
SQL Injection (CWE-89)
2026-06-18 PostgreSQL GHSA-95q2-vx3p-f723
9.4
CVSS 4.0 · Vendor: PostgreSQL
View

Attack ChainAIDerived

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

  1. Recon
    Identify pgAdmin instance with AI Assistant enabled
  2. Delivery
    Plant prompt-injection payload in writable database object
  3. Exploit
    Operator invokes AI Assistant on poisoned data
  4. Install
    LLM emits multi-statement SQL with leading COMMIT
  5. C2
    READ ONLY transaction terminated, autocommit engaged
  6. Execute
    Malicious DML or COPY TO PROGRAM executes under operator role
  7. Impact
    Data tampering or RCE on database host

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

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

Exploitation Conditions

Requires (1) the pgAdmin 4 AI Assistant feature to be enabled and configured with an LLM backend on a vulnerable version (9.13 ≤ v < 9.16); (2) attacker-controlled content reachable by the assistant - any row value, column value, object comment, or other database-stored text that the operator asks the assistant to inspect; (3) at least ordinary write privileges on some object in the target database (to plant the prompt-injection payload), reflected as PR:L in the CVSS vector; and (4) operator interaction (UI:P) where a pgAdmin user actually invokes the AI Assistant against the poisoned data. Impact is bounded by the privileges of the pgAdmin user's PostgreSQL role: ordinary write privileges yield unauthorized DML/DDL, while superuser or pg_execute_server_program membership extends the chain to OS command execution on the database server via COPY ... TO PROGRAM. Deployments that have not enabled the AI Assistant, or that pin pgAdmin operators to least-privilege roles, are not exploitable for RCE.

Impact

Vendor-supplied CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H, base 9.4) reflects network-reachable, low-complexity exploitation requiring only a low-privileged database account plus passive user interaction (the pgAdmin operator running the AI Assistant). EPSS and CISA KEV status are not provided in the input, and no public exploit was identified at time of analysis, so real-world exploitation pressure is currently unmeasured. The PR:L + UI:P combination is honest: the attacker needs write access to some object the assistant reads and an operator who actually invokes the assistant, which limits opportunistic mass exploitation but is highly realistic in shared-tenant PostgreSQL deployments. Severity escalates sharply when the pgAdmin user's role is a superuser or holds pg_execute_server_program (RCE on the DB host via COPY ... TO PROGRAM), so risk should be triaged against the operator's role privileges rather than against the CVSS number alone.

Exploit ScenarioDerived

An attacker with ordinary INSERT/UPDATE rights on any table that a pgAdmin operator might inspect with the AI Assistant plants a row whose text column contains a prompt-injection payload instructing the LLM to call execute_sql_query with 'COMMIT; COPY (SELECT 1) TO PROGRAM ''id > /tmp/id.txt'';' or a DML statement. When the operator next asks the AI Assistant to explore that table, the LLM emits the multi-statement query; the leading COMMIT closes the READ ONLY wrapper and the subsequent statements execute under the operator's role, yielding unauthorized writes or, if the role is a superuser, shell command execution on the database host. Test cases in the fix commit confirm the COMMIT/END/ROLLBACK + COPY TO PROGRAM PoC family; no public weaponized exploit was identified at time of analysis.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.5% 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 SQL injection via prompt injection in pgAdmin 4 versions 9.13 through 9.15 allows attackers who can write content into database objects the AI Assistant inspects to bypass the read-only transaction wrapper and execute arbitrary SQL with the pgAdmin user's database role. When that role is a PostgreSQL superuser or holds pg_execute_server_program, the chain escalates to remote code execution on the database host via COPY ... TO PROGRAM. No public exploit identified at time of analysis; CVSS 4.0 base score is 9.4 (Critical) and an upstream fix is available.

RemediationAI

Upstream fix available (commit bf4792444446f0e7ab721d23cbd6bfe6afaa7a8b); per the advisory the issue is resolved in pgAdmin 4 version 9.16, so upgrading from 9.13-9.15 to 9.16 or later is the primary remediation (see https://github.com/pgadmin-org/pgadmin4/commit/bf4792444446f0e7ab721d23cbd6bfe6afaa7a8b and https://github.com/pgadmin-org/pgadmin4/issues/10022). Where immediate upgrade is not possible, disable the AI Assistant feature in pgAdmin configuration to remove the execute_sql_query attack surface entirely (trade-off: loss of AI-assisted querying for operators). As a defense-in-depth control, configure the database connection used by pgAdmin operators to use a least-privileged role that is neither a superuser nor a member of pg_execute_server_program, which prevents the COPY ... TO PROGRAM escalation path even if the read-only bypass is triggered (trade-off: operators lose superuser-only administrative actions through pgAdmin and must elevate out-of-band).

Affected VersionsENISA

pgAdmin 4 9.13 <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 the official open-source administration and development platform for PostgreSQL. The AI Assistant feature exposes an execute_sql_query tool that forwards LLM-generated SQL to the database driver wrapped in BEGIN TRANSACTION READ ONLY, relying on PostgreSQL's read-only mode to block writes. The root cause aligns with CWE-89 (Improper Neutralization of Special Elements used in an SQL Command): the tool failed to enforce single-statement, read-only-verb constraints on the LLM output, so a multi-statement payload whose leading token was a transaction-control verb (COMMIT, END, ROLLBACK, ABORT) closed the wrapping transaction and ran subsequent statements in autocommit mode. The delivery channel is indirect prompt injection, where attacker-controlled row, column, or comment content steers the LLM into emitting the malicious tool call.

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

Network-reachable via stored prompt injection but requires attacker DB write access (PR:L), an operator invoking the AI Assistant (UI:R), and LLM cooperation (AC:H); scope changes when superuser role enables OS RCE.

3.1 AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
SUSE 9.0 CRITICAL
AV:N/AC:L/PR:L/UI:R/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
None
Privileges Required
Low
User Interaction
Passive
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

2
CVSS changed
Jun 19, 2026 - 00:22 NVD
9.0 (CRITICAL) 9.4 (CRITICAL)
CVE Published
Jun 18, 2026 - 23:37 cve.org
CRITICAL 9.4

DescriptionCVE.org

Read-only transaction bypass in the pgAdmin 4 AI Assistant allows an attacker who can influence database content that the assistant reads to execute arbitrary SQL with the privileges of the pgAdmin user's database role.

The AI Assistant's execute_sql_query tool runs LLM-generated SQL inside a BEGIN TRANSACTION READ ONLY wrapper to prevent data modification. The LLM-supplied query was forwarded to the database driver without restriction to a single statement or to read-only verbs, so a multi-statement payload beginning with COMMIT, END, ROLLBACK, or ABORT terminated the read-only transaction and ran subsequent statements in autocommit mode. The trailing ROLLBACK then had no effect.

Delivery is via prompt injection: an attacker who can write content into any object the AI Assistant may inspect (a row, a column value, a comment) can cause the LLM to emit the multi-statement payload as a tool call. With ordinary write privileges on the pgAdmin user's role the attacker can perform unauthorised data modification. When the pgAdmin user's role is a PostgreSQL superuser or holds pg_execute_server_program, the chain extends to remote code execution on the database server host via COPY ... TO PROGRAM.

Fix validates the LLM-supplied query up front: it must parse to exactly one non-empty / non-comment statement whose leading real token (after stripping whitespace, comments, and punctuation) is one of SELECT, WITH, EXPLAIN, SHOW, VALUES, or TABLE. Transaction-control verbs, DML, DDL, CALL, COPY, DO, SET/RESET, and everything else are rejected before any database work happens. PostgreSQL's READ ONLY mode continues to backstop data-modifying CTEs, EXPLAIN ANALYZE on writes, and volatile side effects.

This issue affects pgAdmin 4: from 9.13 before 9.16.

Executive ViewAI

Why It Matters

pgAdmin 4 versions 9.13-9.15 contain a critical remote vulnerability in the AI Assistant feature that allows attackers to execute arbitrary SQL commands and potentially gain code execution on database servers. Organizations using these affected versions face immediate risk of unauthorized database access and infrastructure compromise. Vendor patches are available and must be deployed urgently.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.5%
Top 61% exploitable
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 No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
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

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

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

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