CVE-2020-8165 — Vulnerability in activesupport — CVE Details
ActiveSupport potentially unintended unmarshalling of user-provided objects in MemCacheStore and RedisCacheStore
What Should I Do?
Fix Within 2-4 Weeks
Moderate exploitation risk (45.73% probability in 30 days). Schedule remediation soon.
Does your project use an affected activesupport version?
Paste your Gemfile.lock to check it for CVE-2020-8165 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
In ActiveSupport, there is potentially unexpected behaviour in the MemCacheStore and RedisCacheStore where, when
untrusted user input is written to the cache store using the raw: true parameter, re-reading the result
from the cache can evaluate the user input as a Marshalled object instead of plain text. Vulnerable code looks like:
data = cache.fetch("demo", raw: true) { untrusted_string }
Versions Affected: rails < 5.2.5, rails < 6.0.4
Not affected: Applications not using MemCacheStore or RedisCacheStore. Applications that do not use the raw option when storing untrusted user input.
Fixed Versions: rails >= 5.2.4.3, rails >= 6.0.3.1
Impact
Unmarshalling of untrusted user input can have impact up to and including RCE. At a minimum,
this vulnerability allows an attacker to inject untrusted Ruby objects into a web application.
In addition to upgrading to the latest versions of Rails, developers should ensure that whenever
they are calling Rails.cache.fetch they are using consistent values of the raw parameter for both
reading and writing, especially in the case of the RedisCacheStore which does not, prior to these changes,
detect if data was serialized using the raw option upon deserialization.
Workarounds
It is recommended that application developers apply the suggested patch or upgrade to the latest release as
soon as possible. If this is not possible, we recommend ensuring that all user-provided strings cached using
the raw argument should be double-checked to ensure that they conform to the expected format.
Advisory Timeline
- First published May 26, 2020 (2376 days ago).
- Last revised May 9, 2025 — 1809 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install activesupport -v 5.2.4.3
gem install activesupport -v 6.0.3.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| activesupport RubyGems · Affected: 5.0.0, 5.0.0.1, 5.0.1, 5.0.1.rc1 (+51 more) | 5.2.4.3 |
| activesupport RubyGems · Affected: 6.0.0, 6.0.1, 6.0.1.rc1, 6.0.2 (+6 more) | 6.0.3.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-502Deserialization of Untrusted DataMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2020-8165ADVISORY
- https://hackerone.com/reports/413388WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/CVE-2020-8165.ymlWEB
- https://groups.google.com/forum/#!topic/rubyonrails-security/bv6fW4S0Y1cWEB
- https://groups.google.com/g/rubyonrails-security/c/bv6fW4S0Y1cWEB
- https://lists.debian.org/debian-lts-announce/2020/06/msg00022.htmlWEB
- https://lists.debian.org/debian-lts-announce/2020/07/msg00013.htmlWEB
- https://security.netapp.com/advisory/ntap-20250509-0002WEB
- https://weblog.rubyonrails.org/2020/5/18/Rails-5-2-4-3-and-6-0-3-1-have-been-releasedWEB
- https://www.debian.org/security/2020/dsa-4766WEB
- https://lists.opensuse.org/opensuse-security-announce/2020-10/msg00031.htmlWEB
- https://lists.opensuse.org/opensuse-security-announce/2020-10/msg00034.htmlWEB
Frequently Asked Questions
- What is CVE-2020-8165?
- ActiveSupport potentially unintended unmarshalling of user-provided objects in MemCacheStore and RedisCacheStore. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
- How do I check if my project is affected by CVE-2020-8165?
- CVE-2020-8165 affects activesupport. It has a 45.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2020-8165 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This places it in the top 5% of EPSS-scored vulnerabilities — 99.1% of tracked vulnerabilities score at or below it, so it is far more likely to be exploited than nearly all other tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2026-130001CRITICAL
Mustache for Ruby: RCE using built-in method access
- CVE-2026-122006CRITICAL
Active Storage: Possible arbitrary file write and read in image analysis
- CVE-2026-126080HIGH
Active Support: Possible DoS vulnerability in Active Support safe_constantize
- CVE-2026-33176MEDIUM
Rails Active Support has a possible DoS vulnerability in its number helpers
- CVE-2026-33170MEDIUM
Rails Active Support has a possible XSS vulnerability in SafeBuffer#%
- CVE-2026-33169MEDIUM
Rails Active Support has a possible ReDoS vulnerability in number_to_delimited
- CVE-2023-38037MEDIUM
Active Support Possibly Discloses Locally Encrypted Files
- CVE-2023-28120MEDIUM
Possible XSS Security Vulnerability in SafeBuffer#bytesplice