brakeman.ignore 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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": 113,
  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": "SQL Injection",
  25. "warning_code": 0,
  26. "fingerprint": "19df3740b8d02a9fe0eb52c939b4b87d3a2a591162a6adfa8d64e9c26aeebe6d",
  27. "check_name": "SQL",
  28. "message": "Possible SQL injection",
  29. "file": "app/models/status.rb",
  30. "line": 100,
  31. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  32. "code": "result.joins(\"INNER JOIN statuses_tags t#{id} ON t#{id}.status_id = statuses.id AND t#{id}.tag_id = #{id}\")",
  33. "render_path": null,
  34. "location": {
  35. "type": "method",
  36. "class": "Status",
  37. "method": null
  38. },
  39. "user_input": "id",
  40. "confidence": "Weak",
  41. "note": ""
  42. },
  43. {
  44. "warning_type": "Redirect",
  45. "warning_code": 18,
  46. "fingerprint": "5fad11cd67f905fab9b1d5739d01384a1748ebe78c5af5ac31518201925265a7",
  47. "check_name": "Redirect",
  48. "message": "Possible unprotected redirect",
  49. "file": "app/controllers/remote_interaction_controller.rb",
  50. "line": 24,
  51. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  52. "code": "redirect_to(RemoteFollow.new(resource_params).interact_address_for(Status.find(params[:id])))",
  53. "render_path": null,
  54. "location": {
  55. "type": "method",
  56. "class": "RemoteInteractionController",
  57. "method": "create"
  58. },
  59. "user_input": "RemoteFollow.new(resource_params).interact_address_for(Status.find(params[:id]))",
  60. "confidence": "High",
  61. "note": ""
  62. },
  63. {
  64. "warning_type": "Mass Assignment",
  65. "warning_code": 105,
  66. "fingerprint": "7631e93d0099506e7c3e5c91ba8d88523b00a41a0834ae30031a5a4e8bb3020a",
  67. "check_name": "PermitAttributes",
  68. "message": "Potentially dangerous key allowed for mass assignment",
  69. "file": "app/controllers/api/v2/search_controller.rb",
  70. "line": 28,
  71. "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
  72. "code": "params.permit(:type, :offset, :min_id, :max_id, :account_id)",
  73. "render_path": null,
  74. "location": {
  75. "type": "method",
  76. "class": "Api::V2::SearchController",
  77. "method": "search_params"
  78. },
  79. "user_input": ":account_id",
  80. "confidence": "High",
  81. "note": ""
  82. },
  83. {
  84. "warning_type": "Mass Assignment",
  85. "warning_code": 105,
  86. "fingerprint": "874be88fedf4c680926845e9a588d3197765a6ccbfdd76466b44cc00151c612e",
  87. "check_name": "PermitAttributes",
  88. "message": "Potentially dangerous key allowed for mass assignment",
  89. "file": "app/controllers/api/v1/admin/reports_controller.rb",
  90. "line": 78,
  91. "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
  92. "code": "params.permit(:resolved, :account_id, :target_account_id)",
  93. "render_path": null,
  94. "location": {
  95. "type": "method",
  96. "class": "Api::V1::Admin::ReportsController",
  97. "method": "filter_params"
  98. },
  99. "user_input": ":account_id",
  100. "confidence": "High",
  101. "note": ""
  102. },
  103. {
  104. "warning_type": "SQL Injection",
  105. "warning_code": 0,
  106. "fingerprint": "9ccb9ba6a6947400e187d515e0bf719d22993d37cfc123c824d7fafa6caa9ac3",
  107. "check_name": "SQL",
  108. "message": "Possible SQL injection",
  109. "file": "lib/mastodon/snowflake.rb",
  110. "line": 87,
  111. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  112. "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\")",
  113. "render_path": null,
  114. "location": {
  115. "type": "method",
  116. "class": "Mastodon::Snowflake",
  117. "method": "define_timestamp_id"
  118. },
  119. "user_input": "SecureRandom.hex(16)",
  120. "confidence": "Medium",
  121. "note": ""
  122. },
  123. {
  124. "warning_type": "Redirect",
  125. "warning_code": 18,
  126. "fingerprint": "ba568ac09683f98740f663f3d850c31785900215992e8c090497d359a2563d50",
  127. "check_name": "Redirect",
  128. "message": "Possible unprotected redirect",
  129. "file": "app/controllers/remote_follow_controller.rb",
  130. "line": 21,
  131. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  132. "code": "redirect_to(RemoteFollow.new(resource_params).subscribe_address_for(@account))",
  133. "render_path": null,
  134. "location": {
  135. "type": "method",
  136. "class": "RemoteFollowController",
  137. "method": "create"
  138. },
  139. "user_input": "RemoteFollow.new(resource_params).subscribe_address_for(@account)",
  140. "confidence": "High",
  141. "note": ""
  142. },
  143. {
  144. "warning_type": "Redirect",
  145. "warning_code": 18,
  146. "fingerprint": "ba699ddcc6552c422c4ecd50d2cd217f616a2446659e185a50b05a0f2dad8d33",
  147. "check_name": "Redirect",
  148. "message": "Possible unprotected redirect",
  149. "file": "app/controllers/media_controller.rb",
  150. "line": 20,
  151. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  152. "code": "redirect_to(MediaAttachment.attached.find_by!(:shortcode => ((params[:id] or params[:medium_id]))).file.url(:original))",
  153. "render_path": null,
  154. "location": {
  155. "type": "method",
  156. "class": "MediaController",
  157. "method": "show"
  158. },
  159. "user_input": "MediaAttachment.attached.find_by!(:shortcode => ((params[:id] or params[:medium_id]))).file.url(:original)",
  160. "confidence": "High",
  161. "note": ""
  162. },
  163. {
  164. "warning_type": "Mass Assignment",
  165. "warning_code": 105,
  166. "fingerprint": "e867661b2c9812bc8b75a5df12b28e2a53ab97015de0638b4e732fe442561b28",
  167. "check_name": "PermitAttributes",
  168. "message": "Potentially dangerous key allowed for mass assignment",
  169. "file": "app/controllers/api/v1/reports_controller.rb",
  170. "line": 36,
  171. "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
  172. "code": "params.permit(:account_id, :comment, :forward, :status_ids => ([]))",
  173. "render_path": null,
  174. "location": {
  175. "type": "method",
  176. "class": "Api::V1::ReportsController",
  177. "method": "report_params"
  178. },
  179. "user_input": ":account_id",
  180. "confidence": "High",
  181. "note": ""
  182. }
  183. ],
  184. "updated": "2021-05-11 20:22:27 +0900",
  185. "brakeman_version": "5.0.1"
  186. }