Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify/extend security consideration B.2 "verification" for attached files #432

Open
Johann150 opened this issue Mar 21, 2024 · 4 comments
Assignees
Labels
Needs errata We need to add errata for this Needs FEP Needs a FEP Needs Group Input/Decision Needs Primer Page Needs a page in the ActivityPub primer Next version Normative change, requires new version of spec

Comments

@Johann150
Copy link

As a thought after Mastodon's GHSA-jhrq-qvrm-qr36 it might be a good idea to extend the security consideration B.2 with a bit of wording about what kind of user submitted content is meant, and what relevance the Content-Type and perhaps Content Type Negotiation has in that context.

Especially when reading the 2nd paragraph the focus seems to me to be on ActivityPub Content, perhaps not taking into account that attached files/media may be hosted on the same host(-name).

In particular I'm thinking of wording like this:

Servers should not trust client submitted content (both ActivityPub activites and, if hosted by the same host, other resources), ...

And perhaps inserting another paragraph like this at the end of the section:

Federated servers that serve resources completely under the control of users, like for example attached media files, SHOULD make sure that the Content-Type header of such files can never be application/ld+json; profile="https://www.w3.org/ns/activitystreams" or application/activity+json. On paths/directories controlled by users, they SHOULD return the HTTP status code 406 "Not Acceptable" if a client's Accept header is set to application/ld+json; profile="https://www.w3.org/ns/activitystreams" as required of the client in section 3.2.

@evanp evanp self-assigned this Mar 22, 2024
@evanp evanp added Needs Primer Page Needs a page in the ActivityPub primer Needs errata We need to add errata for this Needs FEP Needs a FEP labels Mar 22, 2024
@evanp
Copy link
Collaborator

evanp commented Mar 22, 2024

This is an issue with user-uploaded data. Here are some ways to mitigate:

  1. As suggested, No JSON uploads.
  2. Remote clients should check the content-type for JSON types when GETting, and don't accept e.g. text/plain as AP, maybe application/json.
  3. Use a separate domain for uploaded artifacts. This will prevent naive checks that just accept the same origin as verification.
  4. Develop an attribution endpoint FEP to check attribution of objects. Possibly other types of endpoints for other verification, including a server-wide verification.
  5. Use digital signatures. Who the signature is from and what it entails is an open question. E.g. is it client side, server side, user owned, server owned, ...

I believe this solution requires at least these fixes:

  1. A Primer page on the topic.
  2. An Erratum for the security consideration in verification that covers the issue.
  3. Potentially pushing the editor's draft to the public document.

@ap-socialhub
Copy link
Collaborator

This issue has been mentioned on SocialHub. There might be relevant details there:

https://socialhub.activitypub.rocks/t/fep-0391-special-collection-proofs/4165/4

@evanp evanp added the Next version Normative change, requires new version of spec label Dec 27, 2024
@evanp
Copy link
Collaborator

evanp commented Feb 21, 2025

I've been fairly strict in applying errata to ActivityPub and Activity Streams 2.0 Core and Vocabulary, primarily focusing on textual errors and syntax errors in examples. However, in discussing this particular issue, during issue triage, Lisa Dusseault pointed out that the W3C allows three different classes of changes to be marked as errata.

In particular, it does allow changes that don't add new features. I think a security consideration like the one mentioned in this issue would fall into that class of change.

As we move into a period where a Working Group will soon (hopefully) be chartered for a next version, this may be a moot point, but I'd like to have the Social CG make a decision about whether we want to track errata that add information to the spec without adding new features or impacting conformance. I'll put it on the agenda for an upcoming meeting.

@nightpool
Copy link
Collaborator

nightpool commented Feb 21, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs errata We need to add errata for this Needs FEP Needs a FEP Needs Group Input/Decision Needs Primer Page Needs a page in the ActivityPub primer Next version Normative change, requires new version of spec
Projects
None yet
Development

No branches or pull requests

4 participants