Executive Summary

Summary
Title Ruby on Rails Action Pack framework insecurely typecasts YAML and Symbol XML parameters
Informations
Name VU#380039 First vendor Publication 2013-01-08
Vendor VU-CERT Last vendor Modification 2013-01-11
Severity (Vendor) N/A Revision M

Security-Database Scoring CVSS v3

Cvss vector : N/A
Overall CVSS Score NA
Base Score NA Environmental Score NA
impact SubScore NA Temporal Score NA
Exploitabality Sub Score NA
 
Calculate full CVSS 3.0 Vectors scores

Security-Database Scoring CVSS v2

Cvss vector : (AV:N/AC:L/Au:N/C:P/I:P/A:P)
Cvss Base Score 7.5 Attack Range Network
Cvss Impact Score 6.4 Attack Complexity Low
Cvss Expoit Score 10 Authentication None Required
Calculate full CVSS 2.0 Vectors scores

Detail

Vulnerability Note VU#380039

Ruby on Rails Action Pack framework insecurely typecasts YAML and Symbol XML parameters

Original Release date: 08 Jan 2013 | Last revised: 11 Jan 2013

Overview

The Ruby on Rails Action Pack framework is susceptible to authentication bypass, SQL injection, arbitrary code execution, or denial of service.

Description

The Ruby on Rails advisory states:

    "Multiple vulnerabilities in parameter parsing in Action Pack

    There are multiple weaknesses in the parameter parsing code for Ruby on Rails which allows attackers to bypass authentication systems, inject arbitrary SQL, inject and execute arbitrary code, or perform a DoS attack on a Rails application. This vulnerability has been assigned the CVE identifier CVE-2013-0156.

    Versions Affected: ALL versions
    Not affected: NONE
    Fixed Versions: 3.2.11, 3.1.10, 3.0.19, 2.3.15

    Impact
    ------
    The parameter parsing code of Ruby on Rails allows applications to automatically cast values from strings to certain data types. Unfortunately the type casting code supported certain conversions which were not suitable for performing on user-provided data including creating Symbols and parsing YAML. These unsuitable conversions can be used by an attacker to compromise a Rails application.

    Due to the critical nature of this vulnerability, and the fact that portions of it have been disclosed publicly, all users running an affected release should either upgrade or use one of the work arounds *immediately*.

    Releases
    --------
    The 3.2.11, 3.1.10, 3.0.19 and 2.3.15 releases are available at the normal locations."


Additional details are available in the full advisory. Exploit code for this vulnerability is publicly available.

Impact

A Ruby on Rails application that uses Action Pack is susceptible to authentication bypass, SQL injection, arbitrary code execution or denial of service.

Solution

Apply an Update

Versions 3.2.11, 3.1.10, 3.0.19, and 2.3.15 have been released to address this vulnerability.

The Ruby on Rails advisory states the following workarounds:

    Workarounds
    -----------
    The work arounds differ depending on the Rails version you are using, and whether or not your application needs to support XML Parameters.

    Disabling XML Entirely
    ----------------------
    Users who don't need to support XML parameters should disable XML parsing entirely by placing one of the following snippets inside an application initializer.

    Rails 3.2, 3.1 and 3.0
    ----------------------
    ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML)

    Rails 2.3
    ---------
    ActionController::Base.param_parsers.delete(Mime::XML)

    Removing YAML and Symbol support from the XML parser
    ----------------------------------------------------
    If your application must continue to parse XML you must disable the YAML and Symbol type conversion from the Rails XML parser. You should place one of the following code snippets in an application initializer to ensure your application isn't vulnerable. You should also consider greatly reducing the value of REXML::Document.entity_expansion_limit to limit the risk of entity explosion attacks.

    YAML Parameter Parsing
    ----------------------
    Rails has also shipped with YAML parameter parsing code, this was only ever enabled by default in Rails 1.1.0, but users who do enable it are vulnerable to all the exploits mentioned above.. There is no fix for YAML object injection, so if you have enabled it you must disable it immediately.

    For 2.x apps, check whether your app sets `ActionController::Base.param_parsers[Mime::YAML] = :yaml` and snip that out if it does.

    For 3.x apps do this to disable:

    ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::YAML)

    Rails 3.2, 3.1, 3.0
    ---------
    ActiveSupport::XmlMini::PARSING.delete("symbol")
    ActiveSupport::XmlMini::PARSING.delete("yaml")

    Rails 2.3
    ---------
    ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING.delete('symbol')
    ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING.delete('yaml')

Vendor Information (Learn More)

VendorStatusDate NotifiedDate Updated
Ruby on RailsAffected-11 Jan 2013
If you are a vendor and your product is affected, let us know.

CVSS Metrics (Learn More)

GroupScoreVector
Base10.0AV:N/AC:L/Au:N/C:C/I:C/A:C
Temporal8.7E:H/RL:OF/RC:C
Environmental8.7CDP:ND/TD:H/CR:ND/IR:ND/AR:ND

