brakeman.ignore 34 KB

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