BlackTreeCVE Intelligence
← Back to the CVE catalogue
Full vulnerability report · 2026
CVE-2026-12045High confidence

pgAdmin 4: AI Assistant read-only transaction bypass allows unauthorised writes and remote code execution

pgadmin.org · pgAdmin 4

9.4CriticalCVSS 4.0
Recommended action
Within 7 days

Critical technical severity; prioritise exposed affected systems while verifying vendor guidance.

Patch available
R
Operational reassessment

Published severity in operational context

Open reassessment dashboard →
Published severityCriticalOperational priority:Critical, unchanged from published severity.unchanged

Evidence used

  • No CISA KEV confirmation is currently recorded.
  • EPSS is 0.66% for the current model date.

Compensating controls

  • Validate the affected product branch and deploy the verified fixed release.
  • Restrict the affected network interface to trusted sources where business-safe.
  • Monitor vendor guidance and exploitation sources for a material change.

Verification

  1. Confirm that the asset runs pgadmin.org pgAdmin 4 and falls inside the recorded affected range.
  2. Verify the installed build against the product-specific fixed version after deployment.
  3. Validate exposure, authentication requirements and compensating controls in the actual environment.
  4. Reopen this reassessment when CVSS, KEV, EPSS, exploit evidence or remediation changes.
Mitigation target: Within 3 daysRemediation target: Within 90 days

This automated reassessment organises public evidence. It does not know asset exposure, business impact or control effectiveness and does not replace CVSS or a human risk decision.

Optional official sources

National CERT insights
?CERT means Computer Emergency Response Team; CSIRT is the closely related term Computer Security Incident Response Team.

Choose official national sources for this report. Each advisory shows its original language. Your selection is remembered on this device and included in shared links.

Official European source

ENISA European Vulnerability Database

Official EUVD identifiers, advisory evidence and known-exploited context. Missing fields are not treated as evidence of low risk.

1 current
ENISA EUVD identifier

EUVD-2026-37965

No EUVD known-exploited evidence

ENISA has published the identifier mapping but no EUVD description has been stored yet.

EUVD state
Present in the current official mapping
Known exploitation
Not present in the current ENISA EUVD known-exploited dataset. This is not proof of no exploitation.
ENISA score
Not supplied in the stored EUVD record
Advisory evidence
No linked advisory details stored yet
Recommended actionWithin 7 days

Critical technical severity; prioritise exposed affected systems while verifying vendor guidance.

Patch available
01

What, why and how

Read-only transaction bypass in the pgAdmin 4 AI Assistant allows an attacker who can influence database content that the assistant reads to execute arbitrary SQL with the privileges of the pgAdmin user's database role. The AI Assistant's execute_sql_query tool runs LLM-generated SQL inside a BEGIN TRANSACTION READ ONLY wrapper to prevent data modification. The LLM-supplied query was forwarded to the database driver without restriction to a single statement or to read-only verbs, so a multi-statement payload beginning with COMMIT, END, ROLLBACK, or ABORT terminated the read-only transaction and ran subsequent statements in autocommit mode. The trailing ROLLBACK then had no effect. Delivery is via prompt injection: an attacker who can write content into any object the AI Assistant may inspect (a row, a column value, a comment) can cause the LLM to emit the multi-statement payload as a tool call. With ordinary write privileges on the pgAdmin user's role the attacker can perform unauthorised data modification. When the pgAdmin user's role is a PostgreSQL superuser or holds pg_execute_server_program, the chain extends to remote code execution on the database server host via COPY ... TO PROGRAM. Fix validates the LLM-supplied query up front: it must parse to exactly one non-empty / non-comment statement whose leading real token (after stripping whitespace, comments, and punctuation) is one of SELECT, WITH, EXPLAIN, SHOW, VALUES, or TABLE. Transaction-control verbs, DML, DDL, CALL, COPY, DO, SET/RESET, and everything else are rejected before any database work happens. PostgreSQL's READ ONLY mode continues to backstop data-modifying CTEs, EXPLAIN ANALYZE on writes, and volatile side effects. This issue affects pgAdmin 4: from 9.13 before 9.16.

What

