brakeman.ignore 28 KB

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