CVE-2020-8185: Actionpack Untrusted Users Can Run Pending Vulnerability

MODERATE
Advisory Identifier: GHSA-c6qr-h5vq-59jc
CVSS 6.5
CWE-400
Published
Advisory Summary

CVE-2020-8185 is a MODERATE (CVSS 6.5) untrusted users can run pending vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Actionpack libraries in the RubyGems ecosystem. The issue involves untrusted users can run pending migrations in production in rails. Remediation is available by upgrading affected packages to version 6.0.3.2.

CVE-2020-8185 at a Glance

CVE Identifier CVE-2020-8185
GHSA Identifier GHSA-c6qr-h5vq-59jc
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Actionpack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2020-8185

To remediate this vulnerability, upgrade all affected Actionpack dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

actionpack fixed: 6.0.3.2
Upgrade actionpack to 6.0.3.2
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 actionpack

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-8185, inspect your project dependencies for Actionpack:

inspect dependencies for actionpack

Analyze the terminal output to locate any version of Actionpack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.0.3.2), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Actionpack, 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

There is a vulnerability in versions of Rails prior to 6.0.3.2 that allowed an untrusted user to run any pending migrations on a Rails app running in production. This vulnerability has been assigned the CVE identifier CVE-2020-8185. Versions Affected: 6.0.0 < rails < 6.0.3.2 Not affected: Applications with `config.action_dispatch.show_exceptions = false` (this is not a default setting in production) Fixed Versions: rails >= 6.0.3.2 Impact ------ Using this issue, an attacker would be able to execute any migrations that are pending for a Rails app running in production mode. It is important to note that an attacker is limited to running migrations the application developer has already defined in their application and ones that have not already run. Workarounds ----------- Until such time as the patch can be applied, application developers should disable the ActionDispatch middleware in their production environment via a line such as this one in their config/environment/production.rb: `config.middleware.delete ActionDispatch::ActionableExceptions`

CVE-2020-8185 Affected Actionpack Versions

1 component(s)
Fixed Versions:
6.0.3.2
Product / Package Ecosystem Affected Versions Fixed Version
actionpack
RubyGems
≥ 6.0.0
< 6.0.3.2
6.0.3.2

References

Frequently Asked Questions

What is CVE-2020-8185?
CVE-2020-8185 is a security vulnerability in Actionpack involving Untrusted users can run pending migrations in production in Rails under CWE-400: Uncontrolled Resource Consumption.
Which Actionpack versions are affected?
Affected versions include releases prior to 6.0.3.2 across affected packages: actionpack.
What version fixes CVE-2020-8185?
Upgrading to 6.0.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is actionpack affected?
Yes, actionpack is affected in releases prior to 6.0.3.2. Upgrade your dependency to 6.0.3.2 or later.
What is the CVSS score of CVE-2020-8185?
CVE-2020-8185 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2020-8185?
CVE-2020-8185 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check RubyGems dependencies for CVE-2020-8185?
Run the dependency tree command: 'inspect dependencies for actionpack'. 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-c6qr-h5vq-59jc",
  "modified" : "2023-07-05T20:24:19Z",
  "published" : "2020-06-24T17:40:33Z",
  "aliases" : [ "CVE-2020-8185" ],
  "summary" : "Untrusted users can run pending migrations in production in Rails",
  "details" : "There is a vulnerability in versions of Rails prior to 6.0.3.2 that allowed an untrusted user to run any pending migrations on a Rails app running in production.\n\nThis vulnerability has been assigned the CVE identifier CVE-2020-8185.\n\nVersions Affected:  6.0.0 < rails < 6.0.3.2\nNot affected:       Applications with `config.action_dispatch.show_exceptions = false` (this is not a default setting in production)\nFixed Versions:     rails >= 6.0.3.2\n\nImpact\n------\n\nUsing this issue, an attacker would be able to execute any migrations that are pending for a Rails app running in production mode. It is important to note that an attacker is limited to running migrations the application developer has already defined in their application and ones that have not already run.\n\nWorkarounds\n-----------\n\nUntil such time as the patch can be applied, application developers should disable the ActionDispatch middleware in their production environment via a line such as this one in their config/environment/production.rb:\n\n`config.middleware.delete ActionDispatch::ActionableExceptions`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.0.3.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.3.1"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-8185"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/2121b9d20b60ed503aa041ef7b926d331ed79fc2"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/899069"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2020-8185.yml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/rubyonrails-security/c/pAe9EV8gbM0"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XJ7NUWXAEVRQCROIIBV4C6WXO6IR3KSB"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-24T17:33:58Z",
    "nvd_published_at" : "2020-07-02T19:15:00Z"
  }
}