The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2020-8165

CVE-2020-8165: Ruby on Rails RCE Vulnerability

CVE-2020-8165 is a deserialization of untrusted data vulnerability in Ruby on Rails that enables remote code execution through MemCacheStore and RedisCacheStore. This article covers technical details, affected versions, and mitigations.

Published: March 11, 2026

CVE-2020-8165 Overview

CVE-2020-8165 is a critical insecure deserialization vulnerability affecting Ruby on Rails applications that use MemCacheStore or RedisCacheStore for caching. The vulnerability allows attackers to unmarshal user-provided objects, potentially resulting in Remote Code Execution (RCE) on vulnerable systems.

This vulnerability exists in Rails versions prior to 5.2.4.3 and 6.0.3.1. When applications store user-controlled data in cache stores that use Ruby's Marshal serialization without proper validation, attackers can craft malicious serialized payloads that execute arbitrary code when deserialized by the application.

Critical Impact

Successful exploitation enables remote attackers to achieve arbitrary code execution on Rails applications using MemCacheStore or RedisCacheStore, potentially leading to complete system compromise.

Affected Products

  • Ruby on Rails versions prior to 5.2.4.3
  • Ruby on Rails versions prior to 6.0.3.1
  • Debian Linux 8.0, 9.0, and 10.0
  • openSUSE Leap 15.1 and 15.2

Discovery Timeline

  • May 18, 2020 - Ruby on Rails releases security patches (versions 5.2.4.3 and 6.0.3.1)
  • June 19, 2020 - CVE-2020-8165 published to NVD
  • May 9, 2025 - Last updated in NVD database

Technical Details for CVE-2020-8165

Vulnerability Analysis

The vulnerability stems from Ruby on Rails' handling of cached data in MemCacheStore and RedisCacheStore. These cache stores use Ruby's Marshal.load() method to deserialize cached objects. When applications cache user-controllable data using the raw: true option or when the cached value is directly influenced by user input, attackers can inject malicious serialized Ruby objects.

Ruby's Marshal deserialization is inherently unsafe when processing untrusted data because it can instantiate arbitrary Ruby objects and invoke methods during the deserialization process. Attackers can leverage gadget chains within Ruby and Rails to construct payloads that execute arbitrary commands when unmarshaled.

The vulnerability is particularly dangerous because cache stores are commonly used to store session data, user preferences, and other application state that may be influenced by external input. Applications that don't properly sanitize data before caching or that use raw cache storage are susceptible to this attack.

Root Cause

The root cause is CWE-502: Deserialization of Untrusted Data. Rails' cache stores relied on Ruby's Marshal serialization format, which is capable of serializing and deserializing arbitrary Ruby objects including those with dangerous side effects. The framework did not adequately protect against unmarshaling attacker-controlled data, allowing crafted payloads to execute code during deserialization.

Attack Vector

The attack is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Identifying a Rails application that caches user-controllable data using MemCacheStore or RedisCacheStore
  2. Crafting a malicious serialized Ruby object using known gadget chains
  3. Submitting the payload through an input vector that results in the data being cached
  4. Triggering the cache read operation, which deserializes the malicious object
  5. Achieving arbitrary code execution on the server

The vulnerability allows attackers to bypass normal application logic entirely by targeting the serialization layer. This attack is particularly effective because it operates at a lower level than typical input validation mechanisms.

Detection Methods for CVE-2020-8165

Indicators of Compromise

  • Unusual cache operations involving serialized Ruby objects with unexpected class hierarchies
  • Error logs showing Marshal.load failures or unexpected object instantiation
  • Network traffic containing Base64-encoded or binary data patterns consistent with Marshal serialization
  • Unexpected process spawning or command execution originating from Rails worker processes
  • Memory anomalies or crashes in Rails application processes

Detection Strategies

  • Monitor application logs for deserialization errors and unexpected Ruby class instantiation
  • Implement runtime application self-protection (RASP) to detect and block suspicious deserialization attempts
  • Deploy web application firewalls (WAF) configured to detect serialized Ruby object patterns in HTTP requests
  • Use intrusion detection systems (IDS) to monitor for known Ruby deserialization exploit patterns

Monitoring Recommendations

  • Enable verbose logging for cache operations in staging and production environments
  • Set up alerts for unusual patterns in Memcached or Redis traffic
  • Monitor for process execution anomalies on application servers
  • Implement file integrity monitoring on critical system directories

How to Mitigate CVE-2020-8165

Immediate Actions Required

  • Upgrade Ruby on Rails to version 5.2.4.3 or 6.0.3.1 (or later) immediately
  • Audit application code for patterns that cache user-controllable data
  • Review cache usage to identify potential exposure points
  • Consider temporarily disabling caching functionality if immediate patching is not possible

Patch Information

Ruby on Rails has released patched versions that address this vulnerability. The fix ensures that user-provided data cannot be used to inject malicious serialized objects. Upgrade to the following versions:

  • Rails 5.2.x: Upgrade to version 5.2.4.3 or later
  • Rails 6.0.x: Upgrade to version 6.0.3.1 or later

For detailed patch information, refer to the Ruby on Rails Release Announcement and the Ruby on Rails Security Alert. The original vulnerability report is documented in HackerOne Report #413388.

Linux distribution users should apply security updates from their package managers:

  • Debian users should refer to the Debian Security Advisory DSA-4766
  • openSUSE users should apply updates per the openSUSE Security Announcements

Workarounds

  • Avoid caching user-controllable data directly in MemCacheStore or RedisCacheStore
  • Use safer serialization formats like JSON instead of Marshal for cached data when possible
  • Implement strict input validation before any data is cached
  • Consider using Rails' encrypted cache stores with authenticated encryption
  • Apply network segmentation to isolate cache servers from untrusted networks
bash
# Configuration example
# Gemfile - Update Rails version
gem 'rails', '>= 5.2.4.3'
# or for Rails 6.x
gem 'rails', '>= 6.0.3.1'

# Run bundle update to apply the upgrade
bundle update rails

# Restart application servers after upgrade
systemctl restart puma
# or
systemctl restart passenger

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechRubyonrails

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability90.13%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-502
  • Technical References
  • openSUSE Security Announcement

  • openSUSE Security Announcement

  • Debian LTS Security Announcement

  • Debian LTS Security Announcement

  • Debian Security Advisory DSA-4766

  • NetApp Security Advisory NTAP-20250509-0002
  • Vendor Resources
  • Ruby on Rails Security Alert

  • HackerOne Report #413388

  • Ruby on Rails Release Announcement
  • Related CVEs
  • CVE-2020-8163: Ruby on Rails RCE Vulnerability

  • CVE-2026-33169: Ruby on Rails Active Support DoS Vulnerability

  • CVE-2026-33170: Ruby on Rails Active Support XSS Vulnerability

  • CVE-2026-33173: Rails Active Storage Auth Bypass Flaw
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English