CVE-2020-15269: Spree Ensure That Doorkeeper_token Is Valid Vulnerability

HIGH
Advisory Identifier: GHSA-f8cm-364f-q9qh
CVSS 7.4
CWE-613 CWE-287
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2020-15269
GHSA Identifier GHSA-f8cm-364f-q9qh
Severity HIGH
CVSS v3.1 Base Score 7.4
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product Spree
Package Ecosystem RubyGems
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (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.

spree fixed: 3.7.11
Upgrade spree to 3.7.11
spree fixed: 4.0.4
Upgrade spree to 4.0.4
spree fixed: 4.1.11
Upgrade spree to 4.1.11
Verify Direct and Transitive Dependencies

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

### 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: ```ruby 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 [security@spreecommerce.org](mailto:security@spreecommerce.org)

CVE-2020-15269 Affected Spree Versions

3 component(s)
Fixed Versions:
3.7.114.0.44.1.11
Product / Package Ecosystem Affected Versions Fixed Version
spree
RubyGems
< 3.7.11
3.7.11
spree
RubyGems
≥ 4.0.0
< 4.0.4
4.0.4
spree
RubyGems
≥ 4.1.0
< 4.1.11
4.1.11

References

Frequently Asked Questions

What is CVE-2020-15269?
CVE-2020-15269 is a security vulnerability in Spree involving Ensure that doorkeeper_token is valid when authenticating requests in API v2 calls under CWE-613: Insufficient Session Expiration.
Which Spree versions are affected?
Affected versions include releases prior to 3.7.11, 4.0.4, 4.1.11 across affected packages: spree.
What version fixes CVE-2020-15269?
Upgrading to 3.7.11, 4.0.4, 4.1.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spree affected?
Yes, spree is affected in releases prior to 3.7.11, 4.0.4, 4.1.11. Upgrade your dependency to 3.7.11, 4.0.4, 4.1.11 or later.
What is the CVSS score of CVE-2020-15269?
CVE-2020-15269 has a CVSS v3.1 base score of 7.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2020-15269?
CVE-2020-15269 is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check RubyGems dependencies for CVE-2020-15269?
Run the dependency tree command: 'inspect dependencies for spree'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}