Skip to content
CriticalVulnerabilityLLM-specific

CVE-2026-12045: pgAdmin 4 AI Assistant read-only transaction bypass via prompt injection

Identifier
CVE-2026-12045
Published
Record updated
View JSON
Fixed in
The source references a patch, a mitigation or a vendor advisory.

Summary

CVE-2026-12045 is a read-only transaction bypass in the pgAdmin 4 AI Assistant's execute_sql_query tool, affecting pgAdmin 4 from 9.13 before 9.16. An attacker who can write content the assistant reads can use prompt injection to make the LLM emit a multi-statement payload starting with COMMIT, END, ROLLBACK, or ABORT, which ends the read-only transaction and runs later statements in autocommit mode. Where the pgAdmin user's role is a superuser or holds pg_execute_server_program, the chain can extend to remote code execution on the database server host via COPY ... TO PROGRAM.

Mitigation

Fixed in pgAdmin 4 9.16. The fix validates that the LLM-supplied query parses to exactly one statement whose leading token is SELECT, WITH, EXPLAIN, SHOW, VALUES, or TABLE, and rejects transaction-control, DML, DDL, CALL, COPY, DO, SET/RESET, and other statements before any database work. PostgreSQL's READ ONLY mode continues to backstop data-modifying CTEs, EXPLAIN ANALYZE on writes, and volatile side effects.