pgAdmin ProjectのpgAdmin 4における複数の脆弱性
タイトル pgAdmin ProjectのpgAdmin 4における複数の脆弱性
概要

pgAdmin 4のエラーレンダリングおよびプランノードレンダリング経路にクロスサイトスクリプティングの脆弱性があります。PostgreSQLサーバーから返されるテキスト(ErrorResponseメッセージ、リレーションが存在しないエラー内のオブジェクト名引用や、EXPLAINのRecheck Cond / Exact Heap Blocksフィールド内のテキストなど)は、html-react-parserを通じてユーザーに表示される全ての場所(通知トースト、FormFooterMessage / FormInputのヘルプおよびエラー領域、FormNote、ModalProviderのAlertContentおよびconfirmDelete、ToolErrorView、ExplainビジュアライザーのNodeTextパネル、SQLエディタの確認ダイアログ、ConfirmSaveContent、PreferencesHelperのモーダルアラート、およびSelectThemesのヘルパーテキスト)にそのまま渡されていました。攻撃者が制御するPostgreSQLサーバーや、低権限のデータベースユーザーが作成可能なテーブル名やカラム名など、攻撃者が操作したテキストを返す任意のサーバーは、被害者のpgAdminがそのサーバーに接続した瞬間や、細工されたオブジェクトを参照するExplainプランを閲覧した時点で、任意のHTML(iframeを含む)をpgAdminのDOMに注入できました。注入されたiframeのsrcdocは攻撃者が提供するJavaScriptを取得でき、parent.locationを書き換えることで被害者のトップレベルのpgAdminブラウザタブを攻撃者制御のURLにリダイレクト可能です。この注入はpgAdminの自前のインターフェース内から発生するため、標準的なアンチクリックジャッキング制御(X-Frame-Options、Content-Security-Policyのframe-ancestors)ではこの問題を緩和できません。正当なpgAdminウィンドウ内に表示されるフィッシングページは、本物のpgAdminダイアログと区別がつきません。対応策は3つの補完的な層で構成されています。 (1) notifier、alert、form-error、Explain、およびSQLエディタのフローから到達可能なhtml-react-parserの呼び出し箇所すべてに対してDOMPurifyによるサニタイズ処理を適用しました。 (2) 新たにプレーンテキストレンダリング契約(SafeMessage / SafeHtmlMessageコンポーネントおよびNotifier.errorText / alertText / warningText / infoText / successTextヘルパー)を導入し、ブラウザ、ツール、ダッシュボード、デバッガー、ミスク、llm、設定、スキーマ差分、SQLエディタで以前はバックエンド由来の文字列を補間していた約50箇所の呼び出しをプレーンテキストバリアントに移行しました。 (3) バックエンド側でもexecute_post_connection_sqlハンドラーでsanitize_external_textヘルパーを通じてHTMLエスケープを実施し、サードパーティのJSONコンシューマ(監査ログ、APIクライアント)に生のマークアップを送信しないように対応しました。Explainプラン情報のレンダー部にはRecheck CondとExact Heap Blocksも_.escapeで保護し(すべての関連フィールドに対応)、DOMPurify実行前からの多層防御を実現しています。この問題はpgAdmin 4のバージョン6.0から9.16未満に影響します。

想定される影響 ・当該ソフトウェアが扱う情報の一部が外部に漏れる可能性があります。 ・当該ソフトウェアが扱う情報の一部が書き換えられる可能性があります。 ・当該ソフトウェアは停止しません。 
対策

リリース情報、またはパッチ情報が公開されています。参考情報を参照して適切な対策を実施してください。

公表日 2026年6月19日0:00
登録日 2026年6月30日11:23
最終更新日 2026年6月30日11:23
CVSS3.0 : 警告
スコア 5.4
ベクター CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
影響を受けるシステム
pgAdmin Project
pgAdmin 4 6.0 以上 9.16 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
変更履歴
No 変更内容 変更日
1 [2026年06月30日]
  掲載
2026年6月30日11:23

NVD脆弱性情報
CVE-2026-12048
概要

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.

公表日 2026年6月19日9:16
登録日 2026年6月27日4:04
最終更新日 2026年6月23日5:23
関連情報、対策とツール
共通脆弱性一覧