Read-only transaction bypass in the pgAdmin 4 AI Assistant allows an attacker who can influence database content that the assistant reads to execute arbitrary SQL with the privileges of the pgAdmin user's database role. The AI Assistant's execute_sql_query tool runs LLM-generated SQL inside a BEGIN TRANSACTION READ ONLY wrapper to prevent data modification. The LLM-supplied query was forwarded to the database driver without restriction to a single statement or to read-only verbs, so a multi-statement payload beginning with COMMIT, END, ROLLBACK, or ABORT terminated the read-only transaction and ran subsequent statements in autocommit mode. The trailing ROLLBACK then had no effect. Delivery is via prompt injection: an attacker who can write content into any object the AI Assistant may inspect (a row, a column value, a comment) can cause the LLM to emit the multi-statement payload as a tool call. With ordinary write privileges on the pgAdmin user's role the attacker can perform unauthorised data modification. When the pgAdmin user's role is a PostgreSQL superuser or holds pg_execute_server_program, the chain extends to remote code execution on the database server host via COPY ... TO PROGRAM. Fix validates the LLM-supplied query up front: it must parse to exactly one non-empty / non-comment statement whose leading real token (after stripping whitespace, comments, and punctuation) is one of SELECT, WITH, EXPLAIN, SHOW, VALUES, or TABLE. Transaction-control verbs, DML, DDL, CALL, COPY, DO, SET/RESET, and everything else are rejected before any database work happens. PostgreSQL's READ ONLY mode continues to backstop data-modifying CTEs, EXPLAIN ANALYZE on writes, and volatile side effects. This issue affects pgAdmin 4: from 9.13 before 9.16.

Why

Attacker-controlled data is not kept separate from SQL query syntax, allowing the intended database operation to be changed.

How

An attacker operating through a network path may attempt exploitation with low privileges. If successful, the issue may execute code or commands in the affected security context.

What

Read-only transaction bypass in the pgAdmin 4 AI Assistant allows an attacker who can influence database content that the assistant reads to execute arbitrary SQL with the privileges of the pgAdmin user's database role. The AI Assistant's execute_sql_query tool runs LLM-generated SQL inside a BEGIN TRANSACTION READ ONLY wrapper to prevent data modification. The LLM-supplied query was forwarded to the database driver without restriction to a single statement or to read-only verbs, so a multi-statement payload beginning with COMMIT, END, ROLLBACK, or ABORT terminated the read-only transaction and ran subsequent statements in autocommit mode. The trailing ROLLBACK then had no effect. Delivery is via prompt injection: an attacker who can write content into any object the AI Assistant may inspect (a row, a column value, a comment) can cause the LLM to emit the multi-statement payload as a tool call. With ordinary write privileges on the pgAdmin user's role the attacker can perform unauthorised data modification. When the pgAdmin user's role is a PostgreSQL superuser or holds pg_execute_server_program, the chain extends to remote code execution on the database server host via COPY ... TO PROGRAM. Fix validates the LLM-supplied query up front: it must parse to exactly one non-empty / non-comment statement whose leading real token (after stripping whitespace, comments, and punctuation) is one of SELECT, WITH, EXPLAIN, SHOW, VALUES, or TABLE. Transaction-control verbs, DML, DDL, CALL, COPY, DO, SET/RESET, and everything else are rejected before any database work happens. PostgreSQL's READ ONLY mode continues to backstop data-modifying CTEs, EXPLAIN ANALYZE on writes, and volatile side effects. This issue affects pgAdmin 4: from 9.13 before 9.16.

Why

Attacker-controlled data is not kept separate from SQL query syntax, allowing the intended database operation to be changed.

How

An attacker operating through a network path may attempt exploitation with low privileges. If successful, the issue may execute code or commands in the affected security context.

02

Exploit reality and attack path

CVSS severity, EPSS forecast probability, public exploit material and CISA-confirmed exploitation are separate signals.

Observed exploitation
?Confirmed exploitation and public exploit material are separate signals. Attacks can occur without public proof-of-concept or exploit code.
No confirmed evidence

No CISA KEV match was present at the last successful refresh. This means no confirmation from that source, not proof of no exploitation.

Public PoC / exploit material
?Confirmed exploitation and public exploit material are separate signals. Attacks can occur without public proof-of-concept or exploit code.
None recorded

No exploit-tagged reference or CISA SSVC proof-of-concept state is currently recorded. Research may still exist outside the structured feeds.

Likely attack path
a network path → Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') → execute code or commands in the affected security context
Attack surface
Network
Privileges required
Low: a basic authenticated account is required
User interaction
Passive interaction required
Attack complexity
Low: no specialised conditions are recorded
Security boundary
Not a CVSS 4.0 base metric
Weakness
?CWE means Common Weakness Enumeration: a standard category for the underlying weakness.
CWE-89 ↗

CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.

CVSS vector
?CVSS means Common Vulnerability Scoring System. The vector records the metric values used to calculate technical severity.
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

Common Vulnerability Scoring System 4.0: the compact vector below is decoded into plain language.

