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.

EDIT: as a demo, your web browser is probably telling you that it’s blocked a popup or something, you should see an alert I’ve injected

  • sudneo@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    2
    ·
    1 year ago

    Blaming culture does not help with vulnerability disclosure. Vulnerabilities do happen and will happen again.

    Writing a parser is not trivial and remember that it was a tiny project until a month ago.

    • pfannkuchen_gesicht@lemmy.one
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year ago

      Trying to blame is indeed of little help here right now. But it also worries me that such a basic vulnerability exists in the first place. It’s like the #1 rule to not trust user-input. I hope this is the only such trivial one and we won’t wake up to someone exploiting an SQL injection next.

      • sudneo@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Honestly it was not trivial, the custom emojis in the markdown parser seems to be vulnerable. Of course everything should be sanitized, but in practice there are cases where it’s hard to make a proper sanitization while retaining features to let users write weird stuff. This is not the case of “validate a username” that you know very well which regex to use and which character space.

        I would actually say that this vulnerability should have been prevented using proper cookie security, which should make it impossible to steal the session via XSS.

        I do acknowledge though that it’s not easy to take care of all of this when it’s 2 people working on everything (from design to frontend, passing for deployment etc.), especially if there are no specific competencies in appsec.