Skip to content
  • 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 (Darkly)
  • No Skin
Collapse
Brand Logo
  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 2 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.
  • julianJ This user is from outside of this forum
    julianJ This user is from outside of this forum
    julian
    wrote on 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.

    EmeliaT 1 Reply Last reply
    1
    5
    • R AodeRelay shared this topic on
    • julianJ This user is from outside of this forum
      julianJ This user is from outside of this forum
      julian
      wrote on 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
      1
      0
      • julianJ This user is from outside of this forum
        julianJ This user is from outside of this forum
        julian
        wrote on last edited by
        #3

        > @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
        1
        0
        • silverpillS This user is from outside of this forum
          silverpillS This user is from outside of this forum
          silverpill
          wrote on last edited by
          #4

          No, it's not wrong.

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

          silverpillS 1 Reply Last reply
          1
          0
          • infinite love ⴳT This user is from outside of this forum
            infinite love ⴳT This user is from outside of this forum
            infinite love ⴳ
            wrote on last edited by
            #5

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

            julianJ Beady Belle FanchannelP 2 Replies Last reply
            2
            0
            • R AodeRelay shared this topic on
            • infinite love ⴳT infinite love ⴳ

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

              julianJ This user is from outside of this forum
              julianJ This user is from outside of this forum
              julian
              wrote on last edited by
              #6

              @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
              1
              0
              • infinite love ⴳT This user is from outside of this forum
                infinite love ⴳT This user is from outside of this forum
                infinite love ⴳ
                wrote on last edited by
                #7

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

                infinite love ⴳT 1 Reply Last reply
                0
                • infinite love ⴳT infinite love ⴳ

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

                  infinite love ⴳT This user is from outside of this forum
                  infinite love ⴳT This user is from outside of this forum
                  infinite love ⴳ
                  wrote on last edited by
                  #8

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

                  infinite love ⴳT 1 Reply Last reply
                  0
                  • infinite love ⴳT infinite love ⴳ

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

                    infinite love ⴳT This user is from outside of this forum
                    infinite love ⴳT This user is from outside of this forum
                    infinite love ⴳ
                    wrote on last edited by
                    #9

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

                    julianJ 1 Reply Last reply
                    1
                    0
                    • infinite love ⴳT infinite love ⴳ

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

                      julianJ This user is from outside of this forum
                      julianJ This user is from outside of this forum
                      julian
                      wrote on last edited by
                      #10

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

                      1 Reply Last reply
                      1
                      0
                      • Evan ProdromouE This user is from outside of this forum
                        Evan ProdromouE This user is from outside of this forum
                        Evan Prodromou
                        wrote on last edited by
                        #11

                        @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
                        2
                        0
                        • NutomicN This user is from outside of this forum
                          NutomicN This user is from outside of this forum
                          Nutomic
                          wrote on last edited by
                          #12

                          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
                          2
                          0
                          • R ActivityRelay shared this topic on
                          • infinite love ⴳT infinite love ⴳ

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

                            Beady Belle FanchannelP This user is from outside of this forum
                            Beady Belle FanchannelP This user is from outside of this forum
                            Beady Belle Fanchannel
                            wrote on last edited by
                            #13

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

                            infinite love ⴳT 1 Reply Last reply
                            3
                            0
                            • EmeliaT This user is from outside of this forum
                              EmeliaT This user is from outside of this forum
                              Emelia
                              wrote on last edited by
                              #14

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

                              1 Reply Last reply
                              3
                              0
                              • julianJ This user is from outside of this forum
                                julianJ This user is from outside of this forum
                                julian
                                wrote on last edited by
                                #15

                                @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
                                2
                                0
                                • EmeliaT This user is from outside of this forum
                                  EmeliaT This user is from outside of this forum
                                  Emelia
                                  wrote on last edited by
                                  #16

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

                                  1 Reply Last reply
                                  3
                                  0
                                  • julianJ This user is from outside of this forum
                                    julianJ This user is from outside of this forum
                                    julian
                                    wrote on last edited by
                                    #17

                                    @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
                                    3
                                    0
                                    • julianJ julian

                                      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.

                                      EmeliaT This user is from outside of this forum
                                      EmeliaT This user is from outside of this forum
                                      Emelia
                                      wrote on last edited by
                                      #18

                                      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

                                      1 Reply Last reply
                                      2
                                      0
                                      • Beady Belle FanchannelP Beady Belle Fanchannel

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

                                        infinite love ⴳT This user is from outside of this forum
                                        infinite love ⴳT This user is from outside of this forum
                                        infinite love ⴳ
                                        wrote on last edited by
                                        #19

                                        @Profpatsch @julian i've been doing some trust and safety TF work to explore/develop a bidirectional link between actors and moderators/hosts, yeah. mostly in the context of "where to send moderation related activities" (so you don't Flag a user to themselves if there's a better option), but also could be used for authorizing Update/Delete activities.

                                        alternatively, the problem would not be there if service actors messaged each other for more explicit syndication...

                                        1 Reply Last reply
                                        3
                                        0
                                        • julianJ This user is from outside of this forum
                                          julianJ This user is from outside of this forum
                                          julian
                                          wrote on last edited by
                                          #20

                                          @thisismissem hmm, I believe Lemmy and Piefed send cross actor Deletes, but they might be Announces by the group actor.

                                          They (and I) don't use moderatedBy but rather the group actor's attributedTo

                                          Just want to make sure you're aware of that existing prior art.

                                          1 Reply Last reply
                                          3
                                          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
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups