dawnscanner 1.2.99

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +4 -0
  3. data.tar.gz.sig +0 -0
  4. data/.gitignore +19 -0
  5. data/.ruby-gemset +1 -0
  6. data/.ruby-version +1 -0
  7. data/.travis.yml +8 -0
  8. data/Changelog.md +412 -0
  9. data/Gemfile +4 -0
  10. data/KnowledgeBase.md +213 -0
  11. data/LICENSE.txt +22 -0
  12. data/README.md +354 -0
  13. data/Rakefile +250 -0
  14. data/Roadmap.md +59 -0
  15. data/bin/dawn +210 -0
  16. data/certs/paolo_at_codesake_dot_com.pem +21 -0
  17. data/checksum/.placeholder +0 -0
  18. data/checksum/codesake-dawn-1.1.0.gem.sha512 +1 -0
  19. data/checksum/codesake-dawn-1.1.0.rc1.gem.sha512 +1 -0
  20. data/checksum/codesake-dawn-1.1.1.gem.sha512 +1 -0
  21. data/checksum/codesake-dawn-1.1.2.gem.sha512 +1 -0
  22. data/checksum/codesake-dawn-1.1.3.gem.sha512 +1 -0
  23. data/checksum/codesake-dawn-1.2.0.gem.sha512 +1 -0
  24. data/checksum/codesake-dawn-1.2.99.gem.sha512 +1 -0
  25. data/dawnscanner.gemspec +43 -0
  26. data/doc/codesake-dawn.yaml.sample +26 -0
  27. data/doc/dawn_1_0_announcement.md +139 -0
  28. data/doc/dawn_1_1_announcement.md +67 -0
  29. data/doc/dawn_1_2_announcement.md +69 -0
  30. data/features/dawn_complains_about_an_incorrect_command_line.feature.disabled +21 -0
  31. data/features/dawn_scan_a_secure_sinatra_app.feature.disabled +31 -0
  32. data/features/dawn_scan_a_vulnerable_sinatra_app.feature.disabled +36 -0
  33. data/features/step_definition/dawn_steps.rb +19 -0
  34. data/features/support/env.rb +1 -0
  35. data/lib/codesake-dawn.rb +12 -0
  36. data/lib/codesake/dawn/core.rb +175 -0
  37. data/lib/codesake/dawn/engine.rb +380 -0
  38. data/lib/codesake/dawn/gemfile_lock.rb +12 -0
  39. data/lib/codesake/dawn/kb/basic_check.rb +228 -0
  40. data/lib/codesake/dawn/kb/combo_check.rb +64 -0
  41. data/lib/codesake/dawn/kb/cve_2004_0755.rb +32 -0
  42. data/lib/codesake/dawn/kb/cve_2004_0983.rb +30 -0
  43. data/lib/codesake/dawn/kb/cve_2005_1992.rb +30 -0
  44. data/lib/codesake/dawn/kb/cve_2005_2337.rb +32 -0
  45. data/lib/codesake/dawn/kb/cve_2006_1931.rb +32 -0
  46. data/lib/codesake/dawn/kb/cve_2006_2582.rb +30 -0
  47. data/lib/codesake/dawn/kb/cve_2006_3694.rb +31 -0
  48. data/lib/codesake/dawn/kb/cve_2006_4112.rb +29 -0
  49. data/lib/codesake/dawn/kb/cve_2006_5467.rb +30 -0
  50. data/lib/codesake/dawn/kb/cve_2006_6303.rb +30 -0
  51. data/lib/codesake/dawn/kb/cve_2006_6852.rb +29 -0
  52. data/lib/codesake/dawn/kb/cve_2006_6979.rb +31 -0
  53. data/lib/codesake/dawn/kb/cve_2007_0469.rb +29 -0
  54. data/lib/codesake/dawn/kb/cve_2007_5162.rb +30 -0
  55. data/lib/codesake/dawn/kb/cve_2007_5379.rb +29 -0
  56. data/lib/codesake/dawn/kb/cve_2007_5380.rb +29 -0
  57. data/lib/codesake/dawn/kb/cve_2007_5770.rb +32 -0
  58. data/lib/codesake/dawn/kb/cve_2007_6077.rb +31 -0
  59. data/lib/codesake/dawn/kb/cve_2007_6612.rb +30 -0
  60. data/lib/codesake/dawn/kb/cve_2008_1145.rb +40 -0
  61. data/lib/codesake/dawn/kb/cve_2008_1891.rb +40 -0
  62. data/lib/codesake/dawn/kb/cve_2008_2376.rb +32 -0
  63. data/lib/codesake/dawn/kb/cve_2008_2662.rb +35 -0
  64. data/lib/codesake/dawn/kb/cve_2008_2663.rb +34 -0
  65. data/lib/codesake/dawn/kb/cve_2008_2664.rb +35 -0
  66. data/lib/codesake/dawn/kb/cve_2008_2725.rb +33 -0
  67. data/lib/codesake/dawn/kb/cve_2008_3655.rb +39 -0
  68. data/lib/codesake/dawn/kb/cve_2008_3657.rb +39 -0
  69. data/lib/codesake/dawn/kb/cve_2008_3790.rb +32 -0
  70. data/lib/codesake/dawn/kb/cve_2008_3905.rb +38 -0
  71. data/lib/codesake/dawn/kb/cve_2008_4094.rb +29 -0
  72. data/lib/codesake/dawn/kb/cve_2008_4310.rb +103 -0
  73. data/lib/codesake/dawn/kb/cve_2008_5189.rb +29 -0
  74. data/lib/codesake/dawn/kb/cve_2008_7248.rb +29 -0
  75. data/lib/codesake/dawn/kb/cve_2009_4078.rb +31 -0
  76. data/lib/codesake/dawn/kb/cve_2009_4124.rb +32 -0
  77. data/lib/codesake/dawn/kb/cve_2009_4214.rb +29 -0
  78. data/lib/codesake/dawn/kb/cve_2010_1330.rb +30 -0
  79. data/lib/codesake/dawn/kb/cve_2010_2489.rb +62 -0
  80. data/lib/codesake/dawn/kb/cve_2010_3933.rb +29 -0
  81. data/lib/codesake/dawn/kb/cve_2011_0188.rb +69 -0
  82. data/lib/codesake/dawn/kb/cve_2011_0446.rb +30 -0
  83. data/lib/codesake/dawn/kb/cve_2011_0447.rb +30 -0
  84. data/lib/codesake/dawn/kb/cve_2011_0739.rb +30 -0
  85. data/lib/codesake/dawn/kb/cve_2011_0995.rb +63 -0
  86. data/lib/codesake/dawn/kb/cve_2011_1004.rb +36 -0
  87. data/lib/codesake/dawn/kb/cve_2011_1005.rb +33 -0
  88. data/lib/codesake/dawn/kb/cve_2011_2197.rb +29 -0
  89. data/lib/codesake/dawn/kb/cve_2011_2686.rb +31 -0
  90. data/lib/codesake/dawn/kb/cve_2011_2705.rb +34 -0
  91. data/lib/codesake/dawn/kb/cve_2011_2929.rb +29 -0
  92. data/lib/codesake/dawn/kb/cve_2011_2930.rb +30 -0
  93. data/lib/codesake/dawn/kb/cve_2011_2931.rb +32 -0
  94. data/lib/codesake/dawn/kb/cve_2011_2932.rb +29 -0
  95. data/lib/codesake/dawn/kb/cve_2011_3009.rb +30 -0
  96. data/lib/codesake/dawn/kb/cve_2011_3186.rb +31 -0
  97. data/lib/codesake/dawn/kb/cve_2011_3187.rb +31 -0
  98. data/lib/codesake/dawn/kb/cve_2011_4319.rb +31 -0
  99. data/lib/codesake/dawn/kb/cve_2011_4815.rb +30 -0
  100. data/lib/codesake/dawn/kb/cve_2011_5036.rb +28 -0
  101. data/lib/codesake/dawn/kb/cve_2012_1098.rb +32 -0
  102. data/lib/codesake/dawn/kb/cve_2012_1099.rb +29 -0
  103. data/lib/codesake/dawn/kb/cve_2012_1241.rb +29 -0
  104. data/lib/codesake/dawn/kb/cve_2012_2139.rb +28 -0
  105. data/lib/codesake/dawn/kb/cve_2012_2140.rb +29 -0
  106. data/lib/codesake/dawn/kb/cve_2012_2660.rb +30 -0
  107. data/lib/codesake/dawn/kb/cve_2012_2661.rb +29 -0
  108. data/lib/codesake/dawn/kb/cve_2012_2671.rb +30 -0
  109. data/lib/codesake/dawn/kb/cve_2012_2694.rb +32 -0
  110. data/lib/codesake/dawn/kb/cve_2012_2695.rb +29 -0
  111. data/lib/codesake/dawn/kb/cve_2012_3424.rb +31 -0
  112. data/lib/codesake/dawn/kb/cve_2012_3463.rb +29 -0
  113. data/lib/codesake/dawn/kb/cve_2012_3464.rb +29 -0
  114. data/lib/codesake/dawn/kb/cve_2012_3465.rb +28 -0
  115. data/lib/codesake/dawn/kb/cve_2012_4464.rb +29 -0
  116. data/lib/codesake/dawn/kb/cve_2012_4466.rb +29 -0
  117. data/lib/codesake/dawn/kb/cve_2012_4481.rb +28 -0
  118. data/lib/codesake/dawn/kb/cve_2012_4522.rb +29 -0
  119. data/lib/codesake/dawn/kb/cve_2012_5370.rb +29 -0
  120. data/lib/codesake/dawn/kb/cve_2012_5371.rb +29 -0
  121. data/lib/codesake/dawn/kb/cve_2012_5380.rb +30 -0
  122. data/lib/codesake/dawn/kb/cve_2012_6109.rb +27 -0
  123. data/lib/codesake/dawn/kb/cve_2012_6134.rb +29 -0
  124. data/lib/codesake/dawn/kb/cve_2012_6496.rb +30 -0
  125. data/lib/codesake/dawn/kb/cve_2012_6497.rb +30 -0
  126. data/lib/codesake/dawn/kb/cve_2013_0155.rb +31 -0
  127. data/lib/codesake/dawn/kb/cve_2013_0156.rb +29 -0
  128. data/lib/codesake/dawn/kb/cve_2013_0162.rb +30 -0
  129. data/lib/codesake/dawn/kb/cve_2013_0175.rb +29 -0
  130. data/lib/codesake/dawn/kb/cve_2013_0183.rb +27 -0
  131. data/lib/codesake/dawn/kb/cve_2013_0184.rb +27 -0
  132. data/lib/codesake/dawn/kb/cve_2013_0233.rb +28 -0
  133. data/lib/codesake/dawn/kb/cve_2013_0256.rb +61 -0
  134. data/lib/codesake/dawn/kb/cve_2013_0262.rb +28 -0
  135. data/lib/codesake/dawn/kb/cve_2013_0263.rb +28 -0
  136. data/lib/codesake/dawn/kb/cve_2013_0269.rb +29 -0
  137. data/lib/codesake/dawn/kb/cve_2013_0276.rb +30 -0
  138. data/lib/codesake/dawn/kb/cve_2013_0277.rb +27 -0
  139. data/lib/codesake/dawn/kb/cve_2013_0284.rb +29 -0
  140. data/lib/codesake/dawn/kb/cve_2013_0285.rb +29 -0
  141. data/lib/codesake/dawn/kb/cve_2013_0333.rb +30 -0
  142. data/lib/codesake/dawn/kb/cve_2013_1607.rb +27 -0
  143. data/lib/codesake/dawn/kb/cve_2013_1655.rb +67 -0
  144. data/lib/codesake/dawn/kb/cve_2013_1656.rb +30 -0
  145. data/lib/codesake/dawn/kb/cve_2013_1756.rb +28 -0
  146. data/lib/codesake/dawn/kb/cve_2013_1800.rb +28 -0
  147. data/lib/codesake/dawn/kb/cve_2013_1801.rb +29 -0
  148. data/lib/codesake/dawn/kb/cve_2013_1802.rb +29 -0
  149. data/lib/codesake/dawn/kb/cve_2013_1812.rb +29 -0
  150. data/lib/codesake/dawn/kb/cve_2013_1821.rb +30 -0
  151. data/lib/codesake/dawn/kb/cve_2013_1854.rb +28 -0
  152. data/lib/codesake/dawn/kb/cve_2013_1855.rb +27 -0
  153. data/lib/codesake/dawn/kb/cve_2013_1856.rb +28 -0
  154. data/lib/codesake/dawn/kb/cve_2013_1857.rb +29 -0
  155. data/lib/codesake/dawn/kb/cve_2013_1875.rb +29 -0
  156. data/lib/codesake/dawn/kb/cve_2013_1898.rb +29 -0
  157. data/lib/codesake/dawn/kb/cve_2013_1911.rb +30 -0
  158. data/lib/codesake/dawn/kb/cve_2013_1933.rb +29 -0
  159. data/lib/codesake/dawn/kb/cve_2013_1947.rb +29 -0
  160. data/lib/codesake/dawn/kb/cve_2013_1948.rb +29 -0
  161. data/lib/codesake/dawn/kb/cve_2013_2065.rb +31 -0
  162. data/lib/codesake/dawn/kb/cve_2013_2090.rb +30 -0
  163. data/lib/codesake/dawn/kb/cve_2013_2105.rb +28 -0
  164. data/lib/codesake/dawn/kb/cve_2013_2119.rb +29 -0
  165. data/lib/codesake/dawn/kb/cve_2013_2512.rb +28 -0
  166. data/lib/codesake/dawn/kb/cve_2013_2513.rb +27 -0
  167. data/lib/codesake/dawn/kb/cve_2013_2516.rb +28 -0
  168. data/lib/codesake/dawn/kb/cve_2013_2615.rb +29 -0
  169. data/lib/codesake/dawn/kb/cve_2013_2616.rb +29 -0
  170. data/lib/codesake/dawn/kb/cve_2013_2617.rb +30 -0
  171. data/lib/codesake/dawn/kb/cve_2013_3221.rb +29 -0
  172. data/lib/codesake/dawn/kb/cve_2013_4164.rb +32 -0
  173. data/lib/codesake/dawn/kb/cve_2013_4203.rb +27 -0
  174. data/lib/codesake/dawn/kb/cve_2013_4389.rb +28 -0
  175. data/lib/codesake/dawn/kb/cve_2013_4413.rb +29 -0
  176. data/lib/codesake/dawn/kb/cve_2013_4457.rb +31 -0
  177. data/lib/codesake/dawn/kb/cve_2013_4478.rb +28 -0
  178. data/lib/codesake/dawn/kb/cve_2013_4479.rb +28 -0
  179. data/lib/codesake/dawn/kb/cve_2013_4489.rb +30 -0
  180. data/lib/codesake/dawn/kb/cve_2013_4491.rb +30 -0
  181. data/lib/codesake/dawn/kb/cve_2013_4492.rb +31 -0
  182. data/lib/codesake/dawn/kb/cve_2013_4562.rb +29 -0
  183. data/lib/codesake/dawn/kb/cve_2013_4593.rb +29 -0
  184. data/lib/codesake/dawn/kb/cve_2013_5647.rb +31 -0
  185. data/lib/codesake/dawn/kb/cve_2013_5671.rb +28 -0
  186. data/lib/codesake/dawn/kb/cve_2013_6414.rb +31 -0
  187. data/lib/codesake/dawn/kb/cve_2013_6415.rb +30 -0
  188. data/lib/codesake/dawn/kb/cve_2013_6416.rb +31 -0
  189. data/lib/codesake/dawn/kb/cve_2013_6417.rb +31 -0
  190. data/lib/codesake/dawn/kb/cve_2013_6421.rb +30 -0
  191. data/lib/codesake/dawn/kb/cve_2013_6459.rb +30 -0
  192. data/lib/codesake/dawn/kb/cve_2013_6460.rb +55 -0
  193. data/lib/codesake/dawn/kb/cve_2013_6461.rb +59 -0
  194. data/lib/codesake/dawn/kb/cve_2013_7086.rb +29 -0
  195. data/lib/codesake/dawn/kb/cve_2014_0036.rb +29 -0
  196. data/lib/codesake/dawn/kb/cve_2014_0080.rb +30 -0
  197. data/lib/codesake/dawn/kb/cve_2014_0081.rb +28 -0
  198. data/lib/codesake/dawn/kb/cve_2014_0082.rb +29 -0
  199. data/lib/codesake/dawn/kb/cve_2014_0130.rb +28 -0
  200. data/lib/codesake/dawn/kb/cve_2014_1233.rb +29 -0
  201. data/lib/codesake/dawn/kb/cve_2014_1234.rb +28 -0
  202. data/lib/codesake/dawn/kb/cve_2014_2322.rb +30 -0
  203. data/lib/codesake/dawn/kb/cve_2014_2525.rb +61 -0
  204. data/lib/codesake/dawn/kb/cve_2014_2538.rb +28 -0
  205. data/lib/codesake/dawn/kb/cve_2014_3482.rb +30 -0
  206. data/lib/codesake/dawn/kb/cve_2014_3483.rb +29 -0
  207. data/lib/codesake/dawn/kb/dependency_check.rb +86 -0
  208. data/lib/codesake/dawn/kb/deprecation_check.rb +40 -0
  209. data/lib/codesake/dawn/kb/not_revised_code.rb +24 -0
  210. data/lib/codesake/dawn/kb/operating_system_check.rb +98 -0
  211. data/lib/codesake/dawn/kb/osvdb_105971.rb +31 -0
  212. data/lib/codesake/dawn/kb/osvdb_108530.rb +29 -0
  213. data/lib/codesake/dawn/kb/osvdb_108563.rb +30 -0
  214. data/lib/codesake/dawn/kb/osvdb_108569.rb +30 -0
  215. data/lib/codesake/dawn/kb/osvdb_108570.rb +29 -0
  216. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet.rb +41 -0
  217. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/check_for_backup_files.rb +22 -0
  218. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/check_for_safe_redirect_and_forward.rb +59 -0
  219. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/command_injection.rb +30 -0
  220. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/csrf.rb +31 -0
  221. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/mass_assignment_in_model.rb +35 -0
  222. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/security_related_headers.rb +38 -0
  223. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/sensitive_files.rb +31 -0
  224. data/lib/codesake/dawn/kb/owasp_ror_cheatsheet/session_stored_in_database.rb +33 -0
  225. data/lib/codesake/dawn/kb/pattern_match_check.rb +129 -0
  226. data/lib/codesake/dawn/kb/ruby_version_check.rb +91 -0
  227. data/lib/codesake/dawn/kb/simpleform_xss_20131129.rb +30 -0
  228. data/lib/codesake/dawn/kb/version_check.rb +418 -0
  229. data/lib/codesake/dawn/knowledge_base.rb +513 -0
  230. data/lib/codesake/dawn/padrino.rb +82 -0
  231. data/lib/codesake/dawn/rails.rb +17 -0
  232. data/lib/codesake/dawn/railtie.rb +9 -0
  233. data/lib/codesake/dawn/reporter.rb +280 -0
  234. data/lib/codesake/dawn/sinatra.rb +129 -0
  235. data/lib/codesake/dawn/tasks.rb +27 -0
  236. data/lib/codesake/dawn/utils.rb +21 -0
  237. data/lib/codesake/dawn/version.rb +28 -0
  238. data/lib/tasks/codesake-dawn_tasks.rake +1 -0
  239. data/spec/lib/dawn/codesake_core_spec.rb +9 -0
  240. data/spec/lib/dawn/codesake_knowledgebase_spec.rb +940 -0
  241. data/spec/lib/dawn/codesake_padrino_engine_disabled.rb +45 -0
  242. data/spec/lib/dawn/codesake_rails_engine_disabled.rb +12 -0
  243. data/spec/lib/dawn/codesake_sinatra_engine_disabled.rb +128 -0
  244. data/spec/lib/kb/codesake_cve_2013_0175_spec.rb +35 -0
  245. data/spec/lib/kb/codesake_cve_2013_4457_spec.rb +41 -0
  246. data/spec/lib/kb/codesake_dependency_version_check_spec.rb +76 -0
  247. data/spec/lib/kb/codesake_deprecation_check_spec.rb +56 -0
  248. data/spec/lib/kb/codesake_ruby_version_check_spec.rb +40 -0
  249. data/spec/lib/kb/codesake_version_check_spec.rb +165 -0
  250. data/spec/lib/kb/cve_2011_2705_spec.rb +35 -0
  251. data/spec/lib/kb/cve_2011_2930_spec.rb +31 -0
  252. data/spec/lib/kb/cve_2011_3009_spec.rb +25 -0
  253. data/spec/lib/kb/cve_2011_3187_spec.rb +24 -0
  254. data/spec/lib/kb/cve_2011_4319_spec.rb +44 -0
  255. data/spec/lib/kb/cve_2011_5036_spec.rb +95 -0
  256. data/spec/lib/kb/cve_2012_1098_spec.rb +36 -0
  257. data/spec/lib/kb/cve_2012_2139_spec.rb +20 -0
  258. data/spec/lib/kb/cve_2012_2671_spec.rb +23 -0
  259. data/spec/lib/kb/cve_2012_6109_spec.rb +112 -0
  260. data/spec/lib/kb/cve_2013_0162_spec.rb +23 -0
  261. data/spec/lib/kb/cve_2013_0183_spec.rb +54 -0
  262. data/spec/lib/kb/cve_2013_0184_spec.rb +115 -0
  263. data/spec/lib/kb/cve_2013_0256_spec.rb +34 -0
  264. data/spec/lib/kb/cve_2013_0262_spec.rb +44 -0
  265. data/spec/lib/kb/cve_2013_0263_spec.rb +11 -0
  266. data/spec/lib/kb/cve_2013_1607_spec.rb +15 -0
  267. data/spec/lib/kb/cve_2013_1655_spec.rb +31 -0
  268. data/spec/lib/kb/cve_2013_1756_spec.rb +23 -0
  269. data/spec/lib/kb/cve_2013_2090_spec.rb +15 -0
  270. data/spec/lib/kb/cve_2013_2105_spec.rb +11 -0
  271. data/spec/lib/kb/cve_2013_2119_spec.rb +27 -0
  272. data/spec/lib/kb/cve_2013_2512_spec.rb +15 -0
  273. data/spec/lib/kb/cve_2013_2513_spec.rb +15 -0
  274. data/spec/lib/kb/cve_2013_2516_spec.rb +15 -0
  275. data/spec/lib/kb/cve_2013_4203_spec.rb +15 -0
  276. data/spec/lib/kb/cve_2013_4413_spec.rb +16 -0
  277. data/spec/lib/kb/cve_2013_4489_spec.rb +63 -0
  278. data/spec/lib/kb/cve_2013_4593_spec.rb +16 -0
  279. data/spec/lib/kb/cve_2013_5647_spec.rb +19 -0
  280. data/spec/lib/kb/cve_2013_5671_spec.rb +27 -0
  281. data/spec/lib/kb/cve_2013_6416_spec.rb +31 -0
  282. data/spec/lib/kb/cve_2013_6459_spec.rb +15 -0
  283. data/spec/lib/kb/cve_2013_7086_spec.rb +22 -0
  284. data/spec/lib/kb/cve_2014_0036_spec.rb +15 -0
  285. data/spec/lib/kb/cve_2014_0080_spec.rb +28 -0
  286. data/spec/lib/kb/cve_2014_0081_spec.rb +68 -0
  287. data/spec/lib/kb/cve_2014_0082_spec.rb +52 -0
  288. data/spec/lib/kb/cve_2014_0130_spec.rb +19 -0
  289. data/spec/lib/kb/cve_2014_1233_spec.rb +15 -0
  290. data/spec/lib/kb/cve_2014_1234_spec.rb +16 -0
  291. data/spec/lib/kb/cve_2014_2322_spec.rb +15 -0
  292. data/spec/lib/kb/cve_2014_2538_spec.rb +15 -0
  293. data/spec/lib/kb/cve_2014_3482_spec.rb +15 -0
  294. data/spec/lib/kb/cve_2014_3483_spec.rb +23 -0
  295. data/spec/lib/kb/osvdb_105971_spec.rb +15 -0
  296. data/spec/lib/kb/osvdb_108530_spec.rb +22 -0
  297. data/spec/lib/kb/osvdb_108563_spec.rb +18 -0
  298. data/spec/lib/kb/osvdb_108569_spec.rb +17 -0
  299. data/spec/lib/kb/osvdb_108570_spec.rb +17 -0
  300. data/spec/lib/kb/owasp_ror_cheatsheet_disabled.rb +56 -0
  301. data/spec/spec_helper.rb +11 -0
  302. data/support/bootstrap.js +2027 -0
  303. data/support/bootstrap.min.css +9 -0
  304. data/support/codesake.css +63 -0
  305. metadata +659 -0
  306. metadata.gz.sig +0 -0
