ActivityPub: what stops a malicious actor to post from domains they don't own?
I'm trying to better understand Activitypub and I understand that there's a signature to avoid forgeries of known accounts.
However I'm having trouble understanding what prevents a malicious actor from sending a private spam message supposedly from a never before seen account name with valid generated key pair but for a domain they've never bought since there is no DNS lookup or test.
Thank you!
To do the signature validation you need to know/trust the public key signing the incoming request (which will use the
keyId
in the signature to specify the key of the actor, usually a Person, that made the thing, when your server gets this comment thekeyId
will behttps://lemmy.nrd.li/u/terribleplan#main-key
). A good server will check that thekeyId
only differs from the actor of the object by having a fragment appended.Your server needs to fetch my Person object, of
https://lemmy.nrd.li/u/terribleplan
. If you load that with anAccept
header ofapplication/activity+json
you get:You can see my Person object contains
.publicKey.publicKeyPem
, that is what your server will use (and store after fetching it once) to validate the incoming payload/header.Oh, there's also
Linked Data SignaturesVerifiable Credential Data Integrity that puts signatures right in the JSON itself. This is a real neat option that would allow for all sorts of great things like super easy and forwarding of messages with verifiable integrity, and the ability to store things in a verifiable/trusted way forever. Nobody really implemented it because:On the point of 2, it could be made optional, so that the user could choose.
Maybe... I am working on an AP implementation that will reject anything not signed with VCDI because it has such desirable properties. In my implementation all crypto is done client-side only, so the server can't reasonably be expected to do HTTP signing.