CVE-2020-8164: Actionpack Possible Strong Parameters Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-8727-m6gj-mc37
CVSS 7.5
CWE-502
Published
Advisory Summary

CVE-2020-8164 is a HIGH (CVSS 7.5) possible strong parameters bypass vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Actionpack libraries in the RubyGems ecosystem. The issue involves possible strong parameters bypass in actionpack. Remediation is available by upgrading affected packages to version 5.2.4.3, 6.0.3.1.

CVE-2020-8164 at a Glance

CVE Identifier CVE-2020-8164
GHSA Identifier GHSA-8727-m6gj-mc37
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Actionpack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2020-8164

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: 5.2.4.3
Upgrade actionpack to 5.2.4.3
actionpack fixed: 6.0.3.1
Upgrade actionpack to 6.0.3.1
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-8164, 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 5.2.4.3), 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. 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 strong parameters bypass vector in ActionPack. Versions Affected: rails <= 6.0.3 Not affected: rails < 5.0.0 Fixed Versions: rails >= 5.2.4.3, rails >= 6.0.3.1 Impact ------ In some cases user supplied information can be inadvertently leaked from Strong Parameters. Specifically the return value of `each`, or `each_value`, or `each_pair` will return the underlying "untrusted" hash of data that was read from the parameters. Applications that use this return value may be inadvertently use untrusted user input. Impacted code will look something like this: ``` def update # Attacker has included the parameter: `{ is_admin: true }` User.update(clean_up_params) end def clean_up_params params.each { |k, v| SomeModel.check(v) if k == :name } end ``` Note the mistaken use of `each` in the `clean_up_params` method in the above example. Workarounds ----------- Do not use the return values of `each`, `each_value`, or `each_pair` in your application.

CVE-2020-8164 Affected Actionpack Versions

2 component(s)
Fixed Versions:
5.2.4.36.0.3.1
Product / Package Ecosystem Affected Versions Fixed Version
actionpack
RubyGems
≥ 5.0.0
< 5.2.4.3
5.2.4.3
actionpack
RubyGems
≥ 6.0.0
< 6.0.3.1
6.0.3.1

References

Frequently Asked Questions

What is CVE-2020-8164?
CVE-2020-8164 is a security vulnerability in Actionpack involving Possible Strong Parameters Bypass in ActionPack under CWE-502: Deserialization of Untrusted Data.
Which Actionpack versions are affected?
Affected versions include releases prior to 5.2.4.3, 6.0.3.1 across affected packages: actionpack.
What version fixes CVE-2020-8164?
Upgrading to 5.2.4.3, 6.0.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is actionpack affected?
Yes, actionpack is affected in releases prior to 5.2.4.3, 6.0.3.1. Upgrade your dependency to 5.2.4.3, 6.0.3.1 or later.
What is the CVSS score of CVE-2020-8164?
CVE-2020-8164 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2020-8164?
CVE-2020-8164 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check RubyGems dependencies for CVE-2020-8164?
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-8727-m6gj-mc37",
  "modified" : "2023-09-25T16:55:14Z",
  "published" : "2020-05-26T15:09:16Z",
  "aliases" : [ "CVE-2020-8164" ],
  "summary" : "Possible Strong Parameters Bypass in ActionPack",
  "details" : "There is a strong parameters bypass vector in ActionPack.\n\nVersions Affected:  rails <= 6.0.3\nNot affected:       rails < 5.0.0\nFixed Versions:     rails >= 5.2.4.3, rails >= 6.0.3.1\n\nImpact\n------\nIn some cases user supplied information can be inadvertently leaked from\nStrong Parameters.  Specifically the return value of `each`, or `each_value`,\nor `each_pair` will return the underlying \"untrusted\" hash of data that was\nread from the parameters.  Applications that use this return value may be\ninadvertently use untrusted user input.\n\nImpacted code will look something like this:\n\n```\ndef update\n  # Attacker has included the parameter: `{ is_admin: true }`\n  User.update(clean_up_params)\nend\n\ndef clean_up_params\n   params.each { |k, v|  SomeModel.check(v) if k == :name }\nend\n```\n\nNote the mistaken use of `each` in the `clean_up_params` method in the above\nexample.\n\nWorkarounds\n-----------\nDo not use the return values of `each`, `each_value`, or `each_pair` in your\napplication.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.2.4.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.2.4.2"
    }
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.0.3.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.3"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-8164"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/292797"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2020-8164.yml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!topic/rubyonrails-security/f6ioe4sdpbY"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/rubyonrails-security/c/f6ioe4sdpbY"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/06/msg00022.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/07/msg00013.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2020/dsa-4766"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-09/msg00089.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-09/msg00093.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-09/msg00107.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-05-26T15:06:53Z",
    "nvd_published_at" : "2020-06-19T17:15:00Z"
  }
}