| タイトル | pgAdmin ProjectのpgAdmin 4における複数の脆弱性 |
|---|---|
| 概要 | pgAdmin 4のクラウド展開モジュールにおけるHTMLインジェクションの脆弱性です。/rds/、/azure/、/google/、およびトップレベルの/cloud/ブループリント配下のverify_credentials、deploy、regions、update-serverエンドポイントでは、AWS / Azure / Google SDKの例外テキストや関連するファイル解決およびデータベースコミットの例外テキストをJSONレスポンスボディ(infoおよびerrormsgフィールド)にHTMLエンコードせずに伝播させていました。Cloud Wizardのフロントエンドはhtml-react-parserを使用してこれらの文字列をレンダリングしていたため、攻撃者が操作した例外メッセージが構造化されたHTMLとしてウィザードのDOMに直接埋め込まれてしまいます。報告された入口ポイントは/rds/verify_credentials/です。認証済みのpgAdminユーザーがアクセスキー値にiframe/src=...のペイロードを含む細工されたアクセスキーを送信すると、AWS STSはIncompleteSignature例外で認証を拒否し、その例外テキストはアクセスキーを逐語的に引用します。pgAdminのバックエンドはそのテキストをJSONのinfoフィールドに転送し、Cloud WizardのFormFooterMessageがそれをHTMLとしてパースします。ブラウザーはiframeのsrcを攻撃者が制御するホストから取得し、iframe内のJavaScriptがparent.locationを書き換えて被害者のpgAdminタブをリダイレクトします。インジェクションがpgAdmin自身のインターフェイス内部でレンダリングされるため、X-Frame-OptionsおよびContent-Security-Policyのframe-ancestorsでは対策できません。影響の基本は自己対象(ペイロードを提供した同一ユーザーがインジェクションを見る)ですが、他の認証済みユーザーへのエスカレーションには、有効なX-pgA-CSRFTokenを被害者のブラウザコンテキストで送信可能なクロスサイトリクエストフォージェリの追加プリミティブが必要です。同様の未消毒のエラーをJSONに直接返すパターンは複数の関連エンドポイントにも存在しました。具体的には、Azureのcheck_cluster_name_availability、SDKエラーを表示するGoogleのすべてのエンドポイント(verification_ack、projects、regions、instance_types、database_versions、verify_credentialsのパス解決ブランチ)、deploy_on_rds、deploy_on_azure、deploy_on_googleからのstr(e)を返す中央の/deployエンドポイント、および失敗したdb.session.commitに起因するstr(e)を返すupdate_cloud_serverが含まれ、これらはすべて修正が適用されました。修正は、新たに共通で使用されるsanitize_external_textヘルパー(HTMLエスケープと制御文字の除去)を用いて、エンドポイントのシンクで外部/SDK例外文字列をHTMLエスケープするもので、このヘルパーはpsycopg3ドライバーからweb/pgadmin/utils/text_sanitize.pyに移行されました。さらにCloud Wizardのフロントエンドは、バックエンド由来の文字列に対してFormFooterMessageをプレーンテキストモードでレンダリングするため、将来もしエスケープを忘れた場合でもHTMLとしてパースされることはありません。この問題はpgAdmin 4バージョン6.6から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.6 以上 9.16 未満 |
| No | 変更内容 | 変更日 |
|---|---|---|
| 1 | [2026年06月30日] 掲載 |
2026年6月30日11:23 |
| 概要 | HTML injection in pgAdmin 4's cloud deployment module. The verify_credentials, deploy, regions, and update-server endpoints under /rds/, /azure/, /google/, and the top-level /cloud/ blueprint propagated AWS / Azure / Google SDK exception text — and the related file-resolution and database-commit exception text — into the JSON response body (the info and errormsg fields) without HTML-encoding. The Cloud Wizard frontend rendered these strings through html-react-parser, so an attacker-influenced exception message embedded structural HTML directly into the wizard's DOM. The reported entry point is /rds/verify_credentials/. An authenticated pgAdmin user submits a crafted access_key whose value contains an <iframe/src=...> payload; AWS STS rejects the credential with an IncompleteSignature exception whose text quotes the access_key verbatim; the pgAdmin backend forwards that text into the JSON info field; the Cloud Wizard's FormFooterMessage parses it as HTML. The browser fetches the iframe's src from an attacker-controlled host, and JavaScript executing inside the cross-origin iframe writes to parent.location, redirecting the victim's pgAdmin tab. Because the injection renders inside pgAdmin's own interface, X-Frame-Options and Content-Security-Policy frame-ancestors do not mitigate it. Baseline impact is self-targeted (the same user who supplied the payload sees the injection); escalation against other authenticated users requires an additional cross-site request-forgery primitive capable of submitting the malformed credential request with a valid X-pgA-CSRFToken in the victim's browser context. The same unsanitised-error-into-JSON pattern was present across multiple sibling endpoints — Azure's check_cluster_name_availability, every Google endpoint that surfaces SDK errors (verification_ack, projects, regions, instance_types, database_versions, the verify_credentials path-resolution branches), the central /deploy endpoint that bubbles str(e) from deploy_on_rds / deploy_on_azure / deploy_on_google, and update_cloud_server which surfaces the str(e) from a failing db.session.commit — all of which are now covered. Fix HTML-escapes every external/SDK exception string at the endpoint sink via a new shared sanitize_external_text helper (HTML escape with control-character strip), promoted out of the psycopg3 driver into web/pgadmin/utils/text_sanitize.py. The Cloud Wizard frontend additionally renders its FormFooterMessage in plain-text mode for backend-derived strings, so the value is never parsed as HTML even if a future sink forgets the escape. This issue affects pgAdmin 4: from 6.6 before 9.16. |
|---|---|
| 公表日 | 2026年6月19日9:16 |
| 登録日 | 2026年6月27日4:04 |
| 最終更新日 | 2026年6月23日5:23 |