{"id":"CVE-2021-41275","aliases":["CVE-2021-41275","GHSA-26xx-m4q2-xhq8"],"related":[],"kind":"vulnerability","state":"published","title":"Authentication Bypass by CSRF Weakness","summary":"spree_auth_devise is an open source library which provides authentication and authorization services for use with the Spree storefront framework by using an underlying Devise authentication framework. In affected versions spree_auth_devise is subject to a 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). Users are advised to update their spree_auth_devise gem. For users unable to update it may be possible to change your strategy to :exception. Please see the linked GHSA for more workaround details. ### 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 ### 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","summarySource":"cvelist","descriptions":[{"lang":"en","text":"spree_auth_devise is an open source library which provides authentication and authorization services for use with the Spree storefront framework by using an underlying Devise authentication framework. In affected versions spree_auth_devise is subject to a 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). Users are advised to update their spree_auth_devise gem. For users unable to update it may be possible to change your strategy to :exception. Please see the linked GHSA for more workaround details. ### 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 ### 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","source":"cvelist"},{"lang":"en","text":"### 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","format":"markdown","source":"ghsa"},{"lang":"es","text":"spree_auth_devise es una librería de código abierto que proporciona servicios de autenticación y autorización para su uso con el marco de trabajo de la tienda Spree mediante el uso de un marco de trabajo de autenticación Devise subyacente. En las versiones afectadas, spree_auth_devise está sujeto a una vulnerabilidad CSRF que permite la toma de posesión de cuentas de usuario. Todas las aplicaciones que utilizan cualquier versión del componente frontend de spree_auth_devise están afectadas si el método protect_from_forgery es ambos: Se ejecuta como: Un callback before_action (el predeterminado). Un prepend_before_action (opción prepend: true dada) antes del hook :load_object en Spree::UserController (orden más probable de encontrar). Configurado para utilizar las estrategias :null_session o :reset_session (:null_session es la predeterminada en caso de que no se dé ninguna estrategia, pero los raíles --nuevo esqueleto generado utilizan :exception). Se recomienda a los usuarios que actualicen su gema spree_auth_devise. Para los usuarios que no puedan actualizar, puede ser posible cambiar su estrategia a :exception. Por favor, consulte el GHSA vinculado para más detalles de la solución. ### Impacto Vulnerabilidad CSRF que permite la toma de cuenta del usuario. Todas las aplicaciones que utilizan cualquier versión del componente frontend de `spree_auth_devise` están afectadas si el método `protect_from_forgery` es a la vez: * Se ejecuta ya sea como: * Un callback before_action (el predeterminado) * Un prepend_before_action (opción prepend: true dada) antes del hook :load_object en Spree::UserController (orden más probable de encontrar). * Configurado para usar las estrategias :null_session o :reset_session (:null_session es la predeterminada en caso de que no se dé ninguna estrategia, pero el esqueleto generado por rails --new usa :exception). Eso significa que las aplicaciones que no han sido configuradas de forma diferente a la generada con Rails no se ven afectadas. Gracias @waiting-for-dev por informar y proporcionar un parche ? ### Parches Los usuarios de Spree 4.3 deben actualizar a spree_auth_devise 4.4.1 Los usuarios de Spree 4.2 deben actualizar a spree_auth_devise 4.2.1 ### Soluciones Si es posible, cambia tu estrategia a :exception: ```ruby class ApplicationController &lt; ActionController::Base protect_from_forgery with: :exception end ``` Añade lo siguiente a `config/application. rb ``para ejecutar al menos la estrategia `:exception` en el controlador afectado: ```ruby config.after_initialize do Spree::UsersController.protect_from_forgery with: :exception end ``` ### Referencias https://github.com/solidusio/solidus_auth_devise/security/advisories/GHSA-xm34-v85h-9pg2","source":"nvd"}],"published":"2021-11-17T19:50:11.000Z","modified":"2026-07-08T06:29:30.052Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","score":6.8,"rating":"MEDIUM"}],"cwes":["CWE-352"],"affected":[{"ranges":[{"version":">= 4.3.0, < 4.4.1","status":"affected"},{"version":">= 4.2.0, < 4.2.1","status":"affected"},{"version":">= 4.1.0, < 4.1.1","status":"affected"},{"version":"< 4.0.1","status":"affected"}],"vendor":"spree","product":"spree_auth_devise","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"4.3.0","status":"affected","fixed":"4.4.1"}],"ecosystem":"RubyGems","package":"spree_auth_devise","purl":"pkg:gem/spree_auth_devise","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.2.0","status":"affected","fixed":"4.2.1"}],"ecosystem":"RubyGems","package":"spree_auth_devise","purl":"pkg:gem/spree_auth_devise","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.1.0","status":"affected","fixed":"4.1.1"}],"ecosystem":"RubyGems","package":"spree_auth_devise","purl":"pkg:gem/spree_auth_devise","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.0.1"}],"ecosystem":"RubyGems","package":"spree_auth_devise","purl":"pkg:gem/spree_auth_devise","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"4.0.1"},{"status":"affected","introduced":"4.3.0","fixed":"4.4.1"},{"status":"affected","version":"4.1.0"},{"status":"affected","version":"4.1.0"},{"status":"affected","version":"4.2.0"}],"vendor":"spreecommerce","product":"spree_auth_devise","cpe":"cpe:2.3:a:spreecommerce:spree_auth_devise:*:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://github.com/spree/spree_auth_devise/security/advisories/GHSA-26xx-m4q2-xhq8","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/spree/spree_auth_devise/commit/adf6ed4cd94d66091776b5febd4ff3767362de63","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/solidusio/solidus_auth_devise/security/advisories/GHSA-xm34-v85h-9pg2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/spree/spree_auth_devise/security/advisories/GHSA-6mqr-q86q-6gwr","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/spree/spree_auth_devise/security/advisories/GHSA-8xfw-5q82-3652","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/spree/spree_auth_devise/security/advisories/GHSA-gpqc-4pp7-5954","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41275","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/spree_auth_devise/CVE-2021-41275.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/spree/spree_auth_devise","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-41275","url":"https://www.cve.org/CVERecord?id=CVE-2021-41275","licence":"CVE Terms of Use","modified":"2024-08-04T03:08:31.652Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-26xx-m4q2-xhq8","url":"https://github.com/advisories/GHSA-26xx-m4q2-xhq8","licence":"CC-BY-4.0","modified":"2026-07-08T06:29:30.052Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-41275","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41275","licence":"Public domain","modified":"2026-06-17T04:08:13.250Z"}],"updatedAt":"2026-11-25T22:58:05.642Z","epss":{"score":0.00646,"percentile":0.52304,"date":"2026-12-02T12:00:21.000Z"}}