Sha256: 9eee49223dca6159bcc9343926241046de47ee329a685d8c917fdc448c272e09

Contents?: true

Size: 1.94 KB

Versions: 9

Compression:

Stored size: 1.94 KB

Contents

require 'spec_helper'
describe "The CVE-2013-0256 vulnerability" do
	before(:all) do
		@check = Codesake::Dawn::Kb::CVE_2013_0256.new
		# @check.debug = true
	end
  it "fires when vulnerable ruby (1.9.3-p382) and rdoc version (2.3.0) has been found" do
    @check.options={:detected_ruby=>{:engine=>"ruby", :version=>"1.9.3", :patchlevel=>"381"}, :dependencies=>[{:name=>"rdoc", :version=>'2.3.0'}, :root_dir=>"."]}
    @check.vuln?.should   be_true
  end
  it "fires when vulnerable ruby (1.9.2-p342) and rdoc version (2.3.0) has been found" do
    @check.options={:detected_ruby=>{:engine=>"ruby", :version=>"1.9.2", :patchlevel=>"342"}, :dependencies=>[{:name=>"rdoc", :version=>'2.3.0'}, :root_dir=>"."]}
    @check.vuln?.should   be_true
  end

  it "fires when vulnerable ruby (1.9.3-p382) and rdoc version (3.12) has been found" do
    @check.options={:detected_ruby=>{:engine=>"ruby", :version=>"1.9.3", :patchlevel=>"381"}, :dependencies=>[{:name=>"rdoc", :version=>'3.12'}, :root_dir=>"."]}
    @check.vuln?.should   be_true
  end
  it "fires when vulnerable ruby (1.9.2-p342) and rdoc version (3.12) has been found" do
    @check.options={:detected_ruby=>{:engine=>"ruby", :version=>"1.9.2", :patchlevel=>"342"}, :dependencies=>[{:name=>"rdoc", :version=>'3.12'}, :root_dir=>"."]}
    @check.vuln?.should   be_true
  end

  it "doesn't fire when not vulnerable ruby (1.9.3-p383) is found but vulnerable rdoc version (3.12) has been found" do
    @check.options={:detected_ruby=>{:engine=>"ruby", :version=>"1.9.3", :patchlevel=>"383"}, :dependencies=>[{:name=>"rdoc", :version=>'3.12'}, :root_dir=>"."]}
    @check.vuln?.should   be_false
  end

  it "doesn't fire when vulnerable ruby (1.9.3-p382) is found but not vulnerable rdoc version (3.13) has been found" do
    @check.options={:detected_ruby=>{:engine=>"ruby", :version=>"1.9.3", :patchlevel=>"322"}, :dependencies=>[{:name=>"rdoc", :version=>'3.13'}, :root_dir=>"."]}
    @check.vuln?.should   be_false
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
dawnscanner-1.2.99 spec/lib/kb/cve_2013_0256_spec.rb
codesake-dawn-1.2.99 spec/lib/kb/cve_2013_0256_spec.rb
codesake-dawn-1.2.0 spec/lib/kb/cve_2013_0256_spec.rb
codesake-dawn-1.1.3 spec/lib/kb/cve_2013_0256_spec.rb
codesake-dawn-1.1.2 spec/lib/kb/cve_2013_0256_spec.rb
codesake-dawn-1.1.1 spec/lib/kb/cve_2013_0256_spec.rb
codesake-dawn-1.1.0 spec/lib/kb/cve_2013_0256_spec.rb
codesake-dawn-1.1.0.rc2 spec/lib/kb/cve_2013_0256_spec.rb
codesake-dawn-1.1.0.rc1 spec/lib/kb/cve_2013_0256_spec.rb