cross-posted from: https://sh.itjust.works/post/923025

lemmy.world is a victim of an XSS attack right now and the hacker simply injected a JavaScript redirection into the sidebar.

It appears the Lemmy backend does not escape HTML in the main sidebar. Not sure if this is also true for community sidebars.

  • Gamingodcat@2dl.eu
    link
    fedilink
    English
    arrow-up
    33
    arrow-down
    1
    ·
    edit-2
    1 year ago

    This has nothing to do with XSS, it is a simple HTML injection vulnerability, and it can only be exploited by instance admins.

    Also Lemmy.world appears to have been running a custom frontend so it’s hard to say how widespread the affects of this are.

    • TruckBC@lemmy.caM
      link
      fedilink
      English
      arrow-up
      9
      ·
      1 year ago

      You seem to be following the situation closely. Could you please DM me on Matrix?

    • pazukaza@lemmy.ml
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      edit-2
      1 year ago

      Worst case scenario, they can steal your Lemmy session, right?

      Which isn’t super bad for a service like Lemmy. This isn’t a social network, so most contact list scams would be useless.

      Edit: just read the targets were admins. That IS bad.

        • pazukaza@lemmy.ml
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 year ago

          I mean, not in the traditional sense. You don’t have your family and friends as Lemmy contacts and share posts with them. It’s more anonymous.

    • TruckBC@lemmy.caM
      link
      fedilink
      English
      arrow-up
      37
      ·
      1 year ago

      At this point I’m monitoring inter-instance communications channels non stop even though I should be in bed. I will be temporarily removing admins that have not responded to my inquiry to confirm if they have 2FA authentication turned on as initial access appears to have been gained due to lack of 2FA.

      If there’s anything additinal we can do, we will.

      • tarjeezy@lemmy.ca
        link
        fedilink
        English
        arrow-up
        6
        ·
        1 year ago

        Good luck, and thanks for all your hard work. I don’t know if you already saw this, but it looks like this might be the vector for the account compromise. If that’s the case, I don’t think 2FA is enough to protect, because it’s exfiltrating the session cookies of someone already logged in. Seems like the precaution is for admins to avoid clicking any suspicious links. I realize the irony of sharing a link about this, but at least it’s to a thread on this instance.

        https://lemmy.ca/post/1311411

        • TruckBC@lemmy.caM
          link
          fedilink
          English
          arrow-up
          8
          ·
          1 year ago

          I’m copying all links into a brand new incognito mode window for now.

      • Avid Amoeba@lemmy.ca
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Introduce minimum password complexity if there’s a config option for it and force admins to reset passwords.

        • TruckBC@lemmy.caM
          link
          fedilink
          English
          arrow-up
          4
          ·
          1 year ago

          There’s no minimum complexity but I’ve enforced 2FA for all admins. One admin that did not respond has been temporarily removed precautionarily.

          • minnieo@kbin.social
            link
            fedilink
            arrow-up
            3
            ·
            1 year ago

            thanks for your hard work, even though i am sure you’re tired as hell. i think that person’s idea about a minimum complexity requirement in addition to 2FA is a good idea, perhaps something like a complex password generator like LastPass or something, anything.

            • TruckBC@lemmy.caM
              link
              fedilink
              arrow-up
              8
              ·
              edit-2
              1 year ago

              We can put it in place as a internal policy. I’m 99% confident all admins on Lemmy.ca are using complex password generators, that are hopefully not LastPass with their history of being hacked 😅

              Edit: yeah I’m tired. It’s like 3 hours post bed time. I’m supposed to be at work in just over 5 hours.

              • minnieo@kbin.social
                link
                fedilink
                arrow-up
                4
                ·
                1 year ago

                I’m supposed to be at work in just over 5 hours.

                shit that sucks. this happened at a bad time, i’m sorry. are their people besides you who are keeping an eye on this and maintaining it, for when you go off to work or when you need to sleep? cause everyone needs their sleep

  • mr47@kbin.social
    link
    fedilink
    arrow-up
    7
    ·
    1 year ago

    I mean, if it’s something that’s editable only by admins of the instance, I’m not sure it constitutes a vulnerability, since admins can change the content to whatever they desire by definition.

    • AlternateRoute@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      Wasn’t clear till further people commented that it was something only and admin could do. So I agree.

      • TruckBC@lemmy.caM
        link
        fedilink
        English
        arrow-up
        6
        ·
        1 year ago

        We have yet to confirm if a vulnerability exists in the sidebars that can be set by community mods.

        • Uncle@lemmy.ca
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

          can you temporally take away the ability for mods to put html or any kinda script into the sidebar, at least for now?

          • TruckBC@lemmy.caM
            link
            fedilink
            English
            arrow-up
            3
            ·
            1 year ago

            No. Unfortunately. This is not a confirmed vector of attack at this point but we are monitoring.

          • ChemicalRascal@kbin.social
            link
            fedilink
            arrow-up
            2
            ·
            1 year ago

            That would essentially be patching the vulnerability. A temporary fix would be just preventing the sidebar from being editable.

            (Ideally the vulnerability would be patched, but these things take time.)

            • TruckBC@lemmy.caM
              link
              fedilink
              arrow-up
              5
              ·
              1 year ago

              At this point it doesn’t seem like community sidebars have the voulnerabilty. We are fairly confident that they have identified the voulnerabilty and that lemmy.ca is safe as long as our admin accounts are properly locked down which we have confirmed.

  • Thelsim@kbin.social
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    So, as an average, less-technical, Lemmy user (this is my backup for now).
    What can or should I do to stay safe?

    • theneverfox@pawb.social
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      Id use an app you trust for now

      On a site you have to sanitize your data, on a native app you’d have to go out of your way to render this kind of thing…wefwef/voyager is actually a web page (and they might or might not be sanitizing their inputs), the other top options are probably using libraries to do it, and data sanitation is pretty basic. Literally web dev 101. They’d have to choose a very full-featured rendering library that also entirely ignores security, or they’d have to have rolled their own

      At least now I know why my renderer has been so annoying about the warnings the last couple days…

      For any devs that read this - this is a great example of why you can’t trust anything coming off a federated network. Type check and sanitize all your inputs, always. We need to get away from trust - this isn’t a trustful situation

      Luckily, this was more of a warning than an actual attack - and there will be actual attacks. We have to be defensive - always - every time at every level.

      And Flemmy will be that, once I feel good releasing it (2 features left before I’m out of reasons to procrastinate). It’ll be just me, always

    • TruckBC@lemmy.caM
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      While I respect their decision, I believe that’s a over-reaction at this point and we will not be doing that, yet.

    • minnieo@kbin.social
      link
      fedilink
      arrow-up
      7
      ·
      1 year ago

      why is your entire account dedicated to sucking reddit’s asshole. do you like the taste of corporate shit?

      • XiELEd@kbin.social
        link
        fedilink
        arrow-up
        6
        ·
        edit-2
        1 year ago

        Yeah it’s so weird, why make an account here if he likes Reddit so much? We just want to have another place to have communities, that’s why we left and stayed here. He should do the same, stay there and out of here if he hates this place so much.

        • minnieo@kbin.social
          link
          fedilink
          arrow-up
          5
          ·
          1 year ago

          it’s honestly pathetic. he hates it here so much that he spends 95% of his free time here making comments about how much better reddit is hahaha. he seems addicted to this place and addicted to the taste of shiny black boots

          • XiELEd@kbin.social
            link
            fedilink
            arrow-up
            4
            ·
            1 year ago

            I mean I get that he’s in some sort of one-way findom relationship with spez but that should be done without harassing other people— we didn’t consent to it.