Executive Summary

Summary
Title Ruby on Rails 3.0 and 2.3 JSON Parser vulnerability
Informations
Name VU#628463 First vendor Publication 2013-01-28
Vendor VU-CERT Last vendor Modification 2013-03-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#628463

Ruby on Rails 3.0 and 2.3 JSON Parser vulnerability

Original Release date: 28 Jan 2013 | Last revised: 11 Mar 2013

Overview

The Ruby on Rails 3.0 and 2.3 JSON parser contain a vulnerability that may result in arbitrary code execution.

Description

The Ruby on Rails advisory states:

    There is a vulnerability in the JSON 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-0333.

    Versions Affected: 2.3.x, 3.0.x
    Not Affected: 3.1.x, 3.2.x, applications using the yajl gem.
    Fixed Versions: 3.0.20, 2.3.16

    Impact
    - ------
    The JSON Parsing code in Rails 2.3 and 3.0 support multiple parsing backends. One of the backends involves transforming the JSON into YAML, and passing that through the YAML parser. Using a specially crafted payload attackers can trick the backend into decoding a subset of YAML.

    All users running an affected application should upgrade or use the workaround immediately.

    Note: This is a separate vulnerability to CVE-2013-0156, if you are running a 2.3 or 3.0 application you must still take action to protect your application.


Additional details may be found in the full Ruby on Rails advisory.

Impact

An unauthenticated attacker using a specifically crafted payload may be able to trick the Ruby on Rails backend into executing arbitrary code.

Solution

Apply an Update

Ruby on Rails 3.0.20 and 2.3.16 were released to address this vulnerability.

The Ruby on Rails advisory states the following workarounds as well.

    If you are unable to upgrade, or apply the patches, you can work around this vulnerability by switching backends to the JSONGem backend. Place this code in an application initializer:

    ActiveSupport::JSON.backend = "JSONGem"

    If you are running Ruby 1.8 you will need to ensure that the `json` or `json_pure` gems are installed and in your application's Gemfile. Ruby 1.9 includes this code already.

Vendor Information (Learn More)

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

CVSS Metrics (Learn More)

GroupScoreVector
Base8.8AV:N/AC:M/Au:N/C:C/I:C/A:N
Temporal7.7E:H/RL:OF/RC:C
Environmental6.1CDP:MH/TD:M/CR:H/IR:H/AR:L

References

  • http://weblog.rubyonrails.org/2013/1/28/Rails-3-0-20-and-2-3-16-have-been-released/
  • https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/1h2DR63ViGo

Credit

Thanks to Lawrence Pit of Mirror42 for discovering the vulnerability.

This document was written by Jared Allar.

Other Information

  • CVE IDs:CVE-2013-0333
  • Date Public:28 Jan 2013
  • Date First Published:28 Jan 2013
  • Date Last Updated:11 Mar 2013
  • Document Revision:10

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/628463

CWE : Common Weakness Enumeration

% Id Name
100 % CWE-20 Improper Input Validation

OVAL Definitions

Definition Id: oval:org.mitre.oval:def:18384
 
Oval ID: oval:org.mitre.oval:def:18384
Title: DSA-2613-1 rails - insufficient input validation
Description: Lawrence Pit discovered that Ruby on Rails, a web development framework, is vulnerable to a flaw in the parsing of JSON to YAML. Using a specially crafted payload attackers can trick the backend into decoding a subset of YAML.
Family: unix Class: patch
Reference(s): DSA-2613-1
CVE-2013-0333
Version: 7
Platform(s): Debian GNU/Linux 6.0
Debian GNU/kFreeBSD 6.0
Product(s): rails
Definition Synopsis:
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 JSON to YAML parsing deserialization attempt
RuleID : 25552 - Revision : 4 - Type : SERVER-OTHER
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-06-05 Name : The remote host is missing a Mac OS X update that fixes several security issues.
File : macosx_SecUpd2013-002.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-11 Name : The remote Fedora host is missing a security update.
File : fedora_2013-1745.nasl - Type : ACT_GATHER_INFO
2013-02-11 Name : The remote Fedora host is missing a security update.
File : fedora_2013-1710.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-31 Name : The remote Debian host is missing a security-related update.
File : debian_DSA-2613.nasl - Type : ACT_GATHER_INFO
2013-01-29 Name : The remote Red Hat host is missing a security update.
File : redhat-RHSA-2013-0201.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-0686.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-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
Date Informations
2013-03-11 21:19:11
  • Multiple Updates
2013-03-11 21:17:14
  • Multiple Updates
2013-02-07 13:27:14
  • Multiple Updates
2013-01-29 00:17:30
  • First insertion