ID CVE-2016-0752
Summary Directory traversal vulnerability in Action View in Ruby on Rails before 3.2.22.1, 4.0.x and 4.1.x before 4.1.14.1, 4.2.x before 4.2.5.1, and 5.x before 5.0.0.beta1.1 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.
References
Vulnerable Configurations
  • Ruby on Rails 5.0.0 Beta 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:5.0.0:beta1
  • Ruby On Rails 4.2.5 Release Candidate 2
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.5:rc2
  • Ruby On Rails 4.2.5 Release Candidate 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.5:rc1
  • Ruby on Rails 4.2.5
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.5
  • Ruby On Rails 4.2.4 Release Candidate 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.4:rc1
  • Ruby on Rails 4.2.4
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.4
  • Ruby on Rails 4.2.3 Release Candidate 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.3:rc1
  • Ruby on Rails 4.2.3
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.3
  • Ruby on Rails 4.2.2
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.2
  • Ruby on Rails 4.2.1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.1
  • Ruby on Rails 4.2.0 beta 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.2.0:beta1
  • cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.14
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.14
  • cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.13
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.13
  • cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.12
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.12
  • cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.10
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.10
  • cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.9
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.9
  • cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.11
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.11
  • Ruby on Rails 4.1.2
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.2
  • Ruby on Rails 4.1.8
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.8
  • Ruby on Rails Ruby on Rails 4.1.7
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.7
  • Ruby on Rails 4.1.6 Release Candidate 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.6:rc1
  • Ruby on Rails 4.1.5
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.5
  • Ruby on Rails 4.1.4
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.4
  • Ruby on Rails 4.1.3
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.3
  • Ruby on Rails 4.1.2 Release Candidate 3
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.2:rc3
  • Ruby on Rails 4.1.2 Release Candidate 2
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.2:rc2
  • Ruby on Rails 4.1.2 Release Candidate 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.2:rc1
  • Ruby on Rails 4.1.1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.1
  • Ruby on Rails 4.1.0 beta 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.0:beta1
  • Ruby on Rails 4.1.0
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.1.0
  • Ruby on Rails 4.0.9
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.9
  • Ruby on Rails 4.0.8
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.8
  • Ruby on Rails 4.0.7
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.7
  • Ruby on Rails 4.0.6 Release Candidate 3
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.6:rc3
  • Ruby on Rails 4.0.6 Release Candidate 2
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.6:rc2
  • Ruby on Rails 4.0.6 Release Candidate 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.6:rc1
  • Ruby on Rails 4.0.6
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.6
  • Ruby on Rails 4.0.5
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.5
  • Ruby on Rails 4.0.4
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.4
  • Ruby on Rails 4.0.3
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.3
  • Ruby on Rails 4.0.2
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.2
  • Ruby on Rails 4.0.10 Release Candidate 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.10:rc1
  • Ruby on Rails 4.0.1 Release Candidate 4
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.1:rc4
  • Ruby on Rails 4.0.1 Release Candidate 3
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.1:rc3
  • Ruby on Rails 4.0.1 Release Candidate 2
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.1:rc2
  • Ruby on Rails 4.0.1 Release Candidate 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.1:rc1
  • Ruby on Rails 4.0.1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.1
  • Ruby on Rails 4.0.0 Release Candidate 2
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.0:rc2
  • Ruby on Rails 4.0.0 Release Candidate 1
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.0:rc1
  • Ruby on Rails 4.0.0 Beta
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.0:beta
  • Ruby on Rails 4.0.0
    cpe:2.3:a:rubyonrails:ruby_on_rails:4.0.0
  • cpe:2.3:a:rubyonrails:ruby_on_rails:3.2.22
    cpe:2.3:a:rubyonrails:ruby_on_rails:3.2.22
CVSS
Base: 5.0 (as of 03-03-2016 - 13:55)
Impact:
Exploitability:
CWE CWE-22
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.
  • Using Escaped Slashes in Alternate Encoding
    This attack targets the use of the backslash in alternate encoding. An attacker can provide a backslash as a leading character and causes a parser to believe that the next character is special. This is called an escape. By using that trick, the attacker tries to exploit alternate ways to encode the same character which leads to filter problems and opens avenues to attack.
  • Using Slashes in Alternate Encoding
    This attack targets the encoding of the Slash characters. An attacker would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the attacker many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server software that only applies filters to one version, but not the other.
