Vulnerabilities > CVE-2013-0156 - Improper Input Validation vulnerability in multiple products

047910
CVSS 0.0 - NONE
Attack vector
UNKNOWN
Attack complexity
UNKNOWN
Privileges required
UNKNOWN
Confidentiality impact
UNKNOWN
Integrity impact
UNKNOWN
Availability impact
UNKNOWN
rubyonrails
debian
CWE-20
nessus
exploit available
metasploit

Summary

active_support/core_ext/hash/conversions.rb in Ruby on 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 does not properly restrict casts of string values, which allows remote attackers to conduct object-injection attacks and execute arbitrary code, or cause a denial of service (memory and CPU consumption) involving nested XML entity references, by leveraging Action Pack support for (1) YAML type conversion or (2) Symbol type conversion.

Vulnerable Configurations

Part Description Count
Application
Rubyonrails
163
OS
Debian
2

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Server Side Include (SSI) Injection
    An attacker can use Server Side Include (SSI) Injection to send code to a web application that then gets executed by the web server. Doing so enables the attacker to achieve similar results to Cross Site Scripting, viz., arbitrary code execution and information disclosure, albeit on a more limited scale, since the SSI directives are nowhere near as powerful as a full-fledged scripting language. Nonetheless, the attacker can conveniently gain access to sensitive files, such as password files, and execute shell commands.
  • Cross Zone Scripting
    An attacker is able to cause a victim to load content into their web-browser that bypasses security zone controls and gain access to increased privileges to execute scripting code or other web objects such as unsigned ActiveX controls or applets. This is a privilege elevation attack targeted at zone-based web-browser security. In a zone-based model, pages belong to one of a set of zones corresponding to the level of privilege assigned to that page. Pages in an untrusted zone would have a lesser level of access to the system and/or be restricted in the types of executable content it was allowed to invoke. In a cross-zone scripting attack, a page that should be assigned to a less privileged zone is granted the privileges of a more trusted zone. This can be accomplished by exploiting bugs in the browser, exploiting incorrect configuration in the zone controls, through a cross-site scripting attack that causes the attackers' content to be treated as coming from a more trusted page, or by leveraging some piece of system functionality that is accessible from both the trusted and less trusted zone. This attack differs from "Restful Privilege Escalation" in that the latter correlates to the inadequate securing of RESTful access methods (such as HTTP DELETE) on the server, while cross-zone scripting attacks the concept of security zones as implemented by a browser.
  • Cross Site Scripting through Log Files
    An attacker may leverage a system weakness where logs are susceptible to log injection to insert scripts into the system's logs. If these logs are later viewed by an administrator through a thin administrative interface and the log data is not properly HTML encoded before being written to the page, the attackers' scripts stored in the log will be executed in the administrative interface with potentially serious consequences. This attack pattern is really a combination of two other attack patterns: log injection and stored cross site scripting.
  • Command Line Execution through SQL Injection
    An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.

Exploit-Db

  • descriptionRuby on Rails Known Secret Session Cookie Remote Code Execution. CVE-2013-0156. Remote exploits for multiple platform
    idEDB-ID:27527
    last seen2016-02-03
    modified2013-08-12
    published2013-08-12
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/27527/
    titleRuby on Rails Known Secret Session Cookie Remote Code Execution
  • descriptionRuby on Rails XML Processor YAML Deserialization Code Execution. CVE-2013-0156. Remote exploits for multiple platform
    idEDB-ID:24019
    last seen2016-02-02
    modified2013-01-10
    published2013-01-10
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/24019/
    titleRuby on Rails XML Processor YAML Deserialization Code Execution

Metasploit

