CVE-2020-8167: Actionview CSRF Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-xq5j-gw7f-jgj8
CVSS 6.5
CWE-352
Published
Advisory Summary

CVE-2020-8167 is a MODERATE (CVSS 6.5) csrf vulnerability vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Actionview libraries in the RubyGems ecosystem. The issue involves csrf vulnerability in rails-ujs. Remediation is available by upgrading affected packages to version 5.2.4.3, 6.0.3.1.

CVE-2020-8167 at a Glance

CVE Identifier CVE-2020-8167
GHSA Identifier GHSA-xq5j-gw7f-jgj8
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Actionview
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:N/UI:R/S:U/C:N/I:H/A:N).

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

How to Fix CVE-2020-8167

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

actionview fixed: 5.2.4.3
Upgrade actionview to 5.2.4.3
actionview fixed: 6.0.3.1
Upgrade actionview 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 actionview

How to Check if You Are Affected

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

inspect dependencies for actionview

Analyze the terminal output to locate any version of Actionview 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-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In Actionview, 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 rails-ujs that allows attackers to send CSRF tokens to wrong domains. Versions Affected: rails <= 6.0.3 Not affected: Applications which don't use rails-ujs. Fixed Versions: rails >= 5.2.4.3, rails >= 6.0.3.1 Impact ------ This is a regression of CVE-2015-1840. In the scenario where an attacker might be able to control the href attribute of an anchor tag or the action attribute of a form tag that will trigger a POST action, the attacker can set the href or action to a cross-origin URL, and the CSRF token will be sent. Workarounds ----------- To work around this problem, change code that allows users to control the href attribute of an anchor tag or the action attribute of a form tag to filter the user parameters. For example, code like this: link_to params to code like this: link_to filtered_params def filtered_params # Filter just the parameters that you trust end

CVE-2020-8167 Affected Actionview Versions

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

References

Frequently Asked Questions

What is CVE-2020-8167?
CVE-2020-8167 is a security vulnerability in Actionview involving CSRF Vulnerability in rails-ujs under CWE-352: Cross-Site Request Forgery (CSRF).
Which Actionview versions are affected?
Affected versions include releases prior to 5.2.4.3, 6.0.3.1 across affected packages: actionview.
What version fixes CVE-2020-8167?
Upgrading to 5.2.4.3, 6.0.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is actionview affected?
Yes, actionview 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-8167?
CVE-2020-8167 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2020-8167?
CVE-2020-8167 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check RubyGems dependencies for CVE-2020-8167?
Run the dependency tree command: 'inspect dependencies for actionview'. 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-xq5j-gw7f-jgj8",
  "modified" : "2023-08-08T15:14:47Z",
  "published" : "2020-07-07T16:34:10Z",
  "aliases" : [ "CVE-2020-8167" ],
  "summary" : "CSRF Vulnerability in rails-ujs",
  "details" : "There is a vulnerability in rails-ujs that allows attackers to send CSRF tokens to wrong domains.\n\nVersions Affected:  rails <= 6.0.3\nNot affected:       Applications which don't use rails-ujs.\nFixed Versions:     rails >= 5.2.4.3, rails >= 6.0.3.1\n\nImpact\n------\n\nThis is a regression of CVE-2015-1840.\n\nIn the scenario where an attacker might be able to control the href attribute of an anchor tag or the action attribute of a form tag that will trigger a POST action, the attacker can set the href or action to a cross-origin URL, and the CSRF token will be sent.\n\nWorkarounds\n-----------\n\nTo work around this problem, change code that allows users to control the href attribute of an anchor tag or the action attribute of a form tag to filter the user parameters.\n\nFor example, code like this:\n\n    link_to params\n\nto code like this:\n\n    link_to filtered_params\n\n    def filtered_params\n      # Filter just the parameters that you trust\n    end",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionview"
    },
    "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" : "actionview"
    },
    "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-8167"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/189878"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionview/CVE-2020-8167.yml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!topic/rubyonrails-security/x9DixQDG9a0"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/rubyonrails-security/c/x9DixQDG9a0"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2020/dsa-4766"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-07-07T15:51:37Z",
    "nvd_published_at" : "2020-06-19T18:15:00Z"
  }
}