References

  • https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
  • http://api.rubyonrails.org/files/actionpack/README_rdoc.html
  • http://www.insinuator.net/2013/01/rails-yaml/
  • https://community.rapid7.com/community/metasploit/blog/2013/01/09/serialization-mischief-in-ruby-land-cve-2013-0156

Credit

This vulnerability was reported to the Ruby on Rails security team by Ben Murphy, Magnus Holm, Felix Wilhelm, Darcy Laycock, Jonathan Rudenberg, Bryan Helmkamp, Benoist Claassen and Charlie Somerville.

This document was written by Jared Allar.

Other Information

  • CVE IDs:CVE-2013-0156
  • Date Public:08 Jan 2013
  • Date First Published:08 Jan 2013
  • Date Last Updated:11 Jan 2013
  • Document Revision:22

Feedback

If you have feedback, comments, or additional information about this vulnerability, please send us email.

Original Source

Url : http://www.kb.cert.org/vuls/id/380039

CWE : Common Weakness Enumeration

% Id Name
100 % CWE-20 Improper Input Validation

OVAL Definitions

Definition Id: oval:org.mitre.oval:def:19664
 
Oval ID: oval:org.mitre.oval:def:19664
Title: DSA-2604-1 rails - insufficient input validation
Description: It was discovered that Rails, the Ruby web application development framework, performed insufficient validation on input parameters, allowing unintended type conversions. An attacker may use this to bypass authentication systems, inject arbitrary SQL, inject and execute arbitrary code, or perform a DoS attack on the application.
Family: unix Class: patch
Reference(s): DSA-2604-1
CVE-2013-0156
Version: 5
Platform(s): Debian GNU/Linux 6.0
Debian GNU/kFreeBSD 6.0
Product(s): rails
Definition Synopsis:

CPE : Common Platform Enumeration

TypeDescriptionCount
Application 160
Application 12
Os 2

SAINT Exploits

Description Link
Ruby on Rails XML Processor YAML Deserialization More info here

ExploitDB Exploits

id Description
2013-01-29 Ruby on Rails JSON Processor YAML Deserialization Code Execution
2013-01-10 Ruby on Rails XML Processor YAML Deserialization Code Execution

Snort® IPS/IDS

Date Description
2014-01-10 Rails XML parameter parsing vulnerability exploitation attempt
RuleID : 25288 - Revision : 10 - Type : SERVER-OTHER
2014-01-10 Rails XML parameter parsing vulnerability exploitation attempt
RuleID : 25287 - Revision : 12 - Type : SERVER-OTHER

Nessus® Vulnerability Scanner

Date Description
2015-03-26 Name : The remote Debian host is missing a security update.
File : debian_DLA-172.nasl - Type : ACT_GATHER_INFO
2014-12-15 Name : The remote Gentoo host is missing one or more security-related patches.
File : gentoo_GLSA-201412-28.nasl - Type : ACT_GATHER_INFO
2014-06-13 Name : The remote openSUSE host is missing a security update.
File : openSUSE-2013-106.nasl - Type : ACT_GATHER_INFO
2013-03-15 Name : The remote host is missing a Mac OS X update that fixes several security issues.
File : macosx_SecUpd2013-001.nasl - Type : ACT_GATHER_INFO
2013-03-14 Name : The remote FreeBSD host is missing one or more security-related updates.
File : freebsd_pkg_cda566a02df04eb0b70eed7a6fb0ab3c.nasl - Type : ACT_GATHER_INFO
2013-02-05 Name : The remote host is missing an update for OS X Server that fixes two security ...
File : macosx_server_2_2_1.nasl - Type : ACT_GATHER_INFO
2013-01-24 Name : The remote Red Hat host is missing one or more security updates.
File : redhat-RHSA-2013-0154.nasl - Type : ACT_GATHER_INFO
2013-01-23 Name : The remote Fedora host is missing one or more security updates.
File : fedora_2013-0635.nasl - Type : ACT_GATHER_INFO
2013-01-23 Name : The remote Fedora host is missing one or more security updates.
File : fedora_2013-0686.nasl - Type : ACT_GATHER_INFO
2013-01-21 Name : The remote Fedora host is missing one or more security updates.
File : fedora_2013-0568.nasl - Type : ACT_GATHER_INFO
2013-01-10 Name : The remote Debian host is missing a security-related update.
File : debian_DSA-2604.nasl - Type : ACT_GATHER_INFO
2013-01-09 Name : The remote FreeBSD host is missing one or more security-related updates.
File : freebsd_pkg_ca5d327259e311e2853b00262d5ed8ee.nasl - Type : ACT_GATHER_INFO

Alert History

If you want to see full details history, please login or register.
0
1
2
3
4
5
6
7
Date Informations
2013-01-30 21:19:55
  • Multiple Updates
2013-01-14 21:20:59
  • Multiple Updates
2013-01-14 13:20:34
  • Multiple Updates
2013-01-12 05:18:14
  • Multiple Updates
2013-01-11 21:22:31
  • Multiple Updates
2013-01-10 13:20:49
  • Multiple Updates
2013-01-09 21:18:37
  • Multiple Updates
2013-01-09 00:20:47
  • First insertion