Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWY4Y20tMzY0Zi1xOXFo
Ensure that doorkeeper_token is valid when authenticating requests in API v2 calls
Impact
The perpetrator who previously obtained an old expired user token could use it to access Storefront API v2 endpoints.
Patches
Please upgrade to 3.7.11, 4.0.4, or 4.1.11 depending on your used Spree version.
Workarounds
In your project directory create a decorator file app/controllers/spree/api/v2/base_controller_decotatror.rb
with contents:
module Spree
module Api
module V2
module BaseControllerDecorator
private
def spree_current_user
return nil unless doorkeeper_token
return @spree_current_user if @spree_current_user
doorkeeper_authorize!
@spree_current_user ||= ::Spree.user_class.find_by(id: doorkeeper_token.resource_owner_id)
end
end
end
end
Spree::Api::V2::BaseController.prepend(Spree::Api::V2::BaseControllerDecorator)
For more information
If you have any questions or comments about this advisory:
- Email us at [email protected]
JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWY4Y20tMzY0Zi1xOXFo
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: over 3 years ago
Updated: 12 months ago
CVSS Score: 7.4
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Identifiers: GHSA-f8cm-364f-q9qh, CVE-2020-15269
References:
- https://github.com/spree/spree/security/advisories/GHSA-f8cm-364f-q9qh
- https://github.com/spree/spree/commit/e43643abfe51f54bd9208dd02298b366e9b9a847
- https://nvd.nist.gov/vuln/detail/CVE-2020-15269
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/spree/CVE-2020-15269.yml
- https://github.com/advisories/GHSA-f8cm-364f-q9qh
Blast Radius: 25.2
Affected Packages
rubygems:spree
Dependent packages: 34Dependent repositories: 2,534
Downloads: 2,298,900 total
Affected Version Ranges: >= 4.1.0, < 4.1.11, >= 4.0.0, < 4.0.4, < 3.7.11
Fixed in: 4.1.11, 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