{"id":"GHSA-f8cm-364f-q9qh","summary":"Ensure that doorkeeper_token is valid when authenticating requests in API v2 calls","details":"### Impact\nThe perpetrator who previously obtained an old expired user token could use it to access Storefront API v2 endpoints. \n\n### Patches\nPlease upgrade to 3.7.11, 4.0.4, or 4.1.11 depending on your used Spree version. \n\n### Workarounds\nIn your project directory create a decorator file `app/controllers/spree/api/v2/base_controller_decotatror.rb` with contents:\n\n```ruby\nmodule Spree\n  module Api\n    module V2\n      module BaseControllerDecorator\n        private\n\n        def spree_current_user\n          return nil unless doorkeeper_token\n          return @spree_current_user if @spree_current_user\n\n          doorkeeper_authorize!\n\n          @spree_current_user ||= ::Spree.user_class.find_by(id: doorkeeper_token.resource_owner_id)\n        end\n     end\n  end\nend\n\nSpree::Api::V2::BaseController.prepend(Spree::Api::V2::BaseControllerDecorator)\n```\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [security@spreecommerce.org](mailto:security@spreecommerce.org)","aliases":["CVE-2020-15269"],"modified":"2026-05-07T05:00:47.209709858Z","published":"2020-10-20T20:03:52Z","database_specific":{"cwe_ids":["CWE-287","CWE-613"],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2020-10-20T20:03:19Z","nvd_published_at":"2020-10-20T21:15:00Z"},"references":[{"type":"WEB","url":"https://github.com/spree/spree/security/advisories/GHSA-f8cm-364f-q9qh"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-15269"},{"type":"WEB","url":"https://github.com/spree/spree/commit/e43643abfe51f54bd9208dd02298b366e9b9a847"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/spree/CVE-2020-15269.yml"},{"type":"PACKAGE","url":"https://github.com/spree/spree"}],"affected":[{"package":{"name":"spree","ecosystem":"RubyGems","purl":"pkg:gem/spree"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.7.11"}]}],"versions":["0.0.5","0.0.6","0.0.7","0.0.8","0.0.9","0.10.0","0.10.0.beta","0.10.1","0.10.2","0.11.0","0.11.1","0.11.2","0.11.3","0.11.4","0.2.0","0.30.0","0.30.0.beta1","0.30.1","0.30.2","0.4.0","0.4.1","0.40.0","0.40.1","0.40.2","0.40.3","0.40.4","0.5.0","0.5.1","0.50.0","0.50.1","0.50.2","0.50.3","0.50.4","0.6.0","0.60.0","0.60.0.RC1","0.60.1","0.60.2","0.60.3","0.60.4","0.60.5","0.60.6","0.7.0","0.7.1","0.70.0","0.70.0.rc2","0.70.1","0.70.2","0.70.3","0.70.4","0.70.5","0.70.6","0.70.7","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.8.5","0.9.0","0.9.1","0.9.2","0.9.3","0.9.4","1.0.0","1.0.0.rc1","1.0.0.rc2","1.0.0.rc3","1.0.0.rc4","1.0.1","1.0.2","1.0.3","1.0.4","1.0.6","1.0.7","1.1.0","1.1.0.rc1","1.1.0.rc2","1.1.1","1.1.2","1.1.2.rc1","1.1.3","1.1.4","1.1.5","1.1.6","1.2.0","1.2.0.rc1","1.2.0.rc2","1.2.2","1.2.3","1.2.4","1.2.5","1.3.0","1.3.0.rc1","1.3.0.rc2","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","2.0.0","2.0.0.rc1","2.0.1","2.0.10","2.0.11","2.0.12","2.0.13","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.1.0","2.1.1","2.1.10","2.1.11","2.1.12","2.1.2","2.1.3","2.1.4","2.1.5","2.1.6","2.1.7","2.1.8","2.1.9","2.2.0","2.2.1","2.2.10","2.2.11","2.2.12","2.2.13","2.2.14","2.2.2","2.2.3","2.2.4","2.2.5","2.2.6","2.2.7","2.2.8","2.2.9","2.3.0","2.3.1","2.3.10","2.3.11","2.3.12","2.3.13","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.3.9","2.4.0","2.4.0.rc1","2.4.0.rc2","2.4.0.rc3","2.4.1","2.4.10","2.4.2","2.4.3","2.4.4","2.4.5","2.4.6","2.4.7","2.4.8","2.4.9","3.0.0","3.0.0.rc1","3.0.0.rc3","3.0.0.rc4","3.0.1","3.0.10","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.0.6.1","3.0.7","3.0.8","3.0.9","3.1.0","3.1.0.rc1","3.1.0.rc2","3.1.0.rc3","3.1.0.rc4","3.1.1","3.1.10","3.1.11","3.1.12","3.1.13","3.1.14","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9","3.2.0","3.2.0.rc1","3.2.0.rc2","3.2.0.rc3","3.2.1","3.2.2","3.2.3","3.2.4","3.2.5","3.2.6","3.2.7","3.2.8","3.2.9","3.3.0","3.3.0.rc1","3.3.0.rc2","3.3.0.rc3","3.3.0.rc4","3.3.1","3.3.2","3.3.3","3.3.4","3.3.5","3.3.6","3.4.0","3.4.0.rc1","3.4.0.rc2","3.4.1","3.4.2","3.4.3","3.4.4","3.4.5","3.4.6","3.5.0","3.5.0.rc1","3.5.0.rc2","3.6.0","3.6.0.rc1","3.6.1","3.6.2","3.6.3","3.6.4","3.6.5","3.6.6","3.7.0","3.7.0.rc1","3.7.0.rc2","3.7.0.rc3","3.7.1","3.7.10","3.7.2","3.7.3","3.7.4","3.7.5","3.7.6","3.7.7","3.7.8","3.7.9"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/10/GHSA-f8cm-364f-q9qh/GHSA-f8cm-364f-q9qh.json"}},{"package":{"name":"spree","ecosystem":"RubyGems","purl":"pkg:gem/spree"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"4.0.4"}]}],"versions":["4.0.0","4.0.1","4.0.2","4.0.3"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/10/GHSA-f8cm-364f-q9qh/GHSA-f8cm-364f-q9qh.json"}},{"package":{"name":"spree","ecosystem":"RubyGems","purl":"pkg:gem/spree"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.1.0"},{"fixed":"4.1.11"}]}],"versions":["4.1.0","4.1.1","4.1.10","4.1.2","4.1.3","4.1.4","4.1.5","4.1.6","4.1.7","4.1.8","4.1.9"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/10/GHSA-f8cm-364f-q9qh/GHSA-f8cm-364f-q9qh.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N"}]}