brakeman.ignore 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. {
  2. "ignored_warnings": [
  3. {
  4. "warning_type": "Redirect",
  5. "warning_code": 18,
  6. "fingerprint": "069e68c2898ea30f966463fa4616887fb203d48d8c2184693d56569d41f2d3b7",
  7. "check_name": "Redirect",
  8. "message": "Possible unprotected redirect",
  9. "file": "app/controllers/external_credentials_controller.rb",
  10. "line": 38,
  11. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  12. "code": "redirect_to(ExternalCredential.request_account_to_link(params[:provider].downcase)[:authorize_url])",
  13. "render_path": null,
  14. "location": {
  15. "type": "method",
  16. "class": "ExternalCredentialsController",
  17. "method": "link_account"
  18. },
  19. "user_input": "ExternalCredential.request_account_to_link(params[:provider].downcase)[:authorize_url]",
  20. "confidence": "High",
  21. "note": ""
  22. },
  23. {
  24. "warning_type": "Remote Code Execution",
  25. "warning_code": 24,
  26. "fingerprint": "0fcd117fd53301f531142fc075ee8d30219c1239affce9322f9939ac0572ba3b",
  27. "check_name": "UnsafeReflection",
  28. "message": "Unsafe reflection method `constantize` called with model attribute",
  29. "file": "app/models/ticket/number.rb",
  30. "line": 45,
  31. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  32. "code": "Setting.get(\"ticket_number\").constantize",
  33. "render_path": null,
  34. "location": {
  35. "type": "method",
  36. "class": "Ticket::Number",
  37. "method": "Ticket::Number.adapter"
  38. },
  39. "user_input": "Setting.get(\"ticket_number\")",
  40. "confidence": "Medium",
  41. "note": "Setting.get(\"ticket_number\") returns defined ticket number backend class names"
  42. },
  43. {
  44. "warning_type": "Denial of Service",
  45. "warning_code": 76,
  46. "fingerprint": "15d4ddbc3ac2ae0a0fe27218a42a1920fe2c1868ae5f504422c4af8ffe893beb",
  47. "check_name": "RegexDoS",
  48. "message": "Model attribute used in regular expression",
  49. "file": "app/models/channel/filter/monitoring_base.rb",
  50. "line": 92,
  51. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  52. "code": "/#{(Setting.get(\"#{integration_name}_recovery_match\") or \"(OK|UP)\")}/i",
  53. "render_path": null,
  54. "location": {
  55. "type": "method",
  56. "class": "Channel::Filter::MonitoringBase",
  57. "method": "Channel::Filter::MonitoringBase.run"
  58. },
  59. "user_input": "Setting.get(\"#{integration_name}_recovery_match\")",
  60. "confidence": "Medium",
  61. "note": "Admin configured RegExp"
  62. },
  63. {
  64. "warning_type": "Denial of Service",
  65. "warning_code": 76,
  66. "fingerprint": "15d4ddbc3ac2ae0a0fe27218a42a1920fe2c1868ae5f504422c4af8ffe893beb",
  67. "check_name": "RegexDoS",
  68. "message": "Model attribute used in regular expression",
  69. "file": "app/models/channel/filter/monitoring_base.rb",
  70. "line": 121,
  71. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  72. "code": "/#{(Setting.get(\"#{integration_name}_recovery_match\") or \"(OK|UP)\")}/i",
  73. "render_path": null,
  74. "location": {
  75. "type": "method",
  76. "class": "Channel::Filter::MonitoringBase",
  77. "method": "Channel::Filter::MonitoringBase.run"
  78. },
  79. "user_input": "Setting.get(\"#{integration_name}_recovery_match\")",
  80. "confidence": "Medium",
  81. "note": "Admin configured RegExp"
  82. },
  83. {
  84. "warning_type": "Remote Code Execution",
  85. "warning_code": 24,
  86. "fingerprint": "176994cedb6a57bc52f7a98b0fd93caad211f8f3b48fd010a5db164b37992e1f",
  87. "check_name": "UnsafeReflection",
  88. "message": "Unsafe reflection method `constantize` called with model attribute",
  89. "file": "app/models/avatar.rb",
  90. "line": 405,
  91. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  92. "code": "ObjectLookup.by_id(object_id).constantize",
  93. "render_path": null,
  94. "location": {
  95. "type": "method",
  96. "class": "Avatar",
  97. "method": "Avatar._add_init_avatar"
  98. },
  99. "user_input": "ObjectLookup.by_id(object_id)",
  100. "confidence": "Medium",
  101. "note": "ObjectLookup.by_id works as designed"
  102. },
  103. {
  104. "warning_type": "Denial of Service",
  105. "warning_code": 76,
  106. "fingerprint": "230f45f9fba03dd6308704600d0c2cd639ab138a3a485c0dc54f750356d22ebc",
  107. "check_name": "RegexDoS",
  108. "message": "Model attribute used in regular expression",
  109. "file": "app/models/ticket/subject.rb",
  110. "line": 67,
  111. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  112. "code": "/#{Setting.get(\"ticket_hook\")}:#{number}(\\s+?|)/",
  113. "render_path": null,
  114. "location": {
  115. "type": "method",
  116. "class": "Ticket::Subject",
  117. "method": "subject_clean"
  118. },
  119. "user_input": "Setting.get(\"ticket_hook\")",
  120. "confidence": "Medium",
  121. "note": "Admin configured RegExp"
  122. },
  123. {
  124. "warning_type": "Denial of Service",
  125. "warning_code": 76,
  126. "fingerprint": "2eaeb513e1e099ce8bf973d91a9bfce398910cdcede6fce7469d6bd576fe938f",
  127. "check_name": "RegexDoS",
  128. "message": "Model attribute used in regular expression",
  129. "file": "app/models/ticket/subject.rb",
  130. "line": 63,
  131. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  132. "code": "/\\[#{Setting.get(\"ticket_hook\")}#{Setting.get(\"ticket_hook_divider\")}#{number}\\](\\s+?|)/",
  133. "render_path": null,
  134. "location": {
  135. "type": "method",
  136. "class": "Ticket::Subject",
  137. "method": "subject_clean"
  138. },
  139. "user_input": "Setting.get(\"ticket_hook\")",
  140. "confidence": "Medium",
  141. "note": "Admin configured RegExp"
  142. },
  143. {
  144. "warning_type": "SQL Injection",
  145. "warning_code": 0,
  146. "fingerprint": "34d5d0f52def9a9fbcb045f4f16b0117cb22d59d8ab6184f3bddd057d81d7cd1",
  147. "check_name": "SQL",
  148. "message": "Possible SQL injection",
  149. "file": "app/models/channel/filter/internal_article_check.rb",
  150. "line": 31,
  151. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  152. "code": "ticket.articles.where(\"ticket_articles.to #{Rails.application.config.db_like} ?\", \"%#{parse_email(mail[:from_email])}%\")",
  153. "render_path": null,
  154. "location": {
  155. "type": "method",
  156. "class": "Channel::Filter::InternalArticleCheck",
  157. "method": "Channel::Filter::InternalArticleCheck.last_outgoing_mail_is_internal?"
  158. },
  159. "user_input": "Rails.application.config.db_like",
  160. "confidence": "Weak",
  161. "note": "The db_like config setting is safe to use in an SQL string."
  162. },
  163. {
  164. "warning_type": "Denial of Service",
  165. "warning_code": 76,
  166. "fingerprint": "381781925211cac1f2592a6537f4abc050f98b081e5554b7d3d70a9454157e35",
  167. "check_name": "RegexDoS",
  168. "message": "Model attribute used in regular expression",
  169. "file": "app/models/ticket/number/increment.rb",
  170. "line": 47,
  171. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  172. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}\\s{0,2}(#{(\"\" or Setting.get(\"system_id\").to_s)}\\d{2,48})\\b/i",
  173. "render_path": null,
  174. "location": {
  175. "type": "method",
  176. "class": "Ticket::Number::Increment",
  177. "method": "Ticket::Number::Increment.check"
  178. },
  179. "user_input": "Setting.get(\"system_id\").to_s",
  180. "confidence": "Medium",
  181. "note": "Admin configured RegExp"
  182. },
  183. {
  184. "warning_type": "Denial of Service",
  185. "warning_code": 76,
  186. "fingerprint": "4ea1b96c11cdde309b0f31defd8af9dc39dd7605a7bb18b13b122469a74a5a70",
  187. "check_name": "RegexDoS",
  188. "message": "Model attribute used in regular expression",
  189. "file": "app/models/channel/filter/monitoring_base.rb",
  190. "line": 115,
  191. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  192. "code": "/#{(Setting.get(\"#{integration_name}_ignore_match\") or \"\")}/i",
  193. "render_path": null,
  194. "location": {
  195. "type": "method",
  196. "class": "Channel::Filter::MonitoringBase",
  197. "method": "Channel::Filter::MonitoringBase.run"
  198. },
  199. "user_input": "Setting.get(\"#{integration_name}_ignore_match\")",
  200. "confidence": "Medium",
  201. "note": "Admin configured RegExp"
  202. },
  203. {
  204. "warning_type": "Remote Code Execution",
  205. "warning_code": 24,
  206. "fingerprint": "55248822583e32826f88a68e27568416fe1f101d83b02791c10296d2393b83a5",
  207. "check_name": "UnsafeReflection",
  208. "message": "Unsafe reflection method `constantize` called with model attribute",
  209. "file": "app/models/store/file.rb",
  210. "line": 32,
  211. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  212. "code": "\"Store::Provider::#{(Setting.get(\"storage_provider\") or \"DB\")}\".constantize",
  213. "render_path": null,
  214. "location": {
  215. "type": "method",
  216. "class": "File",
  217. "method": "s(:self).add"
  218. },
  219. "user_input": "Setting.get(\"storage_provider\")",
  220. "confidence": "Medium",
  221. "note": "Setting.get('storage_provider') returns defined Store::Provider backend class names"
  222. },
  223. {
  224. "warning_type": "Remote Code Execution",
  225. "warning_code": 24,
  226. "fingerprint": "582df3b442a09879f0c035b50f6c4fce9aa8285c907737476f16004246c67bc6",
  227. "check_name": "UnsafeReflection",
  228. "message": "Unsafe reflection method `safe_constantize` called with parameter value",
  229. "file": "app/controllers/tests_controller.rb",
  230. "line": 19,
  231. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  232. "code": "params.fetch(:exception, \"StandardError\").safe_constantize",
  233. "render_path": null,
  234. "location": {
  235. "type": "method",
  236. "class": "TestsController",
  237. "method": "error_raised_exception"
  238. },
  239. "user_input": "params.fetch(:exception, \"StandardError\")",
  240. "confidence": "High",
  241. "note": "Only for testing purposes"
  242. },
  243. {
  244. "warning_type": "Denial of Service",
  245. "warning_code": 76,
  246. "fingerprint": "5840449fd32ff0c102ebe4b61132fbb129aae57636bbe407cbb809da7eb5a4ee",
  247. "check_name": "RegexDoS",
  248. "message": "Model attribute used in regular expression",
  249. "file": "app/models/ticket/subject.rb",
  250. "line": 61,
  251. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  252. "code": "/\\[#{Setting.get(\"ticket_hook\")}: #{number}\\](\\s+?|)/",
  253. "render_path": null,
  254. "location": {
  255. "type": "method",
  256. "class": "Ticket::Subject",
  257. "method": "subject_clean"
  258. },
  259. "user_input": "Setting.get(\"ticket_hook\")",
  260. "confidence": "Medium",
  261. "note": "Admin configured RegExp"
  262. },
  263. {
  264. "warning_type": "Remote Code Execution",
  265. "warning_code": 24,
  266. "fingerprint": "73999042c4866cd2effe286fdd6a74c51659bc4a5fc760d1b96d35bd11b2bcda",
  267. "check_name": "UnsafeReflection",
  268. "message": "Unsafe reflection method `constantize` called with model attribute",
  269. "file": "lib/transaction_dispatcher.rb",
  270. "line": 37,
  271. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  272. "code": "Setting.get(setting.name).constantize",
  273. "render_path": null,
  274. "location": {
  275. "type": "method",
  276. "class": "TransactionDispatcher",
  277. "method": "s(:self).perform"
  278. },
  279. "user_input": "Setting.get(setting.name)",
  280. "confidence": "Medium",
  281. "note": "Setting.where(area: 'Transaction::Backend::Sync').order(:name) returns defined Transaction backend class names"
  282. },
  283. {
  284. "warning_type": "Dangerous Send",
  285. "warning_code": 23,
  286. "fingerprint": "73f7454b7fdc88e0fb9cfc849b74006956a7a031836897a0b61d8d13dde94340",
  287. "check_name": "Send",
  288. "message": "User controlled method execution",
  289. "file": "app/controllers/channels_sms_controller.rb",
  290. "line": 48,
  291. "link": "https://brakemanscanner.org/docs/warning_types/dangerous_send/",
  292. "code": "Channel.driver_class(params[:options][:adapter]).new.send(params[:options], test_options)",
  293. "render_path": null,
  294. "location": {
  295. "type": "method",
  296. "class": "ChannelsSmsController",
  297. "method": "test"
  298. },
  299. "user_input": "params[:options]",
  300. "confidence": "High",
  301. "note": "Channel#send is a custom implementation"
  302. },
  303. {
  304. "warning_type": "Remote Code Execution",
  305. "warning_code": 24,
  306. "fingerprint": "7541faf8d3249dc4ac24f9c354024614ae79b0d6cd4c057f034ea88be1154bf7",
  307. "check_name": "UnsafeReflection",
  308. "message": "Unsafe reflection method `constantize` called with model attribute",
  309. "file": "lib/application_lib.rb",
  310. "line": 26,
  311. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  312. "code": "Setting.get(setting).constantize",
  313. "render_path": null,
  314. "location": {
  315. "type": "method",
  316. "class": "ApplicationLib::ClassMethods",
  317. "method": "load_adapter_by_setting"
  318. },
  319. "user_input": "Setting.get(setting)",
  320. "confidence": "Medium",
  321. "note": "ApplicationLib.load_adapter_by_setting works as designed"
  322. },
  323. {
  324. "warning_type": "Denial of Service",
  325. "warning_code": 76,
  326. "fingerprint": "768e035d4bcb32ab79f5f747ccd5561d3c5f3a8ea74b2be08638d892be2249b2",
  327. "check_name": "RegexDoS",
  328. "message": "Model attribute used in regular expression",
  329. "file": "app/models/ticket/number/date.rb",
  330. "line": 49,
  331. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  332. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}\\s{0,2}(\\d{4,10}#{(Setting.get(\"system_id\") or \"\")}\\d{2,40})\\b/i",
  333. "render_path": null,
  334. "location": {
  335. "type": "method",
  336. "class": "Ticket::Number::Date",
  337. "method": "Ticket::Number::Date.check"
  338. },
  339. "user_input": "Setting.get(\"system_id\")",
  340. "confidence": "Medium",
  341. "note": "Admin configured RegExp"
  342. },
  343. {
  344. "warning_type": "SSL Verification Bypass",
  345. "warning_code": 71,
  346. "fingerprint": "7d088914c00f93dddb545ad9e567d59bf89dad493884b550ba72c014c0190011",
  347. "check_name": "SSLVerify",
  348. "message": "SSL certificate verification was bypassed",
  349. "file": "lib/user_agent.rb",
  350. "line": 335,
  351. "link": "https://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/",
  352. "code": "(Net::HTTP.Proxy($1, $2, ((options[\"proxy_username\"] or Setting.get(\"proxy_username\")) or nil), ((options[\"proxy_password\"] or Setting.get(\"proxy_password\")) or nil)).new(uri.host, uri.port) or Net::HTTP.new(uri.host, uri.port)).verify_mode = OpenSSL::SSL::VERIFY_NONE",
  353. "render_path": null,
  354. "location": {
  355. "type": "method",
  356. "class": "UserAgent",
  357. "method": "s(:self).get_http"
  358. },
  359. "user_input": null,
  360. "confidence": "High",
  361. "note": "SSL Verification can already be requested from callers. The default value should be switched to true at some point."
  362. },
  363. {
  364. "warning_type": "Remote Code Execution",
  365. "warning_code": 24,
  366. "fingerprint": "8db3b4731daa1ef96c53729b2fca4cc91b47af058564f61cba24833aacaa55ae",
  367. "check_name": "UnsafeReflection",
  368. "message": "Unsafe reflection method `constantize` called with model attribute",
  369. "file": "app/jobs/transaction_job.rb",
  370. "line": 25,
  371. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  372. "code": "Setting.get(setting.name).constantize",
  373. "render_path": null,
  374. "location": {
  375. "type": "method",
  376. "class": "TransactionJob",
  377. "method": "perform"
  378. },
  379. "user_input": "Setting.get(setting.name)",
  380. "confidence": "Medium",
  381. "note": "Setting.where(area: 'Transaction::Backend::Async').order(:name) returns defined Transaction backend class names"
  382. },
  383. {
  384. "warning_type": "Denial of Service",
  385. "warning_code": 76,
  386. "fingerprint": "949570adfbda072b1fa14632a6d7a0e829a632c699339dce93e1ff109bf79786",
  387. "check_name": "RegexDoS",
  388. "message": "Model attribute used in regular expression",
  389. "file": "app/models/ticket/number/increment.rb",
  390. "line": 41,
  391. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  392. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}#{Regexp.quote(Setting.get(\"ticket_hook_divider\").to_s)}(#{(\"\" or Setting.get(\"system_id\").to_s)}\\d{2,48})\\b/i",
  393. "render_path": null,
  394. "location": {
  395. "type": "method",
  396. "class": "Ticket::Number::Increment",
  397. "method": "Ticket::Number::Increment.check"
  398. },
  399. "user_input": "Setting.get(\"system_id\").to_s",
  400. "confidence": "Medium",
  401. "note": "Admin configured RegExp"
  402. },
  403. {
  404. "warning_type": "Denial of Service",
  405. "warning_code": 76,
  406. "fingerprint": "9bb8bfef12e845cf5264fc09d776c90c4458dee93f69d70689e1caa9a0dd4c8a",
  407. "check_name": "RegexDoS",
  408. "message": "Model attribute used in regular expression",
  409. "file": "app/models/ticket/subject.rb",
  410. "line": 68,
  411. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  412. "code": "/#{Setting.get(\"ticket_hook\")}#{Setting.get(\"ticket_hook_divider\")}#{number}(\\s+?|)/",
  413. "render_path": null,
  414. "location": {
  415. "type": "method",
  416. "class": "Ticket::Subject",
  417. "method": "subject_clean"
  418. },
  419. "user_input": "Setting.get(\"ticket_hook\")",
  420. "confidence": "Medium",
  421. "note": "Admin configured RegExp"
  422. },
  423. {
  424. "warning_type": "SQL Injection",
  425. "warning_code": 0,
  426. "fingerprint": "9ec74dbe0ca90264aab31f05df4f0565f53e28477c93ced418e0249913c519fc",
  427. "check_name": "SQL",
  428. "message": "Possible SQL injection",
  429. "file": "app/models/organization/search.rb",
  430. "line": 116,
  431. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  432. "code": "Organization.select(\"DISTINCT(organizations.id), #{::SqlHelper.new(:object => (self)).get_order_select(::SqlHelper.new(:object => (self)).get_sort_by(params, [\"active\", \"updated_at\"]), ::SqlHelper.new(:object => (self)).get_order_by(params, [\"desc\", \"desc\"]), \"organizations.updated_at\")}\")",
  433. "render_path": null,
  434. "location": {
  435. "type": "method",
  436. "class": "Organization",
  437. "method": "search"
  438. },
  439. "user_input": "::SqlHelper.new(:object => (self)).get_order_select(::SqlHelper.new(:object => (self)).get_sort_by(params, [\"active\", \"updated_at\"]), ::SqlHelper.new(:object => (self)).get_order_by(params, [\"desc\", \"desc\"]), \"organizations.updated_at\")",
  440. "confidence": "Medium",
  441. "note": "SqlHelper does properly escape table and column names."
  442. },
  443. {
  444. "warning_type": "Denial of Service",
  445. "warning_code": 76,
  446. "fingerprint": "a08cb6cbb584ab6bf0a1c068a0e99336b97bb68d98aa0294cc4e1184f15aaf9a",
  447. "check_name": "RegexDoS",
  448. "message": "Model attribute used in regular expression",
  449. "file": "app/models/ticket/subject.rb",
  450. "line": 66,
  451. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  452. "code": "/#{Setting.get(\"ticket_hook\")}: #{number}(\\s+?|)/",
  453. "render_path": null,
  454. "location": {
  455. "type": "method",
  456. "class": "Ticket::Subject",
  457. "method": "subject_clean"
  458. },
  459. "user_input": "Setting.get(\"ticket_hook\")",
  460. "confidence": "Medium",
  461. "note": "Admin configured RegExp"
  462. },
  463. {
  464. "warning_type": "Remote Code Execution",
  465. "warning_code": 24,
  466. "fingerprint": "b4e5b1ad22930f849b12cbdf519dced6ec46b6cc653504f0a8e910c0a9590d61",
  467. "check_name": "UnsafeReflection",
  468. "message": "Unsafe reflection method `constantize` called with model attribute",
  469. "file": "app/models/object_manager/attribute.rb",
  470. "line": 806,
  471. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  472. "code": "ObjectLookup.by_id(object_lookup_id).constantize",
  473. "render_path": null,
  474. "location": {
  475. "type": "method",
  476. "class": "ObjectManager::Attribute",
  477. "method": "check_name"
  478. },
  479. "user_input": "ObjectLookup.by_id(object_lookup_id)",
  480. "confidence": "Medium",
  481. "note": "ObjectLookup.by_id works as designed"
  482. },
  483. {
  484. "warning_type": "Command Injection",
  485. "warning_code": 14,
  486. "fingerprint": "be422b13e9cd280bc5ae570cd575777a4d48d8a53aed09bb59d1db85eee4927b",
  487. "check_name": "Execute",
  488. "message": "Possible command injection",
  489. "file": "lib/mysql_strategy.rb",
  490. "line": 62,
  491. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  492. "code": "system(\"mysqldump #{mysql_arguments} > #{backup_file}\", :exception => true)",
  493. "render_path": null,
  494. "location": {
  495. "type": "method",
  496. "class": "MysqlStrategy",
  497. "method": "s(:self).backup"
  498. },
  499. "user_input": "mysql_arguments",
  500. "confidence": "Medium",
  501. "note": "Mysql arguments are internal / from config."
  502. },
  503. {
  504. "warning_type": "Denial of Service",
  505. "warning_code": 76,
  506. "fingerprint": "befcb5177e42e1d0c9184b046185ec84c7ecef8fc9b53822d8344f6a6a35860c",
  507. "check_name": "RegexDoS",
  508. "message": "Model attribute used in regular expression",
  509. "file": "app/models/ticket/subject.rb",
  510. "line": 62,
  511. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  512. "code": "/\\[#{Setting.get(\"ticket_hook\")}:#{number}\\](\\s+?|)/",
  513. "render_path": null,
  514. "location": {
  515. "type": "method",
  516. "class": "Ticket::Subject",
  517. "method": "subject_clean"
  518. },
  519. "user_input": "Setting.get(\"ticket_hook\")",
  520. "confidence": "Medium",
  521. "note": "Admin configured RegExp"
  522. },
  523. {
  524. "warning_type": "Dynamic Render Path",
  525. "warning_code": 15,
  526. "fingerprint": "c52f57d32456c9ab6dba6dfc93bd8effa16829a87a9ce9368da83a35fc6cf1a7",
  527. "check_name": "Render",
  528. "message": "Render path contains parameter value",
  529. "file": "app/controllers/tests_controller.rb",
  530. "line": 13,
  531. "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  532. "code": "render(action => params[:name], {})",
  533. "render_path": null,
  534. "location": {
  535. "type": "method",
  536. "class": "TestsController",
  537. "method": "show"
  538. },
  539. "user_input": "params[:name]",
  540. "confidence": "High",
  541. "note": "Running QUnit tests"
  542. },
  543. {
  544. "warning_type": "SSL Verification Bypass",
  545. "warning_code": 71,
  546. "fingerprint": "cce91e3b231a7971f9f9d2298b8bba7b309610f4b98a88e530cac6fdd8efa1c4",
  547. "check_name": "SSLVerify",
  548. "message": "SSL certificate verification was bypassed",
  549. "file": "app/controllers/integration/exchange_controller.rb",
  550. "line": 17,
  551. "link": "https://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/",
  552. "code": "Autodiscover::Client.new(:email => params[:user], :password => params[:password]).http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE",
  553. "render_path": null,
  554. "location": {
  555. "type": "method",
  556. "class": "Integration::ExchangeController",
  557. "method": "autodiscover"
  558. },
  559. "user_input": null,
  560. "confidence": "High",
  561. "note": "Only if requester sends `:disable_ssl_verify` param"
  562. },
  563. {
  564. "warning_type": "Remote Code Execution",
  565. "warning_code": 24,
  566. "fingerprint": "d48809837203098f7be4803f19b4f180f93361030bcf145560c65582d44f8edc",
  567. "check_name": "UnsafeReflection",
  568. "message": "Unsafe reflection method `constantize` called with model attribute",
  569. "file": "app/models/channel/email_parser.rb",
  570. "line": 154,
  571. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  572. "code": "Setting.get(setting.name).constantize",
  573. "render_path": null,
  574. "location": {
  575. "type": "method",
  576. "class": "Channel::EmailParser",
  577. "method": "_process"
  578. },
  579. "user_input": "Setting.get(setting.name)",
  580. "confidence": "Medium",
  581. "note": "Setting.where(area: 'Postmaster::PreFilter').order(:name) returns defined postmaster backend class names"
  582. },
  583. {
  584. "warning_type": "Remote Code Execution",
  585. "warning_code": 24,
  586. "fingerprint": "d48809837203098f7be4803f19b4f180f93361030bcf145560c65582d44f8edc",
  587. "check_name": "UnsafeReflection",
  588. "message": "Unsafe reflection method `constantize` called with model attribute",
  589. "file": "app/models/channel/email_parser.rb",
  590. "line": 318,
  591. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  592. "code": "Setting.get(setting.name).constantize",
  593. "render_path": null,
  594. "location": {
  595. "type": "method",
  596. "class": "Channel::EmailParser",
  597. "method": "_process"
  598. },
  599. "user_input": "Setting.get(setting.name)",
  600. "confidence": "Medium",
  601. "note": "Setting.where(area: 'Postmaster::PreFilter').order(:name) returns defined postmaster backend class names"
  602. },
  603. {
  604. "warning_type": "Remote Code Execution",
  605. "warning_code": 24,
  606. "fingerprint": "dfe8a5a18f3d403c3cb32a50bf9b10da7254fa6b958c45fa5d6b8d97ae017961",
  607. "check_name": "UnsafeReflection",
  608. "message": "Unsafe reflection method `safe_constantize` called with model attribute",
  609. "file": "app/controllers/attachments_controller.rb",
  610. "line": 86,
  611. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  612. "code": "Store.find(params[:id]).store_object.name.safe_constantize",
  613. "render_path": null,
  614. "location": {
  615. "type": "method",
  616. "class": "AttachmentsController",
  617. "method": "authorize!"
  618. },
  619. "user_input": "Store.find(params[:id]).store_object",
  620. "confidence": "Medium",
  621. "note": "Works as designed."
  622. },
  623. {
  624. "warning_type": "Denial of Service",
  625. "warning_code": 76,
  626. "fingerprint": "ea2a3af842a48c9ef4dc8d142abd56978baa4823a598d2a76dc8f840799d6967",
  627. "check_name": "RegexDoS",
  628. "message": "Model attribute used in regular expression",
  629. "file": "app/models/ticket/number/date.rb",
  630. "line": 44,
  631. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  632. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}#{Regexp.quote((Setting.get(\"ticket_hook_divider\") or \"\"))}(\\d{4,10}#{(Setting.get(\"system_id\") or \"\")}\\d{2,40})\\b/i",
  633. "render_path": null,
  634. "location": {
  635. "type": "method",
  636. "class": "Ticket::Number::Date",
  637. "method": "Ticket::Number::Date.check"
  638. },
  639. "user_input": "Setting.get(\"system_id\")",
  640. "confidence": "Medium",
  641. "note": "Admin configured RegExp"
  642. },
  643. {
  644. "warning_type": "Session Setting",
  645. "warning_code": 29,
  646. "fingerprint": "f0ee1cc1980474c82a013645508f002dcc801e00db5592f7dd8cd6bdb93c73fe",
  647. "check_name": "SessionSettings",
  648. "message": "Session secret should not be included in version control",
  649. "file": "config/secrets.yml",
  650. "line": 2,
  651. "link": "https://brakemanscanner.org/docs/warning_types/session_setting/",
  652. "code": null,
  653. "render_path": null,
  654. "location": null,
  655. "user_input": null,
  656. "confidence": "High",
  657. "note": "Since Sessions are stored in the database and not in cookies, the session secret is not used / not relevant.\""
  658. },
  659. {
  660. "warning_type": "SQL Injection",
  661. "warning_code": 0,
  662. "fingerprint": "fcad47a712a324ace0e97560767e5420500df03fd3de3057198800bdea5fd324",
  663. "check_name": "SQL",
  664. "message": "Possible SQL injection",
  665. "file": "lib/models.rb",
  666. "line": 171,
  667. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  668. "code": "model_class.where(\"#{reflection_value.name}_id\" => object_id)",
  669. "render_path": null,
  670. "location": {
  671. "type": "method",
  672. "class": "Models",
  673. "method": "s(:self).references"
  674. },
  675. "user_input": "reflection_value.name",
  676. "confidence": "Weak",
  677. "note": "Reflections come from the models themselves and are thus safe to use."
  678. },
  679. {
  680. "warning_type": "SQL Injection",
  681. "warning_code": 0,
  682. "fingerprint": "fcad47a712a324ace0e97560767e5420500df03fd3de3057198800bdea5fd324",
  683. "check_name": "SQL",
  684. "message": "Possible SQL injection",
  685. "file": "lib/models.rb",
  686. "line": 184,
  687. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  688. "code": "model_class.where(\"#{reflection_value.name}_id\" => object_id)",
  689. "render_path": null,
  690. "location": {
  691. "type": "method",
  692. "class": "Models",
  693. "method": "s(:self).references"
  694. },
  695. "user_input": "reflection_value.name",
  696. "confidence": "Weak",
  697. "note": "Reflections come from the models themselves and are thus safe to use."
  698. },
  699. {
  700. "warning_type": "Command Injection",
  701. "warning_code": 14,
  702. "fingerprint": "fe15417756eed2c518c355309ee042b57df5f88a5410858dce3fa9fe9c893b84",
  703. "check_name": "Execute",
  704. "message": "Possible command injection",
  705. "file": "lib/mysql_strategy.rb",
  706. "line": 54,
  707. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  708. "code": "system(\"mysql #{mysql_arguments} < #{backup_file}\", :exception => true)",
  709. "render_path": null,
  710. "location": {
  711. "type": "method",
  712. "class": "MysqlStrategy",
  713. "method": "s(:self).rollback"
  714. },
  715. "user_input": "mysql_arguments",
  716. "confidence": "Medium",
  717. "note": "Mysql arguments are internal / from config."
  718. },
  719. {
  720. "warning_type": "Denial of Service",
  721. "warning_code": 76,
  722. "fingerprint": "fe906d9ee6b37c92b7deec029d6a4cca47071006440817e4a50292b2ca956a30",
  723. "check_name": "RegexDoS",
  724. "message": "Model attribute used in regular expression",
  725. "file": "app/models/ticket.rb",
  726. "line": 1577,
  727. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  728. "code": "/#{Setting.get(\"send_no_auto_response_reg_exp\")}/i",
  729. "render_path": null,
  730. "location": {
  731. "type": "method",
  732. "class": "Ticket",
  733. "method": "send_email_notification"
  734. },
  735. "user_input": "Setting.get(\"send_no_auto_response_reg_exp\")",
  736. "confidence": "Medium",
  737. "note": "Admin configured RegExp"
  738. }
  739. ],
  740. "updated": "2021-07-23 08:25:01 +0200",
  741. "brakeman_version": "5.1.1"
  742. }