Skip to main content

CVE-2020-8165 — Vulnerability in activesupport — CVE Details

CRITICAL

ActiveSupport potentially unintended unmarshalling of user-provided objects in MemCacheStore and RedisCacheStore

Published May 26, 2020Updated May 9, 2025Source: OSV

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.

Check my Gemfile.lock

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.

Bundler
Update activesupport to 5.2.4.3 or later
gem install activesupport -v 5.2.4.3
Bundler
Update activesupport to 6.0.3.1 or later
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).

PackageFixed 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-502
    Deserialization of Untrusted DataMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

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

CVSS Score
9.8

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
45.73%
EPSS percentile: 99.1

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

GHSA-2p68-f74v-9wc6

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock