ID CVE-2012-4522
Summary The rb_get_path_check function in file.c in Ruby 1.9.3 before patchlevel 286 and Ruby 2.0.0 before r37163 allows context-dependent attackers to create files in unexpected locations or with unexpected names via a NUL byte in a file path.
References
Vulnerable Configurations
  • cpe:2.3:a:ruby-lang:ruby:1.9.3:*:*:*:*:*:*:*
    cpe:2.3:a:ruby-lang:ruby:1.9.3:*:*:*:*:*:*:*
  • cpe:2.3:a:ruby-lang:ruby:2.0.0:*:*:*:*:*:*:*
    cpe:2.3:a:ruby-lang:ruby:2.0.0:*:*:*:*:*:*:*
CVSS
Base: 5.0 (as of 04-05-2013 - 03:20)
Impact:
Exploitability:
CWE CWE-264
CAPEC
  • Using Malicious Files
    An attack of this type exploits a system's configuration that allows an attacker to either directly access an executable file, for example through shell access; or in a possible worst case allows an attacker to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.
  • Restful Privilege Elevation
    Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
  • Target Programs with Elevated Privileges
    This attack targets programs running with elevated privileges. The attacker would try to leverage a bug in the running program and get arbitrary code to execute with elevated privileges. For instance an attacker would look for programs that write to the system directories or registry keys (such as HKLM, which stores a number of critical Windows environment variables). These programs are typically running with elevated privileges and have usually not been designed with security in mind. Such programs are excellent exploit targets because they yield lots of power when they break. The malicious user try to execute its code at the same level as a privileged system call.
  • Manipulating Web Input to File System Calls
    An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.
Access
VectorComplexityAuthentication
NETWORK LOW NONE
Impact
ConfidentialityIntegrityAvailability
NONE PARTIAL NONE
cvss-vector via4 AV:N/AC:L/Au:N/C:N/I:P/A:N
redhat via4
advisories
bugzilla
id 865940
title CVE-2012-4522 ruby: unintentional file creation caused by inserting an illegal NUL character
oval
AND
  • comment Red Hat Enterprise Linux 5 is installed
    oval oval:com.redhat.rhba:tst:20070331001
  • OR
    • AND
      • comment ruby is earlier than 0:1.8.5-27.el5
        oval oval:com.redhat.rhsa:tst:20130129002
      • comment ruby is signed with Red Hat redhatrelease key
        oval oval:com.redhat.rhsa:tst:20070965003
    • AND
      • comment ruby-devel is earlier than 0:1.8.5-27.el5
        oval oval:com.redhat.rhsa:tst:20130129006
      • comment ruby-devel is signed with Red Hat redhatrelease key
        oval oval:com.redhat.rhsa:tst:20070965013
    • AND
      • comment ruby-docs is earlier than 0:1.8.5-27.el5
        oval oval:com.redhat.rhsa:tst:20130129010
      • comment ruby-docs is signed with Red Hat redhatrelease key
        oval oval:com.redhat.rhsa:tst:20070965017
    • AND
      • comment ruby-irb is earlier than 0:1.8.5-27.el5
        oval oval:com.redhat.rhsa:tst:20130129004
      • comment ruby-irb is signed with Red Hat redhatrelease key
        oval oval:com.redhat.rhsa:tst:20070965011
    • AND
      • comment ruby-libs is earlier than 0:1.8.5-27.el5
        oval oval:com.redhat.rhsa:tst:20130129012
      • comment ruby-libs is signed with Red Hat redhatrelease key
        oval oval:com.redhat.rhsa:tst:20070965019
    • AND
      • comment ruby-mode is earlier than 0:1.8.5-27.el5
        oval oval:com.redhat.rhsa:tst:20130129008
      • comment ruby-mode is signed with Red Hat redhatrelease key
        oval oval:com.redhat.rhsa:tst:20070965005
    • AND
      • comment ruby-rdoc is earlier than 0:1.8.5-27.el5
        oval oval:com.redhat.rhsa:tst:20130129018
      • comment ruby-rdoc is signed with Red Hat redhatrelease key
        oval oval:com.redhat.rhsa:tst:20070965007
    • AND
      • comment ruby-ri is earlier than 0:1.8.5-27.el5
        oval oval:com.redhat.rhsa:tst:20130129014
      • comment ruby-ri is signed with Red Hat redhatrelease key
        oval oval:com.redhat.rhsa:tst:20070965015
    • AND
      • comment ruby-tcltk is earlier than 0:1.8.5-27.el5
        oval oval:com.redhat.rhsa:tst:20130129016
      • comment ruby-tcltk is signed with Red Hat redhatrelease key
        oval oval:com.redhat.rhsa:tst:20070965009
rhsa
id RHSA-2013:0129
released 2013-01-08
severity Moderate
title RHSA-2013:0129: ruby security and bug fix update (Moderate)
rpms
  • ruby-0:1.8.5-27.el5
  • ruby-devel-0:1.8.5-27.el5
  • ruby-docs-0:1.8.5-27.el5
  • ruby-irb-0:1.8.5-27.el5
  • ruby-libs-0:1.8.5-27.el5
  • ruby-mode-0:1.8.5-27.el5
  • ruby-rdoc-0:1.8.5-27.el5
  • ruby-ri-0:1.8.5-27.el5
  • ruby-tcltk-0:1.8.5-27.el5
refmap via4
confirm http://www.ruby-lang.org/en/news/2012/10/12/poisoned-NUL-byte-vulnerability/
fedora
  • FEDORA-2012-16071
  • FEDORA-2012-16086
misc http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=37163
mlist
  • [oss-security] 20121012 CVE request: ruby file creation due in insertion of illegal NUL character
  • [oss-security] 20121013 Re: CVE request: ruby file creation due in insertion of illegal NUL character
  • [oss-security] 20121016 Re: CVE request: ruby file creation due in insertion of illegal NUL character
Last major update 04-05-2013 - 03:20
Published 24-11-2012 - 20:55
Back to Top