Vulnerabilities > CVE-2016-2097 - Path Traversal vulnerability in Rubyonrails Ruby on Rails

047910
CVSS 5.3 - MEDIUM
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
LOW
Integrity impact
NONE
Availability impact
NONE
network
low complexity
rubyonrails
CWE-22
nessus

Summary

Directory traversal vulnerability in Action View in Ruby on Rails before 3.2.22.2 and 4.x before 4.1.14.2 allows remote attackers to read arbitrary files by leveraging an application's unrestricted use of the render method and providing a .. (dot dot) in a pathname. NOTE: this vulnerability exists because of an incomplete fix for CVE-2016-0752.

Vulnerable Configurations

Part Description Count
Application
Rubyonrails
230

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Relative Path Traversal
    An attacker exploits a weakness in input validation on the target by supplying a specially constructed path utilizing dot and slash characters for the purpose of obtaining access to arbitrary files or resources. An attacker modifies a known path on the target in order to reach material that is not available through intended channels. These attacks normally involve adding additional path separators (/ or \) and/or dots (.), or encodings thereof, in various combinations in order to reach parent directories or entirely separate trees of the target's directory structure.
  • Directory Traversal
    An attacker with access to file system resources, either directly or via application logic, will use various file path specification or navigation mechanisms such as ".." in path strings and absolute paths to extend their range of access to inappropriate areas of the file system. The attacker attempts to either explore the file system for recon purposes or access directories and files that are intended to be restricted from their access. Exploring the file system can be achieved through constructing paths presented to directory listing programs, such as "ls" and 'dir', or through specially crafted programs that attempt to explore the file system. The attacker engaging in this type of activity is searching for information that can be used later in a more exploitive attack. Access to restricted directories or files can be achieved through modification of path references utilized by system applications.
  • File System Function Injection, Content Based
    An attack of this type exploits the host's trust in executing remote content including binary files. The files are poisoned with a malicious payload (targeting the file systems accessible by the target software) by the attacker and may be passed through standard channels such as via email, and standard web content like PDF and multimedia files. The attacker exploits known vulnerabilities or handling routines in the target processes. Vulnerabilities of this type have been found in a wide variety of commercial applications from Microsoft Office to Adobe Acrobat and Apple Safari web browser. When the attacker knows the standard handling routines and can identify vulnerabilities and entry points they can be exploited by otherwise seemingly normal content. Once the attack is executed, the attackers' program can access relative directories such as C:\Program Files or other standard system directories to launch further attacks. In a worst case scenario, these programs are combined with other propagation logic and work as a virus.
  • Using Slashes and URL Encoding Combined to Bypass Validation Logic
    This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple way of encoding an URL and abuse the interpretation of the URL. An URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
  • Manipulating 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.

