brakeman.ignore 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  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": 427,
  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": "55248822583e32826f88a68e27568416fe1f101d83b02791c10296d2393b83a5",
  195. "check_name": "UnsafeReflection",
  196. "message": "Unsafe reflection method `constantize` called on model attribute",
  197. "file": "app/models/store/file.rb",
  198. "line": 32,
  199. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  200. "code": "\"Store::Provider::#{(Setting.get(\"storage_provider\") or \"DB\")}\".constantize",
  201. "render_path": null,
  202. "location": {
  203. "type": "method",
  204. "class": "File",
  205. "method": "s(:self).add"
  206. },
  207. "user_input": "Setting.get(\"storage_provider\")",
  208. "confidence": "Medium",
  209. "cwe_id": [
  210. 470
  211. ],
  212. "note": "Setting.get('storage_provider') returns defined Store::Provider backend class names"
  213. },
  214. {
  215. "warning_type": "Remote Code Execution",
  216. "warning_code": 24,
  217. "fingerprint": "582df3b442a09879f0c035b50f6c4fce9aa8285c907737476f16004246c67bc6",
  218. "check_name": "UnsafeReflection",
  219. "message": "Unsafe reflection method `safe_constantize` called on parameter value",
  220. "file": "app/controllers/tests_controller.rb",
  221. "line": 37,
  222. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  223. "code": "params.fetch(:exception, \"StandardError\").safe_constantize",
  224. "render_path": null,
  225. "location": {
  226. "type": "method",
  227. "class": "TestsController",
  228. "method": "error_raised_exception"
  229. },
  230. "user_input": "params.fetch(:exception, \"StandardError\")",
  231. "confidence": "High",
  232. "cwe_id": [
  233. 470
  234. ],
  235. "note": "Only for testing purposes"
  236. },
  237. {
  238. "warning_type": "Remote Code Execution",
  239. "warning_code": 24,
  240. "fingerprint": "73999042c4866cd2effe286fdd6a74c51659bc4a5fc760d1b96d35bd11b2bcda",
  241. "check_name": "UnsafeReflection",
  242. "message": "Unsafe reflection method `constantize` called on model attribute",
  243. "file": "lib/transaction_dispatcher.rb",
  244. "line": 37,
  245. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  246. "code": "Setting.get(setting.name).constantize",
  247. "render_path": null,
  248. "location": {
  249. "type": "method",
  250. "class": "TransactionDispatcher",
  251. "method": "s(:self).perform"
  252. },
  253. "user_input": "Setting.get(setting.name)",
  254. "confidence": "Medium",
  255. "cwe_id": [
  256. 470
  257. ],
  258. "note": "Setting.where(area: 'Transaction::Backend::Sync').order(:name) returns defined Transaction backend class names"
  259. },
  260. {
  261. "warning_type": "Dangerous Send",
  262. "warning_code": 23,
  263. "fingerprint": "73f7454b7fdc88e0fb9cfc849b74006956a7a031836897a0b61d8d13dde94340",
  264. "check_name": "Send",
  265. "message": "User controlled method execution",
  266. "file": "app/controllers/channels_sms_controller.rb",
  267. "line": 48,
  268. "link": "https://brakemanscanner.org/docs/warning_types/dangerous_send/",
  269. "code": "Channel.driver_class(params[:options][:adapter]).new.send(params[:options], test_options)",
  270. "render_path": null,
  271. "location": {
  272. "type": "method",
  273. "class": "ChannelsSmsController",
  274. "method": "test"
  275. },
  276. "user_input": "params[:options]",
  277. "confidence": "High",
  278. "cwe_id": [
  279. 77
  280. ],
  281. "note": "Channel#send is a custom implementation"
  282. },
  283. {
  284. "warning_type": "Remote Code Execution",
  285. "warning_code": 24,
  286. "fingerprint": "7541faf8d3249dc4ac24f9c354024614ae79b0d6cd4c057f034ea88be1154bf7",
  287. "check_name": "UnsafeReflection",
  288. "message": "Unsafe reflection method `constantize` called on model attribute",
  289. "file": "lib/application_lib.rb",
  290. "line": 26,
  291. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  292. "code": "Setting.get(setting).constantize",
  293. "render_path": null,
  294. "location": {
  295. "type": "method",
  296. "class": "ApplicationLib::ClassMethods",
  297. "method": "load_adapter_by_setting"
  298. },
  299. "user_input": "Setting.get(setting)",
  300. "confidence": "Medium",
  301. "cwe_id": [
  302. 470
  303. ],
  304. "note": "ApplicationLib.load_adapter_by_setting works as designed"
  305. },
  306. {
  307. "warning_type": "Denial of Service",
  308. "warning_code": 76,
  309. "fingerprint": "768e035d4bcb32ab79f5f747ccd5561d3c5f3a8ea74b2be08638d892be2249b2",
  310. "check_name": "RegexDoS",
  311. "message": "Model attribute used in regular expression",
  312. "file": "app/models/ticket/number/date.rb",
  313. "line": 49,
  314. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  315. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}\\s{0,2}(\\d{4,10}#{(Setting.get(\"system_id\") or \"\")}\\d{2,40})\\b/i",
  316. "render_path": null,
  317. "location": {
  318. "type": "method",
  319. "class": "Ticket::Number::Date",
  320. "method": "Ticket::Number::Date.check"
  321. },
  322. "user_input": "Setting.get(\"system_id\")",
  323. "confidence": "Medium",
  324. "cwe_id": [
  325. 20,
  326. 185
  327. ],
  328. "note": "Admin configured RegExp"
  329. },
  330. {
  331. "warning_type": "SSL Verification Bypass",
  332. "warning_code": 71,
  333. "fingerprint": "7d088914c00f93dddb545ad9e567d59bf89dad493884b550ba72c014c0190011",
  334. "check_name": "SSLVerify",
  335. "message": "SSL certificate verification was bypassed",
  336. "file": "lib/user_agent.rb",
  337. "line": 335,
  338. "link": "https://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/",
  339. "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",
  340. "render_path": null,
  341. "location": {
  342. "type": "method",
  343. "class": "UserAgent",
  344. "method": "s(:self).get_http"
  345. },
  346. "user_input": null,
  347. "confidence": "High",
  348. "cwe_id": [
  349. 295
  350. ],
  351. "note": "SSL Verification can already be requested from callers. The default value should be switched to true at some point."
  352. },
  353. {
  354. "warning_type": "SQL Injection",
  355. "warning_code": 0,
  356. "fingerprint": "8374304b5866de51754c98208fc3dcd434bc20e02bd4c9713f6d35f831a0ddd7",
  357. "check_name": "SQL",
  358. "message": "Possible SQL injection",
  359. "file": "app/models/pgp_key.rb",
  360. "line": 32,
  361. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  362. "code": "PGPKey.where(([\"#{SqlHelper.new(:object => (PGPKey)).array_contains_one(:email_addresses, uid.downcase)} OR (? LIKE domain_alias)\", SqlHelper.quote_like(uid.downcase)] or SqlHelper.new(:object => (PGPKey)).array_contains_one(:email_addresses, uid.downcase)))",
  363. "render_path": null,
  364. "location": {
  365. "type": "method",
  366. "class": "PGPKey",
  367. "method": "PGPKey.find_all_by_uid"
  368. },
  369. "user_input": "SqlHelper.new(:object => (PGPKey)).array_contains_one(:email_addresses, uid.downcase)",
  370. "confidence": "Medium",
  371. "cwe_id": [
  372. 89
  373. ],
  374. "note": ""
  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": "SQL Injection",
  401. "warning_code": 0,
  402. "fingerprint": "9385240f75935e7ed242f9b52cc9471bcbb907d1990a33ec083f303d951df563",
  403. "check_name": "SQL",
  404. "message": "Possible SQL injection",
  405. "file": "app/models/taskbar/has_attachments.rb",
  406. "line": 7,
  407. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  408. "code": "where(\"state LIKE '%#{SqlHelper.quote_like(\"form_id\")}%'\")",
  409. "render_path": null,
  410. "location": {
  411. "type": "method",
  412. "class": "Taskbar::HasAttachments",
  413. "method": null
  414. },
  415. "user_input": "SqlHelper.quote_like(\"form_id\")",
  416. "confidence": "Medium",
  417. "cwe_id": [
  418. 89
  419. ],
  420. "note": ""
  421. },
  422. {
  423. "warning_type": "Denial of Service",
  424. "warning_code": 76,
  425. "fingerprint": "949570adfbda072b1fa14632a6d7a0e829a632c699339dce93e1ff109bf79786",
  426. "check_name": "RegexDoS",
  427. "message": "Model attribute used in regular expression",
  428. "file": "app/models/ticket/number/increment.rb",
  429. "line": 41,
  430. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  431. "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",
  432. "render_path": null,
  433. "location": {
  434. "type": "method",
  435. "class": "Ticket::Number::Increment",
  436. "method": "Ticket::Number::Increment.check"
  437. },
  438. "user_input": "Setting.get(\"system_id\").to_s",
  439. "confidence": "Medium",
  440. "cwe_id": [
  441. 20,
  442. 185
  443. ],
  444. "note": "Admin configured RegExp"
  445. },
  446. {
  447. "warning_type": "SQL Injection",
  448. "warning_code": 0,
  449. "fingerprint": "9ec74dbe0ca90264aab31f05df4f0565f53e28477c93ced418e0249913c519fc",
  450. "check_name": "SQL",
  451. "message": "Possible SQL injection",
  452. "file": "app/models/organization/search.rb",
  453. "line": 133,
  454. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  455. "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\")}\")",
  456. "render_path": null,
  457. "location": {
  458. "type": "method",
  459. "class": "Organization",
  460. "method": "search"
  461. },
  462. "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\")",
  463. "confidence": "Medium",
  464. "cwe_id": [
  465. 89
  466. ],
  467. "note": "SqlHelper does properly escape table and column names."
  468. },
  469. {
  470. "warning_type": "Redirect",
  471. "warning_code": 18,
  472. "fingerprint": "a50e32b9e4436adca6c2f789c9fd6371f3e752366821d5b49480f8b004ce5ab7",
  473. "check_name": "Redirect",
  474. "message": "Possible unprotected redirect",
  475. "file": "app/controllers/external_credentials_controller.rb",
  476. "line": 38,
  477. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  478. "code": "redirect_to(ExternalCredential.request_account_to_link(params[:provider].downcase, params)[:authorize_url])",
  479. "render_path": null,
  480. "location": {
  481. "type": "method",
  482. "class": "ExternalCredentialsController",
  483. "method": "link_account"
  484. },
  485. "user_input": "ExternalCredential.request_account_to_link(params[:provider].downcase, params)[:authorize_url]",
  486. "confidence": "High",
  487. "cwe_id": [
  488. 601
  489. ],
  490. "note": "https://brakemanscanner.org/docs/warning_types/redirect/"
  491. },
  492. {
  493. "warning_type": "Cross-Site Scripting",
  494. "warning_code": 2,
  495. "fingerprint": "a9e68e841f16226b94c736d272962dd57d02c2333ead2855f2494dfb2c994de7",
  496. "check_name": "CrossSiteScripting",
  497. "message": "Unescaped parameter value",
  498. "file": "app/views/knowledge_base/public/answers/show.html.erb",
  499. "line": 11,
  500. "link": "https://brakemanscanner.org/docs/warning_types/cross_site_scripting",
  501. "code": "prepare_rich_text(find_answer(find_category(params[:category]).answers, params[:answer]).translation.content.body_with_urls)",
  502. "render_path": [
  503. {
  504. "type": "controller",
  505. "class": "KnowledgeBase::Public::AnswersController",
  506. "method": "show",
  507. "line": 11,
  508. "file": "app/controllers/knowledge_base/public/answers_controller.rb",
  509. "rendered": {
  510. "name": "knowledge_base/public/answers/show",
  511. "file": "app/views/knowledge_base/public/answers/show.html.erb"
  512. }
  513. }
  514. ],
  515. "location": {
  516. "type": "template",
  517. "template": "knowledge_base/public/answers/show"
  518. },
  519. "user_input": "params[:category]",
  520. "confidence": "Weak",
  521. "cwe_id": [
  522. 79
  523. ],
  524. "note": ""
  525. },
  526. {
  527. "warning_type": "Remote Code Execution",
  528. "warning_code": 24,
  529. "fingerprint": "b4e5b1ad22930f849b12cbdf519dced6ec46b6cc653504f0a8e910c0a9590d61",
  530. "check_name": "UnsafeReflection",
  531. "message": "Unsafe reflection method `constantize` called on model attribute",
  532. "file": "app/models/object_manager/attribute.rb",
  533. "line": 895,
  534. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  535. "code": "ObjectLookup.by_id(object_lookup_id).constantize",
  536. "render_path": null,
  537. "location": {
  538. "type": "method",
  539. "class": "ObjectManager::Attribute",
  540. "method": "check_name"
  541. },
  542. "user_input": "ObjectLookup.by_id(object_lookup_id)",
  543. "confidence": "Medium",
  544. "cwe_id": [
  545. 470
  546. ],
  547. "note": "ObjectLookup.by_id works as designed"
  548. },
  549. {
  550. "warning_type": "Command Injection",
  551. "warning_code": 14,
  552. "fingerprint": "be422b13e9cd280bc5ae570cd575777a4d48d8a53aed09bb59d1db85eee4927b",
  553. "check_name": "Execute",
  554. "message": "Possible command injection",
  555. "file": "lib/mysql_strategy.rb",
  556. "line": 62,
  557. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  558. "code": "system(\"mysqldump #{mysql_arguments} > #{backup_file}\", :exception => true)",
  559. "render_path": null,
  560. "location": {
  561. "type": "method",
  562. "class": "MysqlStrategy",
  563. "method": "s(:self).backup"
  564. },
  565. "user_input": "mysql_arguments",
  566. "confidence": "Medium",
  567. "cwe_id": [
  568. 77
  569. ],
  570. "note": "Mysql arguments are internal / from config."
  571. },
  572. {
  573. "warning_type": "Command Injection",
  574. "warning_code": 14,
  575. "fingerprint": "c47bddc058fcf0381c1a91f2d107606a76bb1a5c40130c555ff1dfec713f2775",
  576. "check_name": "Execute",
  577. "message": "Possible command injection",
  578. "file": "lib/secure_mailing/pgp/tool/exec/agent.rb",
  579. "line": 32,
  580. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  581. "code": "Open3.capture3(\"GNUPGHOME\" => (@gnupg_home), *([\"#{File.dirname(binary_path)}/gpgconf\"] + cmdline), :binmode => true)",
  582. "render_path": null,
  583. "location": {
  584. "type": "method",
  585. "class": "SecureMailing::PGP::Tool::Exec::Agent",
  586. "method": "gpgconf"
  587. },
  588. "user_input": "File.dirname(binary_path)",
  589. "confidence": "Medium",
  590. "cwe_id": [
  591. 77
  592. ],
  593. "note": "gpg command line tool stuff."
  594. },
  595. {
  596. "warning_type": "Dynamic Render Path",
  597. "warning_code": 15,
  598. "fingerprint": "c52f57d32456c9ab6dba6dfc93bd8effa16829a87a9ce9368da83a35fc6cf1a7",
  599. "check_name": "Render",
  600. "message": "Render path contains parameter value",
  601. "file": "app/controllers/tests_controller.rb",
  602. "line": 13,
  603. "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  604. "code": "render(action => params[:name], {})",
  605. "render_path": null,
  606. "location": {
  607. "type": "method",
  608. "class": "TestsController",
  609. "method": "show"
  610. },
  611. "user_input": "params[:name]",
  612. "confidence": "High",
  613. "cwe_id": [
  614. 22
  615. ],
  616. "note": "Running QUnit tests"
  617. },
  618. {
  619. "warning_type": "SSL Verification Bypass",
  620. "warning_code": 71,
  621. "fingerprint": "c7311ebfec11c51dead99054a31ec84773b4d0d4848c11a15801c439d35d2171",
  622. "check_name": "SSLVerify",
  623. "message": "SSL certificate verification was bypassed",
  624. "file": "app/controllers/integration/exchange_controller.rb",
  625. "line": 93,
  626. "link": "https://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/",
  627. "code": "Autodiscover::Client.new(:email => params[:user], :password => params[:password]).http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE",
  628. "render_path": null,
  629. "location": {
  630. "type": "method",
  631. "class": "Integration::ExchangeController",
  632. "method": "autodiscover_basic_auth_check"
  633. },
  634. "user_input": null,
  635. "confidence": "High",
  636. "cwe_id": [
  637. 295
  638. ],
  639. "note": "Only if requester sends `:disable_ssl_verify` param"
  640. },
  641. {
  642. "warning_type": "Remote Code Execution",
  643. "warning_code": 24,
  644. "fingerprint": "d48809837203098f7be4803f19b4f180f93361030bcf145560c65582d44f8edc",
  645. "check_name": "UnsafeReflection",
  646. "message": "Unsafe reflection method `constantize` called on model attribute",
  647. "file": "app/models/channel/email_parser.rb",
  648. "line": 160,
  649. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  650. "code": "Setting.get(setting.name).constantize",
  651. "render_path": null,
  652. "location": {
  653. "type": "method",
  654. "class": "Channel::EmailParser",
  655. "method": "_process"
  656. },
  657. "user_input": "Setting.get(setting.name)",
  658. "confidence": "Medium",
  659. "cwe_id": [
  660. 470
  661. ],
  662. "note": "Setting.where(area: 'Postmaster::PreFilter').order(:name) returns defined postmaster backend class names"
  663. },
  664. {
  665. "warning_type": "Remote Code Execution",
  666. "warning_code": 24,
  667. "fingerprint": "d48809837203098f7be4803f19b4f180f93361030bcf145560c65582d44f8edc",
  668. "check_name": "UnsafeReflection",
  669. "message": "Unsafe reflection method `constantize` called on model attribute",
  670. "file": "app/models/channel/email_parser.rb",
  671. "line": 325,
  672. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  673. "code": "Setting.get(setting.name).constantize",
  674. "render_path": null,
  675. "location": {
  676. "type": "method",
  677. "class": "Channel::EmailParser",
  678. "method": "_process"
  679. },
  680. "user_input": "Setting.get(setting.name)",
  681. "confidence": "Medium",
  682. "cwe_id": [
  683. 470
  684. ],
  685. "note": "Setting.where(area: 'Postmaster::PreFilter').order(:name) returns defined postmaster backend class names"
  686. },
  687. {
  688. "warning_type": "Remote Code Execution",
  689. "warning_code": 24,
  690. "fingerprint": "d5d1526bf7a888d1965405d0e3dc5c63f11fe2de47f9704c0e1717ee0410dd6b",
  691. "check_name": "UnsafeReflection",
  692. "message": "Unsafe reflection method `safe_constantize` called on model attribute",
  693. "file": "app/models/online_notification.rb",
  694. "line": 38,
  695. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  696. "code": "ObjectLookup.by_id(object_lookup_id).safe_constantize",
  697. "render_path": null,
  698. "location": {
  699. "type": "method",
  700. "class": "OnlineNotification",
  701. "method": "related_object"
  702. },
  703. "user_input": "ObjectLookup.by_id(object_lookup_id)",
  704. "confidence": "Medium",
  705. "cwe_id": [
  706. 470
  707. ],
  708. "note": ""
  709. },
  710. {
  711. "warning_type": "Denial of Service",
  712. "warning_code": 76,
  713. "fingerprint": "ea2a3af842a48c9ef4dc8d142abd56978baa4823a598d2a76dc8f840799d6967",
  714. "check_name": "RegexDoS",
  715. "message": "Model attribute used in regular expression",
  716. "file": "app/models/ticket/number/date.rb",
  717. "line": 44,
  718. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  719. "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",
  720. "render_path": null,
  721. "location": {
  722. "type": "method",
  723. "class": "Ticket::Number::Date",
  724. "method": "Ticket::Number::Date.check"
  725. },
  726. "user_input": "Setting.get(\"system_id\")",
  727. "confidence": "Medium",
  728. "cwe_id": [
  729. 20,
  730. 185
  731. ],
  732. "note": "Admin configured RegExp"
  733. },
  734. {
  735. "warning_type": "Session Setting",
  736. "warning_code": 29,
  737. "fingerprint": "f0ee1cc1980474c82a013645508f002dcc801e00db5592f7dd8cd6bdb93c73fe",
  738. "check_name": "SessionSettings",
  739. "message": "Session secret should not be included in version control",
  740. "file": "config/secrets.yml",
  741. "line": 2,
  742. "link": "https://brakemanscanner.org/docs/warning_types/session_setting/",
  743. "code": null,
  744. "render_path": null,
  745. "location": null,
  746. "user_input": null,
  747. "confidence": "High",
  748. "cwe_id": [
  749. 798
  750. ],
  751. "note": "Since Sessions are stored in the database and not in cookies, the session secret is not used / not relevant.\""
  752. },
  753. {
  754. "warning_type": "Remote Code Execution",
  755. "warning_code": 24,
  756. "fingerprint": "fc299f57cedf226dc79a25c6bca84ceb85d5896a86820648d49c0e59d865575a",
  757. "check_name": "UnsafeReflection",
  758. "message": "Unsafe reflection method `constantize` called on model attribute",
  759. "file": "app/graphql/gql/resolvers/belongs_to_resolver.rb",
  760. "line": 18,
  761. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  762. "code": "ObjectLookup.by_id(object.send(field.through_key)).constantize",
  763. "render_path": null,
  764. "location": {
  765. "type": "method",
  766. "class": "Gql::Resolvers::BelongsToResolver",
  767. "method": "target_object_klass"
  768. },
  769. "user_input": "ObjectLookup.by_id(object.send(field.through_key))",
  770. "confidence": "Medium",
  771. "cwe_id": [
  772. 470
  773. ],
  774. "note": ""
  775. },
  776. {
  777. "warning_type": "SQL Injection",
  778. "warning_code": 0,
  779. "fingerprint": "fcad47a712a324ace0e97560767e5420500df03fd3de3057198800bdea5fd324",
  780. "check_name": "SQL",
  781. "message": "Possible SQL injection",
  782. "file": "lib/models.rb",
  783. "line": 171,
  784. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  785. "code": "model_class.where(\"#{reflection_value.name}_id\" => object_id)",
  786. "render_path": null,
  787. "location": {
  788. "type": "method",
  789. "class": "Models",
  790. "method": "s(:self).references"
  791. },
  792. "user_input": "reflection_value.name",
  793. "confidence": "Weak",
  794. "cwe_id": [
  795. 89
  796. ],
  797. "note": "Reflections come from the models themselves and are thus safe to use."
  798. },
  799. {
  800. "warning_type": "SQL Injection",
  801. "warning_code": 0,
  802. "fingerprint": "fcad47a712a324ace0e97560767e5420500df03fd3de3057198800bdea5fd324",
  803. "check_name": "SQL",
  804. "message": "Possible SQL injection",
  805. "file": "lib/models.rb",
  806. "line": 184,
  807. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  808. "code": "model_class.where(\"#{reflection_value.name}_id\" => object_id)",
  809. "render_path": null,
  810. "location": {
  811. "type": "method",
  812. "class": "Models",
  813. "method": "s(:self).references"
  814. },
  815. "user_input": "reflection_value.name",
  816. "confidence": "Weak",
  817. "cwe_id": [
  818. 89
  819. ],
  820. "note": "Reflections come from the models themselves and are thus safe to use."
  821. },
  822. {
  823. "warning_type": "Command Injection",
  824. "warning_code": 14,
  825. "fingerprint": "fe15417756eed2c518c355309ee042b57df5f88a5410858dce3fa9fe9c893b84",
  826. "check_name": "Execute",
  827. "message": "Possible command injection",
  828. "file": "lib/mysql_strategy.rb",
  829. "line": 54,
  830. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  831. "code": "system(\"mysql #{mysql_arguments} < #{backup_file}\", :exception => true)",
  832. "render_path": null,
  833. "location": {
  834. "type": "method",
  835. "class": "MysqlStrategy",
  836. "method": "s(:self).rollback"
  837. },
  838. "user_input": "mysql_arguments",
  839. "confidence": "Medium",
  840. "cwe_id": [
  841. 77
  842. ],
  843. "note": "Mysql arguments are internal / from config."
  844. },
  845. {
  846. "warning_type": "Denial of Service",
  847. "warning_code": 76,
  848. "fingerprint": "fe906d9ee6b37c92b7deec029d6a4cca47071006440817e4a50292b2ca956a30",
  849. "check_name": "RegexDoS",
  850. "message": "Model attribute used in regular expression",
  851. "file": "app/models/ticket.rb",
  852. "line": 1178,
  853. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  854. "code": "/#{Setting.get(\"send_no_auto_response_reg_exp\")}/i",
  855. "render_path": null,
  856. "location": {
  857. "type": "method",
  858. "class": "Ticket",
  859. "method": "send_email_notification"
  860. },
  861. "user_input": "Setting.get(\"send_no_auto_response_reg_exp\")",
  862. "confidence": "Medium",
  863. "cwe_id": [
  864. 20,
  865. 185
  866. ],
  867. "note": "Admin configured RegExp"
  868. }
  869. ],
  870. "updated": "2023-09-08 14:45:28 +0200",
  871. "brakeman_version": "6.0.1"
  872. }