2017-05-07 10:45:34 +10:00
{
"ignored_warnings": [
2018-11-06 04:53:25 +11:00
{
"warning_type": "SQL Injection",
"warning_code": 0,
"fingerprint": "19df3740b8d02a9fe0eb52c939b4b87d3a2a591162a6adfa8d64e9c26aeebe6d",
"check_name": "SQL",
"message": "Possible SQL injection",
"file": "app/models/status.rb",
2022-02-15 07:27:53 +11:00
"line": 104,
2018-11-06 04:53:25 +11:00
"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": ""
},
2018-08-18 11:03:12 +10:00
{
"warning_type": "Redirect",
"warning_code": 18,
"fingerprint": "5fad11cd67f905fab9b1d5739d01384a1748ebe78c5af5ac31518201925265a7",
"check_name": "Redirect",
"message": "Possible unprotected redirect",
"file": "app/controllers/remote_interaction_controller.rb",
2020-06-03 03:24:53 +10:00
"line": 24,
2018-08-18 11:03:12 +10:00
"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": ""
},
2021-11-25 23:07:38 +11:00
{
"warning_type": "SQL Injection",
"warning_code": 0,
"fingerprint": "75fcd147b7611763ab6915faf8c5b0709e612b460f27c05c72d8b9bd0a6a77f8",
"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)\\nRETURNS 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 || '#{SecureRandom.hex(16)}' || time_part::text),\\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": ""
},
2017-11-08 00:49:32 +11:00
{
2020-06-03 03:24:53 +10:00
"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,
2017-11-08 00:49:32 +11:00
"location": {
2020-06-03 03:24:53 +10:00
"type": "method",
"class": "Api::V2::SearchController",
"method": "search_params"
2017-11-08 00:49:32 +11:00
},
2020-06-03 03:24:53 +10:00
"user_input": ":account_id",
"confidence": "High",
"note": ""
},
2021-05-11 22:18:33 +10:00
{
"warning_type": "Mass Assignment",
"warning_code": 105,
"fingerprint": "874be88fedf4c680926845e9a588d3197765a6ccbfdd76466b44cc00151c612e",
"check_name": "PermitAttributes",
"message": "Potentially dangerous key allowed for mass assignment",
"file": "app/controllers/api/v1/admin/reports_controller.rb",
2022-02-15 07:27:53 +11:00
"line": 90,
2021-05-11 22:18:33 +10:00
"link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
"code": "params.permit(:resolved, :account_id, :target_account_id)",
"render_path": null,
"location": {
"type": "method",
"class": "Api::V1::Admin::ReportsController",
"method": "filter_params"
},
"user_input": ":account_id",
"confidence": "High",
"note": ""
},
2020-06-03 03:24:53 +10:00
{
2020-12-14 19:06:34 +11:00
"warning_type": "SQL Injection",
"warning_code": 0,
2021-11-25 23:07:38 +11:00
"fingerprint": "8c1d8c4b76c1cd3960e90dff999f854a6ff742fcfd8de6c7184ac5a1b1a4d7dd",
2020-12-14 19:06:34 +11:00
"check_name": "SQL",
"message": "Possible SQL injection",
2021-11-25 23:07:38 +11:00
"file": "app/models/preview_card_filter.rb",
"line": 50,
2020-12-14 19:06:34 +11:00
"link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
2021-11-25 23:07:38 +11:00
"code": "PreviewCard.joins(\"join unnest(array[#{(Trends.links.currently_trending_ids(true, -1) or Trends.links.currently_trending_ids(false, -1)).map(&:to_i).join(\",\")}]::integer[]) with ordinality as x (id, ordering) on preview_cards.id = x.id\")",
2020-06-03 03:24:53 +10:00
"render_path": null,
"location": {
"type": "method",
2021-11-25 23:07:38 +11:00
"class": "PreviewCardFilter",
"method": "trending_scope"
2020-06-03 03:24:53 +10:00
},
2021-11-25 23:07:38 +11:00
"user_input": "(Trends.links.currently_trending_ids(true, -1) or Trends.links.currently_trending_ids(false, -1)).map(&:to_i).join(\",\")",
2020-12-14 19:06:34 +11:00
"confidence": "Medium",
2017-11-08 00:49:32 +11:00
"note": ""
},
2022-02-15 07:27:53 +11:00
{
"warning_type": "Cross-Site Scripting",
"warning_code": 2,
"fingerprint": "afad51718ae373b2f19d2513029fd2afccf58b9148e475934bc6a162ee33c352",
"check_name": "CrossSiteScripting",
"message": "Unescaped model attribute",
"file": "app/views/admin/disputes/appeals/_appeal.html.haml",
"line": 7,
"link": "https://brakemanscanner.org/docs/warning_types/cross_site_scripting",
"code": "t((Unresolved Model).new.strike.action, :scope => \"admin.strikes.actions\", :name => content_tag(:span, (Unresolved Model).new.strike.account.username, :class => \"username\"), :target => content_tag(:span, (Unresolved Model).new.account.acct, :class => \"target\"))",
"render_path": [
{
"type": "template",
"name": "admin/disputes/appeals/index",
"line": 16,
"file": "app/views/admin/disputes/appeals/index.html.haml",
"rendered": {
"name": "admin/disputes/appeals/_appeal",
"file": "app/views/admin/disputes/appeals/_appeal.html.haml"
}
}
],
"location": {
"type": "template",
"template": "admin/disputes/appeals/_appeal"
},
"user_input": "(Unresolved Model).new.strike",
"confidence": "Weak",
"note": ""
},
2018-02-16 17:22:20 +11:00
{
"warning_type": "Redirect",
"warning_code": 18,
2020-06-03 03:24:53 +10:00
"fingerprint": "ba568ac09683f98740f663f3d850c31785900215992e8c090497d359a2563d50",
2018-02-16 17:22:20 +11:00
"check_name": "Redirect",
"message": "Possible unprotected redirect",
2020-06-03 03:24:53 +10:00
"file": "app/controllers/remote_follow_controller.rb",
"line": 21,
2018-08-18 11:03:12 +10:00
"link": "https://brakemanscanner.org/docs/warning_types/redirect/",
2020-06-03 03:24:53 +10:00
"code": "redirect_to(RemoteFollow.new(resource_params).subscribe_address_for(@account))",
2018-02-16 17:22:20 +11:00
"render_path": null,
"location": {
"type": "method",
2020-06-03 03:24:53 +10:00
"class": "RemoteFollowController",
"method": "create"
2018-02-16 17:22:20 +11:00
},
2020-06-03 03:24:53 +10:00
"user_input": "RemoteFollow.new(resource_params).subscribe_address_for(@account)",
2018-02-16 17:22:20 +11:00
"confidence": "High",
"note": ""
},
2017-05-07 10:45:34 +10:00
{
2021-11-25 23:07:38 +11:00
"warning_type": "SQL Injection",
"warning_code": 0,
"fingerprint": "c32a484ccd9da46abd3bc93d08b72029d7dbc0576ccf4e878a9627e9a83cad2e",
"check_name": "SQL",
"message": "Possible SQL injection",
"file": "app/models/tag_filter.rb",
"line": 50,
"link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
"code": "Tag.joins(\"join unnest(array[#{Trends.tags.currently_trending_ids(false, -1).map(&:to_i).join(\",\")}]::integer[]) with ordinality as x (id, ordering) on tags.id = x.id\")",
2017-05-07 10:45:34 +10:00
"render_path": null,
"location": {
"type": "method",
2021-11-25 23:07:38 +11:00
"class": "TagFilter",
"method": "trending_scope"
2017-05-07 10:45:34 +10:00
},
2021-11-25 23:07:38 +11:00
"user_input": "Trends.tags.currently_trending_ids(false, -1).map(&:to_i).join(\",\")",
"confidence": "Medium",
"note": ""
},
{
"warning_type": "Cross-Site Scripting",
"warning_code": 4,
"fingerprint": "cd5cfd7f40037fbfa753e494d7129df16e358bfc43ef0da3febafbf4ee1ed3ac",
"check_name": "LinkToHref",
"message": "Potentially unsafe model attribute in `link_to` href",
"file": "app/views/admin/trends/links/_preview_card.html.haml",
"line": 7,
"link": "https://brakemanscanner.org/docs/warning_types/link_to_href",
"code": "link_to((Unresolved Model).new.title, (Unresolved Model).new.url)",
"render_path": [
{
"type": "template",
"name": "admin/trends/links/index",
2022-02-15 07:27:53 +11:00
"line": 39,
2021-11-25 23:07:38 +11:00
"file": "app/views/admin/trends/links/index.html.haml",
"rendered": {
"name": "admin/trends/links/_preview_card",
"file": "app/views/admin/trends/links/_preview_card.html.haml"
}
}
],
"location": {
"type": "template",
"template": "admin/trends/links/_preview_card"
},
"user_input": "(Unresolved Model).new.url",
"confidence": "Weak",
2017-05-07 10:45:34 +10:00
"note": ""
},
2018-08-18 11:03:12 +10:00
{
"warning_type": "Mass Assignment",
"warning_code": 105,
2022-02-15 07:27:53 +11:00
"fingerprint": "f9de0ca4b04ae4b51b74d98db14dcbb6dae6809e627b58e711019cf9b4a47866",
2018-08-18 11:03:12 +10:00
"check_name": "PermitAttributes",
"message": "Potentially dangerous key allowed for mass assignment",
"file": "app/controllers/api/v1/reports_controller.rb",
Add type, limit, offset, min_id, max_id, account_id to search API (#10091)
* Add type, limit, offset, min_id, max_id, account_id to search API
Fix #8939
* Make the offset work on accounts and hashtags search as well
* Assure brakeman we are not doing mass assignment here
* Do not allow paginating unless a type is chosen
* Fix search query and index id field on statuses instead of created_at
2019-02-27 01:21:36 +11:00
"line": 36,
2018-08-18 11:03:12 +10:00
"link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
2022-02-15 07:27:53 +11:00
"code": "params.permit(:account_id, :comment, :category, :forward, :status_ids => ([]), :rule_ids => ([]))",
2018-08-18 11:03:12 +10:00
"render_path": null,
"location": {
"type": "method",
"class": "Api::V1::ReportsController",
"method": "report_params"
},
"user_input": ":account_id",
"confidence": "High",
"note": ""
2017-05-07 10:45:34 +10:00
}
],
2022-02-15 07:27:53 +11:00
"updated": "2022-02-13 02:24:12 +0100",
"brakeman_version": "5.2.1"
2017-05-07 10:45:34 +10:00
}