提交 2f6fb06d 编写于 作者: J Justin Collins

Add test for select vulnerability in Rails 3

上级 05a6ff6b
<h1>Editing user</h1>
<%= select('post', 'author_id', "<option value='#{@user.id}'>#{@user.name}</option>") %>
<%= render 'form' %>
<%= link_to 'Show', @user %> |
......
......@@ -13,7 +13,7 @@ class Rails31Tests < Test::Unit::TestCase
def expected
@expected ||= {
:model => 0,
:template => 0,
:template => 1,
:controller => 1,
:warning => 7 }
end
......@@ -97,4 +97,13 @@ class Rails31Tests < Test::Unit::TestCase
:confidence => 1,
:file => /user\.rb/
end
def test_select_vulnerability
assert_warning :type => :template,
:warning_type => "Cross Site Scripting",
:line => 2,
:message => /^Upgrade to Rails 3.1.4, 3.1.0 select\(\) helper is vulnerable/,
:confidence => 0,
:file => /edit\.html\.erb/
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册