CVE-2026-17351: pgAdmin 4 SQL injection bypass in AI Assistant

CVE-2026-17351 · Severity: critical · CVSS 9 · Published 2026-07-31

pgAdmin 4, a popular management tool for PostgreSQL databases, contains a vulnerability in its AI Assistant feature. An attacker can trick the AI into executing malicious database commands by planting specially crafted text in database objects that the AI reads. This could allow an attacker to bypass security restrictions to modify sensitive data or potentially take full control of the database server.

Quick answers

Is CVE-2026-17351 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-17351 being exploited in the wild.
How severe is CVE-2026-17351?
Critical severity, with a CVSS score of 9, published 31 July 2026.
Which products and versions are affected?
pgAdmin pgAdmin 4 9.13 to 9.16.
Is there a fix for CVE-2026-17351?
A patch was published on 2026-07-27: Fix committed to pgAdmin 4 repository Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-17351 attacked?
It is attacked over the network, in a network appliance.
Am I affected by CVE-2026-17351?
Check whether anything you run is named in the advisory. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A vulnerability exists in the pgAdmin 4 AI Assistant's 'execute_sql_query' tool due to a lexer differential between the 'sqlparse' library and the PostgreSQL server. While pgAdmin attempts to wrap LLM-generated queries in a 'BEGIN TRANSACTION READ ONLY' block and validates them using 'sqlparse', an attacker can use specific backslash-quote sequences to hide a 'COMMIT' statement from the validator. PostgreSQL interprets these sequences differently, allowing the smuggled 'COMMIT' to terminate the read-only transaction and execute subsequent malicious DDL/DML statements. This reintroduces a bypass previously addressed in CVE-2026-12045. The final fix involves forcing the PostgreSQL extended query protocol by setting 'prepare_threshold = 0' on the driver connection, which ensures the server-side parser rejects multi-statement inputs.

Affected products

  • pgAdmin pgAdmin 4 9.13 to 9.16

Timeline

  • 2026-07-31: advisory: CVE-2026-17351 published
  • 2026-07-27: patched: Fix committed to pgAdmin 4 repository

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.