Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module Codesake | ||
module Dawn | ||
module Kb | ||
# Automatically created with rake on 2014-02-21 | ||
class CVE_2014_0082 | ||
include DependencyCheck | ||
|
||
def initialize | ||
message = "actionpack/lib/action_view/template/text.rb in Action View in Ruby on Rails 3.x before 3.2.17 converts MIME type strings to symbols during use of the :text option to the render method, which allows remote attackers to cause a denial of service (memory consumption) by including these strings in headers." | ||
|
||
super({ | ||
:name=>"CVE-2014-0082", | ||
:cvss=>"AV:N/AC:L/Au:N/C:N/I:N/A:P", | ||
:release_date => Date.new(2014, 2, 20), | ||
:cwe=>"20", | ||
:owasp=>"A9", | ||
:applies=>["rails"], | ||
:kind=>Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK, | ||
:message=>message, | ||
:mitigation=>"Please upgrade rails version at least to 3.2.17. As a general rule, using the latest stable rails version is recommended.", | ||
:aux_links=>["https://groups.google.com/forum/message/raw?msg=rubyonrails-security/LMxO_3_eCuc/ozGBEhKaJbIJ"] | ||
}) | ||
|
||
self.safe_dependencies = [{:name=>"rails", :version=>['3.2.17', '3.1.9999', '3.0.99999', '2.99999.99999', '1.99999.99999']}] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
require 'spec_helper' | ||
describe "The CVE-2014-0082 vulnerability" do | ||
before(:all) do | ||
@check = Codesake::Dawn::Kb::CVE_2014_0082.new | ||
# @check.debug = true | ||
end | ||
it "affects version 3.0.x" do | ||
require 'securerandom' | ||
rand = SecureRandom.random_number(9999) | ||
version = "3.0.#{rand}" | ||
|
||
@check.dependencies = [{:name=>"rails", :version=>version}] | ||
@check.vuln?.should be_true | ||
end | ||
it "affects version 2.x.y" do | ||
require 'securerandom' | ||
rand_min = SecureRandom.random_number(9999) | ||
rand_patch = SecureRandom.random_number(9999) | ||
version = "2.#{rand_min}.#{rand_patch}" | ||
|
||
@check.dependencies = [{:name=>"rails", :version=>version}] | ||
@check.vuln?.should be_true | ||
end | ||
it "affects version 1.x.y" do | ||
require 'securerandom' | ||
rand_min = SecureRandom.random_number(9999) | ||
rand_patch = SecureRandom.random_number(9999) | ||
version = "1.#{rand_min}.#{rand_patch}" | ||
|
||
@check.dependencies = [{:name=>"rails", :version=>version}] | ||
@check.vuln?.should be_true | ||
end | ||
it "doesn't affect version 4.0.2" do | ||
@check.dependencies = [{:name=>"rails", :version=>'4.0.2'}] | ||
@check.vuln?.should be_false | ||
end | ||
it "doesn't affect version 4.0.1" do | ||
@check.dependencies = [{:name=>"rails", :version=>'4.0.1'}] | ||
@check.vuln?.should be_false | ||
end | ||
it "doesn't affect version 4.0.0" do | ||
@check.dependencies = [{:name=>"rails", :version=>'4.0.0'}] | ||
@check.vuln?.should be_false | ||
end | ||
it "doesn't affect version 4.0.3" do | ||
@check.dependencies = [{:name=>"rails", :version=>'4.0.3'}] | ||
@check.vuln?.should be_false | ||
end | ||
it "doesn't affect version 3.2.17" do | ||
@check.dependencies = [{:name=>"rails", :version=>'3.2.17'}] | ||
@check.vuln?.should be_false | ||
end | ||
end |