Read the docs
TI-2026-29075 Aliases CVE-2026-40295GHSA-jp94-3292-c3xv

Devise: Open Redirect via Unvalidated `request.referrer` in Timeoutable Session Timeout Handler

Priority LOW 27CWE-601Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
Spoofing
Confidentiality · integrity · availability
Low · Low · None
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-601.

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.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00241 15th percentileScored 2026-11-07
Fix Fixed devise (heartcombo): 5.0.4devise (RubyGems): 5.0.4

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
heartcombodevisebefore 5.0.45.0.4Patch availableCNA
—devise (RubyGems)before 5.0.45.0.4Patch availableGHSA-jp94-3292-c3xv
  • devise Vendorheartcombo Affected before 5.0.4 Fixed in 5.0.4 Patch available CNA
  • devise (RubyGems) Vendor— Affected before 5.0.4 Fixed in 5.0.4 Patch available GHSA-jp94-3292-c3xv

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:heartcombo:devise:*:*:*:*:*:ruby:*:*before 5.0.4Vulnerableheartcombo
  • cpe:2.3:a:heartcombo:devise:*:*:*:*:*:ruby:*:* Versions before 5.0.4 Vulnerable ·heartcombo

Remediation

  • Fix · CNA devise (heartcombo) Fixed in 5.0.4
  • Fix · GHSA-jp94-3292-c3xv devise (RubyGems) Fixed in 5.0.4 Advisory →

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-40295
  2. 2026-10-03 Alias added: GHSA-jp94-3292-c3xv

References

  • TI-2026-25192 Devise has a confirmable "change email" race condition that permits user to confirm email they have no access to CVSS 4.0MEDIUM 6.0
  • TI-2015-06843 The Devise gem before 3.5.4 for Ruby mishandles Remember Me cookies for sessions, which… CVSS 3.1HIGH 7.5

Sources