New post: Can we have a more “social” media?

https://profpatsch.de/essays/a-more-social-media

On advertising, the Fediverse, and what a more human social web could look like.

Special mentions: @smallcircles, @phnt, @happy-programming

#fediverse #activitypub #socialmedia #writing #essay

Can we have a more "social" media?

On advertising, the Fediverse, and what a more human social web could look like.

Profpatsch’s Lair
@Profpatsch oh cool what did you build @happy-programming with?
@liaizon Right now it’s two golang files that do a half-assed job at implementing activitypub
@Profpatsch ah very cool its custom! have you published the code? I would add it to a list of implementations I help manage at https://delightful.club
Delightful Lists

@liaizon yeah, it’s published, but currently I’d not feel comfortable being listed anywhere, the code is really rough and I haven’t really made sure it’s free of security issues
@Profpatsch honestly seeing it running live and followable I would say you are better off then half the things listed on these lists
Profpatsch

My monorepo of random ideas and things that don’t deserve a full project structure yet

Codeberg.org

@liaizon fwiw I made & deployed some security improvements, the current security mechanisms are documented in https://codeberg.org/Profpatsch/Profpatsch/src/commit/249aa389a2023814b328af8fc795750fd28d995d/users/Profpatsch/activitypub-go/security.md

maybe @silverpill wants to take a look at whether this all sounds sensible?

Profpatsch/users/Profpatsch/activitypub-go/security.md at 249aa389a2023814b328af8fc795750fd28d995d

Profpatsch - My monorepo of random ideas and things that don’t deserve a full project structure yet

Codeberg.org
@liaizon @silverpill I want to write a blog post on this at one point, but I don’t know if I missed anything or misunderstand things.

@Profpatsch

2. 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 limits

You 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

ap-next/guide.md at main

ap-next - ActivityPub Next

Codeberg.org
@silverpill @liaizon Another issue I noticed: “set a max request/response size” means that we are essentially forced to implement paging of outboxes both on client and server
Profpatsch/users/Profpatsch/activitypub-go/security.md at 249aa389a2023814b328af8fc795750fd28d995d

Profpatsch - My monorepo of random ideas and things that don’t deserve a full project structure yet

Codeberg.org
@silverpill @liaizon yeah, but in essence anything that produces or consumes an outbox needs to implement paging because of that.