aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-01-20 10:39:19 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2016-01-22 15:02:27 -0800
commitb7758b40fc035a47f6843158155606d455314c42 (patch)
tree92e2bdb231a7dda8902e0563bdc98867098c298a /actionview/test/template
parent0fde6f554b75b13b0435dd70f1c3ec02bc209e0d (diff)
downloadrails-b7758b40fc035a47f6843158155606d455314c42.tar.gz
rails-b7758b40fc035a47f6843158155606d455314c42.tar.bz2
rails-b7758b40fc035a47f6843158155606d455314c42.zip
allow :file to be outside rails root, but anything else must be inside the rails view directory
CVE-2016-0752
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/render_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb
index 994fd44c52..df27b52197 100644
--- a/actionview/test/template/render_test.rb
+++ b/actionview/test/template/render_test.rb
@@ -148,6 +148,13 @@ module RenderTestCases
assert_equal "only partial", @view.render("test/partial_only")
end
+ def test_render_outside_path
+ assert File.exist?(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb'))
+ assert_raises ActionView::MissingTemplate do
+ @view.render(:template => "../\\../test/abstract_unit.rb")
+ end
+ end
+
def test_render_partial
assert_equal "only partial", @view.render(:partial => "test/partial_only")
end