CVE-2026-17346
Received Received - Intake

SQL Injection in pgAdmin 4 Statistics and Dependencies Tabs

Vulnerability report for CVE-2026-17346, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-31

Last updated on: 2026-07-31

Assigner: PostgreSQL

Description

The fix for CVE-2026-12044 in pgAdmin 4 9.16 hardened qtLiteral and switched sixteen COMMENT ON / pgstattuple / pgstatindex templates to it, but missed several sinks that had been placed in test_sql_string_literal_lint.py's ALLOWLIST on the incorrect assumption that schema, table, publication, and subscription names sourced from pg_catalog via the browser tree could never contain an apostrophe. PostgreSQL permits arbitrary characters in quoted identifiers, so a low-privileged user able to CREATE TABLE, CREATE PUBLICATION, or CREATE SUBSCRIPTION can plant an apostrophe'd object name that breaks out of the unescaped '{{ name }}' template interpolation the moment any user (including a higher-privileged one) opens that object's Statistics or Dependencies tab, allowing arbitrary SQL statement injection in the viewing user's database session. Affected sinks: the Index Statistics query for all-indexes listing (coll_stats.sql, both the 16_plus and default PostgreSQL-version template variants -- distinct from the single-index stats.sql path already fixed in CVE-2026-12044), and the publication and subscription dependencies.sql / get_position.sql templates (both the pg and ppas/EPAS dialect variants for publications). Fix switches all of these templates to qtLiteral(conn) for name interpolation, and updates publications/__init__.py and subscriptions/__init__.py to pass conn=self.conn into the dependencies.sql render_template call so the qtLiteral filter has a connection to quote against. The corresponding ALLOWLIST entries in test_sql_string_literal_lint.py are removed now that these sinks are properly escaped rather than merely assumed safe. A behavioral regression test renders each fixed template with a stacked-statement apostrophe payload and asserts both that the object name appears exactly as qtLiteral-escaped and that the rendered SQL parses as exactly one statement, verifying the assertion genuinely fails against the pre-patch raw-interpolation form. This issue affects pgAdmin 4: the Index Statistics sink from 1.0, and the Publications/Subscriptions sinks from 5.0, both before 9.17.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-31
Last Modified
2026-07-31
Generated
2026-07-31
AI Q&A
2026-07-31
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
pgadmin pgadmin to 9.17 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-89 The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability in pgAdmin 4 allows SQL injection via unescaped object names containing apostrophes. It affects Index Statistics, Publications, and Subscriptions features. The issue occurs when a low-privileged user creates objects with apostrophes in their names, which can break out of template interpolation when viewed by other users, leading to arbitrary SQL execution in their sessions.

Detection Guidance

This vulnerability is specific to pgAdmin 4 versions before 9.17 and involves SQL injection through object names with apostrophes. Detection requires checking pgAdmin version and reviewing templates for unescaped name interpolations in Index Statistics, Publications, and Subscriptions queries.

Impact Analysis

An attacker could exploit this to execute arbitrary SQL commands in your database session. This could lead to data theft, unauthorized modifications, or disruption of database operations. The impact depends on your pgAdmin version and PostgreSQL permissions.

Compliance Impact

This vulnerability could violate compliance requirements by enabling unauthorized data access or modification. GDPR requires protecting personal data, while HIPAA mandates safeguarding health information. Exploitation could lead to data breaches, triggering regulatory penalties and reputational damage.

Mitigation Strategies

Upgrade pgAdmin 4 to version 9.17 or later to apply the fix. No additional commands are needed as the patch switches vulnerable templates to use qtLiteral for proper escaping.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-17346. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart