CVE-2026-12045: pgAdmin 4 SQL injection and RCE in AI Assistant

CVE-2026-12045 · Severity: critical · CVSS 9 · Published 2026-06-19

A vulnerability in the pgAdmin 4 AI Assistant allows an attacker to bypass security restrictions and modify database data or execute commands on the server. By placing malicious content in database fields that the AI Assistant reads, an attacker can trick the system into running unauthorized commands. This could lead to complete data loss, unauthorized data modification, or a full takeover of the database server if the user has high-level permissions.

Quick answers

Is CVE-2026-12045 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-12045 being exploited in the wild.
How severe is CVE-2026-12045?
Critical severity, with a CVSS score of 9, published 19 June 2026.
Which products and versions are affected?
pgadmin.org pgAdmin 4 9.13 to 9.15.
Is there a fix for CVE-2026-12045?
A patch was published on 2026-06-08: Fix committed to repository Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-12045 attacked?
It is attacked over the network, in a network appliance.
Am I affected by CVE-2026-12045?
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

The pgAdmin 4 AI Assistant's 'execute_sql_query' tool fails to properly restrict LLM-generated SQL to a single read-only statement. While queries are wrapped in a 'BEGIN TRANSACTION READ ONLY' block, an attacker can use prompt injection (via database content the AI reads) to generate a multi-statement payload starting with 'COMMIT' or 'ROLLBACK'. This terminates the read-only transaction, allowing subsequent malicious statements to run in autocommit mode. If the pgAdmin user has superuser privileges, this can be escalated to remote code execution (RCE) on the database host using 'COPY ... TO PROGRAM'. The vulnerability is fixed in version 9.16 by implementing strict statement parsing and keyword validation.

Affected products

  • pgadmin.org pgAdmin 4 9.13 to 9.15

Timeline

  • 2026-06-08: patched: Fix committed to repository
  • 2026-06-19: advisory: CVE published and NVD entry created

References

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