mrjoy-bundler-audit 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +3 -0
- data/.gitignore +6 -0
- data/.gitmodules +3 -0
- data/.rspec +1 -0
- data/.travis.yml +5 -0
- data/.yardopts +1 -0
- data/COPYING.txt +674 -0
- data/ChangeLog.md +79 -0
- data/Gemfile +14 -0
- data/README.md +105 -0
- data/Rakefile +47 -0
- data/bin/bundle-audit +10 -0
- data/data/ruby-advisory-db/.rspec +1 -0
- data/data/ruby-advisory-db/CONTRIBUTING.md +6 -0
- data/data/ruby-advisory-db/CONTRIBUTORS.md +13 -0
- data/data/ruby-advisory-db/Gemfile +3 -0
- data/data/ruby-advisory-db/LICENSE.txt +5 -0
- data/data/ruby-advisory-db/README.md +86 -0
- data/data/ruby-advisory-db/Rakefile +27 -0
- data/data/ruby-advisory-db/gems/actionpack/OSVDB-79727.yml +26 -0
- data/data/ruby-advisory-db/gems/actionpack/OSVDB-84243.yml +28 -0
- data/data/ruby-advisory-db/gems/actionpack/OSVDB-84513.yml +23 -0
- data/data/ruby-advisory-db/gems/actionpack/OSVDB-84515.yml +26 -0
- data/data/ruby-advisory-db/gems/actionpack/OSVDB-89026.yml +24 -0
- data/data/ruby-advisory-db/gems/actionpack/OSVDB-91452.yml +20 -0
- data/data/ruby-advisory-db/gems/actionpack/OSVDB-91454.yml +23 -0
- data/data/ruby-advisory-db/gems/activerecord/OSVDB-82403.yml +25 -0
- data/data/ruby-advisory-db/gems/activerecord/OSVDB-82610.yml +24 -0
- data/data/ruby-advisory-db/gems/activerecord/OSVDB-89025.yml +24 -0
- data/data/ruby-advisory-db/gems/activerecord/OSVDB-90072.yml +21 -0
- data/data/ruby-advisory-db/gems/activerecord/OSVDB-90073.yml +23 -0
- data/data/ruby-advisory-db/gems/activerecord/OSVDB-91453.yml +26 -0
- data/data/ruby-advisory-db/gems/activesupport/OSVDB-79726.yml +26 -0
- data/data/ruby-advisory-db/gems/activesupport/OSVDB-84516.yml +23 -0
- data/data/ruby-advisory-db/gems/activesupport/OSVDB-89594.yml +25 -0
- data/data/ruby-advisory-db/gems/activesupport/OSVDB-91451.yml +28 -0
- data/data/ruby-advisory-db/gems/command_wrap/OSVDB-91450.yml +10 -0
- data/data/ruby-advisory-db/gems/crack/OSVDB-90742.yml +17 -0
- data/data/ruby-advisory-db/gems/cremefraiche/OSVDB-93395.yml +11 -0
- data/data/ruby-advisory-db/gems/curl/OSVDB-91230.yml +12 -0
- data/data/ruby-advisory-db/gems/devise/OSVDB-89642.yml +20 -0
- data/data/ruby-advisory-db/gems/dragonfly/OSVDB-90647.yml +19 -0
- data/data/ruby-advisory-db/gems/enum_column3/OSVDB-94679.yml +9 -0
- data/data/ruby-advisory-db/gems/extlib/OSVDB-90740.yml +18 -0
- data/data/ruby-advisory-db/gems/fastreader/OSVDB-91232.yml +12 -0
- data/data/ruby-advisory-db/gems/fileutils/OSVDB-90715.yml +10 -0
- data/data/ruby-advisory-db/gems/fileutils/OSVDB-90716.yml +10 -0
- data/data/ruby-advisory-db/gems/fileutils/OSVDB-90717.yml +10 -0
- data/data/ruby-advisory-db/gems/flash_tool/OSVDB-90829.yml +9 -0
- data/data/ruby-advisory-db/gems/ftpd/OSVDB-90784.yml +18 -0
- data/data/ruby-advisory-db/gems/gtk2/OSVDB-40774.yml +20 -0
- data/data/ruby-advisory-db/gems/httparty/OSVDB-90741.yml +19 -0
- data/data/ruby-advisory-db/gems/json/OSVDB-90074.yml +23 -0
- data/data/ruby-advisory-db/gems/karteek-docsplit/OSVDB-92117.yml +10 -0
- data/data/ruby-advisory-db/gems/kelredd-pruview/OSVDB-92228.yml +10 -0
- data/data/ruby-advisory-db/gems/ldoce/OSVDB-91870.yml +10 -0
- data/data/ruby-advisory-db/gems/loofah/OSVDB-90945.yml +21 -0
- data/data/ruby-advisory-db/gems/mail/OSVDB-70667.yml +21 -0
- data/data/ruby-advisory-db/gems/mail/OSVDB-81631.yml +14 -0
- data/data/ruby-advisory-db/gems/mail/OSVDB-81632.yml +16 -0
- data/data/ruby-advisory-db/gems/md2pdf/OSVDB-92290.yml +10 -0
- data/data/ruby-advisory-db/gems/mini_magick/OSVDB-91231.yml +15 -0
- data/data/ruby-advisory-db/gems/multi_xml/OSVDB-89148.yml +16 -0
- data/data/ruby-advisory-db/gems/newrelic_rpm/OSVDB-90189.yml +17 -0
- data/data/ruby-advisory-db/gems/nori/OSVDB-90196.yml +19 -0
- data/data/ruby-advisory-db/gems/omniauth-oauth2/OSVDB-90264.yml +16 -0
- data/data/ruby-advisory-db/gems/pdfkit/OSVDB-90867.yml +11 -0
- data/data/ruby-advisory-db/gems/rack-cache/OSVDB-83077.yml +18 -0
- data/data/ruby-advisory-db/gems/rack/OSVDB-89939.yml +23 -0
- data/data/ruby-advisory-db/gems/rdoc/OSVDB-90004.yml +27 -0
- data/data/ruby-advisory-db/gems/rgpg/OSVDB-95948.yml +13 -0
- data/data/ruby-advisory-db/gems/ruby_parser/OSVDB-90561.yml +11 -0
- data/data/ruby-advisory-db/gems/spree/OSVDB-91216.yml +10 -0
- data/data/ruby-advisory-db/gems/spree/OSVDB-91217.yml +10 -0
- data/data/ruby-advisory-db/gems/spree/OSVDB-91218.yml +10 -0
- data/data/ruby-advisory-db/gems/spree/OSVDB-91219.yml +10 -0
- data/data/ruby-advisory-db/gems/thumbshooter/OSVDB-91839.yml +10 -0
- data/data/ruby-advisory-db/lib/scrape.rb +87 -0
- data/data/ruby-advisory-db/spec/advisory_example.rb +165 -0
- data/data/ruby-advisory-db/spec/gems_spec.rb +8 -0
- data/data/ruby-advisory-db/spec/spec_helper.rb +1 -0
- data/gemspec.yml +16 -0
- data/lib/bundler/audit.rb +21 -0
- data/lib/bundler/audit/advisory.rb +142 -0
- data/lib/bundler/audit/cli.rb +124 -0
- data/lib/bundler/audit/database.rb +187 -0
- data/lib/bundler/audit/scanner.rb +97 -0
- data/lib/bundler/audit/version.rb +25 -0
- data/mrjoy-bundler-audit.gemspec +66 -0
- data/spec/advisory_spec.rb +145 -0
- data/spec/audit_spec.rb +8 -0
- data/spec/bundle/insecure_sources/Gemfile +39 -0
- data/spec/bundle/secure/Gemfile +38 -0
- data/spec/bundle/unpatched_gems/Gemfile +38 -0
- data/spec/database_spec.rb +81 -0
- data/spec/integration_spec.rb +81 -0
- data/spec/scanner_spec.rb +74 -0
- data/spec/spec_helper.rb +21 -0
- metadata +162 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
gem: pdfkit
|
3
|
+
cve: 2013-1607
|
4
|
+
osvdb: 90867
|
5
|
+
url: http://osvdb.org/show/osvdb/90867
|
6
|
+
title: PDFKit Gem for Ruby PDF File Generation Parameter Handling Remote Code Execution
|
7
|
+
date: 2013-02-21
|
8
|
+
description: PDFKit Gem for Ruby contains a flaw that is due to the program failing to properly validate input during the handling of parameters when generating PDF files. This may allow a remote attacker to potentially execute arbitrary code via the pdfkit generation options.
|
9
|
+
cvss_v2:
|
10
|
+
patched_versions:
|
11
|
+
- ">= 0.5.3"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
gem: rack-cache
|
3
|
+
cve: 2012-2671
|
4
|
+
osvdb: 83077
|
5
|
+
url: http://osvdb.org/83077
|
6
|
+
title: rack-cache Rubygem Sensitive HTTP Header Caching Weakness
|
7
|
+
date: 2012-06-06
|
8
|
+
|
9
|
+
description: |
|
10
|
+
Rack::Cache (rack-cache) contains a flaw related to the rubygem caching
|
11
|
+
sensitive HTTP headers. This will result in a weakness that may make it
|
12
|
+
easier for an attacker to gain access to a user's session via a specially
|
13
|
+
crafted header.
|
14
|
+
|
15
|
+
cvss_v2: 7.5
|
16
|
+
|
17
|
+
patched_versions:
|
18
|
+
- ">= 1.2"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
gem: rack
|
3
|
+
cve: 2013-0263
|
4
|
+
osvdb: 89939
|
5
|
+
url: http://osvdb.org/show/osvdb/89939
|
6
|
+
title: |
|
7
|
+
Rack Rack::Session::Cookie Function Timing Attack Remote Code Execution
|
8
|
+
date: 2009-12-01
|
9
|
+
|
10
|
+
description: |
|
11
|
+
Rack contains a flaw that is due to an error in the Rack::Session::Cookie
|
12
|
+
function. Users of the Marshal session cookie encoding (the default), are
|
13
|
+
subject to a timing attack that may lead an attacker to execute arbitrary
|
14
|
+
code. This attack is more practical against 'cloud' users as intra-cloud
|
15
|
+
latencies are sufficiently low to make the attack viable.
|
16
|
+
|
17
|
+
cvss_v2: 7.6
|
18
|
+
patched_versions:
|
19
|
+
- ~> 1.1.6
|
20
|
+
- ~> 1.2.8
|
21
|
+
- ~> 1.3.10
|
22
|
+
- ~> 1.4.5
|
23
|
+
- ">= 1.5.2"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
gem: rdoc
|
3
|
+
cve: 2013-0256
|
4
|
+
osvdb: 90004
|
5
|
+
url: http://www.osvdb.org/show/osvdb/90004
|
6
|
+
title: RDoc 2.3.0 through 3.12 XSS Exploit
|
7
|
+
date: 2013-02-06
|
8
|
+
|
9
|
+
description: |
|
10
|
+
Doc documentation generated by rdoc 2.3.0 through rdoc 3.12 and prereleases
|
11
|
+
up to rdoc 4.0.0.preview2.1 are vulnerable to an XSS exploit. This exploit
|
12
|
+
may lead to cookie disclosure to third parties.
|
13
|
+
|
14
|
+
The exploit exists in darkfish.js which is copied from the RDoc install
|
15
|
+
location to the generated documentation.
|
16
|
+
|
17
|
+
RDoc is a static documentation generation tool. Patching the library itself
|
18
|
+
is insufficient to correct this exploit.
|
19
|
+
|
20
|
+
This exploit was discovered by Evgeny Ermakov <corwmh@gmail.com>.
|
21
|
+
|
22
|
+
cvss_v2: 4.3
|
23
|
+
|
24
|
+
patched_versions:
|
25
|
+
- ~> 3.9.5
|
26
|
+
- ~> 3.12.1
|
27
|
+
- ">= 4.0"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
gem: rgpg
|
3
|
+
osvdb: 95948
|
4
|
+
url: http://www.osvdb.org/show/osvdb/95948
|
5
|
+
title: Ruby rgpg Gem Shell Command Injection Vulnerabilities
|
6
|
+
date: 2013-08-02
|
7
|
+
description: |
|
8
|
+
rgpg Gem for Ruby contains a flaw in the GpgHelper module (lib/rgpg/gpg_helper.rb).
|
9
|
+
The issue is due to the program failing to properly sanitize user-supplied input before being used in the system() function for execution.
|
10
|
+
This may allow a remote attacker to execute arbitrary commands.
|
11
|
+
cvss_v2:
|
12
|
+
patched_versions:
|
13
|
+
- ">= 0.2.3"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
gem: ruby_parser
|
3
|
+
cve: 2013-0162
|
4
|
+
osvdb: 90561
|
5
|
+
url: http://osvdb.org/show/osvdb/90561
|
6
|
+
title: RubyGems ruby_parser (RP) Temporary File Symlink Arbitrary File Overwrite
|
7
|
+
date: 2013-02-21
|
8
|
+
description: RubyGems ruby_parser (RP) contains a flaw as rubygem-ruby_parser creates temporary files insecurely. It is possible for a local attacker to use a symlink attack to cause the program to unexpectedly overwrite an arbitrary file.
|
9
|
+
cvss_v2: 2.1
|
10
|
+
patched_versions:
|
11
|
+
- ">= 3.1.2"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
gem: spree
|
3
|
+
cve: 2013-1656
|
4
|
+
osvdb: 91216
|
5
|
+
url: http://osvdb.org/show/osvdb/91216
|
6
|
+
title: Spree promotion_actions_controller.rb promotion_action Parameter Arbitrary Ruby Object Instantiation Command Execution
|
7
|
+
date: 2013-02-21
|
8
|
+
description: Spree contains a flaw that is triggered when handling input passed via the 'promotion_action' parameter to promotion_actions_controller.rb. This may allow a remote authenticated attacker to instantiate arbitrary Ruby objects and potentially execute arbitrary commands.
|
9
|
+
cvss_v2: 4.3
|
10
|
+
patched_versions:
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
gem: spree
|
3
|
+
cve: 2013-1656
|
4
|
+
osvdb: 91217
|
5
|
+
url: http://osvdb.org/show/osvdb/91217
|
6
|
+
title: Spree payment_methods_controller.rb payment_method Parameter Arbitrary Ruby Object Instantiation Command Execution
|
7
|
+
date: 2013-02-21
|
8
|
+
description: Spree contains a flaw that is triggered when handling input passed via the 'payment_method' parameter to payment_methods_controller.rb. This may allow a remote authenticated attacker to instantiate arbitrary Ruby objects and potentially execute arbitrary commands.
|
9
|
+
cvss_v2: 4.3
|
10
|
+
patched_versions:
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
gem: spree
|
3
|
+
cve: 2013-1656
|
4
|
+
osvdb: 91218
|
5
|
+
url: http://osvdb.org/show/osvdb/91218
|
6
|
+
title: Spree promotions_controller.rb calculator_type Parameter Arbitrary Ruby Object Instantiation Command Execution
|
7
|
+
date: 2013-02-21
|
8
|
+
description: Spree contains a flaw that is triggered when handling input passed via the 'calculator_type' parameter to promotions_controller.rb. This may allow a remote authenticated attacker to instantiate arbitrary Ruby objects and potentially execute arbitrary commands.
|
9
|
+
cvss_v2: 4.3
|
10
|
+
patched_versions:
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
gem: spree
|
3
|
+
cve: 2013-1656
|
4
|
+
osvdb: 91219
|
5
|
+
url: http://osvdb.org/show/osvdb/91219
|
6
|
+
title: Spree promotion_rules_controller.rb promotion_rule Parameter Arbitrary Ruby Object Instantiation Command Execution
|
7
|
+
date: 2013-02-21
|
8
|
+
description: Spree contains a flaw that is triggered when handling input passed via the 'promotion_rule' parameter to promotion_rules_controller.rb. This may allow a remote authenticated attacker to instantiate arbitrary Ruby objects and potentially execute arbitrary commands.
|
9
|
+
cvss_v2: 4.3
|
10
|
+
patched_versions:
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
gem: thumbshooter
|
3
|
+
cve: 2013-1898
|
4
|
+
osvdb: 91839
|
5
|
+
url: http://osvdb.org/show/osvdb/91839
|
6
|
+
title: Thumbshooter Gem for Ruby thumbshooter.rb URL Shell Metacharacter Injection Arbitrary Command Execution
|
7
|
+
date: 2013-03-26
|
8
|
+
description: Thumbshooter Gem for Ruby contains a flaw that is due to the program failing to properly sanitize input passed to thumbshooter.rb. With a specially crafted URL that contains shell metacharacters, a context-dependent attacker can execute arbitrary commands.
|
9
|
+
cvss_v2: 7.5
|
10
|
+
patched_versions:
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
require 'pry'
|
5
|
+
require 'mechanize'
|
6
|
+
require 'yaml'
|
7
|
+
require 'date'
|
8
|
+
|
9
|
+
class OSVDB
|
10
|
+
attr_accessor :osvdb, :cve, :title, :description, :date, :cvss_v2, :gem, :url, :patched_versions, :page
|
11
|
+
def initialize(url)
|
12
|
+
self.url = url
|
13
|
+
parse!
|
14
|
+
end
|
15
|
+
|
16
|
+
def parse!
|
17
|
+
mech = Mechanize.new
|
18
|
+
self.page = mech.get(url)
|
19
|
+
|
20
|
+
page.search(".show_vuln_table").search("td ul li").each do |li|
|
21
|
+
case li.children[0].text.strip
|
22
|
+
when "CVE ID:"
|
23
|
+
self.cve = li.children[1].text
|
24
|
+
when "Vendor URL:"
|
25
|
+
self.set_gem(li.children[1].text)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
self.description = page.search(".show_vuln_table").search("tr td tr .white_content p")[0].text
|
30
|
+
self.date = page.search(".show_vuln_table").search("tr td tr .white_content tr td")[0].text
|
31
|
+
self.title = page.search("title").text.gsub(/\d+: /, "")
|
32
|
+
self.osvdb = page.search("title").text.match(/\d+/)[0]
|
33
|
+
if cvss_p = page.search(".show_vuln_table").search("tr td tr .white_content div p")[0]
|
34
|
+
self.set_cvss(cvss_p.children[0].text)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def set_gem(vendortext)
|
39
|
+
["https://rubygems.org/gems/", "http://rubygems.org/gems/"].each do |str|
|
40
|
+
if vendortext.match(str)
|
41
|
+
self.gem = vendortext.gsub(str,"")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def set_cvss(text)
|
47
|
+
self.cvss_v2 = text.strip.gsub("CVSSv2 Base Score = ", "")
|
48
|
+
end
|
49
|
+
|
50
|
+
def date
|
51
|
+
Date.parse(@date)
|
52
|
+
end
|
53
|
+
|
54
|
+
def cvss_v2
|
55
|
+
@cvss_v2.nil? ? nil : @cvss_v2.to_f
|
56
|
+
end
|
57
|
+
|
58
|
+
def gem
|
59
|
+
@gem.nil? ? "unknown" : @gem
|
60
|
+
end
|
61
|
+
|
62
|
+
def to_yaml
|
63
|
+
{ 'gem' => gem,
|
64
|
+
'cve' => cve,
|
65
|
+
'osvdb' => osvdb.to_i,
|
66
|
+
'url' => url,
|
67
|
+
'title' => title,
|
68
|
+
'date' => date,
|
69
|
+
'description' => description,
|
70
|
+
'cvss_v2' => cvss_v2,
|
71
|
+
'patched_versions' => patched_versions }.to_yaml
|
72
|
+
end
|
73
|
+
|
74
|
+
def filename
|
75
|
+
"OSVDB-#{osvdb}.yml"
|
76
|
+
end
|
77
|
+
|
78
|
+
def to_advisory!
|
79
|
+
gems_path = File.join(File.dirname(__FILE__), "..", "gems")
|
80
|
+
adv_path = File.absolute_path(File.join(gems_path, self.gem))
|
81
|
+
|
82
|
+
FileUtils.mkdir(adv_path) unless File.exists?(adv_path)
|
83
|
+
File.open(File.join(adv_path, filename), "w") do |io|
|
84
|
+
io.puts self.to_yaml
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,165 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
shared_examples_for 'Advisory' do |path|
|
5
|
+
advisory = YAML.load_file(path)
|
6
|
+
|
7
|
+
describe path do
|
8
|
+
let(:gem) { File.basename(File.dirname(path)) }
|
9
|
+
let(:filename_cve) do
|
10
|
+
if File.basename(path).start_with?('CVE-')
|
11
|
+
File.basename(path).gsub('CVE-','').chomp('.yml')
|
12
|
+
else
|
13
|
+
nil
|
14
|
+
end
|
15
|
+
end
|
16
|
+
let(:filename_osvdb) do
|
17
|
+
if File.basename(path).start_with?('OSVDB-')
|
18
|
+
File.basename(path).gsub('OSVDB-','').chomp('.yml')
|
19
|
+
else
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should have CVE or OSVDB" do
|
25
|
+
(advisory['cve'] || advisory['osvdb']).should_not be_nil
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "gem" do
|
29
|
+
subject { advisory['gem'] }
|
30
|
+
|
31
|
+
it { should be_kind_of(String) }
|
32
|
+
it { should == gem }
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "framework" do
|
36
|
+
subject { advisory['framework'] }
|
37
|
+
|
38
|
+
it "may be nil or a String" do
|
39
|
+
[NilClass, String].should include(subject.class)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "platform" do
|
44
|
+
subject { advisory['platform'] }
|
45
|
+
|
46
|
+
it "may be nil or a String" do
|
47
|
+
[NilClass, String].should include(subject.class)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe "cve" do
|
52
|
+
subject { advisory['cve'] }
|
53
|
+
|
54
|
+
it "may be nil or a String" do
|
55
|
+
[NilClass, String].should include(subject.class)
|
56
|
+
end
|
57
|
+
it "should be id in filename if filename is CVE-XXX" do
|
58
|
+
if filename_cve
|
59
|
+
should == filename_cve
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe "osvdb" do
|
65
|
+
subject { advisory['osvdb'] }
|
66
|
+
it "may be nil or a Fixnum" do
|
67
|
+
[NilClass, Fixnum].should include(subject.class)
|
68
|
+
end
|
69
|
+
it "should be id in filename if filename is OSVDB-XXX" do
|
70
|
+
if filename_osvdb
|
71
|
+
should == filename_osvdb.to_i
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe "url" do
|
77
|
+
subject { advisory['url'] }
|
78
|
+
|
79
|
+
it { should be_kind_of(String) }
|
80
|
+
it { should_not be_empty }
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "title" do
|
84
|
+
subject { advisory['title'] }
|
85
|
+
|
86
|
+
it { should be_kind_of(String) }
|
87
|
+
it { should_not be_empty }
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "date" do
|
91
|
+
subject { advisory['date'] }
|
92
|
+
|
93
|
+
it { should be_kind_of(Date) }
|
94
|
+
end
|
95
|
+
|
96
|
+
describe "description" do
|
97
|
+
subject { advisory['description'] }
|
98
|
+
|
99
|
+
it { should be_kind_of(String) }
|
100
|
+
it { should_not be_empty }
|
101
|
+
end
|
102
|
+
|
103
|
+
describe "cvss_v2" do
|
104
|
+
subject { advisory['cvss_v2'] }
|
105
|
+
|
106
|
+
it "may be nil or a Float" do
|
107
|
+
[NilClass, Float].should include(subject.class)
|
108
|
+
end
|
109
|
+
|
110
|
+
case advisory['cvss_v2']
|
111
|
+
when Float
|
112
|
+
context "when a Float" do
|
113
|
+
it { ((0.0)..(10.0)).should include(subject) }
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
describe "patched_versions" do
|
119
|
+
subject { advisory['patched_versions'] }
|
120
|
+
|
121
|
+
it "may be nil or an Array" do
|
122
|
+
[NilClass, Array].should include(subject.class)
|
123
|
+
end
|
124
|
+
|
125
|
+
describe "each patched version" do
|
126
|
+
if advisory['patched_versions']
|
127
|
+
advisory['patched_versions'].each do |version|
|
128
|
+
describe version do
|
129
|
+
subject { version.split(', ') }
|
130
|
+
|
131
|
+
it "should contain valid RubyGem version requirements" do
|
132
|
+
lambda {
|
133
|
+
Gem::Requirement.new(*subject)
|
134
|
+
}.should_not raise_error(ArgumentError)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
describe "unaffected_versions" do
|
143
|
+
subject { advisory['unaffected_versions'] }
|
144
|
+
|
145
|
+
it "may be nil or an Array" do
|
146
|
+
[NilClass, Array].should include(subject.class)
|
147
|
+
end
|
148
|
+
|
149
|
+
case advisory['unaffected_versions']
|
150
|
+
when Array
|
151
|
+
advisory['unaffected_versions'].each do |version|
|
152
|
+
describe version do
|
153
|
+
subject { version.split(', ') }
|
154
|
+
|
155
|
+
it "should contain valid RubyGem version requirements" do
|
156
|
+
lambda {
|
157
|
+
Gem::Requirement.new(*subject)
|
158
|
+
}.should_not raise_error(ArgumentError)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'rspec'
|
data/gemspec.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
name: mrjoy-bundler-audit
|
2
|
+
summary: Patch-level verification for Bundler
|
3
|
+
description: bundler-audit provides patch-level verification for Bundled apps.
|
4
|
+
license: GPLv3
|
5
|
+
authors:
|
6
|
+
- Postmodern
|
7
|
+
- MrJoy
|
8
|
+
email:
|
9
|
+
- postmodern.mod3@gmail.com
|
10
|
+
- jfrisby@mrjoy.com
|
11
|
+
homepage: https://github.com/MrJoy/mrjoy-bundler-audit#readme
|
12
|
+
|
13
|
+
required_rubygems_version: ">= 1.8.0"
|
14
|
+
|
15
|
+
dependencies:
|
16
|
+
bundler: ~> 1.2
|