Hardening

This commit is contained in:
Claire committed 2026-10-29 14:56:55 +01:00
1 parent 4aedf08e51
commit fd31d72d28
2 files changed
+4 -1

No files matched your search

@@ -36,6 +36,8 @@ class ActivityPub::FetchRemoteKeyService < BaseService
private
def keypair_from_actor_json(actor_uri, actor_json)
return if non_matching_uri_hosts?(actor_uri, @uri)
actor = find_actor(actor_uri, actor_json)
return if actor.nil?
@@ -287,6 +287,7 @@ class ActivityPub::ProcessAccountService < BaseService
end
key_id = value
next if non_matching_uri_hosts?(@account.uri, key_id)
# Key is fetched without ID validation because of a GoToSocial bug
value = fetch_resource_without_id_validation(key_id)
@@ -295,7 +296,7 @@ class ActivityPub::ProcessAccountService < BaseService
# Special handling for GoToSocial which returns the whole actor for the key ID
value = first_of_value(value['publicKey']) if value.is_a?(Hash) && value.key?('publicKey')
next unless value['owner'] == @account.uri
next unless value.present? && value['owner'] == @account.uri
key = value['publicKeyPem']
next if key.nil?