Widget Options 4.2.6.1以下 - 'post_content'パラメーターを介した認証済み(寄稿者以上)のコードインジェクション

元情報の公開:2026/11/13 05:59 / 元情報の更新:2026/11/13 18:35(日本時間)

日本語訳

WordPress用プラグイン「Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets」の4.2.6.1以下のすべてのバージョンには、post_contentパラメーターを介したコードインジェクションの脆弱性があります。原因は、保存時の除去フィルターwidgetopts_strip_logic_from_blocks()と描画時のパーサーblockopts_filter_before_display()の解析の不一致です。JSONキーの内側に<!--start_widgetoptsというリテラルを埋め込むと、書き込み側のjson_decodeはclassではないキーとして認識し、除去を省略してペイロードをそのままデータベースに永続的に保存します。一方、描画側のstr_replaceはキーをclassへ復元し、攻撃者が制御するlogic値を@evalへ直接渡します。

これにより、投稿者以上の権限を持つ認証済みの攻撃者は、フロントエンドのページが閲覧されるたびに実行されるPHP式を挿入できます。プラグインの許可リストにある関数を使うサンドボックスを通じて、真偽値の応答を手掛かりに、管理者のメールアドレス、既定のロール、任意のget_option、get_user_meta、get_post_metaの値を含むWordPressサイトの設定データを取り出せます。インストール済みのいずれかのプラグインがwidgetopts_allowed_php_functionsフィルターを拡張している場合には、制限のないコード実行へと発展します。

寄稿者も、提出した投稿が後に管理者によって公開された場合、この脆弱性を悪用できます。特に、バージョン4.2.6で導入された信頼フラグの仕組みにより、widgetopts_safe_eval_trusted()が従来のすべての描画呼び出し箇所で管理者以外に対する早期終了を回避するため、挿入されたペイロードは認証されていない利用者を含むすべてのサイト訪問者に対して実行されます。寄稿者以上の権限を持つ攻撃者による悪用には、管理者または編集者が後に寄稿者の提出した投稿を公開する必要があります。そのように構成されていない初期状態のインストール環境では、攻撃者に投稿者以上の権限が必要です。

原文(英語)

Widget Options <= 4.2.6.1 - Authenticated (Contributor+) Code Injection via 'post_content' Parameter

The Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets plugin for WordPress is vulnerable to Code Injection in all versions up to, and including, 4.2.6.1 via the `post_content` parameter. This is due to asymmetric parsing between the save-time strip filter (`widgetopts_strip_logic_from_blocks()`) and the render-time parser (`blockopts_filter_before_display()`): embedding an inner `<!--start_widgetopts` literal inside a JSON key causes the write-side `json_decode` to see a non-`class` key and skip stripping — persisting the payload verbatim to the database — while the render-side `str_replace` reconstitutes the key to `class`, feeding the attacker-controlled `logic` value directly into `@eval`. This makes it possible for authenticated attackers, with Author-level access and above, to inject PHP expressions that execute on every front-end page view, enabling boolean-oracle exfiltration of WordPress site configuration data — including admin email address, default role, and arbitrary `get_option`, `get_user_meta`, and `get_post_meta` values — via the plugin's allowlisted-function sandbox, which escalates to unrestricted code execution if any installed plugin extends the `widgetopts_allowed_php_functions` filter. Contributors can also exploit this vulnerability when their submitted post is later published by an administrator; notably, the injected payload executes for all site visitors, including unauthenticated users, because a trust-flag mechanism introduced in version 4.2.6 causes `widgetopts_safe_eval_trusted()` to bypass its non-admin short-circuit at every legacy render callsite. Exploitation by attackers with contributor-level access and above requires that an administrator (or editor) later publishes the contributor's submission. On a default installation, where that is not configured, the vulnerability requires attackers with author-level access and above.

引用元:Wordfence

確認と対応の進め方

WordPress管理画面の「プラグイン」→「インストール済みプラグイン」で、対象製品の名前とバージョンを確認してください。

影響バージョンに該当する場合は、バックアップを確認し、「ダッシュボード」→「更新」から対象製品を更新してください。更新後は、記事に記載した修正版になっていることと、サイトの表示・機能を確認してください。

更新が表示されない場合は、製品の提供元で更新情報と更新方法を確認してください。

プラグインの管理・更新方法(WordPress公式・日本語)

運営元KanriPressのサービス案内

サイトを守る備えを、今日から始めませんか。

「KanriPress WP Sakimori」は、ファイアウォールと仮想パッチで攻撃に備え、マルウェア検査と継続監視でサイトの異変を捉えます。毎日のバックアップで万一に備え、月次レポートで保護・監視の状況も確認。日々の管理負担を抑えながらWordPressを守る仕組みを、月額2,200円(税込)で導入できます。

サービス内容・料金を見る