


Perceptive Security
SOC/SIEM Consultancy

The fix for CVE-2026-12045 in pgAdmin 4 9.16 required the LLM-supplied query passed to the AI Assistant's execute_sql_query tool to parse, via sqlparse, as exac…
Published:
30 July 2026 at 22:00:00
Alert date:
31 July 2026 at 17:02:18
Source:
nvd.nist.gov
Enterprise Applications, Database & Storage, Web Technologies, Emerging Technologies
CVE-2026-17351 is a bypass of the fix introduced in CVE-2026-12045 for pgAdmin 4 versions 9.13 through 9.16. The vulnerability stems from a disagreement between sqlparse's string-literal lexing and PostgreSQL's own parser under standard_conforming_strings=on. An attacker can craft a payload that sqlparse classifies as a single SELECT statement, while PostgreSQL actually executes it as multiple statements, smuggling a COMMIT to escape the READ ONLY transaction wrapper and enabling write operations or RCE. An initial candidate fix using psycopg's execute(..., prepare=True) was found ineffective because psycopg3 silently falls back to the simple query protocol when prepare_threshold is None, which is pgAdmin's default. The corrected fix sets conn.prepare_threshold=0 on the dedicated read-only connection, forcing the extended query protocol and causing PostgreSQL to reject multi-statement inputs. The attack vector is indirect prompt injection: an attacker plants the malicious payload in any database object the AI Assistant may read, causing the LLM to emit it as a tool call. Affected versions are pgAdmin 4 from 9.13 before 9.17.
Technical details
Mitigation steps:
Affected products:
pgAdmin 4
Related links:
https://nvd.nist.gov/vuln/detail/CVE-2026-17351
https://github.com/pgadmin-org/pgadmin4/commit/bf4792444446f0e7ab721d23cbd6bfe6afaa7a8b
https://github.com/pgadmin-org/pgadmin4/commit/ef76102bcd1cdb544eb9b4ef18d3382f22b76752
https://github.com/pgadmin-org/pgadmin4/issues/10192
Related CVE's:
Related threat actors:
IOC's:
This article was created with the assistance of AI technology by Perceptive.
