about summary refs log tree commit diff
path: root/config/brakeman.ignore
blob: baa993c78ad9161eeb67ba72f2a1a4890413d0a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
{
  "ignored_warnings": [
    {
      "warning_type": "SQL Injection",
      "warning_code": 0,
      "fingerprint": "04dbbc249b989db2e0119bbb0f59c9818e12889d2b97c529cdc0b1526002ba4b",
      "check_name": "SQL",
      "message": "Possible SQL injection",
      "file": "app/models/report.rb",
      "line": 112,
      "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
      "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\")",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "Report",
        "method": "history"
      },
      "user_input": "Admin::ActionLog.where(:target_type => \"Status\", :target_id => status_ids, :created_at => ((created_at..updated_at))).unscope(:order)",
      "confidence": "High",
      "note": ""
    },
    {
      "warning_type": "SQL Injection",
      "warning_code": 0,
      "fingerprint": "19df3740b8d02a9fe0eb52c939b4b87d3a2a591162a6adfa8d64e9c26aeebe6d",
      "check_name": "SQL",
      "message": "Possible SQL injection",
      "file": "app/models/status.rb",
      "line": 100,
      "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
      "code": "result.joins(\"INNER JOIN statuses_tags t#{id} ON t#{id}.status_id = statuses.id AND t#{id}.tag_id = #{id}\")",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "Status",
        "method": null
      },
      "user_input": "id",
      "confidence": "Weak",
      "note": ""
    },
    {
      "warning_type": "Dynamic Render Path",
      "warning_code": 15,
      "fingerprint": "20a660939f2bbf8c665e69f2844031c0564524689a9570a0091ed94846212020",
      "check_name": "Render",
      "message": "Render path contains parameter value",
      "file": "app/views/admin/action_logs/index.html.haml",
      "line": 26,
      "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
      "code": "render(action => Admin::ActionLogFilter.new(filter_params).results.page(params[:page]), {})",
      "render_path": [
        {
          "type": "controller",
          "class": "Admin::ActionLogsController",
          "method": "index",
          "line": 8,
          "file": "app/controllers/admin/action_logs_controller.rb",
          "rendered": {
            "name": "admin/action_logs/index",
            "file": "app/views/admin/action_logs/index.html.haml"
          }
        }
      ],
      "location": {
        "type": "template",
        "template": "admin/action_logs/index"
      },
      "user_input": "params[:page]",
      "confidence": "Weak",
      "note": ""
    },
    {
      "warning_type": "Dynamic Render Path",
      "warning_code": 15,
      "fingerprint": "371fe16dc4c9d6ab08a20437d65be4825776107a67c38f6d4780a9c703cd44a5",
      "check_name": "Render",
      "message": "Render path contains parameter value",
      "file": "app/views/admin/email_domain_blocks/index.html.haml",
      "line": 17,
      "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
      "code": "render(action => EmailDomainBlock.where(:parent_id => nil).includes(:children).order(:id => :desc).page(params[:page]), {})",
      "render_path": [
        {
          "type": "controller",
          "class": "Admin::EmailDomainBlocksController",
          "method": "index",
          "line": 10,
          "file": "app/controllers/admin/email_domain_blocks_controller.rb",
          "rendered": {
            "name": "admin/email_domain_blocks/index",
            "file": "app/views/admin/email_domain_blocks/index.html.haml"
          }
        }
      ],
      "location": {
        "type": "template",
        "template": "admin/email_domain_blocks/index"
      },
      "user_input": "params[:page]",
      "confidence": "Weak",
      "note": ""
    },
    {
      "warning_type": "Redirect",
      "warning_code": 18,
      "fingerprint": "5fad11cd67f905fab9b1d5739d01384a1748ebe78c5af5ac31518201925265a7",
      "check_name": "Redirect",
      "message": "Possible unprotected redirect",
      "file": "app/controllers/remote_interaction_controller.rb",
      "line": 24,
      "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
      "code": "redirect_to(RemoteFollow.new(resource_params).interact_address_for(Status.find(params[:id])))",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "RemoteInteractionController",
        "method": "create"
      },
      "user_input": "RemoteFollow.new(resource_params).interact_address_for(Status.find(params[:id]))",
      "confidence": "High",
      "note": ""
    },
    {
      "warning_type": "SQL Injection",
      "warning_code": 0,
      "fingerprint": "6f075c1484908e3ec9bed21ab7cf3c7866be8da3881485d1c82e13093aefcbd7",
      "check_name": "SQL",
      "message": "Possible SQL injection",
      "file": "app/models/status.rb",
      "line": 105,
      "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
      "code": "result.joins(\"LEFT OUTER JOIN statuses_tags t#{id} ON t#{id}.status_id = statuses.id AND t#{id}.tag_id = #{id}\")",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "Status",
        "method": null
      },
      "user_input": "id",
      "confidence": "Weak",
      "note": ""
    },
    {
      "warning_type": "Mass Assignment",
      "warning_code": 105,
      "fingerprint": "7631e93d0099506e7c3e5c91ba8d88523b00a41a0834ae30031a5a4e8bb3020a",
      "check_name": "PermitAttributes",
      "message": "Potentially dangerous key allowed for mass assignment",
      "file": "app/controllers/api/v2/search_controller.rb",
      "line": 28,
      "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
      "code": "params.permit(:type, :offset, :min_id, :max_id, :account_id)",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "Api::V2::SearchController",
        "method": "search_params"
      },
      "user_input": ":account_id",
      "confidence": "High",
      "note": ""
    },
    {
      "warning_type": "Mass Assignment",
      "warning_code": 105,
      "fingerprint": "8f63dec68951d9bcf7eddb15af9392b2e1333003089c41fb76688dfd3579f394",
      "check_name": "PermitAttributes",
      "message": "Potentially dangerous key allowed for mass assignment",
      "file": "app/controllers/api/v1/crypto/deliveries_controller.rb",
      "line": 23,
      "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
      "code": "params.require(:device).permit(:account_id, :device_id, :type, :body, :hmac)",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "Api::V1::Crypto::DeliveriesController",
        "method": "resource_params"
      },
      "user_input": ":account_id",
      "confidence": "High",
      "note": ""
    },
    {
      "warning_type": "SQL Injection",
      "warning_code": 0,
      "fingerprint": "9ccb9ba6a6947400e187d515e0bf719d22993d37cfc123c824d7fafa6caa9ac3",
      "check_name": "SQL",
      "message": "Possible SQL injection",
      "file": "lib/mastodon/snowflake.rb",
      "line": 87,
      "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
      "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\")",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "Mastodon::Snowflake",
        "method": "define_timestamp_id"
      },
      "user_input": "SecureRandom.hex(16)",
      "confidence": "Medium",
      "note": ""
    },
    {
      "warning_type": "Dynamic Render Path",
      "warning_code": 15,
      "fingerprint": "9f31d941f3910dba2e9bfcd81aef4513249bd24c02d0f98e13ad44fdeeccd0e8",
      "check_name": "Render",
      "message": "Render path contains parameter value",
      "file": "app/views/admin/accounts/index.html.haml",
      "line": 54,
      "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
      "code": "render(action => filtered_accounts.page(params[:page]), {})",
      "render_path": [
        {
          "type": "controller",
          "class": "Admin::AccountsController",
          "method": "index",
          "line": 12,
          "file": "app/controllers/admin/accounts_controller.rb",
          "rendered": {
            "name": "admin/accounts/index",
            "file": "app/views/admin/accounts/index.html.haml"
          }
        }
      ],
      "location": {
        "type": "template",
        "template": "admin/accounts/index"
      },
      "user_input": "params[:page]",
      "confidence": "Weak",
      "note": ""
    },
    {
      "warning_type": "Redirect",
      "warning_code": 18,
      "fingerprint": "ba568ac09683f98740f663f3d850c31785900215992e8c090497d359a2563d50",
      "check_name": "Redirect",
      "message": "Possible unprotected redirect",
      "file": "app/controllers/remote_follow_controller.rb",
      "line": 21,
      "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
      "code": "redirect_to(RemoteFollow.new(resource_params).subscribe_address_for(@account))",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "RemoteFollowController",
        "method": "create"
      },
      "user_input": "RemoteFollow.new(resource_params).subscribe_address_for(@account)",
      "confidence": "High",
      "note": ""
    },
    {
      "warning_type": "Redirect",
      "warning_code": 18,
      "fingerprint": "ba699ddcc6552c422c4ecd50d2cd217f616a2446659e185a50b05a0f2dad8d33",
      "check_name": "Redirect",
      "message": "Possible unprotected redirect",
      "file": "app/controllers/media_controller.rb",
      "line": 20,
      "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
      "code": "redirect_to(MediaAttachment.attached.find_by!(:shortcode => ((params[:id] or params[:medium_id]))).file.url(:original))",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "MediaController",
        "method": "show"
      },
      "user_input": "MediaAttachment.attached.find_by!(:shortcode => ((params[:id] or params[:medium_id]))).file.url(:original)",
      "confidence": "High",
      "note": ""
    },
    {
      "warning_type": "Mass Assignment",
      "warning_code": 105,
      "fingerprint": "e867661b2c9812bc8b75a5df12b28e2a53ab97015de0638b4e732fe442561b28",
      "check_name": "PermitAttributes",
      "message": "Potentially dangerous key allowed for mass assignment",
      "file": "app/controllers/api/v1/reports_controller.rb",
      "line": 36,
      "link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
      "code": "params.permit(:account_id, :comment, :forward, :status_ids => ([]))",
      "render_path": null,
      "location": {
        "type": "method",
        "class": "Api::V1::ReportsController",
        "method": "report_params"
      },
      "user_input": ":account_id",
      "confidence": "High",
      "note": ""
    }
  ],
  "updated": "2020-06-01 18:18:02 +0200",
  "brakeman_version": "4.8.0"
}