Cross-Site Request Forgery (CSRF) in spree_auth_devise (CVE-2021-41275)
Summary
Vulnerability in spree_auth_devise (CVE-2021-41275). Confidential information can be exposed externally. Exploitable via spree_auth_devise. Mitigation: upgrade to 4.0.1 or later.
Original description
The description as published by the source.
Impact
CSRF vulnerability that allows user account takeover.
All applications using any version of the frontend component of spree_auth_devise are affected if protect_from_forgery method is both:
- Executed whether as:
- A before_action callback (the default)
- A prepend_before_action (option prepend: true given) before the :load_object hook in Spree::UserController (most likely order to find).
- Configured to use :null_session or :reset_session strategies (:null_session is the default in case the no strategy is given, but rails --new generated skeleton use :exception).
That means that applications that haven't been configured differently from what it's generated with Rails aren't affected.
Thanks @waiting-for-dev for reporting and providing a patch 👏
Patches
Spree 4.3 users should update to spree_auth_devise 4.4.1
Spree 4.2 users should update to spree_auth_devise 4.2.1
Spree 4.1 users should update to spree_auth_devise 4.1.1
Older Spree version users should update to spree_auth_devise 4.0.1
Workarounds
If possible, change your strategy to :exception:
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
Add the following toconfig/application.rb to at least run the :exception strategy on the affected controller:
config.after_initialize do
Spree::UsersController.protect_from_forgery with: :exception
end
References
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
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-2021-41275 has been found in spree_auth_devise.
Attackers can target a specific entry point like spree_auth_devise over the network to misuse the product.
Confidential information can be exposed externally.
What to do: upgrade spree_auth_devise to 4.0.1 or later.
If unsure, ask your IT team or search "spree_auth_devise CVE-2021-41275" on the vendor's site.
CVE-2021-41275 (spree_auth_devise) — CWE-352
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: spree_auth_devise / protect_from_forgery
Patched: 4.0.1 — apply immediately
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.
CSRF (CWE-352) exists in spree_auth_devise. Attackers reach the vulnerable code path via spree_auth_devise without authentication.
Check the vendor advisory for the affected versions of spree_auth_devise. Attack surface: spree_auth_devise / protect_from_forgery.
Severity: ?. Confidential information can be exposed externally.
Update to 4.0.1.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'spree_auth_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
-
1Identify exposure identify
grep -r 'spree_auth_devise' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
spree_auth_deviseを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade spree_auth_devise to 4.0.1ステージング環境で 4.0.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com