pgAdmin AI Assistant Bypass Reopens Read-Only SQL Restrictions
Emerging Technology Risk · 4 sources · Updated 4mo ago · First seen Jul 31, 2026

A critical SQL injection flaw tracked as CVE-2026-17351 affects pgAdmin 4 and allows an authenticated remote attacker to induce the product's AI Assistant to bypass intended read-only database protections. The bug is an incomplete fix for CVE-2026-12045 and arises from a parsing mismatch: pgAdmin validates LLM-generated SQL with sqlparse, while PostgreSQL interprets the same input differently, enabling a crafted payload to be seen as a single statement during validation but executed as multiple statements by the database. Public reporting says the issue affects pgAdmin 4 releases before 9.18, including versions 9.13 through 9.16, and a public proof of concept is reportedly available.
By smuggling a COMMIT into the SQL stream, an attacker can escape the read-only transaction wrapper and regain write capability, potentially leading to unauthorized SQL execution, data modification, privilege escalation, security control bypass, and in some environments a return of arbitrary code execution risk through the same indirect prompt-injection path as the earlier bug. Researchers reported that a proposed mitigation using psycopg3 prepared execution failed under default pgAdmin settings because prepare_threshold remained unset, causing fallback to PostgreSQL's simple query protocol; the corrected fix forces conn.prepare_threshold = 0 on the dedicated read-only connection so PostgreSQL rejects multi-statement input via the extended query protocol. Authorities recommend upgrading to the latest vendor patches immediately.


