CVE-2026-40295
Last modified
CVE-2026-40295 is a medium-severity vulnerability rated 6.1/10 on the CVSS scale. 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. EPSS estimates a 0.24% chance of exploitation in the next 30 days.
Description
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.
Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weakness Enumeration
Affected Software
| Vendor | Product | Versions |
|---|---|---|
| Heartcombo | Devise | < 5.0.4 |
References
Timeline
- Published
- Last Modified
- Status
- Analyzed
Frequently Asked Questions
What is CVE-2026-40295?
How severe is CVE-2026-40295?
How do I fix CVE-2026-40295?
How Strix Helps
- One Click Account Takeover in GranolaHow a notification link broke out of Electron and led to a one-click account takeover.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2026
- CVE-2026-40288PraisonAI is a multi-agent teams system. In versions below 4…9.8
- CVE-2026-40289PraisonAI is a multi-agent teams system. In versions below 4…9.1
- CVE-2026-4029The Database Backup for WordPress plugin for WordPress is vu…7.5
- CVE-2026-40290OP-TEE is a Trusted Execution Environment (TEE) designed as …7.8
- CVE-2026-40291Chamilo LMS is an open-source learning management system. In…8.8
- CVE-2026-40293OpenFGA is an authorization/permission engine built for deve…6.5
- CVE-2026-40296PhpSpreadsheet is a pure PHP library for reading and writing…5.4
- CVE-2026-40299next-intl provides internationalization for Next.js. Applica…6.9
- CVE-2026-4030The Database Backup for WordPress plugin for WordPress is vu…8.1
- CVE-2026-40300Zulip is an open-source team collaboration tool. Prior to 12…6.5
- CVE-2026-40301DOMSanitizer is a DOM/SVG/MathML Sanitizer for PHP 7.3+. Pri…4.7
- CVE-2026-40302zrok is software for sharing web services, files, and networ…6.1
Are you affected by CVE-2026-40295?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
