Trust Payments Gateway for WooCommerce (JavaScript Library) 1.3.8以下 - ゲスト登録時のWP_Error型変換を介した認証不要の管理者への認証回避
元情報の公開:2026/11/18 09:41 / 元情報の更新:2026/11/18 22:32(日本時間)
日本語訳
WordPress用プラグイン「Trust Payments Gateway for WooCommerce (JavaScript Library)」は、1.3.8以下のすべてのバージョンで、認証回避の脆弱性があります。new_customer_account()関数が、is_wp_error()による検査より前に、wp_create_user()の未加工の戻り値を注文のtp_userid投稿メタデータへ保存することが原因です。これにはユーザー名の衝突時に返されるWP_Errorオブジェクトも含まれます。その後、add_customer_details_to_thankyou_page()コールバックがそのメタデータを読み取り、(int)でキャストするため、PHPが任意のオブジェクトを整数1へ変換し、wp_set_current_user(1)とwp_set_auth_cookie(1)が無条件に呼び出されます。
認証されていない攻撃者が、購入手続き中に既存のいずれかのログイン名と一致するnew_usernameパラメータを指定し、生成された購入完了ページを訪問すると、WordPressのユーザーID 1として認証できます。これは初期のサイト管理者であり、マルチサイトではネットワークの特権管理者です。悪用にはTrust Paymentsゲートウェイが有効であり、攻撃者が自分のアカウントで有料注文を完了する必要があります。また、ID 1の管理者ユーザー名は、標準的なWordPressのユーザー列挙手法で取得できます。
原文(英語)
Trust Payments Gateway for WooCommerce (JavaScript Library) <= 1.3.8 - Unauthenticated Authentication Bypass to Administrator via Guest-Registration WP_Error Coercion
The Trust Payments Gateway for WooCommerce (JavaScript Library) plugin for WordPress is vulnerable to Authentication Bypass in all versions up to, and including, 1.3.8. The vulnerability exists because the `new_customer_account()` function stores the raw return value of `wp_create_user()` — including a `WP_Error` object returned on username collision — into the order's `tp_userid` post meta before the `is_wp_error()` guard is evaluated; the `add_customer_details_to_thankyou_page()` callback subsequently reads that meta and casts it with `(int)`, causing PHP to coerce any object to integer `1`, after which `wp_set_current_user(1)` and `wp_set_auth_cookie(1)` are called unconditionally. This makes it possible for unauthenticated attackers to authenticate as WordPress user ID 1 — the bootstrap site administrator or, on multisite, a network super-admin — by supplying the `new_username` parameter matching any existing login during checkout and visiting the resulting thank-you page. Exploitation requires the Trust Payments gateway to be active and the attacker to complete a paid order on their own account; the ID 1 administrator username is additionally enumerable via standard WordPress user enumeration techniques.
引用元:Wordfence
確認と対応の進め方
WordPress管理画面の「プラグイン」→「インストール済みプラグイン」で、対象製品の名前とバージョンを確認してください。
修正版が未確認の製品は、まず提供元の最新情報を確認してください。記事の取得時点より後に修正版が公開されている場合があります。
プラグインの代替を探す場合は、必要な機能と既存データの移行方法を確認してください。削除前にバックアップを確保し、代替製品の動作を検証してください。