AI Engine 3.9.4以下 - urlパラメータを介した認証済みの編集者以上による限定的な任意ファイルアップロード
元情報の公開:2026/11/26 05:40 / 元情報の更新:2026/11/26 18:33(日本時間)
日本語訳
WordPress用プラグイン「AI Engine – MCP Server & AI Chatbot for WordPress, with Claude, ChatGPT & Gemini」は、3.9.4以下のすべてのバージョンで、REST APIエンドポイント/mwai/v1/helpers/create_imageのurlパラメータを介した、限定的な任意ファイルアップロードの脆弱性があります。
add_image_from_url()関数がget_allowed_mime_types()の拡張子許可リストを適用するのは、カスタムファイル名を指定する分岐だけです。リクエストでfilename値を省略すると、ファイル名が空の場合の分岐が、MIMEタイプや拡張子を検証せず、sanitize_file_name()を使ってURLのベース名から保存ファイルの拡張子を直接決定します。その後、ダウンロードしたレスポンス本文をfile_put_contents()でWordPressのuploadsディレクトリへそのまま書き込みます。
編集者以上の権限を持つ認証済みの攻撃者が、自分で制御するHTML、SVG、JavaScriptファイルを、攻撃者が選んだ拡張子でwp-content/uploads/YYYY/MM/へ配置できます。これにより、生成された添付ファイルURLを開いた管理者に対して保存型クロスサイトスクリプティングを実行できます。ダウンロード処理は、Content-Typeヘッダーがimage/で始まるすべてのHTTPレスポンスを受け付けます。この値は攻撃者所有の配信元サーバーで自由に制御できるため、書き込む内容が正しい画像である必要はありません。
原文(英語)
AI Engine <= 3.9.4 - Authenticated (Editor+) Limited Arbitrary File Upload via 'url' Parameter
The AI Engine – MCP Server & AI Chatbot for WordPress, with Claude, ChatGPT & Gemini plugin for WordPress is vulnerable to Limited Arbitrary File Upload in all versions up to, and including, 3.9.4 via the `url` parameter of the `/mwai/v1/helpers/create_image` REST API endpoint. The vulnerability exists because the `add_image_from_url()` function applies the `get_allowed_mime_types()` extension allow-list only on the custom-filename branch; when the request omits a `filename` value, the empty-filename branch derives the stored file's extension directly from the URL basename via `sanitize_file_name()` without any MIME or extension validation, then writes the downloaded response body verbatim to the WordPress uploads directory via `file_put_contents()`. This makes it possible for authenticated attackers with Editor-level access and above to place attacker-controlled HTML, SVG, or JavaScript files into `wp-content/uploads/YYYY/MM/` under an attacker-chosen extension, enabling stored cross-site scripting against any administrator who opens the resulting attachment URL. The download routine accepts any HTTP response whose `Content-Type` header begins with `image/`, a value freely controlled by the attacker-owned origin server, meaning the written content need not be a valid image.
引用元:Wordfence
確認と対応の進め方
WordPress管理画面の「プラグイン」→「インストール済みプラグイン」で、対象製品の名前とバージョンを確認してください。
影響バージョンに該当する場合は、バックアップを確認し、「ダッシュボード」→「更新」から対象製品を更新してください。更新後は、記事に記載した修正版になっていることと、サイトの表示・機能を確認してください。
更新が表示されない場合は、製品の提供元で更新情報と更新方法を確認してください。