akkoma/test/pleroma/object
Oneric fee57eb376 Move actor check into fetch_and_contain_remote_object_from_id
This brings it in line with its name and closes an,
in practice harmless, verification hole.

This was/is the only user of contain_origin making it
safe to change the behaviour on actor-less objects.

Until now refetched objects did not ensure the new actor matches the
domain of the object. We refetch polls occasionally to retrieve
up-to-date vote counts. A malicious AP server could have switched out
the poll after initial posting with a completely different post
attribute to an actor from another server.
While we indeed fell for this spoof before the commit,
it fortunately seems to have had no ill effect in practice,
since the asociated Create activity is not changed. When exposing the
actor via our REST API, we read this info from the activity not the
object.

This at first thought still keeps one avenue for exploit open though:
the updated actor can be from our own domain and a third server be
instructed to fetch the object from us. However this is foiled by an
id mismatch. By necessity of being fetchable and our longstanding
same-domain check, the id must still be from the attacker’s server.
Even the most barebone authenticity check is able to sus this out.
2024-03-25 14:05:05 -01:00
..
containment_test.exs Move actor check into fetch_and_contain_remote_object_from_id 2024-03-25 14:05:05 -01:00
fetcher_test.exs Move actor check into fetch_and_contain_remote_object_from_id 2024-03-25 14:05:05 -01:00
pruner_test.exs Fixing up deletes a bit (#327) 2022-12-01 15:00:53 +00:00
updater_test.exs Post editing (#202) 2022-09-06 19:24:02 +00:00