PatchSiren

heartcombo CVE debriefs

These pages are published after PatchSiren validates generated defensive summaries against stored public CVE and source evidence.

MEDIUM heartcombo CVE published 2026-05-22

CVE-2026-40295

## Summary Devise versions ≤5.0.3 contain an open-redirect vulnerability in the Timeoutable module. When a non-GET request triggers a session timeout, `FailureApp#redirect_url` returns the attacker-controllable HTTP Referer header without validation, enabling silent cross-origin redirects to arbitrary external URLs. This bypasses Rails' built-in open-redirect protections because `Devise::FailureApp` is an isolated `ActionController::Metal` app with its own configuration. ## Technical Details - **Affected Component**: `Devise::FailureApp#redirect_url` method when Timeoutable is enabled - **Root Cause**: The method returns `request.referrer` (HTTP Referer header) for non-GET timeout redirects without sanitization - **Protected Paths**: GET timeout redirects use server-side `attempted_path`; Devise's `store_location_for` uses `extract_path_from_location` to strip external hosts - **Bypass Mechanism**: Rails' `config.action_controller.action_on_open_redirect` and `raise_on_open_redirects` settings do not affect `Devise::FailureApp` due to its isolated `ActionController::Metal` implementation ## Attack Scenario An attacker hosts a page with an auto-submitting cross-origin form. When a victim with an expired Devise session submits a non-GET request, they are silently redirected to an attacker-controlled URL without browser warnings, enabling phishing and malware delivery. ## Affected Versions - **Vulnerable**: Devise ≤5.0.3 - **Fixed**: Devise 5.0.4 ## CVSS 3.1 Score **6.1 (MEDIUM)** — CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N ## Detection Guidance - Review application logs for unexpected external redirects following 401/403 responses on non-GET requests - Monitor for anomalous Referer headers in timeout scenarios - Audit Devise version in `Gemfile.lock` ## Remediation Upgrade to Devise 5.0.4 or later. The fix commit validates or sanitizes the redirect URL before returning it in timeout scenarios. ## References - GitHub Security Advisory: GHSA-jp94-3292-c3xv - Fix commit: 025fe2124f9928766fc46520e999633b598d0360