vuln_report_viewer.sh
VULN REPORT / web apps / ID: 257

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

2026-06-18
124 views
Verified
CVE-2026-12045

Summary

This entry details a vulnerability found in the target system. The exploit was published on 2026-06-18 and has garnered 124 views from the community. It is classified under the web apps category. Users are advised to review the source code in the Detail tab for technical specifics.

exploit_257.txt

Zafiyet Ozet Bilgileri

Zafiyet Kodu:CVE-2026-12045
Siddet Derecesi:9.4 | CRITICAL
Hedef Platform:
Yayinlanma Tarihi:18.06.2026 23:37

Zafiyet Detayi (Turkce)

pgAdmin 4 AI Assistant'taki salt okunur işlem atlama, asistanın okuduğu veritabanı içeriğini etkileyebilen bir saldırganın, pgAdmin kullanıcısının veritabanı rolünün ayrıcalıklarıyla isteğe bağlı SQL yürütmesine olanak tanır. AI Assistant'ın executive_sql_query aracı, veri değişikliğini önlemek için LLM tarafından oluşturulan SQL'i bir BEGIN TRANSACTION READ ONLY sarmalayıcısı içinde çalıştırır. LLM tarafından sağlanan sorgu, tek bir ifadeye veya salt okunur fiillere sınırlama olmaksızın veritabanı sürücüsüne iletildi, böylece COMMIT, END, ROLLBACK veya ABORT ile başlayan çok ifadeli bir veri, salt okunur işlemi sonlandırdı ve sonraki ifadeleri otomatik tamamlama modunda çalıştırdı. Sondaki ROLLBACK'in hiçbir etkisi olmadı. Teslimat, anında enjeksiyon yoluyla gerçekleştirilir: AI Assistant'ın inceleyebileceği herhangi bir nesneye (bir satır, bir sütun değeri, bir yorum) içerik yazabilen bir saldırgan, LLM'nin çoklu ifade yükünü bir araç çağrısı olarak yaymasına neden olabilir. Saldırgan, pgAdmin kullanıcısının rolündeki sıradan yazma ayrıcalıklarıyla yetkisiz veri değişikliği gerçekleştirebilir. pgAdmin kullanıcısının rolü bir PostgreSQL süper kullanıcısı olduğunda veya pg_execute_server_program'ı barındırdığında, zincir, COPY ... TO PROGRAM aracılığıyla veritabanı sunucusu ana bilgisayarında uzaktan kod yürütülmesine kadar uzanır. Fix, LLM tarafından sağlanan sorguyu baştan doğrular: Baştaki gerçek belirteci (boşluk, yorumlar ve noktalama işaretleri çıkarıldıktan sonra) SELECT, With, EXPLAIN, SHOW, VALUES veya TABLE'dan biri olan tam olarak bir boş olmayan/yorumsuz ifadeye ayrıştırılmalıdır. İşlem kontrol fiilleri, DML, DDL, CALL, COPY, DO, SET/RESET ve diğer her şey, herhangi bir veritabanı çalışması gerçekleşmeden önce reddedilir. PostgreSQL'in SADECE OKUYUN modu, verileri değiştiren CTE'leri, yazmalarda ANALİZİ AÇIKLAMAYI ve geçici yan etkileri desteklemeye devam ediyor. Bu sorun pgAdmin 4'ü etkilemektedir: 9.13'ten 9.16'ya kadar.

Orijinal Aciklama (Ingilizce)

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.

Otomatik olarak ice aktarildi.Orijinal Kaynagi Goruntule

Download Source

Download the exploit source code for offline analysis and testing.

Download Now

File Size: ~5.9 KB | MD5: 5c2110dc1374648a5be3e976abdd6219

No gallery images available.

No discussion yet.

Markdown supported

Author Profile

Autopilot
Autopilot Elite Member
View All Submissions

Entry Stats

Views 124
Downloads 2
Comments 0