brakeman.ignore 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. {
  2. "ignored_warnings": [
  3. {
  4. "warning_type": "SQL Injection",
  5. "warning_code": 0,
  6. "fingerprint": "04dbbc249b989db2e0119bbb0f59c9818e12889d2b97c529cdc0b1526002ba4b",
  7. "check_name": "SQL",
  8. "message": "Possible SQL injection",
  9. "file": "app/models/report.rb",
  10. "line": 90,
  11. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  12. "code": "Admin::ActionLog.from(\"(#{[Admin::ActionLog.where(:target_type => \"Report\", :target_id => id, :created_at => ((created_at..updated_at))).unscope(:order), Admin::ActionLog.where(:target_type => \"Account\", :target_id => target_account_id, :created_at => ((created_at..updated_at))).unscope(:order), Admin::ActionLog.where(:target_type => \"Status\", :target_id => status_ids, :created_at => ((created_at..updated_at))).unscope(:order)].map do\n \"(#{query.to_sql})\"\n end.join(\" UNION ALL \")}) AS admin_action_logs\")",
  13. "render_path": null,
  14. "location": {
  15. "type": "method",
  16. "class": "Report",
  17. "method": "history"
  18. },
  19. "user_input": "Admin::ActionLog.where(:target_type => \"Status\", :target_id => status_ids, :created_at => ((created_at..updated_at))).unscope(:order)",
  20. "confidence": "High",
  21. "note": ""
  22. },
  23. {
  24. "warning_type": "Cross-Site Scripting",
  25. "warning_code": 4,
  26. "fingerprint": "0adbe361b91afff22ba51e5fc2275ec703cc13255a0cb3eecd8dab223ab9f61e",
  27. "check_name": "LinkToHref",
  28. "message": "Potentially unsafe model attribute in link_to href",
  29. "file": "app/views/admin/accounts/show.html.haml",
  30. "line": 167,
  31. "link": "https://brakemanscanner.org/docs/warning_types/link_to_href",
  32. "code": "link_to(Account.find(params[:id]).inbox_url, Account.find(params[:id]).inbox_url)",
  33. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  34. "location": {
  35. "type": "template",
  36. "template": "admin/accounts/show"
  37. },
  38. "user_input": "Account.find(params[:id]).inbox_url",
  39. "confidence": "Weak",
  40. "note": ""
  41. },
  42. {
  43. "warning_type": "SQL Injection",
  44. "warning_code": 0,
  45. "fingerprint": "19df3740b8d02a9fe0eb52c939b4b87d3a2a591162a6adfa8d64e9c26aeebe6d",
  46. "check_name": "SQL",
  47. "message": "Possible SQL injection",
  48. "file": "app/models/status.rb",
  49. "line": 84,
  50. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  51. "code": "result.joins(\"INNER JOIN statuses_tags t#{id} ON t#{id}.status_id = statuses.id AND t#{id}.tag_id = #{id}\")",
  52. "render_path": null,
  53. "location": {
  54. "type": "method",
  55. "class": "Status",
  56. "method": null
  57. },
  58. "user_input": "id",
  59. "confidence": "Weak",
  60. "note": ""
  61. },
  62. {
  63. "warning_type": "Cross-Site Scripting",
  64. "warning_code": 4,
  65. "fingerprint": "1fc29c578d0c89bf13bd5476829d272d54cd06b92ccf6df18568fa1f2674926e",
  66. "check_name": "LinkToHref",
  67. "message": "Potentially unsafe model attribute in link_to href",
  68. "file": "app/views/admin/accounts/show.html.haml",
  69. "line": 173,
  70. "link": "https://brakemanscanner.org/docs/warning_types/link_to_href",
  71. "code": "link_to(Account.find(params[:id]).shared_inbox_url, Account.find(params[:id]).shared_inbox_url)",
  72. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  73. "location": {
  74. "type": "template",
  75. "template": "admin/accounts/show"
  76. },
  77. "user_input": "Account.find(params[:id]).shared_inbox_url",
  78. "confidence": "Weak",
  79. "note": ""
  80. },
  81. {
  82. "warning_type": "Cross-Site Scripting",
  83. "warning_code": 4,
  84. "fingerprint": "2129d4c1e63a351d28d8d2937ff0b50237809c3df6725c0c5ef82b881dbb2086",
  85. "check_name": "LinkToHref",
  86. "message": "Potentially unsafe model attribute in link_to href",
  87. "file": "app/views/admin/accounts/show.html.haml",
  88. "line": 75,
  89. "link": "https://brakemanscanner.org/docs/warning_types/link_to_href",
  90. "code": "link_to(Account.find(params[:id]).url, Account.find(params[:id]).url)",
  91. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  92. "location": {
  93. "type": "template",
  94. "template": "admin/accounts/show"
  95. },
  96. "user_input": "Account.find(params[:id]).url",
  97. "confidence": "Weak",
  98. "note": ""
  99. },
  100. {
  101. "warning_type": "Mass Assignment",
  102. "warning_code": 105,
  103. "fingerprint": "28d81cc22580ef76e912b077b245f353499aa27b3826476667224c00227af2a9",
  104. "check_name": "PermitAttributes",
  105. "message": "Potentially dangerous key allowed for mass assignment",
  106. "file": "app/controllers/admin/reports_controller.rb",
  107. "line": 80,
  108. "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
  109. "code": "params.permit(:account_id, :resolved, :target_account_id)",
  110. "render_path": null,
  111. "location": {
  112. "type": "method",
  113. "class": "Admin::ReportsController",
  114. "method": "filter_params"
  115. },
  116. "user_input": ":account_id",
  117. "confidence": "High",
  118. "note": ""
  119. },
  120. {
  121. "warning_type": "Dynamic Render Path",
  122. "warning_code": 15,
  123. "fingerprint": "4b6a895e2805578d03ceedbe1d469cc75a0c759eba093722523edb4b8683c873",
  124. "check_name": "Render",
  125. "message": "Render path contains parameter value",
  126. "file": "app/views/admin/action_logs/index.html.haml",
  127. "line": 4,
  128. "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  129. "code": "render(action => Admin::ActionLog.page(params[:page]), {})",
  130. "render_path": [{"type":"controller","class":"Admin::ActionLogsController","method":"index","line":7,"file":"app/controllers/admin/action_logs_controller.rb"}],
  131. "location": {
  132. "type": "template",
  133. "template": "admin/action_logs/index"
  134. },
  135. "user_input": "params[:page]",
  136. "confidence": "Weak",
  137. "note": ""
  138. },
  139. {
  140. "warning_type": "Redirect",
  141. "warning_code": 18,
  142. "fingerprint": "5fad11cd67f905fab9b1d5739d01384a1748ebe78c5af5ac31518201925265a7",
  143. "check_name": "Redirect",
  144. "message": "Possible unprotected redirect",
  145. "file": "app/controllers/remote_interaction_controller.rb",
  146. "line": 20,
  147. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  148. "code": "redirect_to(RemoteFollow.new(resource_params).interact_address_for(Status.find(params[:id])))",
  149. "render_path": null,
  150. "location": {
  151. "type": "method",
  152. "class": "RemoteInteractionController",
  153. "method": "create"
  154. },
  155. "user_input": "RemoteFollow.new(resource_params).interact_address_for(Status.find(params[:id]))",
  156. "confidence": "High",
  157. "note": ""
  158. },
  159. {
  160. "warning_type": "Cross-Site Scripting",
  161. "warning_code": 4,
  162. "fingerprint": "64b5b2a02ede9c2b3598881eb5a466d63f7d27fe0946aa00d570111ec7338d2e",
  163. "check_name": "LinkToHref",
  164. "message": "Potentially unsafe model attribute in link_to href",
  165. "file": "app/views/admin/accounts/show.html.haml",
  166. "line": 176,
  167. "link": "https://brakemanscanner.org/docs/warning_types/link_to_href",
  168. "code": "link_to(Account.find(params[:id]).followers_url, Account.find(params[:id]).followers_url)",
  169. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  170. "location": {
  171. "type": "template",
  172. "template": "admin/accounts/show"
  173. },
  174. "user_input": "Account.find(params[:id]).followers_url",
  175. "confidence": "Weak",
  176. "note": ""
  177. },
  178. {
  179. "warning_type": "Dynamic Render Path",
  180. "warning_code": 15,
  181. "fingerprint": "67afc0d5f7775fa5bd91d1912e1b5505aeedef61876347546fa20f92fd6915e6",
  182. "check_name": "Render",
  183. "message": "Render path contains parameter value",
  184. "file": "app/views/stream_entries/embed.html.haml",
  185. "line": 3,
  186. "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  187. "code": "render(action => \"stream_entries/#{Account.find_local!(params[:account_username]).statuses.find(params[:id]).stream_entry.activity_type.downcase}\", { Account.find_local!(params[:account_username]).statuses.find(params[:id]).stream_entry.activity_type.downcase.to_sym => Account.find_local!(params[:account_username]).statuses.find(params[:id]).stream_entry.activity, :centered => true, :autoplay => ActiveModel::Type::Boolean.new.cast(params[:autoplay]) })",
  188. "render_path": [{"type":"controller","class":"StatusesController","method":"embed","line":59,"file":"app/controllers/statuses_controller.rb"}],
  189. "location": {
  190. "type": "template",
  191. "template": "stream_entries/embed"
  192. },
  193. "user_input": "params[:id]",
  194. "confidence": "Weak",
  195. "note": ""
  196. },
  197. {
  198. "warning_type": "SQL Injection",
  199. "warning_code": 0,
  200. "fingerprint": "6f075c1484908e3ec9bed21ab7cf3c7866be8da3881485d1c82e13093aefcbd7",
  201. "check_name": "SQL",
  202. "message": "Possible SQL injection",
  203. "file": "app/models/status.rb",
  204. "line": 89,
  205. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  206. "code": "result.joins(\"LEFT OUTER JOIN statuses_tags t#{id} ON t#{id}.status_id = statuses.id AND t#{id}.tag_id = #{id}\")",
  207. "render_path": null,
  208. "location": {
  209. "type": "method",
  210. "class": "Status",
  211. "method": null
  212. },
  213. "user_input": "id",
  214. "confidence": "Weak",
  215. "note": ""
  216. },
  217. {
  218. "warning_type": "Cross-Site Scripting",
  219. "warning_code": 4,
  220. "fingerprint": "82f7b0d09beb3ab68e0fa16be63cedf4e820f2490326e9a1cec05761d92446cd",
  221. "check_name": "LinkToHref",
  222. "message": "Potentially unsafe model attribute in link_to href",
  223. "file": "app/views/admin/accounts/show.html.haml",
  224. "line": 149,
  225. "link": "https://brakemanscanner.org/docs/warning_types/link_to_href",
  226. "code": "link_to(Account.find(params[:id]).salmon_url, Account.find(params[:id]).salmon_url)",
  227. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  228. "location": {
  229. "type": "template",
  230. "template": "admin/accounts/show"
  231. },
  232. "user_input": "Account.find(params[:id]).salmon_url",
  233. "confidence": "Weak",
  234. "note": ""
  235. },
  236. {
  237. "warning_type": "Dynamic Render Path",
  238. "warning_code": 15,
  239. "fingerprint": "8d843713d99e8403f7992f3e72251b633817cf9076ffcbbad5613859d2bbc127",
  240. "check_name": "Render",
  241. "message": "Render path contains parameter value",
  242. "file": "app/views/admin/custom_emojis/index.html.haml",
  243. "line": 45,
  244. "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  245. "code": "render(action => filtered_custom_emojis.eager_load(:local_counterpart).page(params[:page]), {})",
  246. "render_path": [{"type":"controller","class":"Admin::CustomEmojisController","method":"index","line":11,"file":"app/controllers/admin/custom_emojis_controller.rb"}],
  247. "location": {
  248. "type": "template",
  249. "template": "admin/custom_emojis/index"
  250. },
  251. "user_input": "params[:page]",
  252. "confidence": "Weak",
  253. "note": ""
  254. },
  255. {
  256. "warning_type": "SQL Injection",
  257. "warning_code": 0,
  258. "fingerprint": "9ccb9ba6a6947400e187d515e0bf719d22993d37cfc123c824d7fafa6caa9ac3",
  259. "check_name": "SQL",
  260. "message": "Possible SQL injection",
  261. "file": "lib/mastodon/snowflake.rb",
  262. "line": 87,
  263. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  264. "code": "connection.execute(\" CREATE OR REPLACE FUNCTION timestamp_id(table_name text)\\n RETURNS bigint AS\\n $$\\n DECLARE\\n time_part bigint;\\n sequence_base bigint;\\n tail bigint;\\n BEGIN\\n time_part := (\\n -- Get the time in milliseconds\\n ((date_part('epoch', now()) * 1000))::bigint\\n -- And shift it over two bytes\\n << 16);\\n\\n sequence_base := (\\n 'x' ||\\n -- Take the first two bytes (four hex characters)\\n substr(\\n -- Of the MD5 hash of the data we documented\\n md5(table_name ||\\n '#{SecureRandom.hex(16)}' ||\\n time_part::text\\n ),\\n 1, 4\\n )\\n -- And turn it into a bigint\\n )::bit(16)::bigint;\\n\\n -- Finally, add our sequence number to our base, and chop\\n -- it to the last two bytes\\n tail := (\\n (sequence_base + nextval(table_name || '_id_seq'))\\n & 65535);\\n\\n -- Return the time part and the sequence part. OR appears\\n -- faster here than addition, but they're equivalent:\\n -- time_part has no trailing two bytes, and tail is only\\n -- the last two bytes.\\n RETURN time_part | tail;\\n END\\n $$ LANGUAGE plpgsql VOLATILE;\\n\")",
  265. "render_path": null,
  266. "location": {
  267. "type": "method",
  268. "class": "Mastodon::Snowflake",
  269. "method": "define_timestamp_id"
  270. },
  271. "user_input": "SecureRandom.hex(16)",
  272. "confidence": "Medium",
  273. "note": ""
  274. },
  275. {
  276. "warning_type": "Dynamic Render Path",
  277. "warning_code": 15,
  278. "fingerprint": "9f31d941f3910dba2e9bfcd81aef4513249bd24c02d0f98e13ad44fdeeccd0e8",
  279. "check_name": "Render",
  280. "message": "Render path contains parameter value",
  281. "file": "app/views/admin/accounts/index.html.haml",
  282. "line": 67,
  283. "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  284. "code": "render(action => filtered_accounts.page(params[:page]), {})",
  285. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"index","line":12,"file":"app/controllers/admin/accounts_controller.rb"}],
  286. "location": {
  287. "type": "template",
  288. "template": "admin/accounts/index"
  289. },
  290. "user_input": "params[:page]",
  291. "confidence": "Weak",
  292. "note": ""
  293. },
  294. {
  295. "warning_type": "Redirect",
  296. "warning_code": 18,
  297. "fingerprint": "ba699ddcc6552c422c4ecd50d2cd217f616a2446659e185a50b05a0f2dad8d33",
  298. "check_name": "Redirect",
  299. "message": "Possible unprotected redirect",
  300. "file": "app/controllers/media_controller.rb",
  301. "line": 10,
  302. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  303. "code": "redirect_to(MediaAttachment.attached.find_by!(:shortcode => ((params[:id] or params[:medium_id]))).file.url(:original))",
  304. "render_path": null,
  305. "location": {
  306. "type": "method",
  307. "class": "MediaController",
  308. "method": "show"
  309. },
  310. "user_input": "MediaAttachment.attached.find_by!(:shortcode => ((params[:id] or params[:medium_id]))).file.url(:original)",
  311. "confidence": "High",
  312. "note": ""
  313. },
  314. {
  315. "warning_type": "Cross-Site Scripting",
  316. "warning_code": 4,
  317. "fingerprint": "bb0ad5c4a42e06e3846c2089ff5269c17f65483a69414f6ce65eecf2bb11fab7",
  318. "check_name": "LinkToHref",
  319. "message": "Potentially unsafe model attribute in link_to href",
  320. "file": "app/views/admin/accounts/show.html.haml",
  321. "line": 138,
  322. "link": "https://brakemanscanner.org/docs/warning_types/link_to_href",
  323. "code": "link_to(Account.find(params[:id]).remote_url, Account.find(params[:id]).remote_url)",
  324. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  325. "location": {
  326. "type": "template",
  327. "template": "admin/accounts/show"
  328. },
  329. "user_input": "Account.find(params[:id]).remote_url",
  330. "confidence": "Weak",
  331. "note": ""
  332. },
  333. {
  334. "warning_type": "Redirect",
  335. "warning_code": 18,
  336. "fingerprint": "bb7e94e60af41decb811bb32171f1b27e9bf3f4d01e9e511127362e22510eb11",
  337. "check_name": "Redirect",
  338. "message": "Possible unprotected redirect",
  339. "file": "app/controllers/remote_follow_controller.rb",
  340. "line": 19,
  341. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  342. "code": "redirect_to(RemoteFollow.new(resource_params).subscribe_address_for(Account.find_local!(params[:account_username])))",
  343. "render_path": null,
  344. "location": {
  345. "type": "method",
  346. "class": "RemoteFollowController",
  347. "method": "create"
  348. },
  349. "user_input": "RemoteFollow.new(resource_params).subscribe_address_for(Account.find_local!(params[:account_username]))",
  350. "confidence": "High",
  351. "note": ""
  352. },
  353. {
  354. "warning_type": "Cross-Site Scripting",
  355. "warning_code": 4,
  356. "fingerprint": "e04aafe1e06cf8317fb6ac0a7f35783e45aa1274272ee6eaf28d39adfdad489b",
  357. "check_name": "LinkToHref",
  358. "message": "Potentially unsafe model attribute in link_to href",
  359. "file": "app/views/admin/accounts/show.html.haml",
  360. "line": 170,
  361. "link": "https://brakemanscanner.org/docs/warning_types/link_to_href",
  362. "code": "link_to(Account.find(params[:id]).outbox_url, Account.find(params[:id]).outbox_url)",
  363. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  364. "location": {
  365. "type": "template",
  366. "template": "admin/accounts/show"
  367. },
  368. "user_input": "Account.find(params[:id]).outbox_url",
  369. "confidence": "Weak",
  370. "note": ""
  371. },
  372. {
  373. "warning_type": "Mass Assignment",
  374. "warning_code": 105,
  375. "fingerprint": "e867661b2c9812bc8b75a5df12b28e2a53ab97015de0638b4e732fe442561b28",
  376. "check_name": "PermitAttributes",
  377. "message": "Potentially dangerous key allowed for mass assignment",
  378. "file": "app/controllers/api/v1/reports_controller.rb",
  379. "line": 37,
  380. "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
  381. "code": "params.permit(:account_id, :comment, :forward, :status_ids => ([]))",
  382. "render_path": null,
  383. "location": {
  384. "type": "method",
  385. "class": "Api::V1::ReportsController",
  386. "method": "report_params"
  387. },
  388. "user_input": ":account_id",
  389. "confidence": "High",
  390. "note": ""
  391. },
  392. {
  393. "warning_type": "Dynamic Render Path",
  394. "warning_code": 15,
  395. "fingerprint": "fbd0fc59adb5c6d44b60e02debb31d3af11719f534c9881e21435bbff87404d6",
  396. "check_name": "Render",
  397. "message": "Render path contains parameter value",
  398. "file": "app/views/stream_entries/show.html.haml",
  399. "line": 23,
  400. "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  401. "code": "render(partial => \"stream_entries/#{Account.find_local!(params[:account_username]).statuses.find(params[:id]).stream_entry.activity_type.downcase}\", { :locals => ({ Account.find_local!(params[:account_username]).statuses.find(params[:id]).stream_entry.activity_type.downcase.to_sym => Account.find_local!(params[:account_username]).statuses.find(params[:id]).stream_entry.activity, :include_threads => true }) })",
  402. "render_path": [{"type":"controller","class":"StatusesController","method":"show","line":30,"file":"app/controllers/statuses_controller.rb"}],
  403. "location": {
  404. "type": "template",
  405. "template": "stream_entries/show"
  406. },
  407. "user_input": "params[:id]",
  408. "confidence": "Weak",
  409. "note": ""
  410. }
  411. ],
  412. "updated": "2018-10-20 23:24:45 +1300",
  413. "brakeman_version": "4.2.1"
  414. }