Sha256: d88eeb20cf8b2b30504ad1d57d9eae397cb37ac9185f4e400bd4b1df5708acf1

Contents?: true

Size: 1.67 KB

Versions: 11

Compression:

Stored size: 1.67 KB

Contents

require 'spec_helper'
describe "The CVE-2014-0082 vulnerability" do
	before(:all) do
		@check = 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 == 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 == 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 == true
  end
  it "doesn't affect version 4.0.2" do 
    @check.dependencies = [{:name=>"rails", :version=>'4.0.2'}]
    @check.vuln?.should == false
  end
  it "doesn't affect version 4.0.1" do 
    @check.dependencies = [{:name=>"rails", :version=>'4.0.1'}]
    @check.vuln?.should == false
  end
  it "doesn't affect version 4.0.0" do 
    @check.dependencies = [{:name=>"rails", :version=>'4.0.0'}]
    @check.vuln?.should == false
  end
  it "doesn't affect version 4.0.3" do 
    @check.dependencies = [{:name=>"rails", :version=>'4.0.3'}]
    @check.vuln?.should == false
  end
  it "doesn't affect version 3.2.17" do 
    @check.dependencies = [{:name=>"rails", :version=>'3.2.17'}]
    @check.vuln?.should == false
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dawnscanner-1.6.1 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.6.0 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.5.2 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.5.1 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.5.0 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.4.2 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.4.1 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.4.0 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.3.5 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.3.1 spec/lib/kb/cve_2014_0082_spec.rb
dawnscanner-1.3.0 spec/lib/kb/cve_2014_0082_spec.rb