heartcomboのdeviseにおけるオープンリダイレクトの脆弱性
タイトル heartcomboのdeviseにおけるオープンリダイレクトの脆弱性
概要

DeviseはWardenに基づくRails用の認証ソリューションです。バージョン5.0.3以下では、TimeoutableモジュールがDeviseで有効になっている場合、FailureApp#redirect_urlメソッドがリクエストのリファラ(HTTP Refererヘッダーであり攻撃者が制御可能)を検証なしに返してしまいます。これはセッションタイムアウトが発生した非GETリクエストに対して起こります。攻撃者が自動送信するクロスオリジンフォームをホストしたページを用意すると、有効期限切れのDeviseセッションを持つ被害者を任意の外部URLへリダイレクトさせることが可能です。これはGETタイムアウトのパス(サーバー側のattempted_pathを使用)やDevise独自のstore_location_forメカニズム(extract_path_from_locationによって外部ホストを除去)と対照的であり、これらは保護されていますが、非GETタイムアウトリダイレクトパスのみが保護されていません。有効期限切れのセッションを持つユーザーは信頼されたアプリドメインから攻撃者制御のURLへ静かにリダイレクトされます。そのため、フィッシングやマルウェア配布がブラウザ警告を回避して可能になります。注意点として、Railsの組み込みのオープンリダイレクト保護はこの問題を軽減しません。Devise::FailureAppは独自の関連リダイレクト構成のコピーを持つActionController::Metalアプリであるため、config.action_controller.action_on_open_redirect = :raise(および古いraise_on_open_redirects設定)は影響を及ぼしません。この問題はバージョン5.0.4で修正されました。

想定される影響 ・当該ソフトウェアが扱う情報の一部が外部に漏れる可能性があります。 ・当該ソフトウェアが扱う情報の一部が書き換えられる可能性があります。 ・当該ソフトウェアは停止しません。 
対策

ベンダ情報を参照して適切な対策を実施してください。

公表日 2026年5月22日0:00
登録日 2026年6月3日17:02
最終更新日 2026年6月3日17:02
CVSS3.0 : 警告
スコア 6.1
ベクター CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
影響を受けるシステム
heartcombo
devise 5.0.4 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
その他
変更履歴
No 変更内容 変更日
1 [2026年06月03日]
  掲載
2026年6月3日17:02

NVD脆弱性情報
CVE-2026-40295
概要

Devise is an authentication solution for Rails based on Warden. In versions 5.0.3 and below, when the Timeoutable module is enabled in Devise, the FailureApp#redirect_url method returns request.referrer — the HTTP Referer header, which is attacker-controllable — without validation for any non-GET request that results in a session timeout. An attacker who hosts a page with an auto-submitting cross-origin form can cause a victim with an expired Devise session to be redirected to an arbitrary external URL. This contrasts with the GET timeout path (which uses server-side attempted_path) and Devise's own store_location_for mechanism (which strips external hosts via extract_path_from_location), both of which are protected; only the non-GET timeout redirect path is unprotected. Expired-session users can be silently redirected from the trusted app domain to attacker-controlled URLs, enabling phishing and malware delivery while bypassing browser warnings. Note: Rails' built-in open-redirect protection does not mitigate this issue. Devise::FailureApp is an ActionController::Metal app with its own isolated copy of the relevant redirect configuration, so config.action_controller.action_on_open_redirect = :raise (and the older raise_on_open_redirects setting) do not reach it. This issue has been fixed in version 5.0.4.

公表日 2026年5月23日5:16
登録日 2026年5月27日4:06
最終更新日 2026年5月30日3:55
影響を受けるソフトウェアの構成
構成1 以上 以下 より上 未満
cpe:2.3:a:heartcombo:devise:*:*:*:*:*:ruby:*:* 5.0.4
関連情報、対策とツール
共通脆弱性一覧