CVE-2021-41275: Spree auth devise Authentication Bypass Vulnerability

CRITICAL
Advisory Identifier: GHSA-26xx-m4q2-xhq8
CVSS 9.3
CWE-352
Published
Advisory Summary

CVE-2021-41275 is a CRITICAL (CVSS 9.3) authentication bypass vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Spree auth devise libraries in the RubyGems ecosystem. The issue involves spree auth devise vulnerability allows for authentication bypass through csrf weakness. Remediation is available by upgrading affected packages to version 4.4.1, 4.2.1, 4.1.1, 4.0.1.

CVE-2021-41275 at a Glance

CVE Identifier CVE-2021-41275
GHSA Identifier GHSA-26xx-m4q2-xhq8
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Spree auth devise
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 9.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2021-41275

To remediate this vulnerability, upgrade all affected Spree auth devise dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

spree_auth_devise fixed: 4.4.1
Upgrade spree_auth_devise to 4.4.1
spree_auth_devise fixed: 4.2.1
Upgrade spree_auth_devise to 4.2.1
spree_auth_devise fixed: 4.1.1
Upgrade spree_auth_devise to 4.1.1
spree_auth_devise fixed: 4.0.1
Upgrade spree_auth_devise to 4.0.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for spree_auth_devise

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-41275, inspect your project dependencies for Spree auth devise:

inspect dependencies for spree_auth_devise

Analyze the terminal output to locate any version of Spree auth devise in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.4.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In Spree auth devise, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```ruby class ApplicationController < ActionController::Base protect_from_forgery with: :exception end ``` Add the following to`config/application.rb `to at least run the `:exception` strategy on the affected controller: ```ruby config.after_initialize do Spree::UsersController.protect_from_forgery with: :exception end ``` ### References https://github.com/solidusio/solidus_auth_devise/security/advisories/GHSA-xm34-v85h-9pg2

CVE-2021-41275 Affected Spree auth devise Versions

4 component(s)
Fixed Versions:
4.4.14.2.14.1.14.0.1
Product / Package Ecosystem Affected Versions Fixed Version
spree_auth_devise
RubyGems
≥ 4.3.0
< 4.4.1
4.4.1
spree_auth_devise
RubyGems
≥ 4.2.0
< 4.2.1
4.2.1
spree_auth_devise
RubyGems
≥ 4.1.0
< 4.1.1
4.1.1
spree_auth_devise
RubyGems
< 4.0.1
4.0.1

References

Frequently Asked Questions

What is CVE-2021-41275?
CVE-2021-41275 is a security vulnerability in Spree auth devise involving Spree Auth Devise vulnerability allows for authentication bypass through CSRF weakness under CWE-352: Cross-Site Request Forgery (CSRF).
Which Spree auth devise versions are affected?
Affected versions include releases prior to 4.4.1, 4.2.1, 4.1.1, 4.0.1 across affected packages: spree_auth_devise.
What version fixes CVE-2021-41275?
Upgrading to 4.4.1, 4.2.1, 4.1.1, 4.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spree_auth_devise affected?
Yes, spree_auth_devise is affected in releases prior to 4.4.1, 4.2.1, 4.1.1, 4.0.1. Upgrade your dependency to 4.4.1, 4.2.1, 4.1.1, 4.0.1 or later.
What is the CVSS score of CVE-2021-41275?
CVE-2021-41275 has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2021-41275?
CVE-2021-41275 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check RubyGems dependencies for CVE-2021-41275?
Run the dependency tree command: 'inspect dependencies for spree_auth_devise'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-26xx-m4q2-xhq8",
  "modified" : "2025-07-01T17:28:05Z",
  "published" : "2021-11-18T20:14:19Z",
  "aliases" : [ "CVE-2021-41275" ],
  "summary" : "Spree Auth Devise vulnerability allows for authentication bypass through CSRF weakness",
  "details" : "### Impact\n\nCSRF vulnerability that allows user account takeover.\n\nAll applications using any version of the frontend component of `spree_auth_devise` are affected if `protect_from_forgery` method is both:\n\n* Executed whether as:\n  * A before_action callback (the default)\n  * A prepend_before_action (option prepend: true given) before the :load_object hook in Spree::UserController (most likely order to find).\n* 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).\n\nThat means that applications that haven't been configured differently from what it's generated with Rails aren't affected.\n\nThanks @waiting-for-dev for reporting and providing a patch 👏 \n\n### Patches\n\nSpree 4.3 users should update to spree_auth_devise 4.4.1\nSpree 4.2 users should update to spree_auth_devise 4.2.1\nSpree 4.1 users should update to spree_auth_devise 4.1.1\nOlder Spree version users should update to spree_auth_devise 4.0.1\n \n### Workarounds\n\nIf possible, change your strategy to :exception:\n\n```ruby\nclass ApplicationController < ActionController::Base\n  protect_from_forgery with: :exception\nend\n```\n\nAdd the following to`config/application.rb `to at least run the `:exception` strategy on the affected controller:\n\n```ruby\nconfig.after_initialize do\n  Spree::UsersController.protect_from_forgery with: :exception\nend\n```\n\n### References\nhttps://github.com/solidusio/solidus_auth_devise/security/advisories/GHSA-xm34-v85h-9pg2",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "spree_auth_devise"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.3.0"
      }, {
        "fixed" : "4.4.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "spree_auth_devise"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2.0"
      }, {
        "fixed" : "4.2.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "spree_auth_devise"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "spree_auth_devise"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/solidusio/solidus_auth_devise/security/advisories/GHSA-xm34-v85h-9pg2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spree/spree_auth_devise/security/advisories/GHSA-26xx-m4q2-xhq8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spree/spree_auth_devise/security/advisories/GHSA-6mqr-q86q-6gwr"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spree/spree_auth_devise/security/advisories/GHSA-8xfw-5q82-3652"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spree/spree_auth_devise/security/advisories/GHSA-gpqc-4pp7-5954"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41275"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spree/spree_auth_devise/commit/adf6ed4cd94d66091776b5febd4ff3767362de63"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/spree_auth_devise/CVE-2021-41275.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spree/spree_auth_devise"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-17T21:07:45Z",
    "nvd_published_at" : "2021-11-17T20:15:00Z"
  }
}