製品・ソフトウェアに関する情報
heartcomboのdeviseにおけるオープンリダイレクトの脆弱性
Title heartcomboのdeviseにおけるオープンリダイレクトの脆弱性
Summary

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で修正されました。

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

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

Publication Date May 22, 2026, midnight
Registration Date June 3, 2026, 5:02 p.m.
Last Update June 3, 2026, 5:02 p.m.
CVSS3.0 : 警告
Score 6.1
Vector CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Affected System
heartcombo
devise 5.0.4 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
その他
Change Log
No Changed Details Date of change
1 [2026年06月03日]
  掲載
June 3, 2026, 5:02 p.m.

NVD Vulnerability Information
CVE-2026-40295
Summary

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.

Publication Date May 23, 2026, 5:16 a.m.
Registration Date May 27, 2026, 4:06 a.m.
Last Update May 30, 2026, 3:55 a.m.
Affected software configurations
Configuration1 or higher or less more than less than
cpe:2.3:a:heartcombo:devise:*:*:*:*:*:ruby:*:* 5.0.4
Related information, measures and tools
Common Vulnerabilities List