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

CVE-2026-12048 - pgAdmin 4: Stored XSS via untrusted error and plan-node text rendered through html-react-parser

2026-06-18
121 views
Verified
CVE-2026-12048

Summary

This entry details a vulnerability found in the target system. The exploit was published on 2026-06-18 and has garnered 121 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_254.txt

Zafiyet Ozet Bilgileri

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

Zafiyet Detayi (Turkce)

PgAdmin 4'ün hata oluşturma ve plan düğümü oluşturma yollarında depolanan siteler arası komut dosyası oluşturma. Bir PostgreSQL sunucusu tarafından döndürülen metin (ErrorResponse mesajları, ilişki-yok-mevcut olmayan hataların içinde ve EXPLAIN Recheck Cond / Exact Heap Blocks alanlarının içinde alıntılanan nesne adları da dahil olmak üzere), kullanıcıya yönelik her havuzda - bildirim tostları, FormFooterMessage / FormInput yardım ve hata alanları, FormNote, ModalProvider AlertContent ve onaylamaDelete, html-react-parser aracılığıyla kelimesi kelimesine iletildi, ToolErrorView, Açıklama görselleştiricisinin NodeText paneli, SQL düzenleyici onaylama diyalogları, ConfirmSaveContent, PreferencesHelper kalıcı uyarıları ve SelectThemes yardımcı metni. Saldırganın kontrol ettiği bir PostgreSQL sunucusu veya düşük ayrıcalıklı bir veritabanı kullanıcısının oluşturabileceği bir tablo veya sütun adı gibi saldırganın etkilediği metni döndüren herhangi bir sunucu, kurbanın pgAdmin'i o sunucuya bağlandığı veya hazırlanmış nesneye referans veren bir Açıklama planını görüntülediği anda pgAdmin DOM'a isteğe bağlı HTML (<iframe> dahil) enjekte edebilir. Enjekte edilen iframe'in srcdoc dosyası, saldırgan tarafından sunulan JavaScript'i getirebilir ve parent.location dosyasına yazarak kurbanın üst düzey pgAdmin tarayıcı sekmesini saldırgan tarafından kontrol edilen bir URL'ye yönlendirebilir. Enjeksiyon pgAdmin'in kendi arayüzünün içinden kaynaklandığı için, standart tıklama hırsızlığı önleme kontrolleri (X-Frame-Options, Content-Security-Policy: çerçeve ataları) bunu hafifletmez. Meşru pgAdmin penceresi içinde oluşturulan bir kimlik avı sayfasının, gerçek bir pgAdmin iletişim kutusundan ayırt edilmesi mümkün değildir. Fix üç tamamlayıcı katmanı birleştirir. (1) DOMpurify temizliği, notifier, uyarı, form hatası, Açıklama ve SQL düzenleyici akışlarından erişilebilen her html-react-parser çağrı sitesine sarılır. (2) Yeni bir düz metin işleme sözleşmesi — SafeMessage / SafeHtmlMessage bileşenleri ve Notifier.errorText / warningText / warningText / infoText / SuccessText yardımcıları — kullanıma sunuldu; Tarayıcı, araçlar, kontrol paneli, hata ayıklayıcı, çeşitli, llm, tercihler, şema farklılığı ve daha önce arka uçtan türetilmiş dizelerin enterpolasyonunu yapan SQL düzenleyicideki yaklaşık elli arayan, düz metin çeşitlerine taşınır. (3) Arka uç HTML çıkışı, yeni bir sanitize_external_text yardımcı aracılığıyla bağlantı sonrası SQL işleyicisine (execute_post_connection_sql) uygulanır, böylece üçüncü taraf JSON tüketicileri (denetim günlükleri, API istemcileri) hiçbir zaman ham işaretleme almaz; Açıklama plan bilgisi oluşturucusu aynı zamanda inşaat sırasında _.escape Recheck Cond ve Exact Heap Blocks'a da yamalı (her kardeş alanla eşleşerek), DOMPurify çalıştırılmadan önce bile derinlemesine savunma sağlıyor. Bu sorun pgAdmin 4'ü etkilemektedir: 6.0'dan 9.16'ya.

Orijinal Aciklama (Ingilizce)

Stored cross-site scripting in pgAdmin 4's error-rendering and plan-node-rendering paths. Text returned by a PostgreSQL server (ErrorResponse messages, including object names quoted back inside relation-does-not-exist errors and inside EXPLAIN Recheck Cond / Exact Heap Blocks fields) was passed verbatim through html-react-parser at every user-facing sink — the notifier toasts, FormFooterMessage / FormInput help and error areas, FormNote, ModalProvider AlertContent and confirmDelete, ToolErrorView, the Explain visualiser's NodeText panel, the SQL editor confirm dialogs, ConfirmSaveContent, PreferencesHelper modal alerts, and SelectThemes helper text. A PostgreSQL server an attacker controls — or any server returning attacker-influenced text such as a table or column name a low-privilege database user can create — could inject arbitrary HTML (including <iframe>) into the pgAdmin DOM the moment the victim's pgAdmin connected to that server or viewed an Explain plan that referenced the crafted object. The injected iframe's srcdoc could fetch attacker-served JavaScript and, by writing to parent.location, redirect the victim's top-level pgAdmin browser tab to an attacker-controlled URL. Because the injection originates from inside pgAdmin's own interface, standard anti-clickjacking controls (X-Frame-Options, Content-Security-Policy: frame-ancestors) do not mitigate it. A phishing page rendered inside the legitimate pgAdmin window is indistinguishable from a genuine pgAdmin dialog. Fix combines three complementary layers. (1) DOMPurify sanitisation is wrapped around every html-react-parser call site reachable from notifier, alert, form-error, Explain, and SQL-editor flows. (2) A new plain-text rendering contract — SafeMessage / SafeHtmlMessage components plus Notifier.errorText / alertText / warningText / infoText / successText helpers — is introduced; around fifty callers across browser, tools, dashboard, debugger, misc, llm, preferences, schema diff, and the SQL editor that previously interpolated backend-derived strings are migrated to the plain-text variants. (3) Backend HTML-escape is applied at the post-connection-SQL handler (execute_post_connection_sql) via a new sanitize_external_text helper, so third-party JSON consumers (audit logs, API clients) never receive raw markup either; the Explain plan-info renderer is also patched to _.escape Recheck Cond and Exact Heap Blocks at construction (matching every sibling field), giving defence in depth even before DOMPurify runs. This issue affects pgAdmin 4: from 6.0 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: ~7.7 KB | MD5: 5db20da76fbed6ca9b6a1f86ce305585

No gallery images available.

No discussion yet.

Markdown supported

Author Profile

Autopilot
Autopilot Elite Member
View All Submissions

Entry Stats

Views 121
Downloads 3
Comments 0