codesake-dawn 1.0.6 → 1.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -0
  3. data.tar.gz.sig +4 -0
  4. data/.travis.yml +5 -3
  5. data/Changelog.md +70 -4
  6. data/README.md +129 -95
  7. data/Rakefile +27 -3
  8. data/Roadmap.md +47 -40
  9. data/bin/dawn +104 -86
  10. data/certs/paolo_at_codesake_dot_com.pem +21 -0
  11. data/checksum/.placeholder +0 -0
  12. data/codesake-dawn.gemspec +11 -3
  13. data/doc/codesake-dawn.yaml.sample +26 -0
  14. data/lib/codesake-dawn.rb +1 -0
  15. data/lib/codesake/dawn/core.rb +84 -51
  16. data/lib/codesake/dawn/engine.rb +66 -15
  17. data/lib/codesake/dawn/gemfile_lock.rb +2 -2
  18. data/lib/codesake/dawn/kb/basic_check.rb +109 -98
  19. data/lib/codesake/dawn/kb/combo_check.rb +4 -3
  20. data/lib/codesake/dawn/kb/cve_2011_2930.rb +1 -0
  21. data/lib/codesake/dawn/kb/cve_2011_3187.rb +1 -0
  22. data/lib/codesake/dawn/kb/cve_2011_4319.rb +1 -0
  23. data/lib/codesake/dawn/kb/cve_2011_5036.rb +28 -0
  24. data/lib/codesake/dawn/kb/cve_2012_1098.rb +1 -0
  25. data/lib/codesake/dawn/kb/cve_2012_6109.rb +27 -0
  26. data/lib/codesake/dawn/kb/cve_2013_0183.rb +27 -0
  27. data/lib/codesake/dawn/kb/cve_2013_0184.rb +27 -0
  28. data/lib/codesake/dawn/kb/cve_2013_0262.rb +28 -0
  29. data/lib/codesake/dawn/kb/cve_2013_0263.rb +1 -1
  30. data/lib/codesake/dawn/kb/cve_2013_1607.rb +27 -0
  31. data/lib/codesake/dawn/kb/cve_2013_2512.rb +28 -0
  32. data/lib/codesake/dawn/kb/cve_2013_2513.rb +27 -0
  33. data/lib/codesake/dawn/kb/cve_2013_2516.rb +28 -0
  34. data/lib/codesake/dawn/kb/cve_2013_4413.rb +29 -0
  35. data/lib/codesake/dawn/kb/cve_2013_4457.rb +1 -1
  36. data/lib/codesake/dawn/kb/cve_2013_4489.rb +30 -0
  37. data/lib/codesake/dawn/kb/cve_2013_4593.rb +29 -0
  38. data/lib/codesake/dawn/kb/cve_2013_5647.rb +1 -0
  39. data/lib/codesake/dawn/kb/cve_2013_5671.rb +28 -0
  40. data/lib/codesake/dawn/kb/cve_2013_6416.rb +1 -0
  41. data/lib/codesake/dawn/kb/cve_2014_0080.rb +30 -0
  42. data/lib/codesake/dawn/kb/dependency_check.rb +37 -13
  43. data/lib/codesake/dawn/kb/deprecation_check.rb +40 -0
  44. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/check_for_safe_redirect_and_forward.rb +3 -1
  45. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/command_injection.rb +2 -0
  46. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/csrf.rb +3 -1
  47. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/mass_assignment_in_model.rb +2 -0
  48. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/security_related_headers.rb +9 -7
  49. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/sensitive_files.rb +2 -0
  50. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/session_stored_in_database.rb +2 -0
  51. data/lib/codesake/dawn/kb/pattern_match_check.rb +16 -8
  52. data/lib/codesake/dawn/kb/ruby_version_check.rb +11 -11
  53. data/lib/codesake/dawn/kb/version_check.rb +416 -0
  54. data/lib/codesake/dawn/knowledge_base.rb +119 -59
  55. data/lib/codesake/dawn/reporter.rb +272 -0
  56. data/lib/codesake/dawn/utils.rb +11 -0
  57. data/lib/codesake/dawn/version.rb +14 -12
  58. data/spec/lib/dawn/codesake_knowledgebase_spec.rb +253 -160
  59. data/spec/lib/kb/codesake_cve_2013_0175_spec.rb +1 -1
  60. data/spec/lib/kb/codesake_dependency_version_check_spec.rb +21 -10
  61. data/spec/lib/kb/codesake_deprecation_check_spec.rb +56 -0
  62. data/spec/lib/kb/codesake_version_check_spec.rb +165 -0
  63. data/spec/lib/kb/cve_2011_2930_spec.rb +5 -6
  64. data/spec/lib/kb/cve_2011_5036_spec.rb +95 -0
  65. data/spec/lib/kb/cve_2012_6109_spec.rb +112 -0
  66. data/spec/lib/kb/cve_2013_0183_spec.rb +54 -0
  67. data/spec/lib/kb/cve_2013_0184_spec.rb +115 -0
  68. data/spec/lib/kb/cve_2013_0256_spec.rb +1 -8
  69. data/spec/lib/kb/cve_2013_0262_spec.rb +44 -0
  70. data/spec/lib/kb/cve_2013_1607_spec.rb +15 -0
  71. data/spec/lib/kb/{codesake_cve_2013_1655_spec.rb → cve_2013_1655_spec.rb} +0 -0
  72. data/spec/lib/kb/cve_2013_2090_spec.rb +0 -5
  73. data/spec/lib/kb/cve_2013_2512_spec.rb +15 -0
  74. data/spec/lib/kb/cve_2013_2513_spec.rb +15 -0
  75. data/spec/lib/kb/cve_2013_2516_spec.rb +15 -0
  76. data/spec/lib/kb/cve_2013_4413_spec.rb +16 -0
  77. data/spec/lib/kb/cve_2013_4489_spec.rb +63 -0
  78. data/spec/lib/kb/cve_2013_4593_spec.rb +16 -0
  79. data/spec/lib/kb/cve_2013_5671_spec.rb +27 -0
  80. data/spec/lib/kb/{codesake_cve_2013_6416_spec.rb → cve_2013_6416_spec.rb} +0 -0
  81. data/spec/lib/kb/cve_2014_0080_spec.rb +28 -0
  82. data/spec/spec_helper.rb +7 -3
  83. data/support/bootstrap.js +2027 -0
  84. data/support/bootstrap.min.css +9 -0
  85. data/support/codesake.css +63 -0
  86. metadata +127 -18
  87. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 533e7cbdaed92f7f1dfd4e9edf9e0f7a3a7eface
