Skip to main content
Mallory
HighPublic exploitVulnerability

CVE-2013-0156: Ruby on Rails XML Parameter Parsing Object Injection and Remote Code Execution

Published Jan 13, 2013 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS7.5High · v2
EPSS99.0%100th percentile
CISA KEVNoNot listed
In the wildReported2 exploitation records in Mallory
Vendors
Debian ProjectRuby On Rails
IdentifiersCVE-2013-0156CWE-502

CVE-2013-0156 is an unsafe type-conversion vulnerability in Ruby on Rails Action Pack XML parameter parsing and ActiveSupport hash conversion. It affects Rails before 2.3.15, 3.0.x before 3.0.19, 3.1.x before 3.1.10, and 3.2.x before 3.2.11. Insufficient restrictions on YAML and Symbol type conversions allow attacker-controlled XML request parameters to instantiate unintended objects and potentially execute arbitrary code. Malicious XML, including nested entity references, can also cause excessive memory and CPU consumption.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Remote exploitation can execute arbitrary code with the privileges of the Rails application process or exhaust server memory and CPU, causing denial of service. Depending on application behavior and the injected objects, parameter parsing attacks can also bypass authentication or enable SQL injection. Observed exploitation has deployed XMRig cryptocurrency miners and installed recurring scheduled tasks for persistence.

Mitigation

If you can’t patch tonight, do this now.

If an upgrade cannot be applied immediately, disable XML parameter parsing where it is unnecessary. Where XML parsing must remain enabled, remove YAML and Symbol type-conversion support and reduce REXML::Document.entity_expansion_limit to constrain entity-expansion resource consumption. Disable YAML parameter parsing if it is enabled.

Remediation

Patch, then assume compromise.

Upgrade Ruby on Rails and its Action Pack dependency to a fixed release: 2.3.15 or later in the 2.3 series, 3.0.19 or later in the 3.0 series, 3.1.10 or later in the 3.1 series, or 3.2.11 or later in the 3.2 series. These are historical minimum fixed versions; migrate legacy applications to a currently supported Rails release.

Public exploits

Exploits

3 exploits validated by Mallory's analysis. Hidden: 2 rejected by Mallory's analysis as not a working exploit.

View more in app →
rails_xml_yaml_code_exec.rbThis repository contains a single Metasploit module: 'rails_xml_yaml_code_exec.rb', which exploits CVE-2013-0156, a remote code execution vulnerability in the XML request processor of Ruby on Rails (versions 2.x and 3.x). The exploit works by sending a specially crafted XML request containing a malicious YAML payload that is deserialized by the Rails application, leading to arbitrary Ruby code execution. The module allows the attacker to specify the HTTP method (GET, POST, PUT) and the URI path to the vulnerable endpoint. The payload is encoded and embedded in the YAML, which is then wrapped in XML and sent to the target over HTTP. The exploit is weaponized, as it is part of the Metasploit framework and supports customizable payloads. The only fingerprintable endpoint is the URI path (default '/'), which must point to a vulnerable Rails application. The module is highly configurable and can be used to gain remote code execution on affected systems.Disclosed Jan 7, 2013 · Framework: metasploit · ruby · networkWeaponizedrails_secret_deserialization.rbThis repository contains a single Metasploit exploit module targeting Ruby on Rails applications vulnerable to secret-based session deserialization (CVE-2013-0156). The exploit requires knowledge of the application's secret_token (Rails 2/3) or secret_key_base (Rails 4), which is often found in the file 'config/initializers/secret_token.rb'. The module crafts a malicious session cookie containing a serialized Ruby object with embedded attacker-controlled code. This cookie is signed or encrypted using the known secret and sent to the target application via HTTP. Upon deserialization, the payload is executed, resulting in remote code execution (RCE) on the server. The module supports both Rails 3 and Rails 4, with configurable options for the HTTP method, target URI, cookie name, digest type, and salts. The main attack vector is network-based, exploiting the HTTP interface of the Rails application. The code is operational and can be used to achieve RCE if the required secret is known.Disclosed Apr 11, 2013 · Framework: metasploit · ruby · networkWeaponizedCVE-2013-0156This repository contains a proof-of-concept exploit for CVE-2013-0156, a critical remote code execution vulnerability in Ruby on Rails (versions 2.x and 3.x). The exploit is implemented in a single Ruby script (rails_rce.rb) and is designed to be compatible with modern Ruby versions, removing dependencies on the Ronin framework. The script constructs a malicious XML payload containing a YAML-encoded Ruby object that triggers arbitrary code execution when deserialized by a vulnerable Rails server. The user supplies the target URL and the Ruby code to execute. The exploit sends a POST request with the crafted payload to the target, attempting to execute the supplied code on the server. The README.md provides usage instructions and legal disclaimers. No hardcoded endpoints are present; the target is specified at runtime. The repository is structured simply, with one exploit script and a README, and is intended for educational and authorized penetration testing use only.7s26simon · Disclosed Dec 11, 2025 · ruby · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Debian ProjectDebian Linuxoperating_system
Ruby On RailsRailsapplication
Ruby On RailsRuby On Railsapplication
FAQ

