Bug 1301963 (CVE-2016-0752) - CVE-2016-0752 rubygem-actionview, rubygem-actionpack: directory traversal flaw in Action View
Summary: CVE-2016-0752 rubygem-actionview, rubygem-actionpack: directory traversal fla...
Status: CLOSED ERRATA
Alias: CVE-2016-0752
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=important,public=20160125,repo...
Keywords: Security
Depends On: 1301964 1306275 1306276 1306277 1306278 1306279 1306281 1306288 1306289
Blocks: 1302006
TreeView+ depends on / blocked
 
Reported: 2016-01-26 12:55 UTC by Adam Mariš
Modified: 2018-02-12 20:00 UTC (History)
33 users (show)

(edit)
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.
Clone Of:
(edit)
Last Closed: 2016-03-15 21:22:29 UTC


Attachments (Terms of Use)
3.2 patch (5.95 KB, patch)
2016-01-29 15:02 UTC, Ján Rusnačko
no flags Details | Diff
4.1 patch (11.33 KB, patch)
2016-01-29 15:02 UTC, Ján Rusnačko
no flags Details | Diff
4.2 patch (11.33 KB, patch)
2016-01-29 15:03 UTC, Ján Rusnačko
no flags Details | Diff
5.0 patch (11.04 KB, patch)
2016-01-29 15:04 UTC, Ján Rusnačko
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0296 normal SHIPPED_LIVE Important: rh-ror41 security update 2016-02-24 15:36:00 UTC
Red Hat Product Errata RHSA-2016:0454 normal SHIPPED_LIVE Important: ror40 security update 2016-03-16 00:56:17 UTC
Red Hat Product Errata RHSA-2016:0455 normal SHIPPED_LIVE Important: ruby193 security update 2016-03-16 00:55:59 UTC

Description Adam Mariš 2016-01-26 12:55:44 UTC
A possible directory traversal and information leak vulnerability in Action View was reported. Applications that pass unverified user input to the `render` method in a controller may be vulnerable to an information leak vulnerability.

Vulnerable code:

```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 versions are affected.

http://weblog.rubyonrails.org/2016/1/25/Rails-5-0-0-beta1-1-4-2-5-1-4-1-14-1-3-2-22-1-and-rails-html-sanitizer-1-0-3-have-been-released/

External References:

https://groups.google.com/forum/#!msg/rubyonrails-security/335P1DcLG00/OfB9_LhbFQAJ
https://nvisium.com/blog/2016/01/26/rails-dynamic-render-to-rce-cve-2016-0752/

Comment 1 Adam Mariš 2016-01-26 12:56:12 UTC
Created rubygem-actionview tracking bugs for this issue:

Affects: fedora-all [bug 1301964]

Comment 2 Adam Mariš 2016-01-26 15:23:49 UTC
Acknowledgments:

Red Hat would like to thank Ruby on Rails project for reporting this issue.
Upstream acknowledges John Poulin as the original reporter.

Comment 3 Ján Rusnačko 2016-01-29 15:02 UTC
Created attachment 1119445 [details]
3.2 patch

Comment 4 Ján Rusnačko 2016-01-29 15:02 UTC
Created attachment 1119446 [details]
4.1 patch

Comment 5 Ján Rusnačko 2016-01-29 15:03 UTC
Created attachment 1119447 [details]
4.2 patch

Comment 6 Ján Rusnačko 2016-01-29 15:04 UTC
Created attachment 1119449 [details]
5.0 patch

Comment 14 errata-xmlrpc 2016-02-24 10:37:27 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6

Via RHSA-2016:0296 https://rhn.redhat.com/errata/RHSA-2016-0296.html

Comment 15 Fedora Update System 2016-02-28 08:27:55 UTC
rubygem-actionview-4.2.0-3.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2016-02-28 12:26:40 UTC
rubygem-actionview-4.2.3-3.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 errata-xmlrpc 2016-03-15 21:00:40 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS

Via RHSA-2016:0455 https://rhn.redhat.com/errata/RHSA-2016-0455.html

Comment 19 errata-xmlrpc 2016-03-15 21:03:31 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS

Via RHSA-2016:0454 https://rhn.redhat.com/errata/RHSA-2016-0454.html

Comment 20 Stephen Herr 2017-12-02 00:16:17 UTC
Mitigation:

Avoid passing untrusted input to render method, or verify the input using whitelist before passing it to the render method:

```

def index
  render verify_template(params[:id])
end

private
def verify_template(name)
  # add verification logic particular to your application here
end

```


Note You need to log in before you can comment on or make changes to this bug.