Magic Login Mail or QR Code 2.07以下 - curpageurl()のマジックログインURLへのHostヘッダー挿入を介したアカウント乗っ取りによる認証不要の権限昇格
元情報の公開:2026/11/18 11:37 / 元情報の更新:2026/11/19 00:33(日本時間)
日本語訳
WordPress用プラグイン「Magic Login Mail or QR Code」は、2.07以下のバージョンで、管理者アカウントの乗っ取りを介した権限昇格の脆弱性があります。get_the_permalink()が空またはfalseを返した場合、curpageurl()関数がhome_url()やsite_url()によるサイトの設定済みオリジンとの照合をせず、未加工の$_SERVER['HTTP_HOST']値へフォールバックすることが原因です。これにより、攻撃者が制御するHostヘッダーが、generate_url()で生成されwp_mail()で対象者へ送られるマジックログインリンクのURLオリジンになります。
認証されていない攻撃者が、対象管理者のメールへ送信されたワンタイムのuidとトークンの組を傍受し、実際のサイトへ再送信できます。これによってautologin_via_url()がwp_set_auth_cookie()を呼び出し、対象アカウントの完全な管理者セッションが確立されます。
悪用には、get_the_permalink()が空またはfalseを返す経路(404ページやブロックテーマのヘッダーテンプレートパーツなど)で[magic_login]ショートコードが描画されること、ウェブサーバーが正規でないHostヘッダーを転送すること、攻撃者が対象管理者のメールアドレスを知っていること、管理者が攻撃者のオリジンを使うマジックログインリンクをクリックすることが必要です。悪用が成功すると、攻撃者は既に管理者権限を持つ別のアカウントを制御できます。攻撃者の元のアカウントが昇格するわけではありません。悪用の成功にはさらに管理者による操作が必要であり、攻撃者だけでこの脆弱性を発動させることはできません。
原文(英語)
Magic Login Mail or QR Code <= 2.07 - Unauthenticated Privilege Escalation via Account Takeover to Host Header Injection in curpageurl() Magic-Login URL
The Magic Login Mail or QR Code plugin for WordPress is vulnerable to Privilege Escalation via Administrator Account Takeover in versions up to, and including, 2.07. This is due to the `curpageurl()` function falling back to the raw `$_SERVER['HTTP_HOST']` value — with no validation against the site's configured origin via `home_url()` or `site_url()` — when `get_the_permalink()` returns empty or false, allowing an attacker-controlled Host header to become the URL origin of the magic-login link generated by `generate_url()` and delivered to the target via `wp_mail()`. This makes it possible for unauthenticated attackers to intercept the one-time uid and token pair sent to a targeted Administrator's email and replay them against the real site, causing `autologin_via_url()` to call `wp_set_auth_cookie()` and establish a full Administrator session on the targeted account. Exploitation requires the `[magic_login]` shortcode to render on a path where `get_the_permalink()` returns empty or false (such as a 404 page or a block-theme header template part), the web server to forward non-canonical Host headers, the attacker to know the target administrator's email address, and the administrator to click the attacker-originated magic-login link. Successful exploitation gives the attacker control of a distinct, already-privileged Administrator account; it does not promote the attacker's original account. Successful exploitation additionally requires an action by an administrator — the attacker cannot trigger the vulnerability on their own.
引用元:Wordfence
確認と対応の進め方
WordPress管理画面の「プラグイン」→「インストール済みプラグイン」で、対象製品の名前とバージョンを確認してください。
影響バージョンに該当する場合は、バックアップを確認し、「ダッシュボード」→「更新」から対象製品を更新してください。更新後は、記事に記載した修正版になっていることと、サイトの表示・機能を確認してください。
更新が表示されない場合は、製品の提供元で更新情報と更新方法を確認してください。