{ "id": "CVE-2021-41275", "sourceIdentifier": "security-advisories@github.com", "published": "2021-11-17T20:15:10.527", "lastModified": "2024-11-21T06:25:56.670", "vulnStatus": "Modified", "cveTags": [], "descriptions": [ { "lang": "en", "value": "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 \ufffd\ufffd ### 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" }, { "lang": "es", "value": "spree_auth_devise es una librer\u00eda de c\u00f3digo abierto que proporciona servicios de autenticaci\u00f3n y autorizaci\u00f3n para su uso con el marco de trabajo de la tienda Spree mediante el uso de un marco de trabajo de autenticaci\u00f3n Devise subyacente. En las versiones afectadas, spree_auth_devise est\u00e1 sujeto a una vulnerabilidad CSRF que permite la toma de posesi\u00f3n de cuentas de usuario. Todas las aplicaciones que utilizan cualquier versi\u00f3n del componente frontend de spree_auth_devise est\u00e1n afectadas si el m\u00e9todo protect_from_forgery es ambos: Se ejecuta como: Un callback before_action (el predeterminado). Un prepend_before_action (opci\u00f3n prepend: true dada) antes del hook :load_object en Spree::UserController (orden m\u00e1s 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\u00e9 ninguna estrategia, pero los ra\u00edles --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\u00e1s detalles de la soluci\u00f3n. ### Impacto Vulnerabilidad CSRF que permite la toma de cuenta del usuario. Todas las aplicaciones que utilizan cualquier versi\u00f3n del componente frontend de `spree_auth_devise` est\u00e1n afectadas si el m\u00e9todo `protect_from_forgery` es a la vez: * Se ejecuta ya sea como: * Un callback before_action (el predeterminado) * Un prepend_before_action (opci\u00f3n prepend: true dada) antes del hook :load_object en Spree::UserController (orden m\u00e1s 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\u00e9 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 < ActionController::Base protect_from_forgery with: :exception end ``` A\u00f1ade 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" } ], "metrics": { "cvssMetricV31": [ { "source": "security-advisories@github.com", "type": "Secondary", "cvssData": { "version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N", "baseScore": 9.3, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE" }, "exploitabilityScore": 2.8, "impactScore": 5.8 }, { "source": "nvd@nist.gov", "type": "Primary", "cvssData": { "version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH" }, "exploitabilityScore": 2.8, "impactScore": 5.9 } ], "cvssMetricV2": [ { "source": "nvd@nist.gov", "type": "Primary", "cvssData": { "version": "2.0", "vectorString": "AV:N/AC:M/Au:N/C:P/I:P/A:P", "baseScore": 6.8, "accessVector": "NETWORK", "accessComplexity": "MEDIUM", "authentication": "NONE", "confidentialityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "availabilityImpact": "PARTIAL" }, "baseSeverity": "MEDIUM", "exploitabilityScore": 8.6, "impactScore": 6.4, "acInsufInfo": false, "obtainAllPrivilege": false, "obtainUserPrivilege": false, "obtainOtherPrivilege": false, "userInteractionRequired": true } ] }, "weaknesses": [ { "source": "security-advisories@github.com", "type": "Secondary", "description": [ { "lang": "en", "value": "CWE-352" } ] }, { "source": "nvd@nist.gov", "type": "Primary", "description": [ { "lang": "en", "value": "CWE-352" } ] } ], "configurations": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:a:spreecommerce:spree_auth_devise:*:*:*:*:*:ruby:*:*", "versionEndIncluding": "4.0.1", "matchCriteriaId": "1B29C2AC-BE4D-4BA9-9EE6-F10E3DB02F3A" }, { "vulnerable": true, "criteria": "cpe:2.3:a:spreecommerce:spree_auth_devise:*:*:*:*:*:ruby:*:*", "versionStartIncluding": "4.3.0", "versionEndExcluding": "4.4.1", "matchCriteriaId": "1779B068-94FF-47BC-8A5D-FF423AC1DEF4" }, { "vulnerable": true, "criteria": "cpe:2.3:a:spreecommerce:spree_auth_devise:4.1.0:-:*:*:*:ruby:*:*", "matchCriteriaId": "D26C42FF-BA82-45FC-994A-383C5C1E5E81" }, { "vulnerable": true, "criteria": "cpe:2.3:a:spreecommerce:spree_auth_devise:4.1.0:rc1:*:*:*:ruby:*:*", "matchCriteriaId": "6D1DB81F-F324-48AE-9641-4862AB5F2304" }, { "vulnerable": true, "criteria": "cpe:2.3:a:spreecommerce:spree_auth_devise:4.2.0:*:*:*:*:ruby:*:*", "matchCriteriaId": "F6936681-9A4A-4876-B918-4D9585CF6B3A" } ] } ] } ], "references": [ { "url": "https://github.com/spree/spree_auth_devise/commit/adf6ed4cd94d66091776b5febd4ff3767362de63", "source": "security-advisories@github.com", "tags": [ "Patch", "Third Party Advisory" ] }, { "url": "https://github.com/spree/spree_auth_devise/security/advisories/GHSA-26xx-m4q2-xhq8", "source": "security-advisories@github.com", "tags": [ "Third Party Advisory" ] }, { "url": "https://github.com/spree/spree_auth_devise/commit/adf6ed4cd94d66091776b5febd4ff3767362de63", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": [ "Patch", "Third Party Advisory" ] }, { "url": "https://github.com/spree/spree_auth_devise/security/advisories/GHSA-26xx-m4q2-xhq8", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": [ "Third Party Advisory" ] } ] }