Nessus

  • NASL familyMacOS X Local Security Checks
    NASL idMACOSX_SERVER_2_2_1.NASL
    descriptionThe remote Mac OS X 10.8 host has a version of OS X Server installed that is prior to 2.2.1. It is, therefore, affected by the following vulnerabilities : - A type casting issue exists in Ruby on Rails due to improper handling of XML parameters. A remote attacker can exploit this issue to execute arbitrary code through either the Profile Manager or Wiki Server components. (CVE-2013-0156) - A type casting issue exists in Ruby on Rails due to improper handling of JSON data. A remote attacker can exploit this to execute arbitrary code through the Wiki Server component. (CVE-2013-0333)
    last seen2020-06-01
    modified2020-06-02
    plugin id64476
    published2013-02-05
    reporterThis script is Copyright (C) 2013-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/64476
    titleMac OS X : OS X Server < 2.2.1 Multiple Vulnerabilities
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    
    include("compat.inc");
    
    
    if (description)
    {
      script_id(64476);
      script_version("1.6");
      script_cvs_date("Date: 2018/07/14  1:59:36");
    
      script_cve_id("CVE-2013-0156", "CVE-2013-0333");
      script_bugtraq_id(57187, 57575);
      script_xref(name:"APPLE-SA", value:"APPLE-SA-2013-02-04-1");
    
      script_name(english:"Mac OS X : OS X Server < 2.2.1 Multiple Vulnerabilities");
      script_summary(english:"Checks OS X Server version.");
    
      script_set_attribute(
        attribute:"synopsis",
        value:
    "The remote host is missing an update for OS X Server that fixes two
    security issues."
      );
      script_set_attribute(
        attribute:"description",
        value:
    "The remote Mac OS X 10.8 host has a version of OS X Server installed
    that is prior to 2.2.1. It is, therefore, affected by the following
    vulnerabilities :
    
      - A type casting issue exists in Ruby on Rails due to
        improper handling of XML parameters. A remote attacker
        can exploit this issue to execute arbitrary code through
        either the Profile Manager or Wiki Server components.
        (CVE-2013-0156)
    
      - A type casting issue exists in Ruby on Rails due to
        improper handling of JSON data. A remote attacker can
        exploit this to execute arbitrary code through the
        Wiki Server component. (CVE-2013-0333)"
      );
      script_set_attribute(attribute:"see_also", value:"http://support.apple.com/kb/HT5644");
      script_set_attribute(attribute:"see_also", value:"http://lists.apple.com/archives/security-announce/2013/Feb/msg00001.html");
      script_set_attribute(attribute:"see_also", value:"http://www.securityfocus.com/archive/1/525572/30/0/threaded");
      script_set_attribute(attribute:"solution", value:"Upgrade to Mac OS X Server v2.2.1 or later.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'Ruby on Rails JSON Processor YAML Deserialization Code Execution');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2013/01/08");
      script_set_attribute(attribute:"patch_publication_date", value:"2013/02/04");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/02/05");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:apple:mac_os_x_server");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"MacOS X Local Security Checks");
    
      script_copyright(english:"This script is Copyright (C) 2013-2018 Tenable Network Security, Inc.");
    
      script_dependencies("macosx_server_services.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/MacOSX/Version", "MacOSX/Server/Version");
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    os = get_kb_item("Host/MacOSX/Version");
    if (!os) audit(AUDIT_OS_NOT, "Mac OS X");
    
    if (!ereg(pattern:"Mac OS X 10\.8([^0-9]|$)", string:os)) audit(AUDIT_OS_NOT, "Mac OS X 10.8");
    
    version = get_kb_item_or_exit("MacOSX/Server/Version");
    
    fixed_version = "2.2.1";
    if (ver_compare(ver:version, fix:fixed_version, strict:FALSE) == -1)
    {
      if (report_verbosity > 0)
      {
        report = 
          '\n  Installed version : ' + version + 
          '\n  Fixed version     : ' + fixed_version + '\n';
        security_hole(port:0, extra:report);
      }
      else security_hole(0);
    }
    else audit(AUDIT_INST_VER_NOT_VULN, "OS X Server", version);
    
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2013-0686.NASL
    descriptionFix for CVE-2013-0155 and CVE-2013-0156. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-03-17
    modified2013-01-23
    plugin id63657
    published2013-01-23
    reporterThis script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/63657
    titleFedora 16 : rubygem-actionpack-3.0.10-10.fc16 / rubygem-activemodel-3.0.10-2.fc16 / etc (2013-0686)
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2013-0154.NASL
    descriptionUpdated rubygem-actionpack, rubygem-activesupport, and rubygem-activerecord packages that fix multiple security issues are now available for Red Hat Subscription Asset Manager. The Red Hat Security Response Team has rated this update as having critical security impact. Common Vulnerability Scoring System (CVSS) base scores, which give detailed severity ratings, are available for each vulnerability from the CVE links in the References section. Ruby on Rails is a model-view-controller (MVC) framework for web application development. Action Pack implements the controller and the view components. Active Record implements object-relational mapping for accessing database entries using objects. Active Support provides support and utility classes used by the Ruby on Rails framework. Multiple flaws were found in the way Ruby on Rails performed XML parameter parsing in HTTP requests. A remote attacker could use these flaws to execute arbitrary code with the privileges of a Ruby on Rails application, perform SQL injection attacks, or bypass the authentication using a specially-created HTTP request. (CVE-2013-0156) Red Hat is aware that a public exploit for the CVE-2013-0156 issues is available that allows remote code execution in applications using Ruby on Rails. Multiple input validation vulnerabilities were discovered in rubygem-activerecord. A remote attacker could possibly use these flaws to perform a SQL injection attack against an application using rubygem-activerecord. (CVE-2012-2661, CVE-2012-2695, CVE-2012-6496, CVE-2013-0155) Multiple input validation vulnerabilities were discovered in rubygem-actionpack. A remote attacker could possibly use these flaws to perform a SQL injection attack against an application using rubygem-actionpack and rubygem-activerecord. (CVE-2012-2660, CVE-2012-2694) Multiple cross-site scripting (XSS) flaws were found in rubygem-actionpack. A remote attacker could use these flaws to conduct XSS attacks against users of an application using rubygem-actionpack. (CVE-2012-3463, CVE-2012-3464, CVE-2012-3465) A flaw was found in the HTTP digest authentication implementation in rubygem-actionpack. A remote attacker could use this flaw to cause a denial of service of an application using rubygem-actionpack and digest authentication. (CVE-2012-3424) Users are advised to upgrade to these updated rubygem-actionpack, rubygem-activesupport, and rubygem-activerecord packages, which resolve these issues. Katello must be restarted (
    last seen2020-06-01
    modified2020-06-02
    plugin id64076
    published2013-01-24
    reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/64076
    titleRHEL 6 : Ruby on Rails in Subscription Asset Manager (RHSA-2013:0154)
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-201412-28.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-201412-28 (Ruby on Rails: Multiple vulnerabilities) Multiple vulnerabilities have been discovered in Ruby on Rails. Please review the CVE identifiers referenced below for details. Impact : A remote attacker could execute arbitrary code or cause a Denial of Service condition. Furthermore, a remote attacker may be able to execute arbitrary SQL commands, change parameter names for form inputs and make changes to arbitrary records in the system, bypass intended access restrictions, render arbitrary views, inject arbitrary web script or HTML, or conduct cross-site request forgery (CSRF) attacks. Workaround : There is no known workaround at this time.
    last seen2020-06-01
    modified2020-06-02
    plugin id79981
    published2014-12-15
    reporterThis script is Copyright (C) 2014-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/79981
    titleGLSA-201412-28 : Ruby on Rails: Multiple vulnerabilities
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DLA-172.NASL
    descriptionImport patches 633974b2759d9b92 and 4540e7102b803624 from uptream to remove symbol and YAML coercion from the XML parser. NOTE: Tenable Network Security has extracted the preceding description block directly from the DLA security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-03-17
    modified2015-03-26
    plugin id82157
    published2015-03-26
    reporterThis script is Copyright (C) 2015-2020 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/82157
    titleDebian DLA-172-1 : libextlib-ruby security update
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_CA5D327259E311E2853B00262D5ED8EE.NASL
    descriptionRuby on Rails team reports : Two high-risk vulnerabilities have been discovered : (CVE-2013-0155) There is a vulnerability when Active Record is used in conjunction with JSON parameter parsing. Due to the way Active Record interprets parameters in combination with the way that JSON parameters are parsed, it is possible for an attacker to issue unexpected database queries with
    last seen2020-06-01
    modified2020-06-02
    plugin id63435
    published2013-01-09
    reporterThis script is Copyright (C) 2013-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/63435
    titleFreeBSD : rubygem-rails -- multiple vulnerabilities (ca5d3272-59e3-11e2-853b-00262d5ed8ee)
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2013-0153.NASL
    descriptionUpdated rubygem-actionpack, rubygem-activesupport, ruby193-rubygem-actionpack, and ruby193-rubygem-activesupport packages that fix multiple security issues are now available for Red Hat OpenShift Enterprise 1.0. The Red Hat Security Response Team has rated this update as having critical security impact. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available from the CVE link in the References section. Ruby on Rails is a model-view-controller (MVC) framework for web application development. Action Pack implements the controller and the view components. Active Support provides support and utility classes used by the Ruby on Rails framework. Multiple flaws were found in the way Ruby on Rails performed XML parameter parsing in HTTP requests. A remote attacker could use these flaws to execute arbitrary code with the privileges of a Ruby on Rails application, perform SQL injection attacks, or bypass the authentication using a specially-created HTTP request. (CVE-2013-0156) Red Hat is aware that a public exploit for the CVE-2013-0156 issues is available that allows remote code execution in applications using Ruby on Rails. All users of Red Hat OpenShift Enterprise are advised to upgrade to these updated packages, which correct these issues. For Red Hat OpenShift Enterprise administrators, the openshift-broker and openshift-console services must be restarted for this update to take effect. Users of OpenShift are advised to update their own applications that are running Ruby on Rails.
    last seen2020-06-01
    modified2020-06-02
    plugin id119429
    published2018-12-06
    reporterThis script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/119429
    titleRHEL 6 : Ruby on Rails (RHSA-2013:0153)
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2013-106.NASL
    descriptionThis update updates the RubyOnRails 2.3 stack to 2.3.16, also this update updates the RubyOnRails 3.2 stack to 3.2.11. Security and bugfixes were done, foremost: CVE-2013-0333: A JSON sql/code injection problem was fixed. CVE-2012-5664: A SQL Injection Vulnerability in Active Record was fixed. CVE-2012-2695: A SQL injection via nested hashes in conditions was fixed. CVE-2013-0155: Unsafe Query Generation Risk in Ruby on Rails was fixed. CVE-2013-0156: Multiple vulnerabilities in parameter parsing in Action Pack were fixed.
    last seen2020-06-05
    modified2014-06-13
    plugin id74881
    published2014-06-13
    reporterThis script is Copyright (C) 2014-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/74881
    titleopenSUSE Security Update : ruby (openSUSE-SU-2013:0278-1)
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_CDA566A02DF04EB0B70EED7A6FB0AB3C.NASL
    descriptionMoses Mendoza reports : A vulnerability found in Puppet could allow an authenticated client to cause the master to execute arbitrary code while responding to a catalog request. Specifically, in order to exploit the vulnerability, the puppet master must be made to invoke the
    last seen2020-06-01
    modified2020-06-02
    plugin id65542
    published2013-03-14
    reporterThis script is Copyright (C) 2013-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/65542
    titleFreeBSD : puppet27 and puppet -- multiple vulnerabilities (cda566a0-2df0-4eb0-b70e-ed7a6fb0ab3c)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2013-0568.NASL
    descriptionFix for CVE-2013-0155 and CVE-2013-0156. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-03-17
    modified2013-01-21
    plugin id63635
    published2013-01-21
    reporterThis script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/63635
    titleFedora 18 : rubygem-actionpack-3.2.8-2.fc18 / rubygem-activerecord-3.2.8-3.fc18 / etc (2013-0568)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-2604.NASL
    descriptionIt 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.
    last seen2020-03-17
    modified2013-01-10
    plugin id63457
    published2013-01-10
    reporterThis script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/63457
    titleDebian DSA-2604-1 : rails - insufficient input validation
  • NASL familyMacOS X Local Security Checks
    NASL idMACOSX_SECUPD2013-001.NASL
    descriptionThe remote host is running a version of Mac OS X 10.6 or 10.7 that does not have Security Update 2013-001 applied. This update contains numerous security-related fixes for the following components : - Apache - CoreTypes (10.7 only) - International Components for Unicode - Identity Services (10.7 only) - ImageIO - Messages Server (Server only) - PDFKit - Podcast Producer Server (Server only) - PostgreSQL (Server only) - Profile Manager (10.7 Server only) - QuickTime - Ruby (10.6 Server only) - Security - Software Update - Wiki Server (10.7 Server only) Note that the update also runs a malware removal tool that will remove the most common variants of malware.
    last seen2020-06-01
    modified2020-06-02
    plugin id65578
    published2013-03-15
    reporterThis script is Copyright (C) 2013-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/65578
    titleMac OS X Multiple Vulnerabilities (Security Update 2013-001)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2013-0635.NASL
    descriptionFix for CVE-2013-0155 and CVE-2013-0156. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-03-17
    modified2013-01-23
    plugin id63654
    published2013-01-23
    reporterThis script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/63654
    titleFedora 17 : rubygem-actionpack-3.0.11-8.fc17 / rubygem-activemodel-3.0.11-2.fc17 / etc (2013-0635)

Packetstorm

Redhat

advisories
  • rhsa
    idRHSA-2013:0153
  • rhsa
    idRHSA-2013:0154
  • rhsa
    idRHSA-2013:0155
rpms
  • ruby193-rubygem-actionpack-1:3.2.8-2.el6
  • ruby193-rubygem-actionpack-doc-1:3.2.8-2.el6
  • ruby193-rubygem-activesupport-1:3.2.8-3.el6
  • rubygem-actionpack-1:3.0.13-2.1.el6op
  • rubygem-activesupport-1:3.0.13-2.el6op
  • rubygem-actionpack-1:3.0.10-11.el6cf
  • rubygem-activerecord-1:3.0.10-8.el6cf
  • rubygem-activesupport-1:3.0.10-5.el6cf
  • rubygem-actionpack-1:3.0.10-11.el6cf
  • rubygem-activerecord-1:3.0.10-8.el6cf
  • rubygem-activesupport-1:3.0.10-5.el6cf

Saint

bid57187
descriptionRuby on Rails XML Processor YAML Deserialization
idweb_dev_rubyonrails
osvdb89026
titleruby_on_rails_yaml_deserialization
typeremote

Seebug

  • bulletinFamilyexploit
    descriptionNo description provided by source.
    idSSV:77757
    last seen2017-11-19
    modified2014-07-01
    published2014-07-01
    reporterRoot
    sourcehttps://www.seebug.org/vuldb/ssvid-77757
    titleRuby on Rails XML Processor YAML Deserialization Code Execution
  • bulletinFamilyexploit
    descriptionNo description provided by source.
    idSSV:60615
    last seen2017-11-19
    modified2013-02-03
    published2013-02-03
    reporterRoot
    sourcehttps://www.seebug.org/vuldb/ssvid-60615
    titleRuby on Rails JSON Processor YAML Deserialization Code Execution

The Hacker News

idTHN:104ADC1CB2EE1C258A129E663822F952
last seen2017-01-08
modified2013-06-03
published2013-05-30
reporterMohit Kumar
sourcehttp://thehackernews.com/2013/05/ruby-on-rails-exploit-could-hijack.html
titleRuby on Rails exploit could hijack unpatched servers for botnet