@@ -0,0 +1,12 @@
1
+ module Codesake
2
+ module Dawn
3
+ class GemfileLock
4
+ include Codesake::Dawn::Engine
5
+
6
+ def initialize(dir = "./", filename = "", guessed_mvc)
7
+ super(dir, "Gemfile.lock", {:gemfile_name=>filename, :guessed_mvc=>guessed_mvc})
8
+ end
9
+
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,228 @@
1
+ require 'cvss'
2
+
3
+ module Codesake
4
+ module Dawn
5
+ module Kb
6
+ module BasicCheck
7
+
8
+ include Codesake::Dawn::Utils
9
+
10
+ attr_reader :name
11
+ attr_reader :cve
12
+ attr_reader :osvdb
13
+ attr_reader :cvss
14
+ attr_reader :cwe
15
+ attr_reader :owasp
16
+ attr_reader :release_date
17
+ attr_reader :applies
18
+ attr_reader :kind
19
+ attr_reader :message
20
+ attr_reader :remediation
21
+ attr_reader :aux_links
22
+ attr_reader :mitigated
23
+
24
+ # This is the ruby version used by the target application. set in
25
+ # Engine class around line #107
26
+ attr_accessor :ruby_version
27
+
28
+ # This is an array of ruby versions that lead a parcitular version to
29
+ # be exploitable.
30
+ # In example, consider CVE-2013-1655, the Puppet rubygem version
31
+ # vulnerability can be exploited only if ruby version is 1.9.3 or
32
+ # higher
33
+ attr_reader :ruby_vulnerable_versions
34
+
35
+ # The framework target version
36
+ attr_reader :target_version
37
+ # The versions of the framework that fixes the vulnerability
38
+ attr_reader :fixes_version
39
+
40
+ # Vulnerability evidences
41
+ attr_reader :evidences
42
+
43
+ # Check status. Returns the latest vuln? call result
44
+ attr_reader :status
45
+
46
+ # Put the check in debug mode
47
+ attr_accessor :debug
48
+
49
+ # This is a flag for the security check family. Valid values are:
50
+ # + generic_check
51
+ # + code_quality
52
+ # + cve_bulletin
53
+ # + code_style
54
+ # + owasp_ror_cheatsheet
55
+ # + owasp_top_10_n (where n is a number between 1 and 10)
56
+ attr_accessor :check_family
57
+ ALLOWED_FAMILIES = [:generic_check, :code_quality, :cve_bulletin, :code_style, :owasp_ror_cheatsheet, :owasp_top_10_1, :owasp_top_10_2, :owasp_top_10_3, :owasp_top_10_4, :owasp_top_10_5, :owasp_top_10_6, :owasp_top_10_7, :owasp_top_10_8, :owasp_top_10_9, :owasp_top_10_10]
58
+
59
+ # This is the check severity level. It tells how dangerous is the
60
+ # vulnerability for you application.
61
+ #
62
+ # Valid values are:
63
+ # + :critical
64
+ # + :high
65
+ # + :medium
66
+ # + :low
67
+ # + :info
68
+ # + :none
69
+ attr_accessor :severity
70
+
71
+ # This is the check priority level. It tells how fast you should
72
+ # mitigate the vulnerability.
73
+ #
74
+ # Valid values are:
75
+ # + :critical
76
+ # + :high
77
+ # + :medium
78
+ # + :low
79
+ # + :info
80
+ # + :none
81
+ attr_accessor :priority
82
+
83
+ def initialize(options={})
84
+ @applies = []
85
+ @ruby_version = ""
86
+ @ruby_vulnerable_versions = []
87
+
88
+ @name = options[:name]
89
+ @cvss = options[:cvss]
90
+ @cwe = options[:cwe]
91
+ @cve = options[:cve]
92
+ @osvdb = options[:osvdb]
93
+ @owasp = options[:owasp]
94
+ @release_date = options[:release_date]
95
+ @applies = options[:applies] unless options[:applies].nil?
96
+ @kind = options[:kind]
97
+ @message = options[:message]
98
+ @remediation = options[:mitigation]
99
+ @aux_links = options[:aux_links]
100
+
101
+ @target_version = options[:target_version]
102
+ @fixes_version = options[:fixes_version]
103
+ @ruby_version = options[:ruby_version]
104
+
105
+ @evidences = []
106
+ @evidences = options[:evidences] unless options[:evidences].nil?
107
+ @mitigated = false
108
+ @status = false
109
+ @debug = false
110
+ @severity = :none
111
+ @priority = :none
112
+ @check_family = :generic_check
113
+
114
+ @severity = options[:severity] unless options[:severity].nil?
115
+ @priority = options[:priority] unless options[:priority].nil?
116
+ @check_family = options[:check_family] unless options[:check_family].nil?
117
+
118
+ # FIXME.20140325
119
+ #
120
+ # I don't want to manually fix 150+ ruby files to add something I can
121
+ # deal here
122
+ @check_family = :cve if !options[:name].nil? && options[:name].start_with?('CVE-')
123
+
124
+ if $logger.nil?
125
+ require 'codesake-commons'
126
+ $logger = Codesake::Commons::Logging.instance
127
+ $logger.helo "dawn-basic-check", Codesake::Dawn::VERSION
128
+ end
129
+ end
130
+
131
+ def self.families
132
+ return ALLOWED_FAMILIES.map { |x| x.to_s }
133
+ end
134
+
135
+ def family=(item)
136
+ if ! ALLOWED_FAMILIES.find_index(item.to_sym).nil?
137
+ instance_variable_set(:@check_family, item.to_sym)
138
+ return item
139
+ else
140
+ $logger.err("invalid check family: #{item}")
141
+ instance_variable_set(:@check_family, :generic_check)
142
+ return @family
143
+ end
144
+ end
145
+
146
+ def family
147
+ return "CVE bulletin" if @check_family == :cve
148
+ return "Ruby coding style" if @check_family == :code_style
149
+ return "Ruby code quality check" if @check_family == :code_quality
150
+ return "Owasp Ruby on Rails cheatsheet" if @check_family == :owasp_ror_cheatsheet
151
+ return "Owasp Top 10" if @check_family.to_s.start_with?('owasp_top_10')
152
+ return "Unknown"
153
+ end
154
+
155
+ def priority
156
+ return (@priority == :none)? "unknown" : @priority.to_s
157
+ end
158
+ def severity
159
+ return @severity.to_s unless @severity == :none
160
+
161
+ # if not set and if cvss is available, than use CVSS
162
+ unless self.cvss.nil?
163
+
164
+ score = Cvss::Engine.new.score(self.cvss)
165
+ case score
166
+ when 10
167
+ return "critical"
168
+ when 7..9
169
+ return "high"
170
+ when 4..6
171
+ return "medium"
172
+ when 2..3
173
+ return "low"
174
+ when 0..1
175
+ return "info"
176
+ else
177
+ return "unknown"
178
+ end
179
+ else
180
+ return "unknown"
181
+ end
182
+
183
+ # if not set, no cvss available just return unknown
184
+ return "unknown"
185
+ end
186
+
187
+ def applies_to?(name)
188
+ ! @applies.find_index(name).nil?
189
+ end
190
+ def cve_link
191
+ "http://cve.mitre.org/cgi-bin/cvename.cgi?name=#{@name}"
192
+ end
193
+ def nvd_link
194
+ "http://web.nvd.nist.gov/view/vuln/detail?vulnId=#{@name}"
195
+ end
196
+ def rubysec_advisories_link
197
+ "http://www.rubysec.com/advisories/#{@name}/"
198
+ end
199
+ def osvdb_link
200
+ "http://osvdb.org/show/osvdb/#{@osvdb}"
201
+ end
202
+
203
+ def cvss_score
204
+ return Cvss::Engine.new.score(self.cvss) unless self.cvss.nil?
205
+ " "
206
+ end
207
+
208
+ def mitigated?
209
+ self.mitigated
210
+ end
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
225
+ end
226
+ end
227
+ end
228
+ end
@@ -0,0 +1,64 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ module ComboCheck
5
+ include BasicCheck
6
+
7
+ attr_reader :checks
8
+ attr_accessor :options
9
+ attr_reader :vulnerable_checks
10
+
11
+
12
+ def initialize(options={})
13
+ super(options)
14
+ @vuln_if_all_fails = true
15
+ @vuln_if_all_fails = options[:vuln_if_all_fails] unless options[:vuln_if_all_fails].nil?
16
+ @checks = options[:checks]
17
+ @vulnerable_checks = []
18
+ @options = options
19
+ end
20
+
21
+ def vuln?
22
+ ret = true
23
+ at_least_one = false
24
+ @checks.each do |check|
25
+ check_vuln = false
26
+ check.detected_ruby = @options[:detected_ruby] if check.kind == Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK
27
+ check.dependencies = @options[:dependencies] if check.kind == Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK
28
+ check.root_dir = @options[:root_dir] if check.kind == Codesake::Dawn::KnowledgeBase::PATTERN_MATCH_CHECK
29
+ check.debug = self.debug
30
+
31
+ check_vuln = check.vuln? if check.respond_to?(:vuln?)
32
+
33
+ ret = ret && check_vuln
34
+ at_least_one = true if check_vuln
35
+ @evidences << check.evidences if check_vuln
36
+ @vulnerable_checks << check if check_vuln
37
+ raise "A check class doesn't respond to vuln? in combo (#{check.class})" unless check.respond_to?(:vuln?)
38
+ end
39
+
40
+ dump_status
41
+ debug_me("combo_check: is_vulnerable_if_all_checks_fail = #{@vuln_if_all_fails}, RET = #{ret}, at_least_one= #{at_least_one}")
42
+ return ret if @vuln_if_all_fails
43
+ return at_least_one unless @vuln_if_all_fails
44
+ end
45
+
46
+ def dump_status
47
+ @checks.each do |check|
48
+ debug_me("check name is #{check.name} and vulnerable status is #{check.status}")
49
+ end
50
+
51
+ true
52
+ end
53
+
54
+ def self.find_vulnerable_checks_by_class(list=[], klass=Object)
55
+ list.each do |l|
56
+ return l if l.instance_of?(klass)
57
+ end
58
+ nil
59
+ end
60
+
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,32 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-01-06
5
+ class CVE_2004_0755
6
+ include RubyVersionCheck
7
+
8
+ def initialize
9
+ message = "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."
10
+
11
+ super({
12
+ :name=>"CVE-2004-0755",
13
+ :cvss=>"AV:L/AC:L/Au:N/C:P/I:N/A:N",
14
+ :release_date => Date.new(2004, 10, 20),
15
+ :cwe=>"",
16
+ :owasp=>"A9",
17
+ :applies=>["rails", "sinatra", "padrino"],
18
+ :kind=>Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK,
19
+ :message=>message,
20
+ :mitigation=>"Upgrade your ruby interpreter",
21
+ :aux_links=>["http://xforce.iss.net/xforce/xfdb/16996"]
22
+ })
23
+
24
+ self.safe_rubies = [{:engine=>"ruby", :version=>"1.8.999", :patchlevel=>"p0"}, {:engine=>"ruby", :version=>"1.6.999", :patchlevel=>"p0"}]
25
+
26
+
27
+
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,30 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-01-06
5
+ class CVE_2004_0983
6
+ include RubyVersionCheck
7
+
8
+ def initialize
9
+ message = "The CGI module in Ruby 1.6 before 1.6.8, and 1.8 before 1.8.2, allows remote attackers to cause a denial of service (infinite loop and CPU consumption) via a certain HTTP request."
10
+ super({
11
+ :name=>"CVE-2004-0983",
12
+ :cvss=>"AV:N/AC:L/Au:N/C:N/I:N/A:P",
13
+ :release_date => Date.new(2005, 03, 01),
14
+ :cwe=>"",
15
+ :owasp=>"A9",
16
+ :applies=>["rails", "sinatra", "padrino"],
17
+ :kind=>Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK,
18
+ :message=>message,
19
+ :mitigation=>"Upgrade your ruby interpreter",
20
+ :aux_links=>["http://xforce.iss.net/xforce/xfdb/17985"]
21
+ })
22
+
23
+ self.safe_rubies = [{:engine=>"ruby", :version=>"1.8.3", :patchlevel=>"p0"}, {:engine=>"ruby", :version=>"1.6.7", :patchlevel=>"p0"}]
24
+
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-01-06
5
+ class CVE_2005_1992
6
+ include RubyVersionCheck
7
+
8
+ def initialize
9
+ message = "The XMLRPC server in utils.rb for the ruby library (libruby) 1.8 sets an invalid default value that prevents \"security protection\" using handlers, which allows remote attackers to execute arbitrary commands."
10
+
11
+ super({
12
+ :name=>"CVE-2005-1992",
13
+ :cvss=>"AV:N/AC:L/Au:N/C:P/I:P/A:P",
14
+ :release_date => Date.new(2005, 06, 20),
15
+ :cwe=>"",
16
+ :owasp=>"A9",
17
+ :applies=>["rails", "sinatra", "padrino"],
18
+ :kind=>Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK,
19
+ :message=>message,
20
+ :mitigation=>"Upgrade your ruby interpreter",
21
+ :aux_links=>["http://www2.ruby-lang.org/en/20050701.html"]
22
+ })
23
+
24
+ self.safe_rubies = [{:engine=>"ruby", :version=>"1.8.999", :patchlevel=>"p0"}]
25
+
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,32 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-01-06
5
+ class CVE_2005_2337
6
+ include RubyVersionCheck
7
+
8
+ def initialize
9
+ message="Ruby 1.6.x up to 1.6.8, 1.8.x up to 1.8.2, and 1.9.0 development up to 2005-09-01 allows attackers to bypass safe level and taint flag protections and execute disallowed code when Ruby processes a program through standard input (stdin)."
10
+ super({
11
+ :name=>"CVE-2005-2337",
12
+ :cvss=>"AV:N/AC:L/Au:N/C:P/I:P/A:P",
13
+ :release_date => Date.new(2005, 10, 07),
14
+ :cwe=>"",
15
+ :owasp=>"A9",
16
+ :applies=>["rails", "sinatra", "padrino"],
17
+ :kind=>Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK,
18
+ :message=>message,
19
+ :mitigation=>"Upgrade your ruby interpreter",
20
+ :aux_links=>["http://www.ruby-lang.org/en/20051003.html"]
21
+ })
22
+
23
+ self.safe_rubies = [
24
+ {:engine=>"ruby", :version=>"1.6.8", :patchlevel=>"p0"},
25
+ {:engine=>"ruby", :version=>"1.8.3", :patchlevel=>"p0"},
26
+ ]
27
+
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ module Codesake
2
+ module Dawn
3
+ module Kb
4
+ # Automatically created with rake on 2014-01-06
5
+ class CVE_2006_1931
6
+ include RubyVersionCheck
7
+
8
+ def initialize
9
+ message = "The HTTP/XMLRPC server in Ruby before 1.8.2 uses blocking sockets, which allows attackers to cause a denial of service (blocked connections) via a large amount of data."
10
+ super({
11
+ :name=>"CVE-2006-1931",
12
+ :cvss=>"AV:N/AC:L/Au:N/C:N/I:N/A:P",
13
+ :release_date => Date.new(2005, 06, 20),
14
+ :cwe=>"",
15
+ :owasp=>"A9",
16
+ :applies=>["rails", "sinatra", "padrino"],
17
+ :kind=>Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK,
18
+ :message=>message,
19
+ :mitigation=>"Upgrade your ruby interpreter",
20
+ :aux_links=>["http://www.securityfocus.com/bid/17645"]
21
+ })
22
+
23
+ self.safe_rubies = [
24
+ {:engine=>"ruby", :version=>"1.8.3", :patchlevel=>"p0"},
25
+ {:engine=>"ruby", :version=>"1.6.8", :patchlevel=>"p0"}
26
+ ]
27
+
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end