CVE-2020-15269: Spree Ensure That Doorkeeper_token Is Valid Vulnerability
HIGHCVE-2020-15269 is a HIGH (CVSS 7.4) ensure that doorkeeper_token is valid vulnerability (CWE-613: Insufficient Session Expiration) affecting Spree libraries in the RubyGems ecosystem. The issue involves ensure that doorkeeper_token is valid when authenticating requests in api v2 calls. Remediation is available by upgrading affected packages to version 3.7.11, 4.0.4, 4.1.11.
CVE-2020-15269 at a Glance
Security Impact
CVSS: 7.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2020-15269
To remediate this vulnerability, upgrade all affected Spree dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade spree to 3.7.11
Upgrade spree to 4.0.4
Upgrade spree to 4.1.11
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for spree
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-15269, inspect your project dependencies for Spree:
inspect dependencies for spree
Analyze the terminal output to locate any version of Spree in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.11), 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-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In Spree, 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
CVE-2020-15269 Affected Spree Versions
3 component(s)References
Frequently Asked Questions
What is CVE-2020-15269?
Which Spree versions are affected?
What version fixes CVE-2020-15269?
Is spree affected?
What is the CVSS score of CVE-2020-15269?
What CWE is associated with CVE-2020-15269?
How can I check RubyGems dependencies for CVE-2020-15269?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f8cm-364f-q9qh",
"modified" : "2021-11-19T13:51:14Z",
"published" : "2020-10-20T20:03:52Z",
"aliases" : [ "CVE-2020-15269" ],
"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)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "spree"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.7.11"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "spree"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.0.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "spree"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.1.0"
}, {
"fixed" : "4.1.11"
} ]
} ]
} ],
"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"
} ],
"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"
}
}