GHSA-jp94-3292-c3xv · Severity: medium · Ecosystem: rubygems — Devise has an Open Redirect via Unvalidated `request.referrer` in Timeoutable Session Timeout Handler
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.
Conclusion & alert: CVE-2026-40295 is rated Low Risk (32.8/100): CVSS Medium severity, with low exploitation likelihood (EPSS 0.32%). Mandatory action: Monitor for updates and reassess as exploit intelligence or EPSS changes.
Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.
EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).
| # | Date | Old EPSS score | New EPSS score | Delta (New - Old) |
|---|---|---|---|---|
| 1 | 2026-06-15 | 0.05% | 0.32% | +0.27% |
| 2 | 2026-05-23 | — | 0.05% | — |
Full EPSS history (2 records total)
CVSS metrics for this CVE.
| Base score | Version | Severity | Vector | Exploitability | Impact | Score source |
|---|---|---|---|---|---|---|
| 6.1 | 3.1 | MEDIUM |
|
2.8 | 2.7 | [email protected] |
GHSA-jp94-3292-c3xv · Severity: medium · Ecosystem: rubygems — Devise has an Open Redirect via Unvalidated `request.referrer` in Timeoutable Session Timeout Handler
| vendor | priority | summary | link |
|---|---|---|---|
debian
|
not yet assigned | CVE-2026-40295 not yet assigned priority: Debian including 1 source packages (ruby-devise), 2 status rows across 2 suites (bookworm, bullseye): open 2. | https://security-tracker.debian.org/tracker/CVE-2026-40295 |
ubuntu
|
medium | CVE-2026-40295 medium priority: Ubuntu including 1 source packages (ruby-devise), 7 status rows across 7 suites (bionic, focal, jammy, noble, questing, resolute, upstream): needs-triage 5, DNE 2. | https://ubuntu.com/security/CVE-2026-40295 |
| Vendor | Product | Version | Raw CPE |
|---|---|---|---|
| heartcombo | devise | < 5.0.4 | cpe:2.3:a:heartcombo:devise:*:*:*:*:*:ruby:*:* |
| URL | Tags |
|---|---|
| https://github.com/heartcombo/devise/commit/025fe2124f9928766fc46520e999633b598d0360 | Patch |
| https://github.com/heartcombo/devise/security/advisories/GHSA-jp94-3292-c3xv | Mitigation Vendor Advisory |