codesake-dawn 1.1.3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/Changelog.md +25 -1
  5. data/KnowledgeBase.md +16 -2
  6. data/README.md +1 -0
  7. data/Rakefile +12 -1
  8. data/checksum/codesake-dawn-1.1.3.gem.sha512 +1 -0
  9. data/codesake-dawn.gemspec +2 -2
  10. data/doc/dawn_1_2_announcement.md +69 -0
  11. data/lib/codesake/dawn/core.rb +9 -3
  12. data/lib/codesake/dawn/kb/basic_check.rb +20 -0
  13. data/lib/codesake/dawn/kb/cve_2013_2105.rb +28 -0
  14. data/lib/codesake/dawn/kb/cve_2014_0036.rb +1 -1
  15. data/lib/codesake/dawn/kb/cve_2014_0130.rb +1 -1
  16. data/lib/codesake/dawn/kb/cve_2014_2322.rb +1 -1
  17. data/lib/codesake/dawn/kb/cve_2014_3482.rb +30 -0
  18. data/lib/codesake/dawn/kb/cve_2014_3483.rb +29 -0
  19. data/lib/codesake/dawn/kb/osvdb_105971.rb +3 -1
  20. data/lib/codesake/dawn/kb/osvdb_108530.rb +29 -0
  21. data/lib/codesake/dawn/kb/osvdb_108563.rb +30 -0
  22. data/lib/codesake/dawn/kb/osvdb_108569.rb +30 -0
  23. data/lib/codesake/dawn/kb/osvdb_108570.rb +29 -0
  24. data/lib/codesake/dawn/kb/version_check.rb +2 -0
  25. data/lib/codesake/dawn/knowledge_base.rb +15 -1
  26. data/lib/codesake/dawn/version.rb +2 -2
  27. data/spec/lib/dawn/codesake_core_spec.rb +9 -0
  28. data/spec/lib/dawn/codesake_knowledgebase_spec.rb +57 -18
  29. data/spec/lib/kb/codesake_version_check_spec.rb +1 -1
  30. data/spec/lib/kb/cve_2013_2105_spec.rb +11 -0
  31. data/spec/lib/kb/cve_2014_0036_spec.rb +0 -1
  32. data/spec/lib/kb/cve_2014_0130_spec.rb +0 -1
  33. data/spec/lib/kb/cve_2014_2322_spec.rb +0 -1
  34. data/spec/lib/kb/cve_2014_3482_spec.rb +15 -0
  35. data/spec/lib/kb/cve_2014_3483_spec.rb +23 -0
  36. data/spec/lib/kb/osvdb_105971_spec.rb +0 -2
  37. data/spec/lib/kb/osvdb_108530_spec.rb +22 -0
  38. data/spec/lib/kb/osvdb_108563_spec.rb +18 -0
  39. data/spec/lib/kb/osvdb_108569_spec.rb +17 -0
  40. data/spec/lib/kb/osvdb_108570_spec.rb +17 -0
  41. metadata +33 -7
  42. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3cb817c04da264b3660491ef777d7587d0ef3fac
4
- data.tar.gz: 45d432e7628eca11e300c2d15b65b1db181e39ee
3
+ metadata.gz: e522602b2fa152943afdffcd24542df92560031d
4
+ data.tar.gz: e6e6ec7e1b4ee9bdbc8ddbe44f89664a685022a0
5
5
  SHA512:
6
- metadata.gz: 33261298a42ed1929845a29379f278b01bc445a892cb35c695568341aafe717a5b51b16333f99781fe67acde8dfd9ec35a0a2d7298de6f4f5ea2056bb3089f92
7
- data.tar.gz: 086af2f4ac028b0443dc38fbf1f5cadf48f8bfae4015f572d0438d2ae0d3006e3edba384221ffa453e27be022d687fa4f9706e6e28960bcc10955856d20ebbe5
6
+ metadata.gz: cebd297a2651ce699f417ee3c392015cd816b51a94c7af558955fee6e87f3e7b640ea022919de994a0efbd568234f933a1089f4cda9e3b8d7332b6056e95ee37
7
+ data.tar.gz: 8b2227e6e41eed184e85e91d0e116cc3571c64fa0510b2685fa892ab0f58a447ed258aa80b361356d71b0d4ecc41bbffaea5e54e2644cde3094ec9799e5d4b29
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -5,7 +5,31 @@ It supports [Sinatra](http://www.sinatrarb.com),
5
5
  [Padrino](http://www.padrinorb.com) and [Ruby on Rails](http://rubyonrails.org)
6
6
  frameworks.
7
7
 
8
- _latest update: Fri Apr 18 07:55:10 CEST 2014_
8
+ _latest update: Fri Jul 11 18:06:30 CEST 2014_
9
+
10
+ ## Version 1.2.0 - codename: Lightning McQueen (2014-07-14)
11
+
12
+ * Adding a check for OSVDB-108569: information disclosure in backup_checksum
13
+ gem (issue #69)
14
+ * Fix issue #74. Now BasicChack has its own cve, osvdb attributes and a rake
15
+ task will perform a sanity check if those values have been initialized
16
+ * Fix issue #62 about codesake-dawn config filename
17
+ * Adding a check for CVE-2013-2105: HTML injection in show_in_browser rubygem
18
+ * Fixing issue #68. I moved some file variable operation after the check for
19
+ nil value. I can't reproduce on my station the offending bug :-(
20
+ * Adding a check for OSVDB-108570: arbitrary command execution for
21
+ backup_checksum gem (issue #70)
22
+ * Adding a check for OSVDB-108530: remote code execution for kajam gem (issue
23
+ #71)
24
+ * Adding a check for OSVDB-108563: remote code execution in gyazo rubygem
25
+ (issue #72)
26
+ * Adding a check for CVE-2014-3482: SQL Injection on Rails 3.2.x due to
27
+ PostgreSQL adapter for active record (issue #73)
28
+ * Adding a check for CVE-2014-3483: Ruby on Rails 4.x SQL Injection due to
29
+ PostgreSQL adapter (issue #75)
30
+ * Fix issue #76 about codesake-dawn gem name being changed. On November 1st,
31
+ 2014 we will rename the codesake-dawn name to just 'dawn' cleaning up also
32
+ the namespace.
9
33
 
10
34
  ## Version 1.1.3 - codename: Lightning McQueen (2014-05-06)
11
35
 
@@ -1,6 +1,6 @@
1
1
  # Codesake::Dawn Knowledge base
2
2
 
3
- The knowledge base library for Codesake::Dawn version 1.1.0 contains 171 security checks.
3
+ The knowledge base library for Codesake::Dawn version 1.2.0 contains 180 security checks.
4
4
  ---
5
5
  * Simple Form XSS - 20131129: There is a XSS vulnerability on Simple Form's label, hint and error options. When Simple Form creates a label, hint or error message it marks the text as being HTML safe, even though it may contain HTML tags. In applications where the text of these helpers can be provided by the users, malicious values can be provided and Simple Form will mark it as safe.
6
6
  * [CVE-2004-0755](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-0755): The FileStore capability in CGI::Session for Ruby before 1.8.1, and possibly PStore, creates files with insecure permissions, which can allow local users to steal session information and hijack sessions.
@@ -127,6 +127,7 @@ The knowledge base library for Codesake::Dawn version 1.1.0 contains 171 securit
127
127
  * [CVE-2013-1948](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1948): converter.rb in the md2pdf gem 0.0.1 for Ruby allows context-dependent attackers to execute arbitrary commands via shell metacharacters in a filename.
128
128
  * [CVE-2013-2065](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2065): Native functions exposed to Ruby with DL or Fiddle do not check the taint values set on the objects passed in. This can result in tainted objects being accepted as input when a SecurityError exception should be raised.
129
129
  * [CVE-2013-2090](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2090): Ruby Gem Creme Fraiche version 0.6 suffers from a remote command injection vulnerability due to unsanitized input.
130
+ * [CVE-2013-2105](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2105): The Show In Browser (show_in_browser) gem 0.0.3 for Ruby allows local users to inject arbitrary web script or HTML via a symlink attack on /tmp/browser.html.
130
131
  * [CVE-2013-2119](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2119): Phusion Passenger gem before 3.0.21 and 4.0.x before 4.0.5 for Ruby allows local users to cause a denial of service (prevent application start) or gain privileges by pre-creating a temporary "config" file in a directory with a predictable name in /tmp/ before it is used by the gem.
131
132
  * [CVE-2013-2512](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2512): ftpd Gem for Ruby contains a flaw that is triggered when handling a specially crafted option or filename that contains a shell character. This may allow a remote attacker to inject arbitrary commands
132
133
  * [CVE-2013-2513](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-2513): flash_tool Gem for Ruby contains a flaw that is triggered during the handling of downloaded files that contain shell characters. With a specially crafted file, a context-dependent attacker can execute arbitrary commands.
@@ -163,11 +164,24 @@ XML documents with carefully crafted entity expansion strings which can cause th
163
164
  * [CVE-2014-0080](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0080): SQL injection vulnerability in activerecord/lib/active_record/connection_adapters/postgresql/cast.rb in Active Record in Ruby on Rails 4.0.x before 4.0.3, and 4.1.0.beta1, when PostgreSQL is used, allows remote attackers to execute "add data" SQL commands via vectors involving (backslash) characters that are not properly handled in operations on array columns.
164
165
  * [CVE-2014-0081](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0081): Multiple cross-site scripting (XSS) vulnerabilities in actionview/lib/action_view/helpers/number_helper.rb in Ruby on Rails before 3.2.17, 4.0.x before 4.0.3, and 4.1.x before 4.1.0.beta2 allow remote attackers to inject arbitrary web script or HTML via the (1) format, (2) negative_format, or (3) units parameter to the (a) number_to_currency, (b) number_to_percentage, or (c) number_to_human helper.
165
166
  * [CVE-2014-0082](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0082): 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.
167
+ * [CVE-2014-0130](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0130): The implicit render functionality allows controllers to render a template, even if there is no explicit action with the corresponding name. This module does not perform adequate input sanitization which could allow an attacker to use a specially crafted request to retrieve arbitrary files from the rails application server.
166
168
  * [CVE-2014-1233](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-1233): The paratrooper-pingdom gem 1.0.0 for Ruby allows local users to obtain the App-Key, username, and password values by listing the curl process.
167
169
  * [CVE-2014-1234](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-1234): The paratrooper-newrelic gem 1.0.1 for Ruby allows local users to obtain the X-Api-Key value by listing the curl process.
168
170
  * [CVE-2014-2322](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2322): Arabic Prawn Gem for Ruby contains a flaw in the ib/string_utf_support.rb file. The issue is due to the program failing to sanitize user input. This may allow a remote attacker to inject arbitrary commands.
169
171
  * [CVE-2014-2525](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2525):
170
172
  * [CVE-2014-2538](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-2538): rack-ssl Gem for Ruby contains a flaw that allows a reflected cross-site scripting (XSS) attack. This flaw exists because the program does not validate input passed via error messages before returning it to users. This may allow a context-dependent attacker to create a specially crafted request that would execute arbitrary script code in a user's browser session within the trust relationship between their browser and the server.
173
+ * [CVE-2014-3482](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-3482): Ruby on Rails contains a flaw that may allow carrying out an SQL injection attack. The issue is due to the PostgreSQL adapter for Active Record not properly sanitizing user-supplied input when quoting bitstrings. This may allow a remote attacker to inject or manipulate SQL queries in the back-end database, allowing for the manipulation or disclosure of arbitrary data.
174
+ * [CVE-2014-3483](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-3483): Ruby on Rails contains a flaw that may allow carrying out an SQL injection attack. The issue is due to the PostgreSQL adapter for Active Record not properly sanitizing user-supplied input when quoting ranges. This may allow a remote attacker to inject or manipulate SQL queries in the back-end database, allowing for the manipulation or disclosure of arbitrary data.
175
+ * [OSVDB-105971](http://osvdb.org/show/osvdb/105971): sfpagent Gem for Ruby contains a flaw that is triggered as JSON[body] input is not properly sanitized when handling module names with shell metacharacters. This may allow a context-dependent attacker to execute arbitrary commands.
176
+ * OSVDB-105971: sfpagent Gem for Ruby contains a flaw that is triggered as JSON[body] input is not properly sanitized when handling module names with shell metacharacters. This may allow a context-dependent attacker to execute arbitrary commands.
177
+ * [OSVDB-108569](http://osvdb.org/show/osvdb/108569): backup_checksum Gem for Ruby contains a flaw in /lib/backup/cli/utility.rb that is triggered as the program displays password information in plaintext in the process list. This may allow a local attacker to gain access to password information.
178
+ * OSVDB-108569: backup_checksum Gem for Ruby contains a flaw in /lib/backup/cli/utility.rb that is triggered as the program displays password information in plaintext in the process list. This may allow a local attacker to gain access to password information.
179
+ * [OSVDB-108570](http://osvdb.org/show/osvdb/108570): backup_checksum Gem for Ruby contains a flaw in /lib/backup/cli/utility.rb that is triggered when handling metacharacters. This may allow a remote attacker to execute arbitrary commands.
180
+ * OSVDB-108570: backup_checksum Gem for Ruby contains a flaw in /lib/backup/cli/utility.rb that is triggered when handling metacharacters. This may allow a remote attacker to execute arbitrary commands.
181
+ * [OSVDB-108530](http://osvdb.org/show/osvdb/108530): kajam Gem for Ruby contains a flaw in /dataset/lib/dataset/database/postgresql.rb that is triggered when handling metacharacters. This may allow a remote attacker to execute arbitrary commands.
182
+ * OSVDB-108530: kajam Gem for Ruby contains a flaw in /dataset/lib/dataset/database/postgresql.rb that is triggered when handling metacharacters. This may allow a remote attacker to execute arbitrary commands.
183
+ * [OSVDB-108563](http://osvdb.org/show/osvdb/108563): gyazo Gem for Ruby contains a flaw in client.rb that is triggered when handling metacharacters. This may allow a remote attacker to execute arbitrary commands.
184
+ * OSVDB-108563: gyazo Gem for Ruby contains a flaw in client.rb that is triggered when handling metacharacters. This may allow a remote attacker to execute arbitrary commands.
171
185
  * Owasp Ror CheatSheet: Command Injection: Ruby offers a function called "eval" which will dynamically build new Ruby code based on Strings. It also has a number of ways to call system commands. While the power of these commands is quite useful, extreme care should be taken when using them in a Rails based application. Usually, its just a bad idea. If need be, a whitelist of possible values should be used and any input should be validated as thoroughly as possible. The Ruby Security Reviewer's Guide has a section on injection and there are a number of OWASP references for it, starting at the top: Command Injection.
172
186
  * Owasp Ror CheatSheet: Cross Site Request Forgery: Ruby on Rails has specific, built in support for CSRF tokens. To enable it, or ensure that it is enabled, find the base ApplicationController and look for the protect_from_forgery directive. Note that by default Rails does not provide CSRF protection for any HTTP GET request.
173
187
  * Owasp Ror CheatSheet: Session management: By default, Ruby on Rails uses a Cookie based session store. What that means is that unless you change something, the session will not expire on the server. That means that some default applications may be vulnerable to replay attacks. It also means that sensitive information should never be put in the session.
@@ -196,4 +210,4 @@ Setting this to true will essentially strip out any host information.
196
210
  This check will analyze the source code looking for the following patterns: XXX, TO_CHECK, CHECKME, CHECK and FIXME
197
211
 
198
212
 
199
- _Last updated: Tue 01 Apr 08:13:46 CEST 2014_
213
+ _Last updated: Tue 08 Jul 17:59:10 CEST 2014_
data/README.md CHANGED
@@ -18,6 +18,7 @@ MVC (Model View Controller) frameworks, like:
18
18
  [![Dependency Status](https://gemnasium.com/codesake/codesake-dawn.png)](https://gemnasium.com/codesake/codesake-dawn)
19
19
  [![Coverage Status](https://coveralls.io/repos/codesake/codesake-dawn/badge.png)](https://coveralls.io/r/codesake/codesake-dawn)
20
20
  [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/codesake/codesake-dawn/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
21
+ [![Inline docs](http://inch-ci.org/github/codesake/codesake-dawn.png?branch=master)](http://inch-ci.org/github/codesake/codesake-dawn)
21
22
 
22
23
  ---
23
24
 
data/Rakefile CHANGED
@@ -156,8 +156,17 @@ task :check, :name do |t,args|
156
156
 
157
157
  end
158
158
 
159
+ namespace :kb do
160
+ desc 'Check information lint'
161
+ task :lint do
162
+ Codesake::Dawn::KnowledgeBase.new.all.each do |check|
163
+ l = check.lint
164
+ puts "check #{check.name} has this attribute(s) with a nil value: #{l.to_s}" unless l.size == 0
165
+ end
166
+
167
+ end
159
168
  desc 'Creates a KnowledgeBase.md file'
160
- task :kb do
169
+ task :create do
161
170
  checks = Codesake::Dawn::KnowledgeBase.new.all
162
171
  open("KnowledgeBase.md", "w") do |file|
163
172
  file.puts "# Codesake::Dawn Knowledge base"
@@ -165,6 +174,7 @@ task :kb do
165
174
  file.puts "---"
166
175
  checks.each do |c|
167
176
  file.puts "* [#{c.name}](#{c.cve_link}): #{c.message}" if c.name.start_with?('CVE')
177
+ file.puts "* [#{c.name}](#{c.osvdb_link}): #{c.message}" if c.name.start_with?('OSVDB')
168
178
  file.puts "* #{c.name}: #{c.message}" unless c.name.start_with?('CVE')
169
179
  end
170
180
 
@@ -173,6 +183,7 @@ task :kb do
173
183
  puts "KnowledgeBase.md file successfully generated"
174
184
 
175
185
  end
186
+ end
176
187
 
177
188
  require 'digest/sha2'
178
189
  namespace :checksum do
@@ -0,0 +1 @@
1
+ 997e78626b78d655ae4b733483883b9e82b24969b167cbca606524665a20189af4ebeabf3c1dffb1000a1e2e70c80bcf39130dfd9e1f0aaeabf7de6ef329d594
@@ -19,11 +19,11 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.cert_chain = ['certs/paolo_at_codesake_dot_com.pem']
21
21
  gem.signing_key = File.expand_path("~/.ssh/paolo_at_codesake_dot_com-private_key.pem") if $0 =~ /gem\z/
22
- gem.post_install_message = "Thank you for installing Codesake::Dawn security source code scanner for Ruby. Start securing your code by running \"dawn project_folder\" right now or just run \"dawn --help\" if you want to explore all possible command line flags."
22
+ gem.post_install_message = "Thank you for installing \"dawn\", a security source code scanner for Ruby. Start securing your code by running \"dawn project_folder\" right now or just run \"dawn --help\" if you want to explore all possible command line flags.\n\n**PLEASE READ THIS** On November 1st, 2014 codesake-dawn gem will change the name in 'dawn'. On this date the first 'dawn' gem will be published and 'codesake-dawn' will be just a placeholder requiring the new gem."
23
23
 
24
24
  gem.required_ruby_version = '>= 1.9.2'
25
25
 
26
- gem.add_dependency "codesake-commons", "~> 0.95.0"
26
+ gem.add_dependency "codesake-commons", "~> 1.0.0"
27
27
  gem.add_dependency 'cvss'
28
28
  gem.add_dependency 'haml'
29
29
  gem.add_dependency 'parser'
@@ -0,0 +1,69 @@
1
+ ## Press announcement
2
+
3
+ Today, the XXX ?nd 2014, the second minor Codesake::Dawn rubygem version it has
4
+ been released.
5
+ This will be the last release of the codesake-dawn gem with this name. Starting
6
+ form November, 7th we will rename the gem to just dawn.
7
+
8
+ Codesake::Dawn is a source code scanner designed to review your code for
9
+ security issues.
10
+
11
+ Codesake::Dawn is able to scan your ruby standalone programs but its main usage
12
+ is to deal with web applications. It supports applications written using majors
13
+ MVC (Model View Controller) frameworks, like:
14
+
15
+ * [Ruby on Rails](http://rubyonrails.org)
16
+ * [Sinatra](http://www.sinatrarb.com)
17
+ * [Padrino](http://www.padrinorb.com)
18
+
19
+ Codesake::Dawn version 1.2 has 180 security checks loaded in its knowledge
20
+ base. Most of them are CVE or OSVDB bulletins applying to gems or the ruby
21
+ interpreter itself. There are also some check coming from Owasp Ruby on Rails
22
+ cheatsheet.
23
+
24
+ Writing safe code it's important, but sometimes security issues are introduced
25
+ by third party code your application relies on. As example, consider a SQL
26
+ Injection vulnerability introduced by Ruby on Rails framework.
27
+
28
+ Despite the effort you spend in sanitizing inputs, your web application
29
+ inherits the vulnerability suffering as well. An attacker can easily exploit it
30
+ and break into your database unless you upgrade the offended gem.
31
+
32
+ There is a comprehensive set of command line flags you can read more by issuing
33
+ ```dawn --list-knowledge-base``` flag or by reading [project
34
+ README](https://github.com/codesake/codesake-dawn/raw/master/README.md) file.
35
+
36
+ The list of security checks included in version 1.2.0 can be found online at:
37
+ [http://dawn.codesake.com/knowledge-base](http://dawn.codesake.com/knowledge-base).
38
+
39
+ You can use [facilities provided by
40
+ github](https://github.com/codesake/codesake-dawn/issues) to submit bug
41
+ reports, product enhancements, new security checks you want to me to add in
42
+ future releases and even success stories.
43
+
44
+ Now it's time for you to install Codesake::Dawn version 1.2.0 with the
45
+ following command and start reviewing your code for security issues:
46
+
47
+ ```
48
+ $ gem install -P MediumSecurity codesake-dawn
49
+ ```
50
+
51
+ You can find the announcement on the web here: [http://dawn.codesake.com/blog/announce-codesake-dawn-v1-2-0-released/](http://dawn.codesake.com/blog/announce-codesake-dawn-v1-2-0-released/)
52
+ Enjoy it!
53
+ Paolo - paolo@codesake.com
54
+
55
+ ## Twitter announcement
56
+
57
+ ### version 1.2.0
58
+ @dawnscanner version 1.2.0 is out. 180 security checks and some bug fixes. Read the announcement: http://dawn.codesake.com/blog/announce-codesake-dawn-v1-2-0-released/ #ruby #rails #sinatra #padrina #security #scanner
59
+
60
+ ## Linkedin announcement
61
+
62
+ ### version 1.2.0
63
+ @dawnscanner version 1.2.0 is out. Read the announcement online. Codesake::Dawn makes security code review fun for ruby developers, it scans 180 CVE and OSVDB bulletins and future release will be able to scan custom ruby code for XSS, SQL Injections and business logic flaws. It supports Sinatra, Padrino and Ruby on Rails MVC frameworks out of the box.
64
+
65
+ $ gem install codesake-dawn
66
+ $ have fun
67
+
68
+ ## HN Link
69
+ ## Reddit
@@ -134,16 +134,22 @@ module Codesake
134
134
  # on the current directory with the default configuration.
135
135
  conf = {"config"=>{:verbose=>false, :output=>"console", :mvc=>"", :gemfile_scan=>false, :gemfile_name=>"", :filename=>nil, :debug=>false, :exit_on_warn => false, :enabled_checks=> Codesake::Dawn::Kb::BasicCheck::ALLOWED_FAMILIES}}
136
136
 
137
- File.open(File.expand_path('~') +'/.'+conf_name, 'w') do |f|
138
- f.write(YAML.dump(conf))
137
+ # Calculate the conf file path
138
+ conf_path = File.expand_path('~') +'/.'+conf_name
139
+
140
+ # Open the conf file and write our default config to it
141
+ File.open(conf_path, 'w') do |f|
142
+ rv = f.write(YAML.dump(conf))
139
143
  end
144
+
145
+ conf_path
140
146
  end
141
147
 
142
148
  def self.read_conf(file=nil)
143
149
  conf = {:verbose=>false, :output=>"console", :mvc=>"", :gemfile_scan=>false, :gemfile_name=>"", :filename=>nil, :debug=>false, :exit_on_warn => false, :enabled_checks=> Codesake::Dawn::Kb::BasicCheck::ALLOWED_FAMILIES}
144
- file = file.chop if file.end_with? '/'
145
150
  begin
146
151
  return conf if file.nil?
152
+ file = file.chop if (not file.nil? and file.end_with? '/')
147
153
  return conf if ! File.exist?(file)
148
154
  rescue => e
149
155
  $logger.err "it seems you've found a bug in core.rb@#{__LINE__}: #{e.message}"
@@ -8,6 +8,8 @@ module Codesake
8
8
  include Codesake::Dawn::Utils
9
9
 
10
10
  attr_reader :name
11
+ attr_reader :cve
12
+ attr_reader :osvdb
11
13
  attr_reader :cvss
12
14
  attr_reader :cwe
13
15
  attr_reader :owasp
@@ -86,6 +88,8 @@ module Codesake
86
88
  @name = options[:name]
87
89
  @cvss = options[:cvss]
88
90
  @cwe = options[:cwe]
91
+ @cve = options[:cve]
92
+ @osvdb = options[:osvdb]
89
93
  @owasp = options[:owasp]
90
94
  @release_date = options[:release_date]
91
95
  @applies = options[:applies] unless options[:applies].nil?
@@ -192,6 +196,9 @@ module Codesake
192
196
  def rubysec_advisories_link
193
197
  "http://www.rubysec.com/advisories/#{@name}/"
194
198
  end
199
+ def osvdb_link
200
+ "http://osvdb.org/show/osvdb/#{@osvdb}"
201
+ end
195
202
 
196
203
  def cvss_score
197
204
  return Cvss::Engine.new.score(self.cvss) unless self.cvss.nil?
@@ -202,6 +209,19 @@ module Codesake
202
209
  self.mitigated
203
210
  end
204
211
 
212
+ # Performs a self check against some core values from being not nil
213
+ #
214
+ # @return an Array with attributes with a nil value
215
+ def lint
216
+ ret = []
217
+ ret << :cve if @cve.nil?
218
+ ret << :osvdb if @osvdb.nil?
219
+ ret << :cvss if @cvss.nil?
220
+ ret << :severity if @severity == :none
221
+ ret << :priority if @priority == :none
222
+
223
+ ret
224
+ end
205
225
  end
206
226
  end
207
227
  end
@@ -0,0 +1,28 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-05-12
5
+ class CVE_2013_2105
6
+ include DependencyCheck
7
+
8
+ def initialize
9
+ message = "The Show In Browser (show_in_browser) gem 0.0.3 for Ruby allows local users to inject arbitrary web script or HTML via a symlink attack on /tmp/browser.html."
10
+ super({
11
+ :name=>"CVE-2013-2105",
12
+ :cvss=>"AV:L/AC:M/AU:N/C:N/I:P/A:P",
13
+ :release_date => Date.new(2014, 4, 22),
14
+ :cwe=>"59",
15
+ :owasp=>"A9",
16
+ :applies=>["sinatra", "padrino", "rails"],
17
+ :kind=>Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK,
18
+ :message=>message,
19
+ :mitigation=>"Please upgrade show_in_browser version at least to 0.0.4. As a general rule, using the latest stable version is recommended.",
20
+ :aux_links=>["http://xforce.iss.net/xforce/xfdb/84378"]
21
+ })
22
+ self.safe_dependencies = [{:name=>"show_in_browser", :version=>['0.0.4']}]
23
+
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -10,7 +10,7 @@ module Codesake
10
10
 
11
11
  super({
12
12
  :name=>"CVE-2014-0036",
13
- :cvss=>"",
13
+ :cvss=>"AV:N/AC:M/Au:N/C:P/I:P/A:P",
14
14
  :release_date => Date.new(2014, 3, 5),
15
15
  :cwe=>"20",
16
16
  :owasp=>"A9",
@@ -9,7 +9,7 @@ module Codesake
9
9
  message = "The implicit render functionality allows controllers to render a template, even if there is no explicit action with the corresponding name. This module does not perform adequate input sanitization which could allow an attacker to use a specially crafted request to retrieve arbitrary files from the rails application server."
10
10
  super({
11
11
  :name=>"CVE-2014-0130",
12
- :cvss=>"",
12
+ :cvss=>"AV:N/AC:M/Au:N/C:P/I:N/A:N",
13
13
  :release_date => Date.new(2014, 5, 6),
14
14
  :cwe=>"",
15
15
  :owasp=>"A9",
@@ -11,7 +11,7 @@ module Codesake
11
11
 
12
12
  super({
13
13
  :name=>"CVE-2014-2322",
14
- :cvss=>"",
14
+ :cvss=>"AV:N/AC:L/Au:N/C:P/I:P/A:P",
15
15
  :release_date => Date.new(2014, 3, 10),
16
16
  :cwe=>"",
17
17
  :owasp=>"A9",
@@ -0,0 +1,30 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-07-04
5
+ class CVE_2014_3482
6
+ include DependencyCheck
7
+
8
+ def initialize
9
+ message = "Ruby on Rails contains a flaw that may allow carrying out an SQL injection attack. The issue is due to the PostgreSQL adapter for Active Record not properly sanitizing user-supplied input when quoting bitstrings. This may allow a remote attacker to inject or manipulate SQL queries in the back-end database, allowing for the manipulation or disclosure of arbitrary data."
10
+ super({
11
+ :name=> "CVE-2014-3482",
12
+ :cve=>"CVE-2014-3482",
13
+ :osvdb=>"108664",
14
+ :cvss=>"AV:N/AC:L/Au:N/C:P/I:P/A:P",
15
+ :release_date => Date.new(2014, 7, 2),
16
+ :cwe=>"",
17
+ :owasp=>"A1",
18
+ :applies=>["rails"],
19
+ :kind=>Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK,
20
+ :message=>message,
21
+ :mitigation=>"Please upgrade rails version at least to 3.2.19. As a general rule, using the latest stable version is recommended.",
22
+ :aux_links=>["http://weblog.rubyonrails.org/2014/7/2/Rails_3_2_19_4_0_7_and_4_1_3_have_been_released/"]
23
+ })
24
+ self.safe_dependencies = [{:name=>"rails", :version=>['3.2.19']}]
25
+
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,29 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-07-07
5
+ class CVE_2014_3483
6
+ include DependencyCheck
7
+
8
+ def initialize
9
+ message = "Ruby on Rails contains a flaw that may allow carrying out an SQL injection attack. The issue is due to the PostgreSQL adapter for Active Record not properly sanitizing user-supplied input when quoting ranges. This may allow a remote attacker to inject or manipulate SQL queries in the back-end database, allowing for the manipulation or disclosure of arbitrary data."
10
+ super({
11
+ :name=>"CVE-2014-3483",
12
+ :cve=>"2014-3483",
13
+ :osvdb=>"108665",
14
+ :cvss=>"AV:N/AC:L/Au:N/C:P/I:P/A:P",
15
+ :release_date => Date.new(2014, 7, 2),
16
+ :cwe=>"",
17
+ :owasp=>"A1",
18
+ :applies=>["rails"],
19
+ :kind=>Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK,
20
+ :message=>message,
21
+ :mitigation=>"Please upgrade rails at least to version 4.0.7 or 4.1.3. As a general rule, using the latest stable rails version is recommended.",
22
+ :aux_links=>["http://weblog.rubyonrails.org/2014/7/2/Rails_3_2_19_4_0_7_and_4_1_3_have_been_released/"]
23
+ })
24
+ self.safe_dependencies = [{:name=>"rails", :version=>['4.0.7', '4.1.3']}]
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -10,7 +10,9 @@ module Codesake
10
10
 
11
11
  super({
12
12
  :name=> "OSVDB-105971",
13
- :cvss=>"",
13
+ :cvss=>"AV:N/AC:L/Au:N/C:P/I:P/A:P",
14
+ :cve=>"2014-2888",
15
+ :osvdb=> "105971",
14
16
  :release_date => Date.new(2014, 4, 16),
15
17
  :cwe=>"",
16
18
  :owasp=>"A9",
@@ -0,0 +1,29 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-07-04
5
+ class OSVDB_108530
6
+ include DependencyCheck
7
+
8
+ def initialize
9
+ message = "kajam Gem for Ruby contains a flaw in /dataset/lib/dataset/database/postgresql.rb that is triggered when handling metacharacters. This may allow a remote attacker to execute arbitrary commands."
10
+ super({
11
+ :name=> "OSVDB-108530",
12
+ :cvss=>"",
13
+ :osvdb=>"108530",
14
+ :release_date => Date.new(2014, 6, 30),
15
+ :cwe=>"",
16
+ :owasp=>"A9",
17
+ :applies=>["rack", "sinatra", "padrino", "rails"],
18
+ :kind=>Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK,
19
+ :message=>message,
20
+ :mitigation=>"We are not currently aware of a solution for this vulnerability. Keep track on kajam gem updates",
21
+ :aux_links=>["http://www.vapid.dhs.org/advisories/kajam-1.0.3.rc2-2nd-vuln.html"]
22
+ })
23
+ self.safe_dependencies = [{:name=>"kajam", :version=>['1.0.3.rc3']}]
24
+
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,30 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-07-04
5
+ class OSVDB_108563
6
+ include DependencyCheck
7
+
8
+ def initialize
9
+ message = "gyazo Gem for Ruby contains a flaw in client.rb that is triggered when handling metacharacters. This may allow a remote attacker to execute arbitrary commands."
10
+ super({
11
+ :name=> "OSVDB-108563",
12
+ :cvss=>"",
13
+ :cve=>"",
14
+ :osvdb=>"108563",
15
+ :release_date => Date.new(2014, 6, 30),
16
+ :cwe=>"",
17
+ :owasp=>"A9",
18
+ :applies=>["rack", "sinatra", "padrino", "rails"],
19
+ :kind=>Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK,
20
+ :message=>message,
21
+ :mitigation=>"We are not currently aware of a solution for this vulnerability. Please check gyazo rubygem for updates and apply them as soon as possible",
22
+ :aux_links=>["http://www.vapid.dhs.org/advisories/gyazo-1.0.0.html"],
23
+ })
24
+ self.safe_dependencies = [{:name=>"gyazo", :version=>['1.0.1']}]
25
+
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,30 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-07-04
5
+ class OSVDB_108569
6
+ include DependencyCheck
7
+
8
+ def initialize
9
+ message = "backup_checksum Gem for Ruby contains a flaw in /lib/backup/cli/utility.rb that is triggered as the program displays password information in plaintext in the process list. This may allow a local attacker to gain access to password information."
10
+
11
+ super({
12
+ :name=> "OSVDB-108569",
13
+ :osvdb=> "108569",
14
+ :cvss=>"",
15
+ :release_date => Date.new(2014, 6, 30),
16
+ :cwe=>"",
17
+ :owasp=>"A9",
18
+ :applies=>["rack", "sinatra", "padrino", "rails"],
19
+ :kind=>Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK,
20
+ :message=>message,
21
+ :mitigation=>"We are not currently aware of a solution for this vulnerability. Please check backup_checksum gem for security updates.",
22
+ :aux_links=>["http://www.vapid.dhs.org/advisories/backup_checksum-3.0.23.html"]
23
+ })
24
+ self.safe_dependencies = [{:name=>"backup_checksum", :version=>['3.0.24']}]
25
+
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,29 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-07-04
5
+ class OSVDB_108570
6
+ include DependencyCheck
7
+
8
+ def initialize
9
+ message = "backup_checksum Gem for Ruby contains a flaw in /lib/backup/cli/utility.rb that is triggered when handling metacharacters. This may allow a remote attacker to execute arbitrary commands."
10
+ super({
11
+ :name=> "OSVDB-108570",
12
+ :cvss=>"",
13
+ :osvdb=> "108570",
14
+ :release_date => Date.new(2014, 6, 30),
15
+ :cwe=>"",
16
+ :owasp=>"A9",
17
+ :applies=>["rack", "sinatra", "padrino", "rails"],
18
+ :kind=>Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK,
19
+ :message=>message,
20
+ :mitigation=>"We are not currently aware of a solution for this vulnerability. Please check backup_checksum rubygem for upgrades",
21
+ :aux_links=>["http://www.vapid.dhs.org/advisories/backup_checksum-3.0.23.html"]
22
+ })
23
+ self.safe_dependencies = [{:name=>"backup_checksum", :version=>['3.0.24']}]
24
+
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -275,7 +275,9 @@ module Codesake
275
275
  # if the safe_version_rc is 0 then the detected_version_rc is
276
276
  # vulnerable by design, since the safe version is a stable and we
277
277
  # detected a rc.
278
+ debug_me "entering is_vulnerable_rc?: s=#{safe_version_rc}, d=#{detected_version_rc}"
278
279
  return true if safe_version_rc == 0 && detected_version_rc != 0
280
+ return false if safe_version_rc != 0 && detected_version_rc == 0
279
281
  return false if safe_version_rc <= detected_version_rc
280
282
  return true if safe_version_rc > detected_version_rc
281
283
 
@@ -173,6 +173,7 @@ require "codesake/dawn/kb/cve_2013_1947"
173
173
  require "codesake/dawn/kb/cve_2013_1948"
174
174
  require "codesake/dawn/kb/cve_2013_2065"
175
175
  require "codesake/dawn/kb/cve_2013_2090"
176
+ require "codesake/dawn/kb/cve_2013_2105"
176
177
  require "codesake/dawn/kb/cve_2013_2119"
177
178
  require "codesake/dawn/kb/cve_2013_2512"
178
179
  require "codesake/dawn/kb/cve_2013_2513"
@@ -217,10 +218,16 @@ require "codesake/dawn/kb/cve_2014_1234"
217
218
  require "codesake/dawn/kb/cve_2014_2322"
218
219
  require "codesake/dawn/kb/cve_2014_2525"
219
220
  require "codesake/dawn/kb/cve_2014_2538"
221
+ require "codesake/dawn/kb/cve_2014_3482"
222
+ require "codesake/dawn/kb/cve_2014_3483"
220
223
 
221
224
  # OSVDB
222
225
 
223
226
  require "codesake/dawn/kb/osvdb_105971"
227
+ require "codesake/dawn/kb/osvdb_108569"
228
+ require "codesake/dawn/kb/osvdb_108570"
229
+ require "codesake/dawn/kb/osvdb_108530"
230
+ require "codesake/dawn/kb/osvdb_108563"
224
231
 
225
232
 
226
233
  module Codesake
@@ -420,6 +427,7 @@ module Codesake
420
427
  Codesake::Dawn::Kb::CVE_2013_1948.new,
421
428
  Codesake::Dawn::Kb::CVE_2013_2065.new,
422
429
  Codesake::Dawn::Kb::CVE_2013_2090.new,
430
+ Codesake::Dawn::Kb::CVE_2013_2105.new,
423
431
  Codesake::Dawn::Kb::CVE_2013_2119.new,
424
432
  Codesake::Dawn::Kb::CVE_2013_2512.new,
425
433
  Codesake::Dawn::Kb::CVE_2013_2513.new,
@@ -461,9 +469,15 @@ module Codesake
461
469
  Codesake::Dawn::Kb::CVE_2014_2322.new,
462
470
  Codesake::Dawn::Kb::CVE_2014_2525.new,
463
471
  Codesake::Dawn::Kb::CVE_2014_2538.new,
472
+ Codesake::Dawn::Kb::CVE_2014_3482.new,
473
+ Codesake::Dawn::Kb::CVE_2014_3483.new,
464
474
 
465
475
  # OSVDB Checks are still here since are all about dependencies
466
- Codesake::Dawn::Kb::OSVDB_105971.new
476
+ Codesake::Dawn::Kb::OSVDB_105971.new,
477
+ Codesake::Dawn::Kb::OSVDB_108569.new,
478
+ Codesake::Dawn::Kb::OSVDB_108570.new,
479
+ Codesake::Dawn::Kb::OSVDB_108530.new,
480
+ Codesake::Dawn::Kb::OSVDB_108563.new,
467
481
  ]
468
482
  # END @cve_security_checks array
469
483
  # START @owasp_ror_cheatsheet_checks array
@@ -19,10 +19,10 @@ module Codesake
19
19
  # | "Luigi" | 7.0.0 |
20
20
  # | "Doc Hudson" | 8.0.0 |
21
21
 
22
- VERSION = "1.1.3"
22
+ VERSION = "1.2.0"
23
23
  CODENAME = "Lightning McQueen"
24
24
  # RELEASE = "(development)"
25
- RELEASE = "20140506"
25
+ RELEASE = "20140714"
26
26
 
27
27
  end
28
28
  end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe "The Codesake::Core" do
4
+ describe "#find_conf" do
5
+ it "returns path name if true passed" do
6
+ Codesake::Dawn::Core.find_conf(true).should_not be_nil
7
+ end
8
+ end
9
+ end
@@ -860,32 +860,32 @@ describe "The Codesake Dawn knowledge base" do
860
860
  sc = kb.find("CVE-2014-0082")
861
861
  sc.should_not be_nil
862
862
  sc.class.should == Codesake::Dawn::Kb::CVE_2014_0082
863
- end
863
+ end
864
864
  it "must have test for CVE-2014-2322" do
865
- sc = kb.find("CVE-2014-2322")
866
- sc.should_not be_nil
867
- sc.class.should == Codesake::Dawn::Kb::CVE_2014_2322
865
+ sc = kb.find("CVE-2014-2322")
866
+ sc.should_not be_nil
867
+ sc.class.should == Codesake::Dawn::Kb::CVE_2014_2322
868
868
  end
869
869
 
870
870
  it "must have test for CVE-2014-0036" do
871
- sc = kb.find("CVE-2014-0036")
872
- sc.should_not be_nil
873
- sc.class.should == Codesake::Dawn::Kb::CVE_2014_0036
871
+ sc = kb.find("CVE-2014-0036")
872
+ sc.should_not be_nil
873
+ sc.class.should == Codesake::Dawn::Kb::CVE_2014_0036
874
874
  end
875
875
  it "must have test for CVE-2014-2538" do
876
- sc = kb.find("CVE-2014-2538")
877
- sc.should_not be_nil
878
- sc.class.should == Codesake::Dawn::Kb::CVE_2014_2538
876
+ sc = kb.find("CVE-2014-2538")
877
+ sc.should_not be_nil
878
+ sc.class.should == Codesake::Dawn::Kb::CVE_2014_2538
879
879
  end
880
880
  it "must have test for CVE-2013-4203" do
881
- sc = kb.find("CVE-2013-4203")
882
- sc.should_not be_nil
883
- sc.class.should == Codesake::Dawn::Kb::CVE_2013_4203
881
+ sc = kb.find("CVE-2013-4203")
882
+ sc.should_not be_nil
883
+ sc.class.should == Codesake::Dawn::Kb::CVE_2013_4203
884
884
  end
885
885
  it "must have test for CVE-2014-2525" do
886
- sc = kb.find("CVE-2014-2525")
887
- sc.should_not be_nil
888
- sc.class.should == Codesake::Dawn::Kb::CVE_2014_2525
886
+ sc = kb.find("CVE-2014-2525")
887
+ sc.should_not be_nil
888
+ sc.class.should == Codesake::Dawn::Kb::CVE_2014_2525
889
889
  end
890
890
  it "must have test for OSVDB_105971" do
891
891
  sc = kb.find("OSVDB-105971")
@@ -894,8 +894,47 @@ end
894
894
  end
895
895
 
896
896
  it "must have test for CVE-2014-0130" do
897
- sc = kb.find("CVE-2014-0130")
897
+ sc = kb.find("CVE-2014-0130")
898
+ sc.should_not be_nil
899
+ sc.class.should == Codesake::Dawn::Kb::CVE_2014_0130
900
+ end
901
+ it "must have test for CVE-2013-2105" do
902
+ sc = kb.find("CVE-2013-2105")
903
+ sc.should_not be_nil
904
+ sc.class.should == Codesake::Dawn::Kb::CVE_2013_2105
905
+ end
906
+ it "must have test for OSVDB-108569" do
907
+ sc = kb.find("OSVDB-108569")
908
+ sc.should_not be_nil
909
+ sc.class.should == Codesake::Dawn::Kb::OSVDB_108569
910
+ end
911
+
912
+ it "must have test for OSVDB-108570" do
913
+ sc = kb.find("OSVDB-108570")
914
+ sc.should_not be_nil
915
+ sc.class.should == Codesake::Dawn::Kb::OSVDB_108570
916
+ end
917
+
918
+ it "must have test for OSVDB-108530" do
919
+ sc = kb.find("OSVDB-108530")
920
+ sc.should_not be_nil
921
+ sc.class.should == Codesake::Dawn::Kb::OSVDB_108530
922
+ end
923
+ it "must have test for OSVDB-108563" do
924
+ sc = kb.find("OSVDB-108563")
925
+ sc.should_not be_nil
926
+ sc.class.should == Codesake::Dawn::Kb::OSVDB_108563
927
+ end
928
+
929
+ it "must have test for CVE-2014-3482" do
930
+ sc = kb.find("CVE-2014-3482")
931
+ sc.should_not be_nil
932
+ sc.class.should == Codesake::Dawn::Kb::CVE_2014_3482
933
+ end
934
+
935
+ it "must have test for CVE-2014-3483" do
936
+ sc = kb.find("CVE-2014-3483")
898
937
  sc.should_not be_nil
899
- sc.class.should == Codesake::Dawn::Kb::CVE_2014_0130
938
+ sc.class.should == Codesake::Dawn::Kb::CVE_2014_3483
900
939
  end
901
940
  end
@@ -94,7 +94,7 @@ describe "The version check should" do
94
94
  @check.is_vulnerable_version?('2.3.0', '2.3.0.rc9').should be_true
95
95
  end
96
96
  it "reports a safe condition when a rc version is safe and the stable version is detected" do
97
- @check.is_vulnerable_version?('2.3.0.rc9', '2.3.0').should be_true
97
+ @check.is_vulnerable_version?('2.3.0.rc9', '2.3.0').should be_false
98
98
  end
99
99
  it "reports a vulnerability when a previous rc version is detected" do
100
100
  @check.is_vulnerable_version?('2.3.0', '2.2.10.rc2').should be_true
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+ describe "The CVE-2013-2105 vulnerability" do
3
+ before(:all) do
4
+ @check = Codesake::Dawn::Kb::CVE_2013_2105.new
5
+ # @check.debug = true
6
+ end
7
+ it "is reported when show_in_browser vulnerable version is reported (0.0.3)" do
8
+ @check.dependencies = [{:name=>'show_in_browser', :version=>'0.0.3'}]
9
+ @check.vuln?.should be_true
10
+ end
11
+ end
@@ -4,7 +4,6 @@ describe "The CVE-2014-0036 vulnerability" do
4
4
  @check = Codesake::Dawn::Kb::CVE_2014_0036.new
5
5
  # @check.debug = true
6
6
  end
7
- it "must be filled with CVSS information"
8
7
  it "is reported when a vulnerable rbovirt gem version is detected (0.0.23)" do
9
8
  @check.dependencies = [{:name=>"rbovirt", :version=>'0.0.23'}]
10
9
  @check.vuln?.should be_true
@@ -16,5 +16,4 @@ describe "The CVE-2014-0130 vulnerability" do
16
16
  @check.dependencies = [{:name=>"rails", :version=>'3.2.17'}]
17
17
  @check.vuln?.should be_true
18
18
  end
19
- it "must be filled with CVSS information"
20
19
  end
@@ -4,7 +4,6 @@ describe "The CVE-2014-2322 vulnerability" do
4
4
  @check = Codesake::Dawn::Kb::CVE_2014_2322.new
5
5
  # @check.debug = true
6
6
  end
7
- it "must be filled with CVSS information"
8
7
  it "is reported when a vulnerable arabic prawn gem version is found (0.0.1)" do
9
8
  @check.dependencies = [{:name=>"Arabic-Prawn", :version=>'0.0.1'}]
10
9
  @check.vuln?.should be_true
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+ describe "The CVE-2014-3482 vulnerability" do
3
+ before(:all) do
4
+ @check = Codesake::Dawn::Kb::CVE_2014_3482.new
5
+ # @check.debug = true
6
+ end
7
+ it "is reported when a vulnerable version it has been found (3.2.18)" do
8
+ @check.dependencies = [{:name=>"rails", :version=>"3.2.18"}]
9
+ @check.vuln?.should be_true
10
+ end
11
+ it "is not reported when a safe version it has been found (3.2.19)" do
12
+ @check.dependencies = [{:name=>"rails", :version=>"3.2.19"}]
13
+ @check.vuln?.should be_false
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+ describe "The CVE-2014-3483 vulnerability" do
3
+ before(:all) do
4
+ @check = Codesake::Dawn::Kb::CVE_2014_3483.new
5
+ # @check.debug = true
6
+ end
7
+ it "is reported when a rails gem version 4.0.6 is detected" do
8
+ @check.dependencies = [{:name=>"rails", :version=>"4.0.6"}]
9
+ @check.vuln?.should be_true
10
+ end
11
+ it "is reported when a rails gem version 4.1.2 is detected" do
12
+ @check.dependencies = [{:name=>"rails", :version=>"4.1.2"}]
13
+ @check.vuln?.should be_true
14
+ end
15
+ it "is not reported when a rails gem version 4.0.7 is detected" do
16
+ @check.dependencies = [{:name=>"rails", :version=>"4.0.7"}]
17
+ @check.vuln?.should be_false
18
+ end
19
+ it "is not reported when a rails gem version 4.1.3 is detected" do
20
+ @check.dependencies = [{:name=>"rails", :version=>"4.1.3"}]
21
+ @check.vuln?.should be_false
22
+ end
23
+ end
@@ -12,6 +12,4 @@ describe "The OSVDB_105971 vulnerability" do
12
12
  @check.dependencies = [{:name=>"sfpagent", :version=>"0.4.15"}]
13
13
  @check.vuln?.should be_false
14
14
  end
15
- it "must be filled with CVE identifier"
16
- it "must be filled with CVSS information"
17
15
  end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+ describe "The OSVDB-108530 vulnerability" do
3
+ before(:all) do
4
+ @check = Codesake::Dawn::Kb::OSVDB_108530.new
5
+ # @check.debug = true
6
+ end
7
+ it "is reported when a vulnerable version it has been found (1.0.3.rc2)" do
8
+ @check.dependencies = [{:name=>"kajam", :version=>"1.0.3.rc2"}]
9
+ @check.vuln?.should be_true
10
+ end
11
+ it "is not reported when a safe version it has been found (1.0.3)" do
12
+ @check.dependencies = [{:name=>"kajam", :version=>"1.0.3"}]
13
+ @check.vuln?.should be_false
14
+ end
15
+ it "is not reported when a safe version it has been found (1.0.4)" do
16
+ @check.dependencies = [{:name=>"kajam", :version=>"1.0.4"}]
17
+ @check.vuln?.should be_false
18
+ end
19
+
20
+ it "must be filled with CVE identifier"
21
+ it "must be filled with CVSS information"
22
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+ describe "The OSVDB-108563 vulnerability" do
3
+ before(:all) do
4
+ @check = Codesake::Dawn::Kb::OSVDB_108563.new
5
+ # @check.debug = true
6
+ end
7
+
8
+ it "is reported when a vulnerable version it has been found (1.0.0)" do
9
+ @check.dependencies = [{:name=>"gyazo", :version=>"1.0.0"}]
10
+ @check.vuln?.should be_true
11
+ end
12
+ it "is not reported when a safe version it has been found (0.4.15)" do
13
+ @check.dependencies = [{:name=>"gyazo", :version=>"1.0.1"}]
14
+ @check.vuln?.should be_false
15
+ end
16
+ it "must be filled with CVE identifier"
17
+ it "must be filled with CVSS information"
18
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+ describe "The OSVDB-108569 vulnerability" do
3
+ before(:all) do
4
+ @check = Codesake::Dawn::Kb::OSVDB_108569.new
5
+ # @check.debug = true
6
+ end
7
+ it "is reported when a vulnerable backup_checksum gem version it has been found (3.0.23)" do
8
+ @check.dependencies = [{:name=>"backup_checksum", :version=>"3.0.23"}]
9
+ @check.vuln?.should be_true
10
+ end
11
+ it "is not reported when a safe backup_checksum gem version it has been found (3.0.24)" do
12
+ @check.dependencies = [{:name=>"backup_checksum", :version=>"3.0.24"}]
13
+ @check.vuln?.should be_false
14
+ end
15
+ it "must be filled with CVE identifier"
16
+ it "must be filled with CVSS information"
17
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+ describe "The OSVDB-108570 vulnerability" do
3
+ before(:all) do
4
+ @check = Codesake::Dawn::Kb::OSVDB_108570.new
5
+ # @check.debug = true
6
+ end
7
+ it "is reported when a vulnerable version it has been found (3.0.23)" do
8
+ @check.dependencies = [{:name=>"backup_checksum", :version=>"3.0.23"}]
9
+ @check.vuln?.should be_true
10
+ end
11
+ it "is not reported when a safe version it has been found (0.4.15)" do
12
+ @check.dependencies = [{:name=>"backup_checksum", :version=>"3.0.24"}]
13
+ @check.vuln?.should be_false
14
+ end
15
+ it "must be filled with CVE identifier"
16
+ it "must be filled with CVSS information"
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codesake-dawn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paolo Perego
@@ -30,7 +30,7 @@ cert_chain:
30
30
  Fh7BfxFDBZdj1mI2V+I+IYYMPKIouvwX3r7NTZgZ4TYuKVpOk9VSCxzhrPhnl4kb
31
31
  1LyVQIFlhF6nL0casp0ixer8N60=
32
32
  -----END CERTIFICATE-----
33
- date: 2014-05-06 00:00:00.000000000 Z
33
+ date: 2014-07-14 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: codesake-commons
@@ -38,14 +38,14 @@ dependencies:
38
38
  requirements:
39
39
  - - ~>
40
40
  - !ruby/object:Gem::Version
41
- version: 0.95.0
41
+ version: 1.0.0
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ~>
47
47
  - !ruby/object:Gem::Version
48
- version: 0.95.0
48
+ version: 1.0.0
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: cvss
51
51
  requirement: !ruby/object:Gem::Requirement
@@ -286,10 +286,12 @@ files:
286
286
  - checksum/codesake-dawn-1.1.0.rc1.gem.sha512
287
287
  - checksum/codesake-dawn-1.1.1.gem.sha512
288
288
  - checksum/codesake-dawn-1.1.2.gem.sha512
289
+ - checksum/codesake-dawn-1.1.3.gem.sha512
289
290
  - codesake-dawn.gemspec
290
291
  - doc/codesake-dawn.yaml.sample
291
292
  - doc/dawn_1_0_announcement.md
292
293
  - doc/dawn_1_1_announcement.md
294
+ - doc/dawn_1_2_announcement.md
293
295
  - features/dawn_complains_about_an_incorrect_command_line.feature.disabled
294
296
  - features/dawn_scan_a_secure_sinatra_app.feature.disabled
295
297
  - features/dawn_scan_a_vulnerable_sinatra_app.feature.disabled
@@ -423,6 +425,7 @@ files:
423
425
  - lib/codesake/dawn/kb/cve_2013_1948.rb
424
426
  - lib/codesake/dawn/kb/cve_2013_2065.rb
425
427
  - lib/codesake/dawn/kb/cve_2013_2090.rb
428
+ - lib/codesake/dawn/kb/cve_2013_2105.rb
426
429
  - lib/codesake/dawn/kb/cve_2013_2119.rb
427
430
  - lib/codesake/dawn/kb/cve_2013_2512.rb
428
431
  - lib/codesake/dawn/kb/cve_2013_2513.rb
@@ -464,11 +467,17 @@ files:
464
467
  - lib/codesake/dawn/kb/cve_2014_2322.rb
465
468
  - lib/codesake/dawn/kb/cve_2014_2525.rb
466
469
  - lib/codesake/dawn/kb/cve_2014_2538.rb
470
+ - lib/codesake/dawn/kb/cve_2014_3482.rb
471
+ - lib/codesake/dawn/kb/cve_2014_3483.rb
467
472
  - lib/codesake/dawn/kb/dependency_check.rb
468
473
  - lib/codesake/dawn/kb/deprecation_check.rb
469
474
  - lib/codesake/dawn/kb/not_revised_code.rb
470
475
  - lib/codesake/dawn/kb/operating_system_check.rb
471
476
  - lib/codesake/dawn/kb/osvdb_105971.rb
477
+ - lib/codesake/dawn/kb/osvdb_108530.rb
478
+ - lib/codesake/dawn/kb/osvdb_108563.rb
479
+ - lib/codesake/dawn/kb/osvdb_108569.rb
480
+ - lib/codesake/dawn/kb/osvdb_108570.rb
472
481
  - lib/codesake/dawn/kb/owasp_ror_cheatsheet.rb
473
482
  - lib/codesake/dawn/kb/owasp_ror_cheatsheet/check_for_backup_files.rb
474
483
  - lib/codesake/dawn/kb/owasp_ror_cheatsheet/check_for_safe_redirect_and_forward.rb
@@ -492,6 +501,7 @@ files:
492
501
  - lib/codesake/dawn/utils.rb
493
502
  - lib/codesake/dawn/version.rb
494
503
  - lib/tasks/codesake-dawn_tasks.rake
504
+ - spec/lib/dawn/codesake_core_spec.rb
495
505
  - spec/lib/dawn/codesake_knowledgebase_spec.rb
496
506
  - spec/lib/dawn/codesake_padrino_engine_disabled.rb
497
507
  - spec/lib/dawn/codesake_rails_engine_disabled.rb
@@ -522,6 +532,7 @@ files:
522
532
  - spec/lib/kb/cve_2013_1655_spec.rb
523
533
  - spec/lib/kb/cve_2013_1756_spec.rb
524
534
  - spec/lib/kb/cve_2013_2090_spec.rb
535
+ - spec/lib/kb/cve_2013_2105_spec.rb
525
536
  - spec/lib/kb/cve_2013_2119_spec.rb
526
537
  - spec/lib/kb/cve_2013_2512_spec.rb
527
538
  - spec/lib/kb/cve_2013_2513_spec.rb
@@ -544,7 +555,13 @@ files:
544
555
  - spec/lib/kb/cve_2014_1234_spec.rb
545
556
  - spec/lib/kb/cve_2014_2322_spec.rb
546
557
  - spec/lib/kb/cve_2014_2538_spec.rb
558
+ - spec/lib/kb/cve_2014_3482_spec.rb
559
+ - spec/lib/kb/cve_2014_3483_spec.rb
547
560
  - spec/lib/kb/osvdb_105971_spec.rb
561
+ - spec/lib/kb/osvdb_108530_spec.rb
562
+ - spec/lib/kb/osvdb_108563_spec.rb
563
+ - spec/lib/kb/osvdb_108569_spec.rb
564
+ - spec/lib/kb/osvdb_108570_spec.rb
548
565
  - spec/lib/kb/owasp_ror_cheatsheet_disabled.rb
549
566
  - spec/spec_helper.rb
550
567
  - support/bootstrap.js
@@ -553,9 +570,10 @@ files:
553
570
  homepage: http://dawn.codesake.com
554
571
  licenses: []
555
572
  metadata: {}
556
- post_install_message: Thank you for installing Codesake::Dawn security source code
557
- scanner for Ruby. Start securing your code by running "dawn project_folder" right
558
- now or just run "dawn --help" if you want to explore all possible command line flags.
573
+ post_install_message: |-
574
+ Thank you for installing "dawn", a security source code scanner for Ruby. Start securing your code by running "dawn project_folder" right now or just run "dawn --help" if you want to explore all possible command line flags.
575
+
576
+ **PLEASE READ THIS** On November 1st, 2014 codesake-dawn gem will change the name in 'dawn'. On this date the first 'dawn' gem will be published and 'codesake-dawn' will be just a placeholder requiring the new gem.
559
577
  rdoc_options: []
560
578
  require_paths:
561
579
  - lib
@@ -583,6 +601,7 @@ test_files:
583
601
  - features/dawn_scan_a_vulnerable_sinatra_app.feature.disabled
584
602
  - features/step_definition/dawn_steps.rb
585
603
  - features/support/env.rb
604
+ - spec/lib/dawn/codesake_core_spec.rb
586
605
  - spec/lib/dawn/codesake_knowledgebase_spec.rb
587
606
  - spec/lib/dawn/codesake_padrino_engine_disabled.rb
588
607
  - spec/lib/dawn/codesake_rails_engine_disabled.rb
@@ -613,6 +632,7 @@ test_files:
613
632
  - spec/lib/kb/cve_2013_1655_spec.rb
614
633
  - spec/lib/kb/cve_2013_1756_spec.rb
615
634
  - spec/lib/kb/cve_2013_2090_spec.rb
635
+ - spec/lib/kb/cve_2013_2105_spec.rb
616
636
  - spec/lib/kb/cve_2013_2119_spec.rb
617
637
  - spec/lib/kb/cve_2013_2512_spec.rb
618
638
  - spec/lib/kb/cve_2013_2513_spec.rb
@@ -635,6 +655,12 @@ test_files:
635
655
  - spec/lib/kb/cve_2014_1234_spec.rb
636
656
  - spec/lib/kb/cve_2014_2322_spec.rb
637
657
  - spec/lib/kb/cve_2014_2538_spec.rb
658
+ - spec/lib/kb/cve_2014_3482_spec.rb
659
+ - spec/lib/kb/cve_2014_3483_spec.rb
638
660
  - spec/lib/kb/osvdb_105971_spec.rb
661
+ - spec/lib/kb/osvdb_108530_spec.rb
662
+ - spec/lib/kb/osvdb_108563_spec.rb
663
+ - spec/lib/kb/osvdb_108569_spec.rb
664
+ - spec/lib/kb/osvdb_108570_spec.rb
639
665
  - spec/lib/kb/owasp_ror_cheatsheet_disabled.rb
640
666
  - spec/spec_helper.rb
metadata.gz.sig CHANGED
Binary file