Nessus

  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-3509.NASL
    descriptionTwo vulnerabilities have been discovered in Rails, a web application framework written in Ruby. Both vulnerabilities affect Action Pack, which handles the web requests for Rails. - CVE-2016-2097 Crafted requests to Action View, one of the components of Action Pack, might result in rendering files from arbitrary locations, including files beyond the application
    last seen2020-06-01
    modified2020-06-02
    plugin id89791
    published2016-03-10
    reporterThis script is Copyright (C) 2016-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89791
    titleDebian DSA-3509-1 : rails - security update
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DLA-604.NASL
    descriptionMultiple vulnerabilities have been discovered in ruby-actionpack-3.2, a web-flow and rendering framework and part of Rails : CVE-2015-7576 A flaw was found in the way the Action Controller component compared user names and passwords when performing HTTP basic authentication. Time taken to compare strings could differ depending on input, possibly allowing a remote attacker to determine valid user names and passwords using a timing attack. CVE-2016-0751 A flaw was found in the way the Action Pack component performed MIME type lookups. Since queries were cached in a global cache of MIME types, an attacker could use this flaw to grow the cache indefinitely, potentially resulting in a denial of service. CVE-2016-0752 A directory traversal flaw was found in the way the Action View component searched for templates for rendering. If an application passed untrusted input to the
    last seen2020-03-17
    modified2016-08-29
    plugin id93132
    published2016-08-29
    reporterThis script is Copyright (C) 2016-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/93132
    titleDebian DLA-604-1 : ruby-actionpack-3.2 security update
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_5A016DD08AA8490EA59655F4CC17E4EF.NASL
    descriptionRuby on Rails blog : Rails 4.2.5.2, 4.1.14.2, and 3.2.22.2 have been released! These contain the following important security fixes, and it is recommended that users upgrade as soon as possible.
    last seen2020-06-01
    modified2020-06-02
    plugin id89708
    published2016-03-07
    reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89708
    titleFreeBSD : rails -- multiple vulnerabilities (5a016dd0-8aa8-490e-a596-55f4cc17e4ef)
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2016-369.NASL
    descriptionThis update for rubygem-actionpack-3_2 fixes the following issues : - CVE-2016-2097: rubygem-actionview: Possible Information Leak Vulnerability in Action View. (boo#968850) - CVE-2016-2098: rubygem-actionpack: Possible remote code execution vulnerability in Action Pack (boo#968849)
    last seen2020-06-05
    modified2016-03-21
    plugin id90061
    published2016-03-21
    reporterThis script is Copyright (C) 2016-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/90061
    titleopenSUSE Security Update : rubygem-actionpack-3_2 (openSUSE-2016-369)

Redhat

rpms
  • ror40-rubygem-actionpack-1:4.0.2-7.el6
  • ror40-rubygem-actionpack-1:4.0.2-7.el7
  • ror40-rubygem-actionpack-doc-1:4.0.2-7.el6
  • ror40-rubygem-actionpack-doc-1:4.0.2-7.el7
  • ror40-rubygem-activerecord-1:4.0.2-6.el6
  • ror40-rubygem-activerecord-1:4.0.2-6.el7
  • ror40-rubygem-activerecord-doc-1:4.0.2-6.el6
  • ror40-rubygem-activerecord-doc-1:4.0.2-6.el7
  • ror40-rubygem-activesupport-1:4.0.2-4.el6
  • ror40-rubygem-activesupport-1:4.0.2-4.el7
  • ruby193-rubygem-actionpack-1:3.2.8-16.el6
  • ruby193-rubygem-actionpack-1:3.2.8-16.el7
  • ruby193-rubygem-actionpack-doc-1:3.2.8-16.el6
  • ruby193-rubygem-actionpack-doc-1:3.2.8-16.el7
  • ruby193-rubygem-activerecord-1:3.2.8-11.el6
  • ruby193-rubygem-activerecord-1:3.2.8-11.el7
  • ruby193-rubygem-activerecord-doc-1:3.2.8-11.el6
  • ruby193-rubygem-activerecord-doc-1:3.2.8-11.el7
  • ruby193-rubygem-activesupport-1:3.2.8-6.el6
  • ruby193-rubygem-activesupport-1:3.2.8-6.el7
  • rh-ror41-rubygem-actionpack-1:4.1.5-4.el6
  • rh-ror41-rubygem-actionpack-1:4.1.5-4.el7
  • rh-ror41-rubygem-actionpack-doc-1:4.1.5-4.el6
  • rh-ror41-rubygem-actionpack-doc-1:4.1.5-4.el7
  • rh-ror41-rubygem-actionview-0:4.1.5-5.el6
  • rh-ror41-rubygem-actionview-0:4.1.5-5.el7
  • rh-ror41-rubygem-actionview-doc-0:4.1.5-5.el6
  • rh-ror41-rubygem-actionview-doc-0:4.1.5-5.el7

Seebug

bulletinFamilyexploit
descriptionPossible Information Leak Vulnerability in Action View. There is a possible directory traversal and information leak vulnerability in Action View. This was meant to be fixed on CVE-2016-0752. However the 3.2 patch was not covering all the scenarios. This vulnerability has been assigned the CVE identifier CVE-2016-2097. Versions Affected: 3.2.x, 4.0.x, 4.1.x Not affected: 4.2+ Fixed Versions: 3.2.22.2, 4.1.14.2 Impact ------ Applications that pass unverified user input to the `render` method in a controller may be vulnerable to an information leak vulnerability. Impacted code will look something like this: ```ruby def index render params[:id] end ``` Carefully crafted requests can cause the above code to render files from unexpected places like outside the application's view directory, and can possibly escalate this to a remote code execution attack. All users running an affected release should either upgrade or use one of the workarounds immediately. Releases -------- The FIXED releases are available at the normal locations. Workarounds ----------- A workaround to this issue is to not pass arbitrary user input to the `render` method. Instead, verify that data before passing it to the `render` method. For example, change this: ```ruby def index render params[:id] end ``` To this: ```ruby def index render verify_template(params[:id]) end private def verify_template(name) # add verification logic particular to your application here end ``` Credits ------- Thanks to both Jyoti Singh and Tobias Kraze from makandra for reporting this and working with us in the patch!
idSSV:91076
last seen2017-11-19
modified2016-03-17
published2016-03-17
reporterRoot
titleRuby on Rails Action View 信息泄漏