bundler-audit 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.gitmodules +3 -0
- data/.travis.yml +4 -0
- data/ChangeLog.md +13 -0
- data/Gemfile +12 -0
- data/README.md +3 -37
- data/Rakefile +20 -49
- data/bundler-audit.gemspec +7 -0
- data/data/ruby-advisory-db/.rspec +1 -0
- data/data/ruby-advisory-db/README.md +64 -0
- data/data/ruby-advisory-db/gems/actionpack/2012-1099.yml +23 -0
- data/data/{bundler/audit/rails → ruby-advisory-db/gems/actionpack}/2012-3424.yml +10 -6
- data/data/ruby-advisory-db/gems/actionpack/2012-3463.yml +20 -0
- data/data/ruby-advisory-db/gems/actionpack/2012-3465.yml +20 -0
- data/data/{bundler/audit/rails → ruby-advisory-db/gems/actionpack}/2013-0156.yml +5 -3
- data/data/ruby-advisory-db/gems/activerecord/2012-2660.yml +21 -0
- data/data/ruby-advisory-db/gems/activerecord/2012-2661.yml +19 -0
- data/data/{bundler/audit/rails → ruby-advisory-db/gems/activerecord}/2013-0155.yml +6 -4
- data/data/{bundler/audit/rails → ruby-advisory-db/gems/activerecord}/2013-0276.yml +5 -3
- data/data/{bundler/audit/rails → ruby-advisory-db/gems/activerecord}/2013-0277.yml +5 -3
- data/data/ruby-advisory-db/gems/activesupport/2012-1098.yml +20 -0
- data/data/ruby-advisory-db/gems/activesupport/2012-3464.yml +20 -0
- data/data/{bundler/audit/rails → ruby-advisory-db/gems/activesupport}/2013-0333.yml +5 -3
- data/data/ruby-advisory-db/gems/devise/2013-0233.yml +18 -0
- data/data/ruby-advisory-db/gems/gtk2/2007-6183.yml +18 -0
- data/data/{bundler/audit → ruby-advisory-db/gems}/json/2013-0269.yml +4 -2
- data/data/ruby-advisory-db/gems/mail/2011-0739.yml +19 -0
- data/data/ruby-advisory-db/gems/mail/2012-2139.yml +11 -0
- data/data/ruby-advisory-db/gems/mail/2012-2140.yml +11 -0
- data/data/ruby-advisory-db/gems/multi_xml/2013-0175.yml +14 -0
- data/data/ruby-advisory-db/gems/newrelic_rpm/2013-0284.yml +15 -0
- data/data/ruby-advisory-db/gems/nori/2013-0285.yml +17 -0
- data/data/ruby-advisory-db/gems/omniauth-oauth2/2012-6134.yml +14 -0
- data/data/ruby-advisory-db/gems/rack-cache/2012-267.yml +16 -0
- data/data/{bundler/audit → ruby-advisory-db/gems}/rack/2013-0263.yml +9 -8
- data/data/ruby-advisory-db/gems/rdoc/2013-0256.yml +25 -0
- data/data/ruby-advisory-db/spec/advisory_example.rb +80 -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 +1 -6
- data/lib/bundler/audit/advisory.rb +13 -1
- data/lib/bundler/audit/cli.rb +17 -6
- data/lib/bundler/audit/database.rb +1 -30
- data/lib/bundler/audit/version.rb +1 -1
- data/spec/advisory_spec.rb +1 -1
- data/spec/bundle/secure/Gemfile +38 -0
- data/spec/bundle/{Gemfile → vuln/Gemfile} +0 -0
- data/spec/database_spec.rb +1 -32
- data/spec/integration_spec.rb +63 -0
- data/spec/spec_helper.rb +14 -1
- metadata +68 -112
- data/data/bundler/audit/mail/2011-0739.yml +0 -17
- data/data/bundler/audit/mail/2012-2139.yml +0 -16
- data/data/bundler/audit/mail/2012-2140.yml +0 -13
- data/data/bundler/audit/rack-cache/2012-267.yml +0 -14
- data/data/bundler/audit/rails/2012-1098.yml +0 -19
- data/data/bundler/audit/rails/2012-1099.yml +0 -19
- data/data/bundler/audit/rails/2012-2660.yml +0 -17
- data/data/bundler/audit/rails/2012-2661.yml +0 -18
- data/data/bundler/audit/rails/2012-3463.yml +0 -19
- data/data/bundler/audit/rails/2012-3464.yml +0 -18
- data/data/bundler/audit/rails/2012-3465.yml +0 -19
- data/spec/bundle/Gemfile.lock +0 -92
data/.gitignore
CHANGED
data/.gitmodules
ADDED
data/.travis.yml
ADDED
data/ChangeLog.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
### 0.1.2 / 2013-02-17
|
2
|
+
|
3
|
+
* Require [bundler] ~> 1.2.
|
4
|
+
* Vendor a full copy of the [ruby-advisory-db].
|
5
|
+
* Added {Bundler::Audit::Advisory#path} for debugging purposes.
|
6
|
+
* Added {Bundler::Audit::Advisory#to_s} for debugging purposes.
|
7
|
+
|
8
|
+
#### CLI
|
9
|
+
|
10
|
+
* Simply parse the `Gemfile.lock` instead of loading the bundle (@grosser).
|
11
|
+
* Exit with non-zero status on failure (@grosser).
|
12
|
+
|
1
13
|
### 0.1.1 / 2013-02-12
|
2
14
|
|
3
15
|
* Fixed a Ruby 1.8 syntax error.
|
@@ -40,4 +52,5 @@
|
|
40
52
|
* [CVE-2013-0277](http://direct.osvdb.org/show/osvdb/90073)
|
41
53
|
* [CVE-2013-0333](http://osvdb.org/show/osvdb/89594)
|
42
54
|
|
55
|
+
[bundler]: http://gembundler.com/
|
43
56
|
[ruby-advisory-db]: https://github.com/rubysec/ruby-advisory-db#readme
|
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
* [Issues](https://github.com/postmodern/bundler-audit/issues)
|
5
5
|
* [Documentation](http://rubydoc.info/gems/bundler-audit/frames)
|
6
6
|
* [Email](mailto:postmodern.mod3 at gmail.com)
|
7
|
+
* [![Build Status](https://travis-ci.org/postmodern/bundler-audit.png)](https://travis-ci.org/postmodern/bundler-audit)
|
8
|
+
|
7
9
|
|
8
10
|
## Description
|
9
11
|
|
@@ -65,48 +67,12 @@ Audit a projects `Gemfile.lock`:
|
|
65
67
|
|
66
68
|
## Requirements
|
67
69
|
|
68
|
-
* [bundler] ~> 1.
|
70
|
+
* [bundler] ~> 1.2
|
69
71
|
|
70
72
|
## Install
|
71
73
|
|
72
74
|
$ gem install bundler-audit
|
73
75
|
|
74
|
-
## Contributing Advisories
|
75
|
-
|
76
|
-
For an advisory to be added to the Database, it must match the following
|
77
|
-
format:
|
78
|
-
|
79
|
-
* Must be a YAML file.
|
80
|
-
* Must be placed in the `data/bundler/audit/$gem/` directory.
|
81
|
-
* Must be named after the CVE number (`2013-0156.yml`):
|
82
|
-
* Must contain a URL to the [OSVDB] advisory.
|
83
|
-
* Must contain the `title` and `description`.
|
84
|
-
* Must contain the `title` and `description`.
|
85
|
-
* Must contain the CVSSv2 Score.
|
86
|
-
* Must contain the patched versions ranges.
|
87
|
-
|
88
|
-
### Example
|
89
|
-
|
90
|
-
---
|
91
|
-
url: http://osvdb.org/show/osvdb/89026
|
92
|
-
title: |
|
93
|
-
Ruby on Rails params_parser.rb Action Pack Type Casting Parameter Parsing
|
94
|
-
Remote Code Execution
|
95
|
-
|
96
|
-
description: |
|
97
|
-
Ruby on Rails contains a flaw in params_parser.rb of the Action Pack.
|
98
|
-
The issue is triggered when a type casting error occurs during the parsing
|
99
|
-
of parameters. This may allow a remote attacker to potentially execute
|
100
|
-
arbitrary code.
|
101
|
-
|
102
|
-
cvss_v2: 10.0
|
103
|
-
|
104
|
-
patched_versions:
|
105
|
-
- "~> 2.3.15"
|
106
|
-
- "~> 3.0.19"
|
107
|
-
- "~> 3.1.10"
|
108
|
-
- ">= 3.2.11"
|
109
|
-
|
110
76
|
## License
|
111
77
|
|
112
78
|
Copyright (c) 2013 Hal Brodigan (postmodern.mod3 at gmail.com)
|
data/Rakefile
CHANGED
@@ -1,72 +1,43 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require 'rake'
|
5
4
|
|
6
5
|
begin
|
7
|
-
|
8
|
-
require 'rubygems/tasks'
|
9
|
-
|
10
|
-
Gem::Tasks.new
|
6
|
+
require 'bundler'
|
11
7
|
rescue LoadError => e
|
12
8
|
warn e.message
|
13
|
-
warn "Run `gem install
|
9
|
+
warn "Run `gem install bundler` to install Bundler."
|
10
|
+
exit -1
|
14
11
|
end
|
15
12
|
|
16
13
|
begin
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
task :spec do
|
23
|
-
abort "Please run `gem install rspec` to install RSpec."
|
24
|
-
end
|
14
|
+
Bundler.setup(:development)
|
15
|
+
rescue Bundler::BundlerError => e
|
16
|
+
warn e.message
|
17
|
+
warn "Run `bundle install` to install missing gems."
|
18
|
+
exit e.status_code
|
25
19
|
end
|
26
20
|
|
27
|
-
|
28
|
-
task :validate do
|
29
|
-
validate = lambda do |path,data,field,type|
|
30
|
-
value = data[field]
|
21
|
+
require 'rake'
|
31
22
|
|
32
|
-
|
33
|
-
|
34
|
-
# no-op
|
35
|
-
when NilClass
|
36
|
-
warn "#{path}: #{field} is missing"
|
37
|
-
else
|
38
|
-
warn "#{path}: expected #{field} to be #{type} but was #{value.class}"
|
39
|
-
end
|
40
|
-
end
|
23
|
+
require 'rubygems/tasks'
|
24
|
+
Gem::Tasks.new
|
41
25
|
|
42
|
-
|
43
|
-
|
44
|
-
data = YAML.load_file(path)
|
26
|
+
require 'rspec/core/rake_task'
|
27
|
+
RSpec::Core::RakeTask.new
|
45
28
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
validate[path, data, 'patched_versions', Array]
|
51
|
-
rescue ArgumentError => error
|
52
|
-
warn "#{path}: #{error.message}"
|
53
|
-
end
|
29
|
+
namespace :spec do
|
30
|
+
task :bundle do
|
31
|
+
%w[spec/bundle/vuln spec/bundle/secure].each do |path|
|
32
|
+
chdir(path) { sh 'bundle', 'install', '--quiet' }
|
54
33
|
end
|
55
34
|
end
|
56
35
|
end
|
57
|
-
task :spec => 'spec:
|
36
|
+
task :spec => 'spec:bundle'
|
58
37
|
|
59
38
|
task :test => :spec
|
60
39
|
task :default => :spec
|
61
40
|
|
62
|
-
|
63
|
-
|
64
|
-
require 'yard'
|
65
|
-
|
66
|
-
YARD::Rake::YardocTask.new
|
67
|
-
rescue LoadError => e
|
68
|
-
task :yard do
|
69
|
-
abort "Please run `gem install yard` to install YARD."
|
70
|
-
end
|
71
|
-
end
|
41
|
+
require 'yard'
|
42
|
+
YARD::Rake::YardocTask.new
|
72
43
|
task :doc => :yard
|
data/bundler-audit.gemspec
CHANGED
@@ -26,6 +26,13 @@ Gem::Specification.new do |gem|
|
|
26
26
|
gem.files = `git ls-files`.split($/)
|
27
27
|
gem.files = glob[gemspec['files']] if gemspec['files']
|
28
28
|
|
29
|
+
# add paths from data/ruby-advisory-db/
|
30
|
+
gem.files += Dir.chdir('data/ruby-advisory-db') do
|
31
|
+
`git ls-files`.split($/).map do |sub_path|
|
32
|
+
File.join('data','ruby-advisory-db',sub_path)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
29
36
|
gem.executables = gemspec.fetch('executables') do
|
30
37
|
glob['bin/*'].map { |path| File.basename(path) }
|
31
38
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# Ruby Advisory Database
|
2
|
+
|
3
|
+
The Ruby advisory database seeks to compile all advisories relevant to Ruby libraries.
|
4
|
+
|
5
|
+
## Directory Structure
|
6
|
+
|
7
|
+
The database is a list of directories that match the names of Ruby libraries on
|
8
|
+
[rubygems.org]. Within each directory are one or more advisory files
|
9
|
+
for the Ruby library. These advisory files are typically named using
|
10
|
+
the advisories [CVE] identifier number.
|
11
|
+
|
12
|
+
gems/:
|
13
|
+
rails/:
|
14
|
+
2012-1098.yml 2012-2660.yml 2012-2661.yml 2012-3463.yml
|
15
|
+
|
16
|
+
If an advisory does not yet have a [CVE], [requesting a CVE][1] is easy.
|
17
|
+
## Format
|
18
|
+
|
19
|
+
Each advisory file contains the advisory information in [YAML] format:
|
20
|
+
|
21
|
+
---
|
22
|
+
gem: rails
|
23
|
+
cve: 2013-0156
|
24
|
+
url: http://osvdb.org/show/osvdb/89026
|
25
|
+
title: |
|
26
|
+
Ruby on Rails params_parser.rb Action Pack Type Casting Parameter Parsing
|
27
|
+
Remote Code Execution
|
28
|
+
|
29
|
+
description: |
|
30
|
+
Ruby on Rails contains a flaw in params_parser.rb of the Action Pack.
|
31
|
+
The issue is triggered when a type casting error occurs during the parsing
|
32
|
+
of parameters. This may allow a remote attacker to potentially execute
|
33
|
+
arbitrary code.
|
34
|
+
|
35
|
+
cvss_v2: 10.0
|
36
|
+
|
37
|
+
patched_versions:
|
38
|
+
- ~> 2.3.15
|
39
|
+
- ~> 3.0.19
|
40
|
+
- ~> 3.1.10
|
41
|
+
- ">= 3.2.11"
|
42
|
+
|
43
|
+
### Schema
|
44
|
+
|
45
|
+
* `gem` \[String\]: Name of the affected gem.
|
46
|
+
* `cve` \[String\]: CVE id
|
47
|
+
* `url` \[String\]: The URL to the full advisory.
|
48
|
+
* `title` \[String\]: The title of the advisory.
|
49
|
+
* `description` \[String\]: Multi-paragraph description of the vulnerability.
|
50
|
+
* `cvss_v2` \[Float\]: The [CVSSv2] score for the vulnerability.
|
51
|
+
* `patched_versions` \[Array\<String\>\]: The version requirements for the
|
52
|
+
patched versions of the Ruby library.
|
53
|
+
|
54
|
+
## Credits
|
55
|
+
|
56
|
+
* [Postmodern](https://github.com/postmodern/)
|
57
|
+
* [Max Veytsman](https://twitter.com/mveytsman)
|
58
|
+
|
59
|
+
[rubygems.org]: https://rubygems.org/
|
60
|
+
[CVE]: http://cve.mitre.org/
|
61
|
+
[CVSSv2]: http://www.first.org/cvss/cvss-guide.html
|
62
|
+
[YAML]: http://www.yaml.org/
|
63
|
+
|
64
|
+
[1]: http://people.redhat.com/kseifrie/CVE-OpenSource-Request-HOWTO.html
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
gem: actionpack
|
3
|
+
cve: 2012-1099
|
4
|
+
url: http://www.osvdb.org/show/osvdb/79727
|
5
|
+
title:
|
6
|
+
Ruby on Rails actionpack/lib/action_view/helpers/form_options_helper.rb
|
7
|
+
Manually Generated Select Tag Options XSS
|
8
|
+
|
9
|
+
description: |
|
10
|
+
Ruby on Rails contains a flaw that allows a remote cross-site scripting (XSS)
|
11
|
+
attack. This flaw exists because the application does not validate manually
|
12
|
+
generated 'select tag options' upon submission to
|
13
|
+
actionpack/lib/action_view/helpers/form_options_helper.rb. This may allow a
|
14
|
+
user to create a specially crafted request that would execute arbitrary
|
15
|
+
script code in a user's browser within the trust relationship between their
|
16
|
+
browser and the server.
|
17
|
+
|
18
|
+
cvss_v2: 4.3
|
19
|
+
|
20
|
+
patched_versions:
|
21
|
+
- ~> 3.0.12
|
22
|
+
- ~> 3.1.4
|
23
|
+
- ">= 3.2.2"
|
@@ -1,17 +1,21 @@
|
|
1
|
-
---
|
1
|
+
---
|
2
|
+
gem: actionpack
|
3
|
+
cve: 2012-3424
|
2
4
|
url: http://www.osvdb.org/show/osvdb/84243
|
3
|
-
title:
|
5
|
+
title:
|
6
|
+
Ruby on Rails actionpack/lib/action_controller/metal/http_authentication.rb
|
7
|
+
with_http_digest Helper Method Remote DoS
|
4
8
|
|
5
|
-
description:
|
6
|
-
Ruby on Rails contains a flaw that may allow a remote denial of
|
7
|
-
|
9
|
+
description: |
|
10
|
+
Ruby on Rails contains a flaw that may allow a remote denial of service.
|
11
|
+
The issue is triggered when an error occurs in
|
8
12
|
actionpack/lib/action_controller/metal/http_authentication.rb when the
|
9
13
|
with_http_digest helper method is being used. This may allow a remote
|
10
14
|
attacker to cause a loss of availability for the program.
|
11
15
|
|
12
16
|
cvss_v2: 4.3
|
13
17
|
|
14
|
-
patched_versions:
|
18
|
+
patched_versions:
|
15
19
|
- ~> 3.0.16
|
16
20
|
- ~> 3.1.7
|
17
21
|
- ">= 3.2.7"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
gem: actionpack
|
3
|
+
cve: 2012-3463
|
4
|
+
url: http://osvdb.org/84515
|
5
|
+
title: Ruby on Rails select_tag Helper Method prompt Value XSS
|
6
|
+
|
7
|
+
description: |
|
8
|
+
Ruby on Rails contains a flaw that allows a remote cross-site scripting (XSS)
|
9
|
+
attack. This flaw exists because input passed via the prompt value is not
|
10
|
+
properly sanitized by the select_tag helper method before returning it to
|
11
|
+
the user. This may allow a user to create a specially crafted request that
|
12
|
+
would execute arbitrary script code in a user's browser within the trust
|
13
|
+
relationship between their browser and the server.
|
14
|
+
|
15
|
+
cvss_v2: 4.3
|
16
|
+
|
17
|
+
patched_versions:
|
18
|
+
- ~> 3.0.17
|
19
|
+
- ~> 3.1.8
|
20
|
+
- ">= 3.2.8"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
gem: actionpack
|
3
|
+
cve: 2012-3465
|
4
|
+
url: http://www.osvdb.org/show/osvdb/84513
|
5
|
+
title: Ruby on Rails strip_tags Helper Method XSS
|
6
|
+
|
7
|
+
description: |
|
8
|
+
Ruby on Rails contains a flaw that allows a remote cross-site scripting (XSS)
|
9
|
+
attack. This flaw exists because the application does not validate input
|
10
|
+
passed via the 'strip_tags' helper method before returning it to the user.
|
11
|
+
This may allow a user to create a specially crafted request that would
|
12
|
+
execute arbitrary script code in a user's browser within the trust
|
13
|
+
relationship between their browser and the server.
|
14
|
+
|
15
|
+
cvss_v2: 4.3
|
16
|
+
|
17
|
+
patched_versions:
|
18
|
+
- ~> 3.0.17
|
19
|
+
- ~> 3.1.8
|
20
|
+
- ">= 3.2.8"
|
@@ -1,6 +1,8 @@
|
|
1
|
-
---
|
1
|
+
---
|
2
|
+
gem: actionpack
|
3
|
+
cve: 2013-0156
|
2
4
|
url: http://osvdb.org/show/osvdb/89026
|
3
|
-
title:
|
5
|
+
title:
|
4
6
|
Ruby on Rails params_parser.rb Action Pack Type Casting Parameter Parsing
|
5
7
|
Remote Code Execution
|
6
8
|
|
@@ -12,7 +14,7 @@ description: |
|
|
12
14
|
|
13
15
|
cvss_v2: 10.0
|
14
16
|
|
15
|
-
patched_versions:
|
17
|
+
patched_versions:
|
16
18
|
- ~> 2.3.15
|
17
19
|
- ~> 3.0.19
|
18
20
|
- ~> 3.1.10
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
gem: activerecord
|
3
|
+
cve: 2012-2660
|
4
|
+
url: http://www.osvdb.org/show/osvdb/82610
|
5
|
+
title:
|
6
|
+
Ruby on Rails ActiveRecord Class Rack Query Parameter Parsing SQL Query
|
7
|
+
Arbitrary IS NULL Clause Injection
|
8
|
+
|
9
|
+
description: |
|
10
|
+
Ruby on Rails contains a flaw related to the way ActiveRecord handles
|
11
|
+
parameters in conjunction with the way Rack parses query parameters.
|
12
|
+
This issue may allow an attacker to inject arbitrary 'IS NULL' clauses in
|
13
|
+
to application SQL queries. This may also allow an attacker to have the
|
14
|
+
SQL query check for NULL in arbitrary places.
|
15
|
+
|
16
|
+
cvss_v2: 7.5
|
17
|
+
|
18
|
+
patched_versions:
|
19
|
+
- ~> 3.0.13
|
20
|
+
- ~> 3.1.5
|
21
|
+
- ">= 3.2.4"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
gem: activerecord
|
3
|
+
cve: 2012-2661
|
4
|
+
url: http://www.osvdb.org/show/osvdb/82403
|
5
|
+
title: Ruby on Rails where Method ActiveRecord Class SQL Injection
|
6
|
+
|
7
|
+
description: |
|
8
|
+
Ruby on Rails (RoR) contains a flaw that may allow an attacker to carry out
|
9
|
+
an SQL injection attack. The issue is due to the ActiveRecord class not
|
10
|
+
properly sanitizing user-supplied input to the 'where' method. This may
|
11
|
+
allow an attacker to inject or manipulate SQL queries in an application
|
12
|
+
built on RoR, allowing for the manipulation or disclosure of arbitrary data.
|
13
|
+
|
14
|
+
cvss_v2: 5.0
|
15
|
+
|
16
|
+
patched_versions:
|
17
|
+
- ~> 3.0.13
|
18
|
+
- ~> 3.1.5
|
19
|
+
- ">= 3.2.4"
|