闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

293 lines
15 KiB

  1. {
  2. "ignored_warnings": [
  3. {
  4. "warning_type": "Cross-Site Scripting",
  5. "warning_code": 4,
  6. "fingerprint": "0adbe361b91afff22ba51e5fc2275ec703cc13255a0cb3eecd8dab223ab9f61e",
  7. "check_name": "LinkToHref",
  8. "message": "Potentially unsafe model attribute in link_to href",
  9. "file": "app/views/admin/accounts/show.html.haml",
  10. "line": 143,
  11. "link": "http://brakemanscanner.org/docs/warning_types/link_to_href",
  12. "code": "link_to(Account.find(params[:id]).inbox_url, Account.find(params[:id]).inbox_url)",
  13. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  14. "location": {
  15. "type": "template",
  16. "template": "admin/accounts/show"
  17. },
  18. "user_input": "Account.find(params[:id]).inbox_url",
  19. "confidence": "Weak",
  20. "note": ""
  21. },
  22. {
  23. "warning_type": "Cross-Site Scripting",
  24. "warning_code": 4,
  25. "fingerprint": "1fc29c578d0c89bf13bd5476829d272d54cd06b92ccf6df18568fa1f2674926e",
  26. "check_name": "LinkToHref",
  27. "message": "Potentially unsafe model attribute in link_to href",
  28. "file": "app/views/admin/accounts/show.html.haml",
  29. "line": 149,
  30. "link": "http://brakemanscanner.org/docs/warning_types/link_to_href",
  31. "code": "link_to(Account.find(params[:id]).shared_inbox_url, Account.find(params[:id]).shared_inbox_url)",
  32. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  33. "location": {
  34. "type": "template",
  35. "template": "admin/accounts/show"
  36. },
  37. "user_input": "Account.find(params[:id]).shared_inbox_url",
  38. "confidence": "Weak",
  39. "note": ""
  40. },
  41. {
  42. "warning_type": "Cross-Site Scripting",
  43. "warning_code": 4,
  44. "fingerprint": "2129d4c1e63a351d28d8d2937ff0b50237809c3df6725c0c5ef82b881dbb2086",
  45. "check_name": "LinkToHref",
  46. "message": "Potentially unsafe model attribute in link_to href",
  47. "file": "app/views/admin/accounts/show.html.haml",
  48. "line": 54,
  49. "link": "http://brakemanscanner.org/docs/warning_types/link_to_href",
  50. "code": "link_to(Account.find(params[:id]).url, Account.find(params[:id]).url)",
  51. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  52. "location": {
  53. "type": "template",
  54. "template": "admin/accounts/show"
  55. },
  56. "user_input": "Account.find(params[:id]).url",
  57. "confidence": "Weak",
  58. "note": ""
  59. },
  60. {
  61. "warning_type": "Dynamic Render Path",
  62. "warning_code": 15,
  63. "fingerprint": "44d3f14e05d8fbb5b23e13ac02f15aa38b2a2f0f03b9ba76bab7f98e155a4a4e",
  64. "check_name": "Render",
  65. "message": "Render path contains parameter value",
  66. "file": "app/views/stream_entries/embed.html.haml",
  67. "line": 3,
  68. "link": "http://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  69. "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 })",
  70. "render_path": [{"type":"controller","class":"StatusesController","method":"embed","line":41,"file":"app/controllers/statuses_controller.rb"}],
  71. "location": {
  72. "type": "template",
  73. "template": "stream_entries/embed"
  74. },
  75. "user_input": "params[:id]",
  76. "confidence": "Weak",
  77. "note": ""
  78. },
  79. {
  80. "warning_type": "Dynamic Render Path",
  81. "warning_code": 15,
  82. "fingerprint": "4b6a895e2805578d03ceedbe1d469cc75a0c759eba093722523edb4b8683c873",
  83. "check_name": "Render",
  84. "message": "Render path contains parameter value",
  85. "file": "app/views/admin/action_logs/index.html.haml",
  86. "line": 5,
  87. "link": "http://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  88. "code": "render(action => Admin::ActionLog.page(params[:page]), {})",
  89. "render_path": [{"type":"controller","class":"Admin::ActionLogsController","method":"index","line":7,"file":"app/controllers/admin/action_logs_controller.rb"}],
  90. "location": {
  91. "type": "template",
  92. "template": "admin/action_logs/index"
  93. },
  94. "user_input": "params[:page]",
  95. "confidence": "Weak",
  96. "note": ""
  97. },
  98. {
  99. "warning_type": "Cross-Site Scripting",
  100. "warning_code": 4,
  101. "fingerprint": "64b5b2a02ede9c2b3598881eb5a466d63f7d27fe0946aa00d570111ec7338d2e",
  102. "check_name": "LinkToHref",
  103. "message": "Potentially unsafe model attribute in link_to href",
  104. "file": "app/views/admin/accounts/show.html.haml",
  105. "line": 152,
  106. "link": "http://brakemanscanner.org/docs/warning_types/link_to_href",
  107. "code": "link_to(Account.find(params[:id]).followers_url, Account.find(params[:id]).followers_url)",
  108. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  109. "location": {
  110. "type": "template",
  111. "template": "admin/accounts/show"
  112. },
  113. "user_input": "Account.find(params[:id]).followers_url",
  114. "confidence": "Weak",
  115. "note": ""
  116. },
  117. {
  118. "warning_type": "Cross-Site Scripting",
  119. "warning_code": 4,
  120. "fingerprint": "82f7b0d09beb3ab68e0fa16be63cedf4e820f2490326e9a1cec05761d92446cd",
  121. "check_name": "LinkToHref",
  122. "message": "Potentially unsafe model attribute in link_to href",
  123. "file": "app/views/admin/accounts/show.html.haml",
  124. "line": 127,
  125. "link": "http://brakemanscanner.org/docs/warning_types/link_to_href",
  126. "code": "link_to(Account.find(params[:id]).salmon_url, Account.find(params[:id]).salmon_url)",
  127. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  128. "location": {
  129. "type": "template",
  130. "template": "admin/accounts/show"
  131. },
  132. "user_input": "Account.find(params[:id]).salmon_url",
  133. "confidence": "Weak",
  134. "note": ""
  135. },
  136. {
  137. "warning_type": "Dynamic Render Path",
  138. "warning_code": 15,
  139. "fingerprint": "8d843713d99e8403f7992f3e72251b633817cf9076ffcbbad5613859d2bbc127",
  140. "check_name": "Render",
  141. "message": "Render path contains parameter value",
  142. "file": "app/views/admin/custom_emojis/index.html.haml",
  143. "line": 31,
  144. "link": "http://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  145. "code": "render(action => filtered_custom_emojis.eager_load(:local_counterpart).page(params[:page]), {})",
  146. "render_path": [{"type":"controller","class":"Admin::CustomEmojisController","method":"index","line":10,"file":"app/controllers/admin/custom_emojis_controller.rb"}],
  147. "location": {
  148. "type": "template",
  149. "template": "admin/custom_emojis/index"
  150. },
  151. "user_input": "params[:page]",
  152. "confidence": "Weak",
  153. "note": ""
  154. },
  155. {
  156. "warning_type": "SQL Injection",
  157. "warning_code": 0,
  158. "fingerprint": "9ccb9ba6a6947400e187d515e0bf719d22993d37cfc123c824d7fafa6caa9ac3",
  159. "check_name": "SQL",
  160. "message": "Possible SQL injection",
  161. "file": "lib/mastodon/snowflake.rb",
  162. "line": 87,
  163. "link": "http://brakemanscanner.org/docs/warning_types/sql_injection/",
  164. "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\")",
  165. "render_path": null,
  166. "location": {
  167. "type": "method",
  168. "class": "Mastodon::Snowflake",
  169. "method": "define_timestamp_id"
  170. },
  171. "user_input": "SecureRandom.hex(16)",
  172. "confidence": "Medium",
  173. "note": ""
  174. },
  175. {
  176. "warning_type": "Dynamic Render Path",
  177. "warning_code": 15,
  178. "fingerprint": "9f31d941f3910dba2e9bfcd81aef4513249bd24c02d0f98e13ad44fdeeccd0e8",
  179. "check_name": "Render",
  180. "message": "Render path contains parameter value",
  181. "file": "app/views/admin/accounts/index.html.haml",
  182. "line": 64,
  183. "link": "http://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  184. "code": "render(action => filtered_accounts.page(params[:page]), {})",
  185. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"index","line":12,"file":"app/controllers/admin/accounts_controller.rb"}],
  186. "location": {
  187. "type": "template",
  188. "template": "admin/accounts/index"
  189. },
  190. "user_input": "params[:page]",
  191. "confidence": "Weak",
  192. "note": ""
  193. },
  194. {
  195. "warning_type": "Cross-Site Scripting",
  196. "warning_code": 4,
  197. "fingerprint": "bb0ad5c4a42e06e3846c2089ff5269c17f65483a69414f6ce65eecf2bb11fab7",
  198. "check_name": "LinkToHref",
  199. "message": "Potentially unsafe model attribute in link_to href",
  200. "file": "app/views/admin/accounts/show.html.haml",
  201. "line": 116,
  202. "link": "http://brakemanscanner.org/docs/warning_types/link_to_href",
  203. "code": "link_to(Account.find(params[:id]).remote_url, Account.find(params[:id]).remote_url)",
  204. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  205. "location": {
  206. "type": "template",
  207. "template": "admin/accounts/show"
  208. },
  209. "user_input": "Account.find(params[:id]).remote_url",
  210. "confidence": "Weak",
  211. "note": ""
  212. },
  213. {
  214. "warning_type": "Redirect",
  215. "warning_code": 18,
  216. "fingerprint": "bb7e94e60af41decb811bb32171f1b27e9bf3f4d01e9e511127362e22510eb11",
  217. "check_name": "Redirect",
  218. "message": "Possible unprotected redirect",
  219. "file": "app/controllers/remote_follow_controller.rb",
  220. "line": 18,
  221. "link": "http://brakemanscanner.org/docs/warning_types/redirect/",
  222. "code": "redirect_to(RemoteFollow.new(resource_params).subscribe_address_for(Account.find_local!(params[:account_username])))",
  223. "render_path": null,
  224. "location": {
  225. "type": "method",
  226. "class": "RemoteFollowController",
  227. "method": "create"
  228. },
  229. "user_input": "RemoteFollow.new(resource_params).subscribe_address_for(Account.find_local!(params[:account_username]))",
  230. "confidence": "High",
  231. "note": ""
  232. },
  233. {
  234. "warning_type": "Dynamic Render Path",
  235. "warning_code": 15,
  236. "fingerprint": "c5d6945d63264af106d49367228d206aa2f176699ecdce2b98fac101bc6a96cf",
  237. "check_name": "Render",
  238. "message": "Render path contains parameter value",
  239. "file": "app/views/admin/reports/index.html.haml",
  240. "line": 25,
  241. "link": "http://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  242. "code": "render(action => filtered_reports.page(params[:page]), {})",
  243. "render_path": [{"type":"controller","class":"Admin::ReportsController","method":"index","line":10,"file":"app/controllers/admin/reports_controller.rb"}],
  244. "location": {
  245. "type": "template",
  246. "template": "admin/reports/index"
  247. },
  248. "user_input": "params[:page]",
  249. "confidence": "Weak",
  250. "note": ""
  251. },
  252. {
  253. "warning_type": "Cross-Site Scripting",
  254. "warning_code": 4,
  255. "fingerprint": "e04aafe1e06cf8317fb6ac0a7f35783e45aa1274272ee6eaf28d39adfdad489b",
  256. "check_name": "LinkToHref",
  257. "message": "Potentially unsafe model attribute in link_to href",
  258. "file": "app/views/admin/accounts/show.html.haml",
  259. "line": 146,
  260. "link": "http://brakemanscanner.org/docs/warning_types/link_to_href",
  261. "code": "link_to(Account.find(params[:id]).outbox_url, Account.find(params[:id]).outbox_url)",
  262. "render_path": [{"type":"controller","class":"Admin::AccountsController","method":"show","line":18,"file":"app/controllers/admin/accounts_controller.rb"}],
  263. "location": {
  264. "type": "template",
  265. "template": "admin/accounts/show"
  266. },
  267. "user_input": "Account.find(params[:id]).outbox_url",
  268. "confidence": "Weak",
  269. "note": ""
  270. },
  271. {
  272. "warning_type": "Dynamic Render Path",
  273. "warning_code": 15,
  274. "fingerprint": "fbd0fc59adb5c6d44b60e02debb31d3af11719f534c9881e21435bbff87404d6",
  275. "check_name": "Render",
  276. "message": "Render path contains parameter value",
  277. "file": "app/views/stream_entries/show.html.haml",
  278. "line": 21,
  279. "link": "http://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  280. "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 }) })",
  281. "render_path": [{"type":"controller","class":"StatusesController","method":"show","line":20,"file":"app/controllers/statuses_controller.rb"}],
  282. "location": {
  283. "type": "template",
  284. "template": "stream_entries/show"
  285. },
  286. "user_input": "params[:id]",
  287. "confidence": "Weak",
  288. "note": ""
  289. }
  290. ],
  291. "updated": "2017-11-19 20:34:18 +0100",
  292. "brakeman_version": "4.0.1"
  293. }