AVNetworkAttack vector: The vulnerable component can be reached over a network.ACLowAttack complexity: No specialised conditions are required beyond attacker-controlled input.ATNoneAttack requirements: No additional deployment or execution condition is required.PRLowPrivileges required: The attacker needs basic user-level privileges.UIPassiveUser interaction: A user must unknowingly interact with the vulnerable system.VCHighVulnerable-system confidentiality: A successful attack can cause a major loss.VIHighVulnerable-system integrity: A successful attack can cause a major loss.VAHighVulnerable-system availability: A successful attack can cause a major loss.SCHighSubsequent-system confidentiality: A successful attack can cause a major loss.SIHighSubsequent-system integrity: A successful attack can cause a major loss.SAHighSubsequent-system availability: A successful attack can cause a major loss.
Post-exploitation / living off the land
After compromise, an attacker may use built-in shells, scripting engines, scheduled tasks and native network utilities for discovery, persistence or movement. This is a plausible LoTL path, not evidence that it has occurred for every attack.
NetworkRemote code executionCWE-89
A

Official authority intelligence

Only matched European and national findings are included. Language selectors and unavailable sources are omitted.

BSI · German · WID-SEC-2026-2005pgAdmin: Mehrere Schwachstellen

Ein entfernter, authentisierter Angreifer kann mehrere Schwachstellen in pgAdmin ausnutzen, um beliebigen Code mit Benutzer- oder Administratorrechten auszuführen, Sicherheitsmaßnahmen zu umgehen, SQL-Injection- und Cross-Site-Scripting-Angriffe durchzuführen, Benutzer auf bösartige Websites umzuleiten, vertrauliche Informationen offenzulegen oder Daten zu manipulieren.

Official advisory ↗
Cyber Security Agency of Singapore · English · CSA-SB-20260624Security Bulletin 24 June 2026

The Cyber Security Agency of Singapore included this CVE in its official Security Bulletin 24 June 2026, published on 24 June 2026. Open the linked bulletin for the product, severity and reference information published in that issue.

Official advisory ↗
JVN iPedia · Japanese · JVNDB-2026-027062pgAdmin ProjectのpgAdmin 4における複数の脆弱性

pgAdmin 4 9.16でのCVE-2026-12045の修正では、AIアシスタントのexecute_sql_queryツールに渡される、LLMから提供されたクエリがsqlparseによってトランザクション制御文ではない単一の文として正確に解析される必要があり、それをBEGIN TRANSACTION READ ONLYラッパー内で実行していました。しかし、sqlparseの文字列リテラルの字句解析はPostgreSQL自身のパーサーと異なる可能性があります。標準準拠文字列(standard_conforming_strings)がon(PostgreSQL 9.1以降のデフォルト)の場合、クォート直前のバックスラッシュはPostgreSQLにとって単なる文字ですが、sqlparseはそれをクォートのエスケープとみなします。したがって、SELECT '\';COMMIT;CREATE TABLE pwn(x int);SELECT 1 --' のようなペイロードはsqlparseのバリデータには単一のSELECT文として解析されますが、PostgreSQLではこれが4つの文として実行されます。隠されたCOMMITによって読み取り専用トランザクションが終了し、後続のROLLBACKは無効となります。これにより、CVE-2026-12045で対策された書き込み/RCE回避が再現され、同じ間接的プロンプトインジェクションの手法(攻撃者がAIアシスタントが読み取れる任意のオブジェクトにペイロードを植え付け、LLMがそれをツール呼び出しとして出力する方法)で悪用可能となります。初期の修正案ではpsycopgのexecute(..., prepare=True)を使用し、sqlparseの分類にかかわらずPostgreSQLのParseステップ(拡張クエリプロトコル)により複数文を拒否しようとしました。しかし、この修正案は期待どおりに機能しませんでした。psycopg3のPrepareManagerは接続のprepare_thresholdがNone(pgAdminではすべてのサーバー接続でデフォルト)であればprepare引数を無視し、単純クエリプロトコルにフォールバックします。この単純クエリプロトコルは回避を可能にする複数文対応経路であるため、この修正案では現実のデフォルト構成では対策できませんでした。最終的な修正では、AIアシスタントツールが開く専用の使い捨て読み取り専用接続に対してconn.prepare_threshold = 0を直接設定し、サーバーレベルの設定に依存せず強制的に拡張クエリプロトコルを利用させます。PostgreSQL 18の実環境で検証した結果、prepare_threshold=None(デフォルト)の場合はペイロードが成功して実行されましたが、prepare_threshold=0を設定すると「準備済みステートメントに複数コマンドを挿入できません」として拒否されました。本問題はpgAdmin 4の9.13から9.17未満のバージョンに影響を及ぼします。

Official advisory ↗
JVN iPedia · Japanese · JVNDB-2026-022112pgAdmin ProjectのpgAdmin 4における複数の脆弱性