Access
VectorComplexityAuthentication
NETWORK LOW NONE
Impact
ConfidentialityIntegrityAvailability
PARTIAL NONE NONE
exploit-db via4
description Ruby on Rails - Dynamic Render File Upload Remote Code Execution. CVE-2016-0752. Remote exploit for Multiple platform. Tags: Metasploit Framework
file exploits/multiple/remote/40561.rb
id EDB-ID:40561
last seen 2016-10-18
modified 2016-10-17
platform multiple
port
published 2016-10-17
reporter Metasploit
source https://www.exploit-db.com/download/40561/
title Ruby on Rails - Dynamic Render File Upload Remote Code Execution
type remote
metasploit via4
description This module exploits a remote code execution vulnerability in the explicit render method when leveraging user parameters. This module has been tested across multiple versions of Ruby on Rails. The technique used by this module requires the specified endpoint to be using dynamic render paths, such as the following example: def show render params[:id] end Also, the vulnerable target will need a POST endpoint for the TempFile upload, this can literally be any endpoint. This module doesnt use the log inclusion method of exploitation due to it not being universal enough. Instead, a new code injection technique was found and used whereby an attacker can upload temporary image files against any POST endpoint and use them for the inclusion attack. Finally, you only get one shot at this if you are testing with the builtin rails server, use caution.
id MSF:EXPLOIT/MULTI/HTTP/RAILS_DYNAMIC_RENDER_CODE_EXEC
last seen 2019-02-14
modified 2017-07-24
published 2016-10-10
reliability Excellent
reporter Rapid7
source https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/rails_dynamic_render_code_exec.rb
title Ruby on Rails Dynamic Render File Upload Remote Code Execution
nessus via4
  • NASL family Debian Local Security Checks
    NASL id DEBIAN_DSA-3464.NASL
    description Multiple security issues have been discovered in the Ruby on Rails web application development framework, which may result in denial of service, cross-site scripting, information disclosure or bypass of input validation.
    last seen 2019-02-21
    modified 2018-11-10
    plugin id 88499
    published 2016-02-01
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=88499
    title Debian DSA-3464-1 : rails - security update
  • NASL family SuSE Local Security Checks
    NASL id OPENSUSE-2016-159.NASL
    description This update for rubygem-actionpack-4_2, rubygem-actionview-4_2, rubygem-activemodel-4_2, rubygem-activerecord-4_2, rubygem-activesupport-4_2 fixes the following issues : - CVE-2015-7576: Timing attack vulnerability in basic authentication in Action Controller (boo#963329) - CVE-2016-0752: directory traversal and information leak in Action View (boo#963332) - CVE-2015-7581: unbounded memory growth DoS via wildcard controller routes (boo#963335) - CVE-2016-0751: rubygem-actionpack: Object Leak DoS (boo#963331) - CVE-2016-0753: Input Validation Circumvention (boo#963334) - CVE-2015-7577: Nested attributes rejection proc bypass (boo#963330)
    last seen 2019-02-21
    modified 2016-12-07
    plugin id 88612
    published 2016-02-08
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=88612
    title openSUSE Security Update : rubygem-actionpack-4_2 / rubygem-actionview-4_2 / rubygem-activemodel-4_2 / etc (openSUSE-2016-159)
  • NASL family FreeBSD Local Security Checks
    NASL id FREEBSD_PKG_BB0EF21D0E1B461BBC3D9CBA39948888.NASL
    description Ruby on Rails blog : Rails 5.0.0.beta1.1, 4.2.5.1, 4.1.14.1, and 3.2.22.1 have been released! These contain important security fixes, and it is recommended that users upgrade as soon as possible.
    last seen 2019-02-21
    modified 2018-12-19
    plugin id 88532
    published 2016-02-03
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=88532
    title FreeBSD : rails -- multiple vulnerabilities (bb0ef21d-0e1b-461b-bc3d-9cba39948888)
  • NASL family Debian Local Security Checks
    NASL id DEBIAN_DLA-604.NASL
    description Multiple 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 'render' method, a remote, unauthenticated attacker could use this flaw to render unexpected files and, possibly, execute arbitrary code. CVE-2016-2097 Crafted requests to Action View might result in rendering files from arbitrary locations, including files beyond the application's view directory. This vulnerability is the result of an incomplete fix of CVE-2016-0752. This bug was found by Jyoti Singh and Tobias Kraze from Makandra. CVE-2016-2098 If a web applications does not properly sanitize user inputs, an attacker might control the arguments of the render method in a controller or a view, resulting in the possibility of executing arbitrary ruby code. This bug was found by Tobias Kraze from Makandra and joernchen of Phenoelit. CVE-2016-6316 Andrew Carpenter of Critical Juncture discovered a cross-site scripting vulnerability affecting Action View. Text declared as 'HTML safe' will not have quotes escaped when used as attribute values in tag helpers. For Debian 7 'Wheezy', these problems have been fixed in version 3.2.6-6+deb7u3. We recommend that you upgrade your ruby-actionpack-3.2 packages. 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 seen 2019-02-21
    modified 2018-07-10
    plugin id 93132
    published 2016-08-29
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=93132
    title Debian DLA-604-1 : ruby-actionpack-3.2 security update
  • NASL family Fedora Local Security Checks
    NASL id FEDORA_2016-97002AD37B.NASL
    description Security fix for CVE-2016-0752 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 seen 2019-02-21
    modified 2016-12-08
    plugin id 89585
    published 2016-03-04
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=89585
    title Fedora 23 : rubygem-actionview-4.2.3-3.fc23 (2016-97002ad37b)
  • NASL family SuSE Local Security Checks
    NASL id OPENSUSE-2016-160.NASL
    description This update for rubygem-actionpack-3_2, rubygem-activesupport-3_2 fixes the following issues : - CVE-2015-7576: Timing attack vulnerability in basic authentication in Action Controller (boo#963329) - CVE-2016-0752: directory traversal and information leak in Action View (boo#963332) - CVE-2016-0751: rubygem-actionpack: Object Leak DoS (boo#963331) - CVE-2015-7577: Nested attributes rejection proc bypass (boo#963330)
    last seen 2019-02-21
    modified 2016-12-07
    plugin id 88613
    published 2016-02-08
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=88613
    title openSUSE Security Update : rubygem-actionpack-3_2 / rubygem-activesupport-3_2 (openSUSE-2016-160)
  • NASL family Fedora Local Security Checks
    NASL id FEDORA_2016-FA0DEC2360.NASL
    description Security fix for CVE-2016-0752 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 seen 2019-02-21
    modified 2016-12-08
    plugin id 89644
    published 2016-03-04
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=89644
    title Fedora 22 : rubygem-actionview-4.2.0-3.fc22 (2016-fa0dec2360)
packetstorm via4
data source https://packetstormsecurity.com/files/download/139143/rails_dynamic_render_code_exec.rb.txt
id PACKETSTORM:139143
last seen 2016-12-05
published 2016-10-13
reporter metasploit.com
source https://packetstormsecurity.com/files/139143/Ruby-on-Rails-Dynamic-Render-File-Upload-Remote-Code-Execution.html
title Ruby on Rails Dynamic Render File Upload Remote Code Execution
redhat via4
advisories
rhsa
id RHSA-2016:0296
refmap via4
bid 81801
debian DSA-3464
exploit-db 40561
fedora
  • FEDORA-2016-97002ad37b
  • FEDORA-2016-fa0dec2360
mlist
  • [oss-security] 20160125 [CVE-2016-0752] Possible Information Leak Vulnerability in Action View
  • [ruby-security-ann] 20160125 [CVE-2016-0752] Possible Information Leak Vulnerability in Action View
sectrack 1034816
suse
  • SUSE-SU-2016:1146
  • openSUSE-SU-2016:0363
  • openSUSE-SU-2016:0372
saint via4
bid 81801
description Ruby on Rails Dynamic Render code execution
id web_dev_rubyonrailsdynrender
title ruby_on_rails_dynamic_render
type remote
Last major update 05-12-2016 - 22:05
Published 15-02-2016 - 21:59
Last modified 09-09-2017 - 21:29
Back to Top