Vulnerability
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.
91 advisories report this vulnerability, across 4 ecosystems.
Advisories
- CGA-2crj-wvgx-hg7j
- CGA-2mcx-36xg-5wc2
- CGA-2rxq-pp95-v5gf
- CGA-2w36-gqc2-jcjq
- CGA-3353-g5gx-q86p
- CGA-35vg-9gc4-3wqw
- CGA-3cfc-j297-93rx
- CGA-4f9h-5qvv-93fm
- CGA-5v9m-cfh7-3hf4
- CGA-65fj-m5m6-qmxm
- CGA-6c4j-vrh2-5mfj
- CGA-6gww-245x-99q2
- CGA-725p-838v-w5q8
- CGA-73vc-8mfr-9542
- CGA-766m-p766-x5xj
- CGA-794w-57px-9fj6
- CGA-7gqh-35h9-6hgh
- CGA-7hr3-x39q-rpx3
- CGA-7j2r-frxh-xh24
- CGA-7q73-rh3r-9xm5
- CGA-7xj6-23mg-g4rr
- CGA-86pm-hp23-gxgp
- CGA-8chv-85m2-56jp
- CGA-8r5h-78h3-ffxv
- CGA-937x-pp2m-pmp3
- CGA-93cf-gv3p-v3xh
- CGA-93xc-cwc4-2hc3
- CGA-9467-6h5v-9ppc
- CGA-965j-wrpm-8299
- CGA-96f2-q8x4-3j76
- CGA-9gwq-8f24-cgq2
- CGA-c2g3-4f98-wvw8
- CGA-c392-37vj-f47r
- CGA-c6m3-wf36-95fw
- CGA-cc2f-f66g-r2pj
- CGA-chr3-m2x8-cvh3
- CGA-chv5-fc9f-rpp6
- CGA-cv98-hj8j-r9h5
- CGA-cwcc-qf7f-87hm
- CGA-f4jq-qgc7-qqvx
- CGA-f9gc-f3fq-w5ch
- CGA-fhfm-5267-hrhf
- CGA-fhpq-pq6w-j7h7
- CGA-g83x-pc2r-frqf
- CGA-gj9h-739h-pxvm
- CGA-gp2c-8m24-cw4q
- CGA-h6c6-w7p9-5rjv
- CGA-hfjr-3m53-jpj5
- CGA-hgx6-9rc3-pj33
- CGA-hp5g-qcmx-p79f
- CGA-hp7x-53cf-8vjh
- CGA-hxr9-xq42-h23v
- CGA-j2qc-5wjh-2356
- CGA-jf97-jmv3-whvj
- CGA-jgf3-3q26-qgc9
- CGA-jq48-mg2m-xx83
- CGA-jv77-68f8-j372
- CGA-jxc4-2pfc-vxwv
- CGA-jxjv-vhj9-v7j9
- CGA-m2xc-84vr-8497
- CGA-mqf8-5pxp-v5wf
- CGA-mqvq-g527-j27g
- CGA-mvvf-qw25-hhrm
- CGA-p4hp-5g3j-rg6x
- CGA-pmp4-v343-6vvr
- CGA-pqjx-6fxq-48c5
- CGA-pvwj-8pg7-852p
- CGA-pxg6-8gh7-hrqw
- CGA-pxxp-r675-jj3x
- CGA-qg2h-hmqq-r336
- CGA-qh76-qx2f-x9fj
- CGA-qhxc-657h-f3rq
- CGA-qp5p-66g8-cjqc
- CGA-r22r-x5mj-xh6h
- CGA-rm79-x444-g2h8
- CGA-rrjg-36x5-27cq
- CGA-v8wf-7x6g-x2c8
- CGA-vj27-v48r-j4vr
- CGA-vmvh-8j27-34ww
- CGA-wg6g-pm7c-g2jq
- CGA-wm8j-6959-7h8h
- CGA-wphv-6jm8-qrg8
- CGA-wv5p-rhh6-vfx8
- CGA-wvgq-32wx-m8qg
- CGA-x5j3-v7c5-699r
- CGA-xpwm-74pf-whx2
- CGA-xpww-rvgc-m8v5
- CGA-xwgg-m8qg-m594
-
DEBIAN-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…
-
GHSA-jp94-3292-c3xv
Devise has an Open Redirect via Unvalidated `request.referrer` in Timeoutable Session Timeout Handler
-
UBUNTU-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…