Impact
The issue arises from a mismatch between PostgreSQL and the sqlparse library used by the AI Assistant's execute_sql_query tool. The victim's SQL string can be parsed by sqlparse as a single, harmless statement but is interpreted by PostgreSQL as a series of statements, including a COMMIT that exits the read‑only wrapper and a subsequent CREATE TABLE. The attacker can therefore inject write operations into a supposedly read‑only session and, by creating privileged objects, achieve remote code execution. This vulnerability corresponds to the CWE‑115 and CWE‑89 classes.
Affected Systems
The flaw appears in pgAdmin 4 version 9.13, 9.14, 9.15 and 9.16 released by pgadmin.org. The bug is triggered when the AI Assistant feature reads any object and the LLM emits a tool call containing the payload. These versions are affected until the release of pgAdmin 4 9.17, which deploys a patch that forces the connection to use the extended query protocol with prepare_threshold set to zero.
Risk and Exploitability
The CVSS score of 9.4 indicates critical severity. EPSS is below 1 %, suggesting that, while the flaw is hardly used in the wild, any discovered instance would be highly damaging. It is not listed in the CISA KEV catalog, so no known exploitation campaigns have been reported yet. Nevertheless, the attack vector requires only the ability to pose a prompt to the AI Assistant, a permission many users already grant. The toxicity of the bypass (write operations evolve to create tables) makes this a high‑risk vulnerability that should be patched immediately or mitigated by disabling or restricting the AI Assistant.
OpenCVE Enrichment