Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Open Challenge: Ruby YAML.load(YOUR_STRING_HERE) == RCE?

For some, the challenge may already be quite clear by the title of this post, but I'm going to add a little color for the sake of clarity.


Back in January 2013, there was a lot of excitement about a vulnerability in Ruby on Rails (CVE-2013-0156). In short, the vulnerability allowed a remote attacker to craft a request to Rails that would allow object creation via YAML deserialization and result in remote code execution (RCE). You can check the plethora of blog posts that covered the topic at the time to learn more (I've provided some of the better ones below as references).

Since that time, there has been a lot of discussion surrounding the use of Ruby YAML.load on user-controlled content in any Ruby application because of the RCE risk. And of course, I understand that it's important for us to learn from past mistakes and try to make a safer way to load YAML content. Examples of this include using something like YAML.safe_load or using white-listing techniques to restrict your object class exposure when you actually need to deserialize objects using YAML.load.


My Concerns

However, one of my concerns about such potential RCE scenarios, and maybe I'm not alone, is that of context. The issue I have with context is that in all the public PoC's I've observed, the attacker needed either an existing object behaving badly (ie. ActionController::Routing::RouteSet::NamedRouteCollection) or the creation of a contrived dangerous object being loaded manually to achieve such RCE.

The question I'd like posited is whether or not it's possible to achieve arbitrary RCE with a YAML.load using only standard lib objects, which are loaded by default. After all, if you're allowing the loading of dangerous/contrived objects with eval behavior, isn't this in the same vein as evaluating a user-controlled string?

I've done a little bit of poking around this topic myself and frankly, I've come up short. I've even consulted other fellow Rubyists to provide such an example, and I've yet to get a positive response that was acceptable to demonstrate such a risk.


The Challenge

As a Rubyist and a Security professional, I'm compelled to test such things and seek the truth. As such, I'm opening up a community challenge to see if there are some smart people out there willing to take on such a challenge.

Here are the basic constraints:

  • Must use a currently supported Ruby version
  • Must be a string that is supplied to the YAML.load function
  • Must use STDLIB only (ie. whatever's available to you after typing "irb" at a command prompt, no additional libs, requires, or .irbrc-type behavior)
  • Must be able to do something with the RCE (i.e., throw a shell, exfill, etc.)

The challenge is open as of now and will be completed on Thursday, May 14th. I will update this post as soon as the challenge is solved or will provide an update if it goes unsolved in the time window.



Please submit your solutions to the challenge by sending an e-mail to and include the subject line "Ruby YAML.load Challenge".


***UPDATE - May 29, 2015--No one solved the challenge, bummer. Thanks for playing!

Latest SpiderLabs Blogs

Welcome to Adventures in Cybersecurity: The Defender Series

I’m happy to say I’m done chasing Microsoft certifications (AZ104/AZ500/SC100), and as a result, I’ve had the time to put some effort into a blog series that hopefully will entertain and inform you...

Read More

Trustwave SpiderLabs: Insights and Solutions to Defend Educational Institutions Against Cyber Threats

Security teams responsible for defending educational institutions at higher education and primary school levels often find themselves facing harsh lessons from threat actors who exploit the numerous...

Read More

Breakdown of Tycoon Phishing-as-a-Service System

Just weeks after Trustwave SpiderLabs reported on the Greatness phishing-as-a-service (PaaS) framework, SpiderLabs’ Email Security team is tracking another PaaS called Tycoon Group.

Read More