🆕 blog!
-
Another Mastodon / ActivityPub signature question.
Alice reposts Bob.
Bob updates their post.
Alice's instance syndicates that update to her followers.The message Alice's instance sends has an Actor of Bob. But the headers are signed by Alice. So the signature doesn't match the actor.
Which means Bob's embedded RsaSignature2017 *also* needs to be checked.
Security - Mastodon documentation
Public key cryptography and supported signature schemes over HTTP and JSON-LD.
(docs.joinmastodon.org)
But that doesn't mean I can skip checking Alice's signature, right?
The documentation says:
> Strip type, id, and signatureValue from the signature, leaving only signature[creator] and signature[created].
> Base64-decode the signatureValue and verify it against the public key in signature[creator].But it doesn't say *what* to validate the signature against!
Is it a JSON document just containing creator and created? Or is it something else?
-
The documentation says:
> Strip type, id, and signatureValue from the signature, leaving only signature[creator] and signature[created].
> Base64-decode the signatureValue and verify it against the public key in signature[creator].But it doesn't say *what* to validate the signature against!
Is it a JSON document just containing creator and created? Or is it something else?
@Edent oh.... it's against some wild RDF thingy that you obtain by putting the JSON document through some JSON-LD processing algorithms. My memory is fuzzy because I implemented that from scratch way back in 2019, but here's my known working implementation if that helps:
https://github.com/grishka/Smithereen/blob/master/src/main/java/smithereen/jsonld/LinkedDataSignatures.javaSmithereen/src/main/java/smithereen/jsonld/LinkedDataSignatures.java at master · grishka/Smithereen
Federated, ActivityPub-compatible social network server with friends, walls, and groups. - Smithereen/src/main/java/smithereen/jsonld/LinkedDataSignatures.java at master · grishka/Smithereen
GitHub (github.com)
-
@Edent oh.... it's against some wild RDF thingy that you obtain by putting the JSON document through some JSON-LD processing algorithms. My memory is fuzzy because I implemented that from scratch way back in 2019, but here's my known working implementation if that helps:
https://github.com/grishka/Smithereen/blob/master/src/main/java/smithereen/jsonld/LinkedDataSignatures.javaSmithereen/src/main/java/smithereen/jsonld/LinkedDataSignatures.java at master · grishka/Smithereen
Federated, ActivityPub-compatible social network server with friends, walls, and groups. - Smithereen/src/main/java/smithereen/jsonld/LinkedDataSignatures.java at master · grishka/Smithereen
GitHub (github.com)
@grishka thanks! I've just found your comments from back then.
I think this might go in the category of th;di (too hard; didn't implement).
-
@Edent oh.... it's against some wild RDF thingy that you obtain by putting the JSON document through some JSON-LD processing algorithms. My memory is fuzzy because I implemented that from scratch way back in 2019, but here's my known working implementation if that helps:
https://github.com/grishka/Smithereen/blob/master/src/main/java/smithereen/jsonld/LinkedDataSignatures.javaSmithereen/src/main/java/smithereen/jsonld/LinkedDataSignatures.java at master · grishka/Smithereen
Federated, ActivityPub-compatible social network server with friends, walls, and groups. - Smithereen/src/main/java/smithereen/jsonld/LinkedDataSignatures.java at master · grishka/Smithereen
GitHub (github.com)
@Edent (you know it's ancient because it uses the old switch statement syntax)
-
A weird #ActivityPub message from #Frendica.
Signed on 2026-09-01
Published on 2026-03-02That's a skew of six months! The message type is "Undo" - so they're undoing a like they sent in March.
Is there *really* a worry about accepting requests like this? Given the message has been signed, what risk is there to replay attacks?
@Edent I don’t treat the published date as authoritative of anything—it’s just a piece of user-supplied information
-
@Edent I don’t treat the published date as authoritative of anything—it’s just a piece of user-supplied information
@toddsundsted Fair.
-
The documentation says:
> Strip type, id, and signatureValue from the signature, leaving only signature[creator] and signature[created].
> Base64-decode the signatureValue and verify it against the public key in signature[creator].But it doesn't say *what* to validate the signature against!
Is it a JSON document just containing creator and created? Or is it something else?
I've added an #OpenAPI / #Swagger specification to #ActivityBot.
https://gitlab.com/edent/activity-bot/-/blob/main/openapi.yaml
I've never done this before - so please do feel free to give me constructive criticism on what I've done

openapi.yaml · main · Terence Eden / ActivityBot · GitLab
A single PHP file which acts as a basic ActivityPub bot server.
GitLab (gitlab.com)
-
I've added an #OpenAPI / #Swagger specification to #ActivityBot.
https://gitlab.com/edent/activity-bot/-/blob/main/openapi.yaml
I've never done this before - so please do feel free to give me constructive criticism on what I've done

openapi.yaml · main · Terence Eden / ActivityBot · GitLab
A single PHP file which acts as a basic ActivityPub bot server.
GitLab (gitlab.com)
@Edent I used Swagger for something years and years ago, I really liked it. What did you think?
-
@Edent I used Swagger for something years and years ago, I really liked it. What did you think?
@denny Other than YAML (a cursed language) I like it!
-
@denny Other than YAML (a cursed language) I like it!
@Edent YAML seems to breed dialects. Like we don't have enough problems already.
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi
Citiverse è un progetto che si basa su NodeBB ed è federato! | Categorie federate | Chat | 📱 Installa web app o APK | 🧡 Donazioni | Privacy Policy