Skip to content
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

fedi wiki

  1. Home
  2. Technical Discussion
  3. Question re: Origin Based Security Model (FEP-fe34)

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

Scheduled Pinned Locked Moved Technical Discussion
activitypubsecurityfe34fep
38 Posts 9 Posters 28 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • julian@activitypub.spaceJ This user is from outside of this forum
    julian@activitypub.spaceJ This user is from outside of this forum
    julian@activitypub.space
    wrote last edited by
    #1

    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.

    thisismissem@activitypub.spaceT 1 Reply Last reply
    0
    • julian@activitypub.spaceJ This user is from outside of this forum
      julian@activitypub.spaceJ This user is from outside of this forum
      julian@activitypub.space
      wrote last edited by
      #2

      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.

      1 Reply Last reply
      0
      • silverpill@mitra.socialS This user is from outside of this forum
        silverpill@mitra.socialS This user is from outside of this forum
        silverpill@mitra.social
        wrote last edited by
        #3

        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 julian@activitypub.spaceJ 2 Replies Last reply
        0
        • silverpill@mitra.socialS silverpill@mitra.social

          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 This user is from outside of this forum
          silverpill@mitra.socialS This user is from outside of this forum
          silverpill@mitra.social
          wrote last edited by
          #4

          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.

          1 Reply Last reply
          0
          • silverpill@mitra.socialS silverpill@mitra.social

            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...)

            julian@activitypub.spaceJ This user is from outside of this forum
            julian@activitypub.spaceJ This user is from outside of this forum
            julian@activitypub.space
            wrote last edited by
            #5

            > @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.

            1 Reply Last reply
            0
            • silverpill@mitra.socialS This user is from outside of this forum
              silverpill@mitra.socialS This user is from outside of this forum
              silverpill@mitra.social
              wrote last edited by
              #6

              No, it's not wrong.

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

              silverpill@mitra.socialS 1 Reply Last reply
              0
              • trwnh@mastodon.socialT This user is from outside of this forum
                trwnh@mastodon.socialT This user is from outside of this forum
                trwnh@mastodon.social
                wrote last edited by
                #7

                @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 profpatsch@mastodon.xyzP 2 Replies Last reply
                0
                • trwnh@mastodon.socialT trwnh@mastodon.social

                  @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 This user is from outside of this forum
                  julian@activitypub.spaceJ This user is from outside of this forum
                  julian@activitypub.space
                  wrote last edited by
                  #8

                  @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.

                  1 Reply Last reply
                  0
                  • trwnh@mastodon.socialT This user is from outside of this forum
                    trwnh@mastodon.socialT This user is from outside of this forum
                    trwnh@mastodon.social
                    wrote last edited by
                    #9

                    @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 1 Reply Last reply
                    0
                    • trwnh@mastodon.socialT trwnh@mastodon.social

                      @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 This user is from outside of this forum
                      trwnh@mastodon.socialT This user is from outside of this forum
                      trwnh@mastodon.social
                      wrote last edited by
                      #10

                      @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 1 Reply Last reply
                      0
                      • trwnh@mastodon.socialT trwnh@mastodon.social

                        @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 This user is from outside of this forum
                        trwnh@mastodon.socialT This user is from outside of this forum
                        trwnh@mastodon.social
                        wrote last edited by
                        #11

                        @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 1 Reply Last reply
                        0
                        • trwnh@mastodon.socialT trwnh@mastodon.social

                          @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 This user is from outside of this forum
                          julian@activitypub.spaceJ This user is from outside of this forum
                          julian@activitypub.space
                          wrote last edited by
                          #12

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

                          1 Reply Last reply
                          0
                          • evan@cosocial.caE This user is from outside of this forum
                            evan@cosocial.caE This user is from outside of this forum
                            evan@cosocial.ca
                            wrote last edited by
                            #13

                            @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.

                            1 Reply Last reply
                            0
                            • nutomic@lemmy.mlN This user is from outside of this forum
                              nutomic@lemmy.mlN This user is from outside of this forum
                              nutomic@lemmy.ml
                              wrote last edited by
                              #14

                              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.

                              1 Reply Last reply
                              0
                              • trwnh@mastodon.socialT trwnh@mastodon.social

                                @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".)

                                profpatsch@mastodon.xyzP This user is from outside of this forum
                                profpatsch@mastodon.xyzP This user is from outside of this forum
                                profpatsch@mastodon.xyz
                                wrote last edited by
                                #15

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

                                trwnh@mastodon.socialT 1 Reply Last reply
                                0
                                • thisismissem@activitypub.spaceT This user is from outside of this forum
                                  thisismissem@activitypub.spaceT This user is from outside of this forum
                                  thisismissem@activitypub.space
                                  wrote last edited by
                                  #16

                                  > @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 1 Reply Last reply
                                  0
                                  • thisismissem@activitypub.spaceT thisismissem@activitypub.space

                                    > @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 This user is from outside of this forum
                                    julian@activitypub.spaceJ This user is from outside of this forum
                                    julian@activitypub.space
                                    wrote last edited by
                                    #17

                                    @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.

                                    1 Reply Last reply
                                    0
                                    • thisismissem@activitypub.spaceT This user is from outside of this forum
                                      thisismissem@activitypub.spaceT This user is from outside of this forum
                                      thisismissem@activitypub.space
                                      wrote last edited by
                                      #18

                                      @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 1 Reply Last reply
                                      0
                                      • thisismissem@activitypub.spaceT thisismissem@activitypub.space

                                        @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 This user is from outside of this forum
                                        julian@activitypub.spaceJ This user is from outside of this forum
                                        julian@activitypub.space
                                        wrote last edited by
                                        #19

                                        @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="😛" />

                                        1 Reply Last reply
                                        0
                                        • julian@activitypub.spaceJ julian@activitypub.space

                                          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.

                                          thisismissem@activitypub.spaceT This user is from outside of this forum
                                          thisismissem@activitypub.spaceT This user is from outside of this forum
                                          thisismissem@activitypub.space
                                          wrote last edited by
                                          #20

                                          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

                                          julian@activitypub.spaceJ 1 Reply Last reply
                                          0

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better 💗

                                          Register Login
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          Powered by NodeBB Contributors
                                          • First post
                                            Last post