Citiverse
  • Question re: Origin Based Security Model (FEP-fe34)


    julian@activitypub.spaceJ
    175
    0

    I received a security vulnerability report regarding NodeBB's handling of Update and Delete activities.

    tl;dr

    • NodeBB implementes FEP fe34, and treats Update and Delete activities as valid if the activity's actor and the object's attributedTo differ but the origins are identical.
    • e.g. @alice@example.org is allowed to federate Delete(Note) on @bob@example.org's Note.
    • The origin-based security model allows for moderator-style actions (third-party post editing and deletions) in the absence of explicit moderator claims.
    • The reporter disagrees that this should be allowed.

    Are they right?

    I responded that FEP fe34 allows for this behaviour because we do not have ready access to an instance's admin or moderator list. By conducting same-origin checks and allowing Update and Delete through for same-origin (but different identifier), we allow for moderators to federate their actions across instances.

    Their response:

    > I respectfully disagree that FEP-fe34 permits this behavior. Below are direct quotes from the specification that contradict your assessment.
    >
    > 1. ActivityPub spec (quoted in FEP-fe34 Rationale, Section 7.3 Update Activity):
    >
    > ▎ "The receiving server MUST take care to be sure that the Update is authorized to modify its object. At minimum, this may be done by ensuring that the Update and its object are of same origin."
    >
    > Note: "at minimum" means same-origin is the floor, not the ceiling. Authorization must still be verified.
    >2. FEP-fe34 — Authorization > Ownership:
    >
    > ▎ "The actor that creates an object MUST be its owner."
    > ▎ "The owner of an object is permitted to modify and delete it."
    > ▎ "Update and Delete activities, and objects indicated by their object property are expected to have the same owner."
    >
    > "Same owner" means the same specific actor — not any actor on the same domain.

    I responded back with the following:

    > "The actor that creates an object MUST be its owner."
    >
    >
    > Correct, the creator must be an owner, no impersonation allowed.
    >
    >
    > "The owner of an object is permitted to modify and delete it."
    >
    >
    > A strict reading of this does not preclude the ability of a same-origin moderator to modify and delete the object. This is my argument.
    >
    >
    > "Update and Delete activities, and objects indicated by their object property are expected to have the same owner."
    >
    >
    > Again, "expected to" does not rise to the level of MUST.
    >
    > I agree out of principle that the security implications exist, but if you follow through with the exploit, it requires a non-compliant server to allow users to publish Update and Delete for other users on the same instance, and even then the exposure is limited to users of that origin only (e.g. your server cannot arbitrarily delete my posts). This is the foundation of the Origin-based security model.

    So we are at an impasse as to whether my strict reading of the FEP is adherent to the spirit of the FEP itself. Here's where you come in... do you agree with me, or the reporter?

    Directly tagging @silverpill@mitra.social (as FEP author), @trwnh@mastodon.social and @evan@cosocial.ca (both subject matter experts) for their thoughts.

  • julian@activitypub.spaceJ
    175
    0

    My thoughts:

    I don't necessarily think FEP fe34 is strict enough to be a guiding principle for security across federated instances. The reporter said:

    > "at minimum" means same-origin is the floor, not the ceiling.

    ... and he's right, there's more you should do to verify that only the owner or a designated moderator can update and delete an object.

    However we don't have a widely-used ability to determine who the moderators or admins are for any given instance. Mastodon may have an endpoint (in their API), threadiverse software use their own (as directed by 1b12, and even then it's optional), other software <img class="not-responsive emoji" src="https://activitypub.space/assets/plugins/nodebb-plugin-emoji/emoji/android/1f937.png?v=f187f9278b7" title="🤷" /> ?

    So we fall back to origin-based security model and hand off the responsibility of determining who can and cannot alter somebody else's objects to the sending server.

    That's a risk we take with this model. Not sure if there is more that can be done to tighten this up.

  • silverpill@mitra.socialS
    36
    0

    I agree out of principle that the security implications exist, but if you follow through with the exploit, it requires a non-compliant server to allow users to publish Update and Delete for other users on the same instance, and even then the exposure is limited to users of that origin only (e.g. your server cannot arbitrarily delete my posts). This is the foundation of the Origin-based security model.

    Correct. FEP-fe34 is based on the assumption that originating servers enforce boundaries between actors. This is stated in the section "Assumptions":

    The origin-based security model is designed for use in a network where a server is resposible for enforcing security boundaries between the hosted actors. Servers that publish objects without validation are not supported.

    In some cases, FEP-fe34 recommends same-actor policy as an additional protection against implementation bugs and against implementations that don't enforce actor boundaries on purpose. Update/Delete authorization is one of those cases (admittedly, the wording is a bit confusing in that paragraph...)

  • silverpill@mitra.socialS
    36
    0

    Is the assumption on which FEP-fe34 is based valid?

    Of course, it is primarily a philosophical question. Who should be responsible for enforcing boundaries between actors hosted on the same server, the sender or the recipient? In my opinion, the answer is clear: the sender should be responsible.

    As far as I know, the majority of existing implementations do enforce boundaries between actors. I am not aware of any implementation that doesn't do that.

    Enforcement of boundaries is challenge for generic ActivityPub servers, but it's not insurmountable.

  • julian@activitypub.spaceJ
    175
    0

    > @silverpill@mitra.social said:
    >
    > In some cases, FEP-fe34 recommends same-actor policy as an additional protection against implementation bugs and against implementations that don't enforce actor boundaries on purpose. Update/Delete authorization is one of those cases (admittedly, the wording is a bit confusing in that paragraph...)

    Does this mean NodeBB is wrong is allowing different actors on the same origin to publish Updates and Deletes? I do not know of a way to reconcile this with the ability to have moderators carry out their actions.

  • silverpill@mitra.socialS
    36
    0

    No, it's not wrong.

    I think the good of group moderation currently outweighs the theoretical bad of same-origin impersonation.

  • trwnh@mastodon.socialT
    22
    0

    @julian You're making a very strong assumption that the remote server is necessarily checking for things it might not actually be checking for.

    Neither the "instance" model nor the "same origin" model are enshrined in ActivityPub. This technically falls under "undefined behavior", because AP doesn't define an authorization model. (It suggests ("may") same origin, but that's about it. A lot of things are "at the receiving server's discretion".)

  • julian@activitypub.spaceJ
    175
    0

    @trwnh@mastodon.social on the flip side, I could argue that if the sending server doesn't enforce boundaries between actors, then there's no need to enforce the boundary on my end.

    For example, if the sending server is a federated wiki where anyone™️ can edit, then it would actually be incorrect for me to enforce a boundary.

  • trwnh@mastodon.socialT
    22
    0

    @julian The sending server might not have boundaries to enforce. Especially not along "same origin" lines. This requires agreement on what the authorization model is.

    Say for example everyone gets a subdirectory that they "own" -- /~alice/ and /~bob/ have their spaces on the same origin. One authorization model is "anything within this container is authorized". If you don't recognize this, you can't detect that alice and bob have a boundary between them.

  • trwnh@mastodon.socialT
    22
    0

    @julian Really, taking "same origin" to its logical conclusion would mean that every actor MUST have their own origin and therefore their own FQDN. It doesn't make sense for origins hosting user-generated content unless the UGC is very tightly controlled and sanitized. And even that's not a guarantee of safety.

  • trwnh@mastodon.socialT
    22
    0

    @julian oh dear, these couple of mentions seem not to have made it across. do i need to also mention @technical-discussion too?

  • julian@activitypub.spaceJ
    175
    0

    @trwnh@mastodon.social ...! That sounds like a bug. They all came in after you mentioned the category.

  • evan@cosocial.caE
    125
    0

    @julian @silverpill we did not define this well in ActivityPub.

    There's an implicit authorization model (creator can write the object, addressees can read and react) which will probably be more explicit in the next version, but we'd leave open other types of authorization.

    I think it's likely in the future we'll have a property for defining additional access control options.

    Same-origin is a good guess but it's not as good as explicit properties.

  • nutomic@lemmy.mlN
    5
    0

    We also got the same type of vulnerability reports. Good that you bring it up, because I wasnt aware of the FEP.

    To answer your question we can look at it the other way. Imagine we implement a way to federate admin/moderator status and then check it for every incoming mod action. First of all we get problems with older platforms which dont implement this feature yet, it means all their mod actions will be rejected and we end up with spam. Or we add a way to bypass the check, then the whole security feature becomes pointless.

    Even if we assume that all platforms correctly federate the admin/mod status, there would still be problems. Federation is not perfect, sometimes things get lost. Or someone gets appointed as admin and immediately removes some spam. At this point the admin status is not federated yet (if its part of the user profile and only updated every 24h). Then again valid mod actions are rejected and we end up with spam that is not deleted.

    On the other hand, whats exactly is the exploit here? Some platform lets a normal user (no admin/mod rights) send Update or Delete activites for another user on the same instance. That is clearly not our problem, but its a problem of the remote platform which allows such actions. Besides it cannot affect users from other instances so the impact would be very limited.

    Overall, adding such stricter checks would create more problems than it solves.

  • profpatsch@mastodon.xyzP
    6
    0

    @trwnh @julian I would be more comfortable with there being a way of the serving server explicitly saying "this actor is allowed to moderate"

  • thisismissem@activitypub.spaceT
    11
    0

    > @julian said:
    >
    > A strict reading of this does not preclude the ability of a same-origin moderator to modify and delete the object. This is my argument.

    I think I'd ask here is why is the Delete/Update coming from the moderator, instead of from the account that posted the thing, since that account is the owner of that thing?

    Edit: For the moderation use case, I believe Moderation Actors will be the answer here.

  • julian@activitypub.spaceJ
    175
    0

    @thisismissem isn't that the correct way to communicate this across the wire?

    The moderator is deleting the post, not the author, so the moderator is the Delete's actor.

    You could fake this by federating out an update or delete as though it came from the original author, which would be a most compatible way to do things, but it isn't necessarily right.

  • thisismissem@activitypub.spaceT
    11
    0

    @julian yeah, but the problem with the same-origin model is that you don't know who the moderator is. the actor https://social.example/joe shouldn't be able to delete https://social.example/steve's posts or issue updates. But if steve is moderatedBy https://social.example/mods, then a Delete or Update from https://social.example/mods for https://social.example/steve

    So whilst you have same-origin, you actually also have same-actor and http-message-signatures indicated authenticated actor.

  • julian@activitypub.spaceJ
    175
    0

    @thisismissem Yes, agreed. However in the absence of any widespread consensus on how exactly to do that, the current origin-based security model is all we've got.

    Open to working on standardizing that though <img class="not-responsive emoji" src="https://activitypub.space/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61b.png?v=f187f9278b7" title="😛" />

  • thisismissem@activitypub.spaceT
    11
    0

    Well, yeah, that's why I linked what T&S is doing here to fix the moderator use case. At present I don't know of anyone sending cross-actor delete/update actions, so we'd be adding capability with the moderatedBy


Citiverse è un progetto che si basa su NodeBB ed è federato! | Categorie federate | Chat | 📱 Installa web app o APK | 🧡 Donazioni | Privacy Policy

Il server utilizzato è quello di Webdock, in Danimarca. Se volete provarlo potete ottenere il 20% di sconto con questo link e noi riceveremo un aiuto sotto forma di credito da usare proprio per mantenere Citiverse.