Frequently asked questions

Is CVE-2013-0156 exploited in the wild?
Yes. As of Oct 18, 2026, Mallory has reports of exploitation in the wild.
Is there a public exploit for CVE-2013-0156?
Yes. Mallory tracks 3 public exploits or proofs of concept for CVE-2013-0156, the earliest disclosed Jan 7, 2013.
Is there a patch for CVE-2013-0156?
Upgrade Ruby on Rails and its Action Pack dependency to a fixed release: 2.3.15 or later in the 2.3 series, 3.0.19 or later in the 3.0 series, 3.1.10 or later in the 3.1 series, or 3.2.11 or later in the 3.2 series. These are historical minimum fixed versions; migrate legacy applications to a currently supported Rails release.
What products are affected by CVE-2013-0156?
Ruby On Rails Rails, Ruby On Rails, and Debian Project Debian Linux.
How severe is CVE-2013-0156?
CVE-2013-0156 has a CVSS v2 score of 7.5 (High) and an EPSS score of 99.0% (100th percentile) as of Oct 18, 2026.
Activity feed

Recent activity

5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
elttamNews · Mar 24, 2026New Method to Leverage Unsafe Reflection and Deserialisation to RCE on Rails - elttamA historical Ruby on Rails remote-code-execution vulnerability referenced as prior use of the DeprecatedInstanceVariableProxy deserialization gadget; it is background context rather than the subject of this research.Read more ↗certego blogNews · Mar 10, 2026Ruby RCE pushing Monero CoinminerA remote code execution vulnerability in Ruby on Rails targeted through crafted HTTP POST requests involving XML and YAML content. The observed attacks deliver a Base64-encoded payload that installs an hourly cron job. The job downloads and executes a shell script that checks for an existing coinminer and, if absent, downloads and launches the Linux XMRIG CPU miner.Read more ↗checkpoint research blogNews · Jan 11, 2018‘RubyMiner’ Cryptominer Affects 30% of WW Networks - Check Point ResearchA Ruby on Rails XML-processing/YAML-deserialization code execution vulnerability exploited in a widespread cryptomining campaign. The attacker used a POST request containing Base64-encoded code to compromise servers and deploy a modified XMRig Monero miner. The report states that approximately 700 servers were compromised across the campaign, without attributing all compromises specifically to this vulnerability.Read more ↗slideshareNews · Oct 21, 2015脆弱性は誰のせい? PHP、MySQL、Joomla! の責任やいかに | PPTXRuby on RailsのYAMLデシリアライズによるコード実行脆弱性として比較例で言及。Read more ↗
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malware3Malware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity1Community discussion across Reddit, Mastodon, and other social sources.