CVE-2026-17351 is a bypass of the CVE-2026-12045 fix in pgAdmin 4 affecting versions 9.13 through 9.16. The vulnerability exists in the AI Assistant's execute_sql_query tool, which attempted to ensure that LLM-supplied SQL consisted of exactly one non-transaction-control statement by validating it with sqlparse and then executing it inside a read-only transaction wrapper. The protection fails because sqlparse can tokenize string literals differently from PostgreSQL itself. In the described case, sqlparse classifies crafted input as a single statement, while PostgreSQL parses and executes it as multiple statements. This parser discrepancy allows an attacker to smuggle a transaction-control statement that terminates the intended read-only wrapper, after which subsequent injected statements can execute with write semantics. The issue is reachable through indirect prompt injection, where attacker-controlled content read by the AI Assistant causes the model to emit a malicious tool invocation. An attempted fix using psycopg3 execute with prepare=True was ineffective under pgAdmin's default configuration because prepare_threshold remained unset, causing fallback to the simple query protocol. The corrected fix forces the dedicated read-only connection to use the extended query protocol by setting prepare_threshold to 0, which causes PostgreSQL to reject multi-statement input in a prepared statement context.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.
This repository is a compact Python PoC for CVE-2026-17351 affecting pgAdmin 4 AI Assistant. It contains two executable scripts and a README. The main exploit logic is in poc.py, which reproduces pgAdmin 9.16-style sqlparse-based read-only validation, then shows that the crafted SQL payload is classified as a single safe SELECT by sqlparse but is executed by PostgreSQL simple query protocol as multiple statements. The payload issues COMMIT to escape BEGIN TRANSACTION READ ONLY and then performs CREATE TABLE pwn(x int), proving write access. The script also demonstrates the mitigation by forcing psycopg3 extended query protocol with prepare_threshold=0 and prepare=True, which causes PostgreSQL to reject the multi-statement text structurally. The second script, prompt_injection_demo.py, models the delivery chain through indirect prompt injection. It stores attacker-controlled text in a column comment on customers.email, reads that comment back, simulates an LLM extracting the embedded SQL and emitting an execute_sql_query-style tool call, then executes the extracted query against PostgreSQL. This demonstrates that the exploit is not just raw SQL injection from direct user input, but a trust-boundary failure where untrusted database content can influence AI-generated tool calls. Repository structure is straightforward: README.md explains the vulnerability, payload, setup, and fix; poc.py is the primary exploit demonstration; prompt_injection_demo.py is a scenario-focused delivery demo. The exploit is real and operational, not merely a detector. It targets pgAdmin 4 versions 9.13 through 9.16 under the documented conditions and requires access to a PostgreSQL instance plus a vulnerable execution path in the AI Assistant.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.