提交 88d4341c 编写于 作者: J Justin Collins

Add check for CVE-2014-3482 and CVE-2014-3483

上级 0e3379b7
......@@ -48,6 +48,18 @@ class Brakeman::CheckSQLCVEs < Brakeman::BaseCheck
}
end
if tracker.config[:gems] and tracker.config[:gems][:pg]
issues << {
:cve => "CVE-2014-3482",
:versions => [%w[2.0.0 2.9.9 3.2.19], %w[3.0.0 3.2.18 3.2.19], %w[4.0.0 4.0.6 4.0.7], %w[4.1.0 4.1.2 4.1.3]],
:url => "https://groups.google.com/d/msg/rubyonrails-security/wDxePLJGZdI/WP7EasCJTA4J"
} <<
{
:cve => "CVE-2014-3483",
:versions => [%w[2.0.0 2.9.9 3.2.19], %w[3.0.0 3.2.18 3.2.19], %w[4.0.0 4.0.6 4.0.7], %w[4.1.0 4.1.2 4.1.3]],
:url => "https://groups.google.com/d/msg/rubyonrails-security/wDxePLJGZdI/WP7EasCJTA4J" }
end
issues.each do |cve_issue|
cve_warning_for cve_issue[:versions], cve_issue[:cve], cve_issue[:url]
end
......
......@@ -78,6 +78,8 @@ module Brakeman::WarningCodes
:CVE_2014_0082 => 75,
:regex_dos => 76,
:CVE_2014_0130 => 77,
:CVE_2014_3482 => 78,
:CVE_2014_3483 => 79,
}
def self.code name
......
......@@ -15,7 +15,7 @@ class Rails4Tests < Test::Unit::TestCase
:controller => 0,
:model => 1,
:template => 2,
:generic => 28
:generic => 30
}
end
......@@ -464,6 +464,30 @@ class Rails4Tests < Test::Unit::TestCase
:user_input => nil
end
def test_sql_injection_CVE_2014_3482
assert_warning :type => :warning,
:warning_code => 78,
:fingerprint => "5c9706393849d7de5125a3688562aea31e112a7b09d0abbb461ee5dc7c1751b8",
:warning_type => "SQL Injection",
:line => nil,
:message => /^Rails\ 4\.0\.0\ contains\ a\ SQL\ injection\ vul/,
:confidence => 0,
:relative_path => "Gemfile",
:user_input => nil
end
def test_sql_injection_CVE_2014_3483
assert_warning :type => :warning,
:warning_code => 79,
:fingerprint => "4a60c60c39e12b1dd1d8b490f228594f0a555aa5447587625df362327e86ad2f",
:warning_type => "SQL Injection",
:line => nil,
:message => /^Rails\ 4\.0\.0\ contains\ a\ SQL\ injection\ vul/,
:confidence => 0,
:relative_path => "Gemfile",
:user_input => nil
end
def test_mass_assignment_with_permit!
assert_warning :type => :warning,
:warning_code => 70,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册