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
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
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
OR
  • comment Red Hat Enterprise Linux must be installed
    oval oval:com.redhat.rhba:tst:20070304026
  • AND
    • comment Red Hat Enterprise Linux 5 is installed
      oval oval:com.redhat.rhba:tst:20070331005
    • OR
      • AND
        • comment ruby is earlier than 0:1.8.5-27.el5
          oval oval:com.redhat.rhsa:tst:20130129001
        • comment ruby is signed with Red Hat redhatrelease key
          oval oval:com.redhat.rhsa:tst:20070965002
      • AND
        • comment ruby-devel is earlier than 0:1.8.5-27.el5
          oval oval:com.redhat.rhsa:tst:20130129003
        • comment ruby-devel is signed with Red Hat redhatrelease key
          oval oval:com.redhat.rhsa:tst:20070965004
      • AND
        • comment ruby-docs is earlier than 0:1.8.5-27.el5
          oval oval:com.redhat.rhsa:tst:20130129005
        • comment ruby-docs is signed with Red Hat redhatrelease key
          oval oval:com.redhat.rhsa:tst:20070965006
      • AND
        • comment ruby-irb is earlier than 0:1.8.5-27.el5
          oval oval:com.redhat.rhsa:tst:20130129007
        • comment ruby-irb is signed with Red Hat redhatrelease key
          oval oval:com.redhat.rhsa:tst:20070965008
      • AND
        • comment ruby-libs is earlier than 0:1.8.5-27.el5
          oval oval:com.redhat.rhsa:tst:20130129009
        • comment ruby-libs is signed with Red Hat redhatrelease key
          oval oval:com.redhat.rhsa:tst:20070965010
      • AND
        • comment ruby-mode is earlier than 0:1.8.5-27.el5
          oval oval:com.redhat.rhsa:tst:20130129011
        • comment ruby-mode is signed with Red Hat redhatrelease key
          oval oval:com.redhat.rhsa:tst:20070965012
      • AND
        • comment ruby-rdoc is earlier than 0:1.8.5-27.el5
          oval oval:com.redhat.rhsa:tst:20130129013
        • comment ruby-rdoc is signed with Red Hat redhatrelease key
          oval oval:com.redhat.rhsa:tst:20070965014
      • AND
        • comment ruby-ri is earlier than 0:1.8.5-27.el5
          oval oval:com.redhat.rhsa:tst:20130129015
        • comment ruby-ri is signed with Red Hat redhatrelease key
          oval oval:com.redhat.rhsa:tst:20070965016
      • AND
        • comment ruby-tcltk is earlier than 0:1.8.5-27.el5
          oval oval:com.redhat.rhsa:tst:20130129017
        • comment ruby-tcltk is signed with Red Hat redhatrelease key
          oval oval:com.redhat.rhsa:tst:20070965018
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-debuginfo-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
  • graphviz-0:2.26.0-10.el6
  • graphviz-debuginfo-0:2.26.0-10.el6
  • graphviz-devel-0:2.26.0-10.el6
  • graphviz-doc-0:2.26.0-10.el6
  • graphviz-gd-0:2.26.0-10.el6
  • graphviz-ruby-0:2.26.0-10.el6
  • openshift-console-0:0.0.16-1.el6op
  • openshift-origin-broker-0:1.0.11-1.el6op
  • openshift-origin-broker-util-0:1.0.15-1.el6op
  • openshift-origin-cartridge-cron-1.4-0:1.0.3-1.el6op
  • openshift-origin-cartridge-diy-0.1-0:1.0.3-1.el6op
  • openshift-origin-cartridge-haproxy-1.4-0:1.0.4-1.el6op
  • openshift-origin-cartridge-jbosseap-6.0-0:1.0.4-1.el6op
  • openshift-origin-cartridge-jbossews-1.0-0:1.0.13-1.el6op
  • openshift-origin-cartridge-jenkins-1.4-0:1.0.2-1.el6op
  • openshift-origin-cartridge-jenkins-client-1.4-0:1.0.2-1.el6op
  • openshift-origin-cartridge-mysql-5.1-0:1.0.5-1.el6op
  • openshift-origin-cartridge-perl-5.10-0:1.0.3-1.el6op
  • openshift-origin-cartridge-php-5.3-0:1.0.5-1.el6op
  • openshift-origin-cartridge-postgresql-8.4-0:1.0.3-2.el6op
  • openshift-origin-cartridge-ruby-1.8-0:1.0.7-1.el6op
  • openshift-origin-cartridge-ruby-1.9-scl-0:1.0.8-1.el6op
  • openshift-origin-msg-node-mcollective-0:1.0.3-1.el6op
  • php-bcmath-0:5.3.3-22.el6
  • php-debuginfo-0:5.3.3-22.el6
  • php-devel-0:5.3.3-22.el6
  • php-imap-0:5.3.3-22.el6
  • php-mbstring-0:5.3.3-22.el6
  • php-process-0:5.3.3-22.el6
  • ruby193-ruby-0:1.9.3.327-25.el6
  • ruby193-ruby-debuginfo-0:1.9.3.327-25.el6
  • ruby193-ruby-devel-0:1.9.3.327-25.el6
  • ruby193-ruby-doc-0:1.9.3.327-25.el6
  • ruby193-ruby-irb-0:1.9.3.327-25.el6
  • ruby193-ruby-libs-0:1.9.3.327-25.el6
  • ruby193-ruby-tcltk-0:1.9.3.327-25.el6
  • ruby193-rubygem-actionpack-1:3.2.8-3.el6
  • ruby193-rubygem-actionpack-doc-1:3.2.8-3.el6
  • ruby193-rubygem-activemodel-0:3.2.8-2.el6
  • ruby193-rubygem-activemodel-doc-0:3.2.8-2.el6
  • ruby193-rubygem-activerecord-1:3.2.8-3.el6
  • ruby193-rubygem-activerecord-doc-1:3.2.8-3.el6
  • ruby193-rubygem-bigdecimal-0:1.1.0-25.el6
  • ruby193-rubygem-io-console-0:0.3-25.el6
  • ruby193-rubygem-json-0:1.5.4-25.el6
  • ruby193-rubygem-minitest-0:2.5.1-25.el6
  • ruby193-rubygem-railties-0:3.2.8-2.el6
  • ruby193-rubygem-railties-doc-0:3.2.8-2.el6
  • ruby193-rubygem-rake-0:0.9.2.2-25.el6
  • ruby193-rubygem-rdoc-0:3.9.4-25.el6
  • ruby193-rubygem-ruby_parser-0:2.3.1-3.el6op
  • ruby193-rubygem-ruby_parser-doc-0:2.3.1-3.el6op
  • ruby193-rubygems-0:1.8.23-25.el6
  • ruby193-rubygems-devel-0:1.8.23-25.el6
  • rubygem-actionpack-1:3.0.13-4.el6op
  • rubygem-activemodel-0:3.0.13-3.el6op
  • rubygem-activemodel-doc-0:3.0.13-3.el6op
  • rubygem-activerecord-1:3.0.13-5.el6op
  • rubygem-bson-0:1.8.1-2.el6op
  • rubygem-mongo-0:1.8.1-2.el6op
  • rubygem-mongo-doc-0:1.8.1-2.el6op
  • rubygem-openshift-origin-auth-remote-user-0:1.0.5-1.el6op
  • rubygem-openshift-origin-console-0:1.0.10-1.el6op
  • rubygem-openshift-origin-console-doc-0:1.0.10-1.el6op
  • rubygem-openshift-origin-controller-0:1.0.12-1.el6op
  • rubygem-openshift-origin-node-0:1.0.11-1.el6op
  • rubygem-ruby_parser-0:2.0.4-6.el6op
  • rubygem-ruby_parser-doc-0:2.0.4-6.el6op
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
Last modified 04-05-2013 - 03:20
Back to Top