Home | Notifications | New Note | Local | Federated | Search | Logout

Note Detail


Reply to @Profpatsch@mastodon.xyz
silverpill@silverpill@mitra.social (2026-03-26 04:39:41)
@Profpatsch2.  Activity-Level Origin Checks
Same-origin is checked rather than exact equality so that servers with multiple actors can sign on behalf of any of their actors — a common legitimate pattern.For incoming activities, consider checking exact equality. See FEP-fe34, section "Signatures":In order to minimize damage in the event of a key compromise or insufficient validation, consumers MUST verify that the signing key has the same owner as the signed object. Consumers MUST also confirm the ownership of the key by verifying a reciprocal claim.This is not strictly necessary, but would help if the origin server does poor job at validating user input.3. Embedded Object Origin Checks
Owner origin: the object's owner (actor for Activity subtypes, attributedTo for Notes/Objects) must be same-origin as the signing actor. Anonymous objects (no owner field) are accepted.In this case I also recommend checking owner ID equality, as a rule of thumb. Because origin servers implementing C2S API may fail to validate all embedded objects (which can be deeply nested).Response body size limitsYou may also need to limit the number of redirects and set a timeout. Some HTTP libraries have bad defaults.

By the way, I collect such recommendations in this guide: https://codeberg.org/ap-next/ap-next/src/branch/main/guide.md#network. Contributions are welcome!

@liaizon
---Reply--- Beady Belle Fanchannel@Profpatsch@mastodon.xyz (2026-03-26 23:20:56) @silverpill @liaizon What does this mean? “Follow redirects, but set a limit. Request must be re-signed after every redirect.”

do you mean I have to check the new http signature on every 30x response? I don’t believe that can work??
Reply

---Replies---
silverpill@silverpill@mitra.social (2026-03-27 05:04:10)
@Profpatsch You need to create a new signature because the request target is changing. It is a part of a signature base, so the initial signature becomes invalid when the client follows a redirect.

@liaizon