Ability to forge per-form CSRF tokens in Rails
Published 26 May 2020 · Updated 5 May 2026
Is your project on an affected actionpack?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=5.0.0 <5.2.4.3
- Fixed in
- 5.2.4.3
bundle update --conservative actionpack # Gemfile: '>= 5.2.4.3'- Affected
- >=6.0.0 <6.0.3.1
- Fixed in
- 6.0.3.1
bundle update --conservative actionpack # Gemfile: '>= 6.0.3.1'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.
Impact ------
Given the ability to extract the global CSRF token, an attacker would be able to construct a per-form CSRF token for that session.
Workarounds -----------
This is a low-severity security issue. As such, no workaround is necessarily until such time as the application can be upgraded.
Is GHSA-jp5v-5gx4-jmj9 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected actionpack, and gives you the command that fixes it.
More advisories for actionpack
- MediumCVE-2026-126072Action Pack: Possible DoS vulnerability in Action Controller Live streaming · 12 Nov 2026
- MediumCVE-2026-126077Action Pack: Possible sensitive session information leak in Active Storage proxy mode · 12 Nov 2026
- HighCVE-2026-126081Action Pack: Possible Strong Parameters Bypass in Parameters#each_key · 12 Nov 2026
- MediumCVE-2026-126073Action Pack: Possible cache poisoning in Action Pack content negotiation · 10 Nov 2026
- LowCVE-2026-126067Action Pack: Missing SameSite attribute on session cookies from Action Pack session stores · 10 Nov 2026
- HighCVE-2026-126083Action Pack: Possible IP spoofing in Action Dispatch RemoteIp · 10 Nov 2026
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2020-8166
- Linkhackerone.com/reports/732415
- Packagegithub.com/rails/rails
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2020-8166.yml
- Linkgroups.google.com/forum/#!topic/rubyonrails-security/NOjKiGeXUgw
- Linkgroups.google.com/g/rubyonrails-security/c/NOjKiGeXUgw
- Linkwww.debian.org/security/2020/dsa-4766
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.