CVE-2026-40295
Devise: 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.
Exposure status: unknown. This page does not establish whether an installed system is affected or corrected.
Severity and exploitation evidence
EPSS: 0.241% · score date 2026-11-19. EPSS is an estimated probability over the next 30 days, not proof of exploitation.
CISA KEV: not included in the checked catalog; exploitation may still occur. Last checked: 2026-11-19T17:28:52.703Z. Public exploit availability is not used to set this status.
CVSS 3.1 · 6.1 · published by GitHub_MCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Assessment source · checked 2026-11-19T12:58:29.197Z
Verification by field
| Field | Status | Checked at (UTC) | Source |
|---|---|---|---|
| kev | verified | 2026-11-19T17:28:52.703Z | CISA KEV |
| cvss | verified | 2026-11-19T12:58:29.197Z | CVE Program |
| epss | verified | 2026-11-19T16:04:49.616Z | FIRST EPSS |
| patches | verified | 2026-11-19T12:52:45.885Z | OSV |
| affected | verified | 2026-11-19T12:58:29.197Z | CVE Program |
| lifecycle | verified | 2026-11-19T12:58:29.197Z | CVE Program |
Affected versions and configuration
heartcombo devise; default status: unknown: < 5.0.4 [affected; scheme: unspecified]
Defaults, conditional configuration, package status and version schemes are retained below. A version range alone is not an exposure verdict.
CVE Program · cve-json · full conditions
{
"affected": [
{
"vendor": "heartcombo",
"product": "devise",
"versions": [
{
"status": "affected",
"version": "< 5.0.4"
}
]
}
],
"additionalContainers": [
{
"title": "CISA ADP Vulnrichment",
"metrics": [
{
"other": {
"type": "ssvc",
"content": {
"id": "CVE-2026-40295",
"role": "CISA Coordinator",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"version": "2.0.3",
"timestamp": "2026-05-26T13:09:47.384783Z"
}
}
}
],
"providerMetadata": {
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP",
"dateUpdated": "2026-05-26T13:10:00.845Z"
}
}
]
}Archived source JSONOSV · osv · full conditions
{
"id": "GHSA-jp94-3292-c3xv",
"aliases": [
"CVE-2026-40295"
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "5.0.4"
}
]
}
],
"package": {
"name": "devise",
"purl": "pkg:gem/devise",
"ecosystem": "RubyGems"
},
"versions": [
"0.1.0",
"0.1.1",
"0.2.0",
"0.2.1",
"0.2.2",
"0.2.3",
"0.3.0",
"0.4.0",
"0.4.1",
"0.4.2",
"0.4.3",
"0.5.0",
"0.5.1",
"0.5.2",
"0.5.3",
"0.5.4",
"0.5.5",
"0.5.6",
"0.6.0",
"0.6.1",
"0.6.2",
"0.6.3",
"0.7.0",
"0.7.1",
"0.7.2",
"0.7.3",
"0.7.4",
"0.7.5",
"0.8.0",
"0.8.1",
"0.8.2",
"0.9.0",
"0.9.1",
"0.9.2",
"1.0.0",
"1.0.1",
"1.0.10",
"1.0.11",
"1.0.2",
"1.0.3",
"1.0.4",
"1.0.5",
"1.0.6",
"1.0.7",
"1.0.8",
"1.0.9",
"1.1.0",
"1.1.1",
"1.1.2",
"1.1.3",
"1.1.4",
"1.1.5",
"1.1.6",
"1.1.7",
"1.1.8",
"1.1.9",
"1.1.pre",
"1.1.pre2",
"1.1.pre3",
"1.1.pre4",
"1.1.rc0",
"1.1.rc1",
"1.1.rc2",
"1.2.0",
"1.2.1",
"1.2.rc",
"1.2.rc2",
"1.3.0",
"1.3.1",
"1.3.2",
"1.3.3",
"1.3.4",
"1.4.1",
"1.4.2",
"1.4.3",
"1.4.5",
"1.4.7",
"1.4.8",
"1.4.9",
"1.5.0",
"1.5.0.rc1",
"1.5.1",
"1.5.2",
"1.5.3",
"1.5.4",
"2.0.0",
"2.0.0.rc",
"2.0.0.rc2",
"2.0.1",
"2.0.2",
"2.0.4",
"2.0.5",
"2.0.6",
"2.1.0",
"2.1.0.rc",
"2.1.0.rc2",
"2.1.2",
"2.1.3",
"2.1.4",
"2.2.0",
"2.2.0.rc",
"2.2.1",
"2.2.2",
"2.2.3",
"2.2.4",
"2.2.5",
"2.2.6",
"2.2.7",
"2.2.8",
"3.0.0",
"3.0.0.rc",
"3.0.1",
"3.0.2",
"3.0.3",
"3.0.4",
"3.1.0",
"3.1.0.rc2",
"3.1.1",
"3.1.2",
"3.2.0",
"3.2.1",
"3.2.2",
"3.2.3",
"3.2.4",
"3.3.0",
"3.4.0",
"3.4.1",
"3.5.1",
"3.5.10",
"3.5.2",
"3.5.3",
"3.5.4",
"3.5.5",
"3.5.6",
"3.5.7",
"3.5.8",
"3.5.9",
"4.0.0",
"4.0.0.rc1",
"4.0.0.rc2",
"4.0.1",
"4.0.2",
"4.0.3",
"4.1.0",
"4.1.1",
"4.2.0",
"4.2.1",
"4.3.0",
"4.4.0",
"4.4.1",
"4.4.2",
"4.4.3",
"4.5.0",
"4.6.0",
"4.6.1",
"4.6.2",
"4.7.0",
"4.7.1",
"4.7.2",
"4.7.3",
"4.8.0",
"4.8.1",
"4.9.0",
"4.9.1",
"4.9.2",
"4.9.3",
"4.9.4",
"5.0.0",
"5.0.0.rc",
"5.0.1",
"5.0.2",
"5.0.3"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-jp94-3292-c3xv/GHSA-jp94-3292-c3xv.json",
"last_known_affected_version_range": "<= 5.0.3"
}
}
],
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
}
],
"upstream": [],
"withdrawn": null,
"references": [
{
"url": "https://github.com/heartcombo/devise/security/advisories/GHSA-jp94-3292-c3xv",
"type": "WEB"
},
{
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40295",
"type": "ADVISORY"
},
{
"url": "https://github.com/heartcombo/devise/commit/025fe2124f9928766fc46520e999633b598d0360",
"type": "WEB"
},
{
"url": "https://github.com/heartcombo/devise",
"type": "PACKAGE"
},
{
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/devise/CVE-2026-40295.yml",
"type": "WEB"
}
],
"relatedGitRanges": [],
"database_specific": {
"cwe_ids": [
"CWE-601"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": "2026-05-22T20:16:34Z",
"github_reviewed_at": "2026-05-08T15:41:47Z"
}
}Archived source JSONCorrection evidence
Distribution packages and upstream releases are distinct. ESM channels may require the corresponding Ubuntu entitlement. Notes and branch ranges are not installable package versions. OSV fixed boundaries are ecosystem-specific version thresholds, not proof that a package is currently available or installed.
| Evidence type | Distribution / release | Package | Channel | Version or source note | Source |
|---|---|---|---|---|---|
| ecosystem-boundary | RubyGems / package | devise | Not a distribution channel | 5.0.4 | Official record |
Vendor notices and operational guidance
No connected vendor notice is available for this record.
Original sources and dates
- OSVConsulted: 2026-11-19T12:52:45.885ZArchived source JSON
Source publication: 2026-05-08T15:41:47.000Z
Source modification: 2026-09-10T03:51:06.249ZDocument fingerprint
629f5e8110b5250c868c984f2cb08a43b89e5e626526b7f6437b0b5550344a45 - CVE ProgramConsulted: 2026-11-19T12:58:29.197ZArchived source JSON
Source publication: 2026-05-22T19:10:57.039Z
Source modification: 2026-05-26T13:10:00.845ZDocument fingerprint
5c0fa8f30b8ed010f548ace0683a02de3c39372ec77ac3b0e8b10314f3d9dbd7 - CISA KEVConsulted: 2026-11-19T17:28:52.703ZArchived source JSON
Source publication: not supplied
Source modification: 2026-11-18T19:17:41.0354ZDocument fingerprint
a35fdc67c7d9802988dcfc1d3ff1198da327948d1db122ab7692ac201055ac56 - FIRST EPSSConsulted: 2026-11-19T16:04:49.616ZArchived source JSON
Source publication: not supplied
Source modification: not suppliedDocument fingerprint
21dd983f00e8645324096731e4fb75be5ea39aa4a58a565c80b67996d366740e
Official status history
- UNKNOWN → PUBLISHED · · evidence