Fix unneeded requests to blocked domains when receiving relayed signed activities from them (#31161)

pull/32137/head
Claire 2024-10-01 14:52:13 +02:00 committed by GitHub
parent c5f0da98e4
commit 7b92cf3b47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@
class ActivityPub::ProcessCollectionService < BaseService
include JsonLdHelper
include DomainControlHelper
def call(body, actor, **options)
@account = actor
@ -69,6 +70,9 @@ class ActivityPub::ProcessCollectionService < BaseService
end
def verify_account!
return unless @json['signature'].is_a?(Hash)
return if domain_not_allowed?(@json['signature']['creator'])
@options[:relayed_through_actor] = @account
@account = ActivityPub::LinkedDataSignature.new(@json).verify_actor!
@account = nil unless @account.is_a?(Account)