pgAdmin 4 の AI Assistant における読み取り専用トランザクションのバイパスにより、アシスタントが読み取るデータベース内容に影響を与えられる攻撃者は、pgAdmin ユーザーのデータベース・ロールの権限で任意の SQL を実行できる。AI Assistant の execute_sql_query ツールは、データ変更を防ぐために、LLM が生成した SQL を BEGIN TRANSACTION READ ONLY のラッパー内で実行する。LLM から渡されたクエリは、単一ステートメントに限定する制約や読み取り専用の動詞に限定する制約なしにデータベース・ドライバへ転送されていたため、COMMIT、END、ROLLBACK、または ABORT で始まる複数ステートメントのペイロードによって読み取り専用トランザクションが終了され、その後のステートメントがオートコミットモードで実行された。末尾の ROLLBACK はそのため効果がなかった。攻撃ベクトルはプロンプトインジェクションである。AI Assistant が参照し得る任意のオブジェクト(行、列値、コメント)に内容を書き込める攻撃者は、LLM にツール呼び出しとして複数ステートメントのペイロードを出力させることができる。pgAdmin ユーザーのロールに通常の書き込み権限がある場合、攻撃者は不正なデータ変更を実行できる。pgAdmin ユーザーのロールが PostgreSQL のスーパーユーザーであるか、pg_execute_server_program を保持している場合、この連鎖は COPY ... TO PROGRAM を介してデータベース・サーバーホスト上でのリモートコード実行にまで及ぶ。修正では、LLM から渡されたクエリを事前に検証する。空でなくコメントのみでもない単一のステートメントに正しく構文解析でき、その先頭の実トークン(空白、コメント、句読点を取り除いた後)が SELECT、WITH、EXPLAIN、SHOW、VALUES、または TABLE のいずれかでなければならない。トランザクション制御の動詞、DML、DDL、CALL、COPY、DO、SET/RESET などその他すべては、データベース処理が行われる前に拒否される。さらに、PostgreSQL の READ ONLY モードが、データ変更を行う CTE、書き込みを伴う EXPLAIN ANALYZE、揮発的な副作用に対する最後の防波堤として機能し続ける。この問題は pgAdmin 4 の 9.13 から 9.16 未満に影響する。

Official advisory ↗
03

Patch and workaround

Operational remediation based on structured source evidence.

Status
?Patch availability is based on structured fixed-version fields and authoritative update references. If no fix is verified, check the vendor advisory before making a change.
Patch available
Affected
pgAdmin 4: 9.13 < 9.16
Fixed
An authoritative update reference is available, but the fixed version is not recorded in the structured CVE fields. Check the linked vendor advisory for the applicable release.
Action
Review the linked authoritative reference and apply the recorded fixed release appropriate to the affected product branch.
Workaround
No verified workaround is recorded. If business-safe, reduce exposure to the affected interface and allow only trusted sources until authoritative guidance is available.
04

Evidence and provenance

Published 18 Jun 2026 · Last source change 23 Jun 2026, 03:55 UTC · CWE-89 · Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

CVE recordCVE.org · 5.2
CVSS sourceCNA
EPSS source
?The date BlackTree first stored a score for this CVE from the daily FIRST EPSS feed.
FIRST · tracked since 2026-08-14
European sourceENISA EUVD · EUVD-2026-37965
Product sourceCNA
Remediation sourceCVE/CNA references
CWE sourceCNA
NVD statusNVD enriched

Core structured fields are present and their contributing authorities are shown above.

Material change intelligence

What changed after publication

View recent updates ↗

No material field changes have been recorded since change tracking began. Routine source refreshes and cosmetic edits are intentionally excluded.

Material fields only · duplicate refreshes suppressed · history retained for the configured operational retention period
Technical terms and abbreviations used in this report
CVE
Common Vulnerabilities and Exposures: the public identifier for one disclosed vulnerability.
CVSS
Common Vulnerability Scoring System: a technical severity framework; it is not patching priority by itself.
EPSS
Exploit Prediction Scoring System: FIRST's estimate of the probability that exploitation activity will be observed in the next 30 days; it is a forecast, not confirmation.
CWE
Common Weakness Enumeration: the standard category describing the underlying software or hardware weakness.
CNA
CVE Numbering Authority: an organisation authorised to assign and publish CVE records.
CISA ADP
Cybersecurity and Infrastructure Security Agency Authorized Data Publisher: structured enrichment added to a CVE record.
NVD
National Vulnerability Database: NIST's enrichment service for CVE records.
CERT / CSIRT
A computer security incident response team that publishes warnings or coordinates incident response.
PoC
Proof of concept: public material that demonstrates or helps reproduce exploitation.
CSAF
Common Security Advisory Framework: a machine-readable format for security advisories.
LoTL
Living off the land: abuse of legitimate tools or system functions during an attack.
Free version - for non-commercial use only.CVE-2026-12045 · cve.blacktree.nl