CVE-2020-8166: Actionpack Ability To Forge Per-form CSRF Vulnerability
MODERATECVE-2020-8166 is a MODERATE (CVSS 4.3) ability to forge per-form csrf vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Actionpack libraries in the RubyGems ecosystem. The issue involves ability to forge per-form csrf tokens in rails. Remediation is available by upgrading affected packages to version 5.2.4.3, 6.0.3.1.
CVE-2020-8166 at a Glance
Security Impact
CVSS: 4.3
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:L/A:N).
How to Fix CVE-2020-8166
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.
Upgrade actionpack to 5.2.4.3
Upgrade actionpack to 6.0.3.1
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-8166, 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-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 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
CVE-2020-8166 Affected Actionpack Versions
2 component(s)| 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-8166?
Which Actionpack versions are affected?
What version fixes CVE-2020-8166?
Is actionpack affected?
What is the CVSS score of CVE-2020-8166?
What CWE is associated with CVE-2020-8166?
How can I check RubyGems dependencies for CVE-2020-8166?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jp5v-5gx4-jmj9",
"modified" : "2026-05-05T22:16:48Z",
"published" : "2020-05-26T15:11:13Z",
"aliases" : [ "CVE-2020-8166" ],
"summary" : "Ability to forge per-form CSRF tokens in Rails",
"details" : "It is possible to, given a global CSRF token such as the one present in the authenticity_token meta tag, forge a per-form CSRF token for any action for that session.\n\nImpact\n------\n\nGiven the ability to extract the global CSRF token, an attacker would be able to construct a per-form CSRF token for that session.\n\nWorkarounds\n-----------\n\nThis is a low-severity security issue. As such, no workaround is necessarily until such time as the application can be upgraded.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/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-8166"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/732415"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/rails/rails"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2020-8166.yml"
}, {
"type" : "WEB",
"url" : "https://groups.google.com/forum/#!topic/rubyonrails-security/NOjKiGeXUgw"
}, {
"type" : "WEB",
"url" : "https://groups.google.com/g/rubyonrails-security/c/NOjKiGeXUgw"
}, {
"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-05-26T15:10:56Z",
"nvd_published_at" : "2020-07-02T19:15:12Z"
}
}