4
- data.tar.gz: ab8a1b8696885fd7e4974b4e2b290306450da5e3
3
+ metadata.gz: e6f5635154af886b9fe241f81237d26881b8d355
4
+ data.tar.gz: 4876b2d24472a2ed3e593433b0cfde0e0eb41242
5
5
  SHA512:
6
- metadata.gz: 5c1065fe087482d80c4d8cbaf8d40be918c2fc076097e2fbc45425c5cd9f77e3d60088bac26ee759a9f04e582c00a93b031fc76e27e050106c9406b110bf2ab6
7
- data.tar.gz: 742f0d74ab39c0301ecc29a60dbc564bb1e12fb793796970d8229a4bd14b4487ba4eac6272684ab81eaf033fc8d0ffb64e4a460f6e812e06e2481c2e746a9c3f
6
+ metadata.gz: 9196f5452bc7611b064b2d2f9cd08e301495b91c15531272d9edba5ec98428f7578c98916499c8844c65e1eb2f727574a9eca50160f9bda93e67fbad1914e84a
7
+ data.tar.gz: e7128f118a790d48eb7139d7ce429cf28de1fcca516397ced49bc621e295c3ccc4d0e37bc58d64f2522abcb5ed85e89136749b360e3cf6eeba4ef372662cc2e5
@@ -0,0 +1,2 @@
1
+ LϬ=�4Y�O��p5O,͚�b�qTLOQ(�
2
+ �k�Y r���g�@%�O�����w
@@ -0,0 +1,4 @@
1
+ ��$
2
+ �ߓ�<�G��WO�Q_���� �"ލF�b� �W@f�q� үrs"$ �S+hy|��4�:�-]�v�[�U����N#�E.�׳tI�ˢr��1�H�!��>�Q�Q�#_d����
3
+ t0Y��8�� }�|��fj *����
4
+ {�c15k�S$��sc�\:R�'��r��������f�b-�J�:\��π�i����z��s�p�k��;�^����=�s@]��yl3)�T��L2�/��J�m�)
@@ -1,6 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
- - 1.9.3
5
- - 2.0.0
6
3
  - 2.1.0
4
+ - 2.0.0
5
+ - 1.9.3
6
+ - 1.9.2
7
+ - ruby-head
8
+ - rbx
@@ -5,7 +5,73 @@ 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: Sun Mar 23 22:36:42 CET 2014_
8
+ _latest update: Sun Mar 23 23:06:38 CET 2014_
9
+
10
+ ## Version 1.1.0 - codename: Lightning McQueen (2014-xx-xx)
11
+
12
+ * Added a check for CVE-2011-5036
13
+ * Added a check for CVE-2012-6109
14
+ * Added a check for CVE-2013-0183
15
+ * Added a check for CVE-2013-0184
16
+ * Added a check for CVE-2013-0262
17
+ * Added a check for CVE-2013-1607
18
+ * Added a check for CVE-2013-2512
19
+ * Added a check for CVE-2013-2513
20
+ * Added a check for CVE-2013-2516
21
+ * Added a check for CVE-2013-4413
22
+ * Added a check for CVE-2013-4489
23
+ * Added a check for CVE-2013-4593
24
+ * Added a check for CVE-2013-5671
25
+ * Added a check for CVE-2014-0080
26
+ * Added remaining compliance checks against Owasp Ruby on Rails cheatsheet.
27
+ Some other checks in the cheatsheet can't be turned into a Codesake::Dawn
28
+ test, so all the cheatsheet content is covered since now.
29
+ * Added a --ascii-tabular-report (-a) to produce a report formatted with ascii
30
+ tables. A bit of bin/dawn refactoring was necessary.
31
+ * Added a --json (-j) to produce JSON reports
32
+ * Added a --html (-h) to produce HTML reports
33
+ * Added a --file (-F) flag to save report to supplied filename
34
+ * Added Codesake::Dawn gem signature as described in
35
+ http://guides.rubygems.org/security/. README is modified accordingly with new
36
+ installation suggestions. Added also gem SHA512 checksum in repository.
37
+ * Added a not_affected attribute to dependency check to flag as not vulnerable
38
+ previous versions
39
+ * CVE-2013-2090: we were uncertain about previous cremefraiche version if they
40
+ were vulnerable or not. Gem author, yanked all previous version but the
41
+ latest released 29 January 2014. We removed the rspec check for version <
42
+ 0.6.x
43
+ * basic_check.rb: due to the great @rubysec guys work, the link to their site
44
+ is provided as well. True to be told, there are some CVE valid but not found
45
+ on NVID website, so having @rubysec link is even more accurate in those
46
+ situations.
47
+ * New Codesake::Dawn::Kb::VersionCheck class to provide version specific
48
+ checks, supporting beta version number, release candidate and pre. Fully
49
+ integrated with DepedencyCheck and RubyVersionCheck
50
+ * Issue #34. I added a deprecation check. However I haven't found an official
51
+ link saying which are MVC gem version to be considered officially deprecated
52
+ or just old. I enabled only check against ruby
53
+ * Added a --seach-knowledge-base removing the optional parameter to
54
+ --list-knowledge-base that is just for listing.
55
+ * Renamed '--list-knowledgebase' to '--list-knowledge-base' and '-k' short option was removed
56
+ * Added a --list-known-families option printing out Codesake::Dawn supported check family name
57
+ * Removed '-f' short option for list-known-framework
58
+ * Added family and severity to Owasp RoR Cheatsheet files
59
+ * Add a method to return severity level. If it's provided by check constructor
60
+ then that value is used, otherwise is calculated using CVSS. If no value and
61
+ no CVSS are available the return value is "unknown".
62
+ * Removed old ruby version check from BasicCheck. It's outdated and no longer
63
+ needed
64
+ * Added --disable-cve-bulletins flag to disable all CVE security checks
65
+ * Added --disable-code-quality flag to disable all code quality checks
66
+ * Added --disable-code-style flag to disable all code style checks
67
+ * Added --disable-owasp-ror-cheatsheet flag to disable all Owasp Ruby on Rails
68
+ cheatsheet checks
69
+ * Added --disable-owasp-top-10 flag to disable all Owasp Top 10 checks
70
+ * Revamped help output
71
+ * Added YAML Codesake::Dawn configuration support. Now you can specify your
72
+ preferences in a .codesake-dawn.yaml file in your home directory (or you can
73
+ use the --config-file option to specify the file you want to use). It returns
74
+ an embedded default configuration if the supplied filename doesn't exist.
9
75
 
10
76
  ## Version 1.0.6 - codename: Lightning McQueen (2014-03-23)
11
77
 
@@ -166,7 +232,7 @@ _latest update: Sun Mar 23 22:36:42 CET 2014_
166
232
  ## Version 0.85 - codename: elevator (2013-12-17)
167
233
 
168
234
  * refactoring bin/dawn script: some stuff were moved into Codesake::Core class
169
- * Added a check against Denial of Service vulnerability for Nokogiri 1.5.x
235
+ * Added a check against Denial of Service vulnerability for Nokogiri 1.5.x
170
236
  and 1.6.0 when used with JRuby.
171
237
  * Added a check against Denial of Service vulnerability due to entity expansion
172
238
  for Nokogiri 1.5.x and 1.6.0 when used with JRuby.
@@ -199,7 +265,7 @@ able to scan something. It deserves a special release.
199
265
  * adding test for CVE-2013-2065
200
266
  * adding test for CVE-2013-4389
201
267
  * adding test for CVE-2010-1330
202
- * adding test for CVE-2011-0446
268
+ * adding test for CVE-2011-0446
203
269
  * adding test for CVE-2011-0995
204
270
  * adding test for CVE-2011-2929
205
271
  * adding test for CVE-2011-4815
@@ -268,7 +334,7 @@ able to scan something. It deserves a special release.
268
334
  * adding test for CVE-2013-2616
269
335
  * adding test for CVE-2013-2617
270
336
  * adding test for CVE-2013-3221
271
- * make output less verbose. Only vulnerabilities and severity will be shown
337
+ * make output less verbose. Only vulnerabilities and severity will be shown
272
338
  * adding a '--verbose' option to see also the whole knowledge base info about each findings
273
339
  * adding a '--output' option
274
340
  * adding a '--count-only' option
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # Codesake::Dawn - The security code scanner for Ruby
2
2
 
3
3
  Codesake::Dawn is a source code scanner designed to review your code for
4
- security issues.
4
+ security issues.
5
5
 
6
6
  Codesake::Dawn is able to scan your ruby standalone programs but its main usage
7
7
  is to deal with web applications. It supports applications written using majors
8
- MVC (Model View Controller) frameworks, like:
8
+ MVC (Model View Controller) frameworks, like:
9
9
 
10
10
  * [Ruby on Rails](http://rubyonrails.org)
11
11
  * [Sinatra](http://www.sinatrarb.com)
12
- * [Padrino](http://www.padrinorb.com)
12
+ * [Padrino](http://www.padrinorb.com)
13
13
 
14
14
  ---
15
15
 
@@ -28,7 +28,7 @@ You can dump all security checks in the knowledge base by using the -k
28
28
  flag:
29
29
 
30
30
  ```
31
- $ dawn -k|--list-knowledge-base
31
+ $ dawn -k|--list-knowledge-base
32
32
  ```
33
33
 
34
34
  Useful in scripts, you can even supply a parameter to ```-k``` flag to check if
@@ -64,23 +64,39 @@ application.
64
64
 
65
65
  ## Installation
66
66
 
67
- You can install latest Codesake::Dawn version, using [Rubygems](https://rubygems.org) by typing:
67
+ codesake-dawn rubygem is cryptographically signed. To be sure the gem you
68
+ install hasn’t been tampered, you must first add ```paolo@codesake.com```
69
+ public signing certificate as trusted to your gem specific keyring.
68
70
 
69
- gem install codesake-dawn
71
+ ```
72
+ $ gem cert --add <(curl -Ls https://raw.github.com/codesake/codesake-dawn/certs/paolo_at_codesake_dot_com.pem)
73
+ ```
70
74
 
71
- In order to install a release candidate version, the gem install command line is the following:
75
+ You can install latest Codesake::Dawn version, fetching it from
76
+ [Rubygems](https://rubygems.org) by typing:
72
77
 
73
78
  ```
74
- $ gem install codesake-dawn --pre
79
+ $ gem install codesake-dawn -P MediumSecurity
80
+ ```
81
+
82
+ The MediumSecurity trust profile will verify signed gems, but allow the
83
+ installation of unsigned dependencies. This is necessary because not all of
84
+ Codesake::Dawn’s dependencies are signed, so we cannot use HighSecurity.
85
+
86
+ In order to install a release candidate version, the gem install command line
87
+ is the following:
88
+
89
+ ```
90
+ $ gem install codesake-dawn --pre -P MediumSecurity
75
91
  ```
76
92
 
77
93
  If you want to add dawn to your project Gemfile, you must add the following:
78
-
94
+
79
95
  group :development do
80
96
  gem 'codesake-dawn', :require=>false
81
97
  end
82
98
 
83
- And then upgrade your bundle
99
+ And then upgrade your bundle
84
100
 
85
101
  $ bundle install
86
102
 
@@ -98,7 +114,7 @@ that.
98
114
  ## Usage
99
115
 
100
116
  You can start your code review with Codesake::Dawn very easily. Simply tell the tool
101
- where the project root directory.
117
+ where the project root directory.
102
118
 
103
119
  Underlying MVC framework is autodetected by Codesake::Dawn using target Gemfile.lock
104
120
  file. If autodetect fails for some reason, the tool will complain about it and
@@ -108,35 +124,55 @@ hand.
108
124
  Basic usage is to specify some optional command line option to fit best your
109
125
  needs, and to specify the target directory where your code is stored.
110
126
 
111
- ```
127
+ ```
112
128
  $ dawn [options] target
113
129
  ```
114
130
 
115
131
  In case of need, there is a quick command line option reference running ```dawn -h``` at your OS prompt.
116
132
 
117
133
  ```
118
- $ bundle exec dawn -h
119
- 08:05:21 [*] dawn v1.0.0 is starting up
134
+ $ dawn -h
120
135
  Usage: dawn [options] target_directory
121
136
 
122
-
123
- Examples:$ dawn a_sinatra_webapp_directory
124
- $ dawn -C the_rails_blog_engine
125
- $ dawn -C --output json a_sinatra_webapp_directory
126
-
127
- -r, --rails force dawn to consider the target a rails application
128
- -s, --sinatra force dawn to consider the target a sinatra application
129
- -p, --padrino force dawn to consider the target a padrino application
130
- -G, --gem-lock force dawn to scan only for vulnerabilities affecting dependencies in Gemfile.lock
131
- -D, --debug enters dawn debug mode
132
- -f, --list-known-framework list ruby MVC frameworks supported by dawn
133
- -k, --list-knowledgebase [check_name] list dawn known security checks. If check_name is specified dawn says if check is present or not
134
- -o, --output [console, json. csv, html] the output will be in the specified format
135
- -V, --verbose the output will be more verbose
136
- -C, --count-only dawn will only count vulnerabilities (useful for scripts)
137
- -z, --exit-on-warn dawn will return number of found vulnerabilities as exit code
138
- -v, --version show version information
139
- -h, --help show this help
137
+ Examples:
138
+ $ dawn a_sinatra_webapp_directory
139
+ $ dawn -C the_rails_blog_engine
140
+ $ dawn -C --json a_sinatra_webapp_directory
141
+ $ dawn --ascii-tabular-report my_rails_blog_ecommerce
142
+ $ dawn --html -F my_report.html my_rails_blog_ecommerce
143
+
144
+ -r, --rails force dawn to consider the target a rails application
145
+ -s, --sinatra force dawn to consider the target a sinatra application
146
+ -p, --padrino force dawn to consider the target a padrino application
147
+ -G, --gem-lock force dawn to scan only for vulnerabilities affecting dependencies in Gemfile.lock
148
+ -a, --ascii-tabular-report cause dawn to format findings using table in ascii art
149
+ -j, --json cause dawn to format findings using json
150
+ -C, --count-only dawn will only count vulnerabilities (useful for scripts)
151
+ -z, --exit-on-warn dawn will return number of found vulnerabilities as exit code
152
+ -F, --file filename tells dawn to write output to filename
153
+ -c, --config-file filename tells dawn to load configuration from filename
154
+
155
+ Disable security check family
156
+
157
+ --disable-cve-bulletins disable all CVE security checks
158
+ --disable-code-quality disable all code quality checks
159
+ --disable-code-style disable all code style checks
160
+ --disable-owasp-ror-cheatsheet disable all Owasp Ruby on Rails cheatsheet checks
161
+ --disable-owasp-top-10 disable all Owasp Top 10 checks
162
+
163
+ Flags useful to query Codesake::Dawn
164
+
165
+ -S, --search-knowledge-base [check_name] search check_name in the knowledge base
166
+ --list-knowledge-base list knowledge-base content
167
+ --list-known-families list security check families contained in dawn's knowledge base
168
+ --list-known-framework list ruby MVC frameworks supported by dawn
169
+
170
+ Service flags
171
+
172
+ -D, --debug enters dawn debug mode
173
+ -V, --verbose the output will be more verbose
174
+ -v, --version show version information
175
+ -h, --help show this help
140
176
  ```
141
177
 
142
178
  ### Rake task
@@ -150,7 +186,8 @@ require 'codesake/dawn/tasks'
150
186
  Then executing ```$ rake -T``` you will have a ```dawn:run``` task you want to execute.
151
187
 
152
188
  ```
153
- $ rake -T (ruby-2.0.0-p353@engage)
189
+ $ rake -T
190
+ ...
154
191
  rake dawn:run # Execute codesake-dawn on the current directory
155
192
  ...
156
193
  ```
@@ -159,7 +196,7 @@ rake dawn:run # Execute codesake-dawn on the current directory
159
196
 
160
197
  As output, Codesake::Dawn will put all security checks that are failed during the scan.
161
198
 
162
- This the result of Codedake::Dawn running against a
199
+ This the result of Codedake::Dawn running against a
163
200
  [Sinatra 1.4.2 web application](https://github.com/thesp0nge/railsberry2013) wrote for a talk I
164
201
  delivered in 2013 at [Railsberry conference](http://www.railsberry.com).
165
202
 
@@ -168,21 +205,23 @@ looking at Gemfile.lock, than it discards all security checks not appliable to
168
205
  Sinatra (49 security checks, in version 1.0, especially designed for Ruby on
169
206
  Rails) and it applies them.
170
207
 
171
- ```
172
- $ bundle exec dawn ~/src/hacking/railsberry2013
173
- 08:09:47 [*] dawn v1.0.0 is starting up
174
- 08:09:47 [$] dawn: scanning /Users/thesp0nge/src/hacking/railsberry2013
175
- 08:09:47 [$] dawn: sinatra v1.4.2 detected
176
- 08:09:47 [$] dawn: applying all security checks
177
- 08:09:47 [$] dawn: 82 security checks applied - 0 security checks skipped
178
- 08:09:47 [$] dawn: 1 vulnerabilities found
179
- 08:09:47 [$] dawn: CVE-2013-1800 failed
180
- 08:09:47 [$] dawn: Description: The crack gem 0.3.1 and earlier for Ruby does not properly restrict casts of string values, which might allow remote attackers to conduct object-injection attacks and execute arbitrary code, or cause a denial of service (memory and CPU consumption) by leveraging Action Pack support for (1) YAML type conversion or (2) Symbol type conversion, a similar vulnerability to CVE-2013-0156.
181
- 08:09:47 [$] dawn: Solution: Please use crack gem version 0.3.2 or above. Correct your gemfile
182
- 08:09:47 [!] dawn: Evidence:
183
- 08:09:47 [!] dawn: Vulnerable crack gem version found: 0.3.1
184
- 08:09:47 [*] dawn is leaving
185
- ```
208
+ ```
209
+ $ dawn ~/src/hacking/railsberry2013
210
+ 18:40:27 [*] dawn v1.1.0 is starting up
211
+ 18:40:27 [$] dawn: scanning /Users/thesp0nge/src/hacking/railsberry2013
212
+ 18:40:27 [$] dawn: sinatra v1.4.2 detected
213
+ 18:40:27 [$] dawn: applying all security checks
214
+ 18:40:27 [$] dawn: 109 security checks applied - 0 security checks skipped
215
+ 18:40:27 [$] dawn: 1 vulnerabilities found
216
+ 18:40:27 [!] dawn: CVE-2013-1800 check failed
217
+ 18:40:27 [$] dawn: Severity: high
218
+ 18:40:27 [$] dawn: Priority: unknown
219
+ 18:40:27 [$] dawn: Description: The crack gem 0.3.1 and earlier for Ruby does not properly restrict casts of string values, which might allow remote attackers to conduct object-injection attacks and execute arbitrary code, or cause a denial of service (memory and CPU consumption) by leveraging Action Pack support for (1) YAML type conversion or (2) Symbol type conversion, a similar vulnerability to CVE-2013-0156.
220
+ 18:40:27 [$] dawn: Solution: Please use crack gem version 0.3.2 or above. Correct your gemfile
221
+ 18:40:27 [$] dawn: Evidence:
222
+ 18:40:27 [$] dawn: Vulnerable crack gem version found: 0.3.1
223
+ 18:40:27 [*] dawn is leaving
224
+ ```
186
225
 
187
226
  ---
188
227
 
@@ -191,63 +230,36 @@ it's likely to return a friendly _no vulnerabilities found_ message. Keep it up
191
230
  working that way!
192
231
 
193
232
  This is Codesake::Dawn running against a Padrino web application I wrote for [a
194
- scorecard quiz game about application security](http://scorecard.armoredcode.com).
233
+ scorecard quiz game about application security](http://scorecard.armoredcode.com).
195
234
  Italian language only. Sorry.
196
235
 
197
236
  ```
198
- 08:17:09 [*] dawn v1.0.0 is starting up
199
- 08:17:09 [$] dawn: scanning /Users/thesp0nge/src/CORE_PROJECTS/scorecard
200
- 08:17:09 [$] dawn: padrino v0.11.2 detected
201
- 08:17:09 [$] dawn: applying all security checks
202
- 08:17:09 [$] dawn: 82 security checks applied - 0 security checks skipped
203
- 08:17:09 [*] dawn: no vulnerabilities found.
204
- 08:17:09 [*] dawn is leaving
237
+ 18:42:39 [*] dawn v1.1.0 is starting up
238
+ 18:42:39 [$] dawn: scanning /Users/thesp0nge/src/CORE_PROJECTS/scorecard
239
+ 18:42:39 [$] dawn: padrino v0.11.2 detected
240
+ 18:42:39 [$] dawn: applying all security checks
241
+ 18:42:39 [$] dawn: 109 security checks applied - 0 security checks skipped
242
+ 18:42:39 [*] dawn: no vulnerabilities found.
243
+ 18:42:39 [*] dawn is leaving
205
244
  ```
206
245
 
207
- ---
208
-
209
- Last example shows Codesake::Dawn against a very simple Sinatra application
210
- designed to be buggy:
246
+ If you need a fancy HTML report about your scan, just ask it to Codesake::Dawn
247
+ with the ```--html``` flag used with the ```--file``` since I wanto to save the
248
+ HTML to disk.
211
249
 
212
250
  ```
213
- $ dawn target
214
- 08:28:18 [*] dawn v1.0.0 is starting up
215
- 08:28:18 [$] dawn: scanning /Users/thesp0nge/tmp/sinatra-vulnerable
216
- 08:28:18 [$] dawn: sinatra v1.2.6 detected
217
- 08:28:18 [$] dawn: applying all security checks
218
- 08:28:18 [$] dawn: 82 security checks applied - 0 security checks skipped
219
- 08:28:18 [$] dawn: 5 vulnerabilities found
220
- 08:28:18 [$] dawn: Not revised code failed
221
- 08:28:18 [$] dawn: Description: Analyzing comments, it seems your code is waiting from some review from you. Please consider take action before putting it in production.
222
- This check will analyze the source code looking for the following patterns: XXX, TO_CHECK, CHECKME, CHECK and FIXME
223
- 08:28:18 [$] dawn: Solution: Please review the file fixing the issue.
224
- 08:28:18 [!] dawn: Evidence:
225
- 08:28:18 [!] dawn: {:filename=>"/Users/thesp0nge/tmp/sinatra-vulnerable/application.rb", :matches=>[{:match=>"# FIXME: I must raise an error here\n", :line=>30}]}
226
- 08:28:18 [$] dawn: CVE-2013-0269 failed
227
- 08:28:18 [$] dawn: Description: The JSON gem before 1.5.5, 1.6.x before 1.6.8, and 1.7.x before 1.7.7 for Ruby allows remote attackers to cause a denial of service (resource consumption) or bypass the mass assignment protection mechanism via a crafted JSON document that triggers the creation of arbitrary Ruby symbols or certain internal objects, as demonstrated by conducting a SQL injection attack against Ruby on Rails, aka "Unsafe Object Creation Vulnerability."
228
- 08:28:18 [$] dawn: Solution: Please upgrade JSON gem to version 1.5.5, 1.6.8 or 1.7.7 or latest version available
229
- 08:28:18 [!] dawn: Evidence:
230
- 08:28:18 [!] dawn: Vulnerable json gem version found: 1.4.6
231
- 08:28:18 [$] dawn: CVE-2013-1800 failed
232
- 08:28:18 [$] dawn: Description: The crack gem 0.3.1 and earlier for Ruby does not properly restrict casts of string values, which might allow remote attackers to conduct object-injection attacks and execute arbitrary code, or cause a denial of service (memory and CPU consumption) by leveraging Action Pack support for (1) YAML type conversion or (2) Symbol type conversion, a similar vulnerability to CVE-2013-0156.
233
- 08:28:18 [$] dawn: Solution: Please use crack gem version 0.3.2 or above. Correct your gemfile
234
- 08:28:18 [!] dawn: Evidence:
235
- 08:28:18 [!] dawn: Vulnerable crack gem version found: 0.3.1
236
- 08:28:18 [$] dawn: CVE-2013-4164 failed
237
- 08:28:18 [$] dawn: Description: Any time a string is converted to a floating point value, a specially crafted string can cause a heap overflow. This can lead to a denial of service attack via segmentation faults and possibly arbitrary code execution. Any program that converts input of unknown origin to floating point values (especially common when accepting JSON) are vulnerable.
238
- 08:28:18 [$] dawn: Solution: All users are recommended to upgrade to Ruby 1.9.3 patchlevel 484, ruby 2.0.0 patchlevel 353 or ruby 2.1.0 preview2.
239
- 08:28:18 [!] dawn: Evidence:
240
- 08:28:18 [!] dawn: ruby v2.0.0-p247 detected
241
- 08:28:18 [$] dawn: 1 reflected XSS found
242
- 08:28:18 [$] dawn: request parameter "name"
243
- 08:28:18 [*] dawn is leaving
251
+ $ dawn /Users/thesp0nge/src/hacking/rt_first_app --html --file report.html
252
+
253
+ 09:00:54 [*] dawn v1.1.0 is starting up
254
+ 09:00:54 [*] dawn: report.html created (2952 bytes)
255
+ 09:00:54 [*] dawn is leaving
244
256
  ```
245
257
 
246
258
  ---
247
259
 
248
260
  ## Useful links
249
261
 
250
- Project homepage: [http://dawn.codesake.com](http://dawn.codesake.com)
262
+ Project homepage: [http://dawn.codesake.com](http://dawn.codesake.com)
251
263
 
252
264
  Twitter profile: [@dawnscanner](https://twitter.com/dawnscanner)
253
265
 
@@ -259,7 +271,7 @@ Mailing list: [https://groups.google.com/forum/#!forum/codesake-dawn](https://gr
259
271
 
260
272
  ## Supporters
261
273
 
262
- To me as project leader it's very important to have feedbacks.
274
+ To me as project leader it's very important to have feedbacks.
263
275
 
264
276
  If you're a proud codesake-dawn user, if you find it useful, if you integrated
265
277
  it in your release process and if you want to openly support the project you
@@ -279,12 +291,34 @@ Thank you.
279
291
 
280
292
  [saten](https://github.com/saten): first issue posted about a typo in the README
281
293
 
282
- [presidentbeef](https://github.com/presidentbeef): for his outstanding work that inspired me creating dawn and for double check comparison matrix. Issue #2 is your :)
294
+ [presidentbeef](https://github.com/presidentbeef): for his outstanding work that inspired me creating dawn and for double check comparison matrix. Issue #2 is yours :)
283
295
 
284
296
  [marinerJB](https://github.com/marinerJB): for misc bug reports and further ideas
285
297
 
286
298
  [Matteo](https://github.com/matteocollina): for ideas on API and their usage with [github.com](https://github.com) hooks
287
299
 
300
+ ## Contribute to Codesake::Dawn
301
+
302
+ Are you interested in contributing to Codesake::Dawn project? Great, here is
303
+ some very basic rules in order to make rocking pull requests.
304
+
305
+ First of all, I use the branching model described in [this
306
+ post](http://nvie.com/posts/a-successful-git-branching-model/). There are two
307
+ major branches:
308
+
309
+ * master: it contains in every moment the code for the latest codesake-dawn
310
+ released gem. You can't make branches from here unless you're working on a
311
+ bugfix.
312
+ * development: it contains the unstable code that is going to be the next
313
+ codesake-dawn realease. You start from here. Pick a task on the Roadmap.md
314
+ and create a separated branch to work on your feature to. When you're ready
315
+ (remember to include also spec files), submit your pull request. If the code
316
+ will be fine, it will be merged into the development tree ready to be include
317
+ in upcoming gem version.
318
+
319
+ No branch from master it would be analyzed unless they are related to bugfix.
320
+ In this case, the branch name must be something like _issue\_#xx\_description_
321
+
288
322
  ## LICENSE
289
323
 
290
324
  Copyright (c) 2013, 2014 Paolo Perego