Skip to content
Medium 6.1

Open Redirect in devise

CVE-2026-40295 First seen on SecPulse

Summary

Vulnerability in devise (CVE-2026-40295). Risk of unauthorized operations or information disclosure. Exploitable via Referer header. Mitigation: upgrade to 5.0.4 or later.

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-40295 has been found in devise.
Attackers can target a specific entry point like Referer header over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 6.1/10.
What to do: upgrade devise to 5.0.4 or later.
If unsure, ask your IT team or search "devise CVE-2026-40295" on the vendor's site.

CVE-2026-40295 (devise) — CWE-601 / CVSS v3 6.1
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: Referer header / Timeoutable / request.referrer / Referer
Patched: 5.0.4 — apply immediately
Workaround: None beyond upgrading.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

What is the problem

A vulnerability (CWE-601) exists in devise. Attackers reach the vulnerable code path via Referer header without authentication.

Affected scope

Check the vendor advisory for the affected versions of devise. Attack surface: Referer header / Timeoutable / request.referrer / Referer.

Severity

Severity: Medium (CVSS 6.1/10). Risk of unauthorized operations or information disclosure.

How to fix

Update to 5.0.4.

Workaround

Workaround: None beyond upgrading.

Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'devise' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposureidentify
    grep -r 'devise' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で devise を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply temporary workaroundmitigate
    None beyond upgrading.

    パッチが適用されるまでの応急処置として、None beyond upgrading. を実施。回避策の副作用 (機能低下) を確認した上で。

  3. 3
    Apply patchpatch
    Upgrade devise to 5.0.4

    ステージング環境で 5.0.4 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  4. 4
    Post-deployment verificationverify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

PackageAffected → Fixed
rubygemsdevise
< 5.0.4→ 5.0.4

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

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.

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details