]> cat aescling's git repositories - mastodon.git/commitdiff
Fix leaking private statuses the admin account follows (#11300)
authorThibG <thib@sitedethib.com>
Mon, 15 Jul 2019 00:29:04 +0000 (02:29 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 15 Jul 2019 00:29:04 +0000 (02:29 +0200)
Now that the request is signed, it can return private toots. Do not leak them.

app/services/resolve_url_service.rb

index 80381c16b6faf720379cc873e10e5094a050d3b2..aa883597a467e3d133cc2627cff34aaac785ee0a 100644 (file)
@@ -21,7 +21,9 @@ class ResolveURLService < BaseService
     if equals_or_includes_any?(type, ActivityPub::FetchRemoteAccountService::SUPPORTED_TYPES)
       FetchRemoteAccountService.new.call(resource_url, body, protocol)
     elsif equals_or_includes_any?(type, ActivityPub::Activity::Create::SUPPORTED_TYPES + ActivityPub::Activity::Create::CONVERTED_TYPES)
-      FetchRemoteStatusService.new.call(resource_url, body, protocol)
+      status = FetchRemoteStatusService.new.call(resource_url, body, protocol)
+      authorize_with @on_behalf_of, status, :show? unless status.nil?
+      status
     end
   end