提交 0aca60fc 编写于 作者: J Justin Collins

Tests for SafeBuffer vulnerability

上级 f6dfcce6
...@@ -15,7 +15,7 @@ class Rails3Tests < Test::Unit::TestCase ...@@ -15,7 +15,7 @@ class Rails3Tests < Test::Unit::TestCase
:controller => 1, :controller => 1,
:model => 5, :model => 5,
:template => 21, :template => 21,
:warning => 22 :warning => 23
} }
end end
...@@ -494,4 +494,12 @@ class Rails3Tests < Test::Unit::TestCase ...@@ -494,4 +494,12 @@ class Rails3Tests < Test::Unit::TestCase
:confidence => 0, :confidence => 0,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
end end
def test_string_buffer_manipulation_bug
assert_warning :type => :warning,
:warning_type => "Cross Site Scripting",
:message => /^Rails 3.0.5 has a vulnerabilty in SafeBuffer. Upgrade to 3.0.12/,
:confidence => 1,
:file => /Gemfile/
end
end end
...@@ -15,7 +15,7 @@ class Rails31Tests < Test::Unit::TestCase ...@@ -15,7 +15,7 @@ class Rails31Tests < Test::Unit::TestCase
:model => 0, :model => 0,
:template => 1, :template => 1,
:controller => 1, :controller => 1,
:warning => 7 } :warning => 8 }
end end
def test_without_protection def test_without_protection
...@@ -106,4 +106,12 @@ class Rails31Tests < Test::Unit::TestCase ...@@ -106,4 +106,12 @@ class Rails31Tests < Test::Unit::TestCase
:confidence => 1, :confidence => 1,
:file => /edit\.html\.erb/ :file => /edit\.html\.erb/
end end
def test_string_buffer_manipulation_bug
assert_warning :type => :warning,
:warning_type => "Cross Site Scripting",
:message => /^Rails 3.1.0 has a vulnerabilty in SafeBuffer. Upgrade to 3.1.4/,
:confidence => 1,
:file => /Gemfile/
end
end end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册