GeezerVison is showing github.com — AI Assistant read-only transaction bypass via sqlparse/PostgreSQL lexer disagreement (CVE-2026-17351) · Issue #10192 · pgadmin-org/pgadmin4
AI Assistant read-only transaction bypass via sqlparse/PostgreSQL lexer disagreement (CVE-2026-17351) #10192
Description
Summary
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 exactly one non-transaction-control statement before running it inside a BEGIN TRANSACTION READ ONLY wrapper. sqlparse's string-literal lexing can disagree with PostgreSQL's own parser: under standard_conforming_strings = on (PostgreSQL's default), a backslash before a quote is a literal character, not an escape, so a crafted multi-statement payload could be classified by sqlparse as a single statement while PostgreSQL executed it as several — smuggling a COMMIT past the read-only wrapper and executing arbitrary SQL. This is an incomplete fix for CVE-2026-12045.
The fix executes the query over psycopg3's extended query protocol (forcing prepare_threshold = 0 on the dedicated read-only connection), so PostgreSQL's own Parse step rejects multi-statement text regardless of how any client-side lexer classifies it.
Affected versions
pgAdmin 4 >= 9.13, < 9.17
Fix
Fixed in pgAdmin 4 9.17 by commit ef76102bc.
Severity
- CVSS 3.1: 9.0 CRITICAL —
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
- CVSS 4.0: 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
Credit
Reported by Kai Aizen (SnailSploit).
References
Activity
changed the title
[-]Internal tracking: pending fix for 9.17[/-] [+]AI Assistant read-only transaction bypass via sqlparse/PostgreSQL lexer disagreement (CVE-2026-17351)[/+] on Jul 31, 2026asheshv commented on Jul 31, 2026
ContributorAuthor
More actions
Fixed in pgAdmin 4 9.17, released 2026-07-30.
Metadata
Metadata
Development
No branches or pull requestsIssue actions