While I was asleep, apparently the site was hacked. Luckily, (big) part of the lemmy.world team is in US, and some early birds in EU also helped mitigate this.

As I am told, this was the issue:

  • There is an vulnerability which was exploited
  • Several people had their JWT cookies leaked, including at least one admin
  • Attackers started changing site settings and posting fake announcements etc

Our mitigations:

  • We removed the vulnerability
  • Deleted all comments and private messages that contained the exploit
  • Rotated JWT secret which invalidated all existing cookies

The vulnerability will be fixed by the Lemmy devs.

Details of the vulnerability are here

Many thanks for all that helped, and sorry for any inconvenience caused!

Update While we believe the admins accounts were what they were after, it could be that other users accounts were compromised. Your cookie could have been ‘stolen’ and the hacker could have had access to your account, creating posts and comments under your name, and accessing/changing your settings (which shows your e-mail).

For this, you would have had to be using lemmy.world at that time, and load a page that had the vulnerability in it.

  • Snow-Foxx
    link
    fedilink
    262 years ago

    You guys really have my highest respect for spending so much time to keep this running, despite all the recent trouble and now even an attack.

    Thank you very much <3 You guys are awesome and I really appreciate how publicly you deal with this.

  • @[email protected]
    link
    fedilink
    182 years ago

    Good job. I don’t understand very much of that, so that makes me all the more grateful. Thank you.

  • @[email protected]
    link
    fedilink
    52 years ago

    A lot of images seems to be gone from posts in /c/pics is this related to the hack or the cleanup after?

  • @[email protected]
    link
    fedilink
    2
    edit-2
    2 years ago

    Is there a rough time range when it happened? and any news about other big instances like lemmy.ml? Are those safe? Currently they are not on the same version as lemmy.world.

    • @[email protected]
      link
      fedilink
      32 years ago

      2:11 UTC is my first record of the event taking place, but keep in mind the attacker could have injected code long before without noticeable impacts. There’s no way to be completely certain they didn’t steal tokens and access accounts before they made themselves known.

  • godless
    link
    fedilink
    82 years ago

    With the JWT secret rotation, shouldn’t everyone be forced to re-login? I’m posting with my existing session without any changes.

  • @[email protected]
    link
    fedilink
    22 years ago

    I lost some of my post history. Is there a data issue that’s come from this? Why are my comments gone?

    • pgetsos
      link
      fedilink
      22 years ago

      If it is only recent post history, maybe it was purged along with many malicious comments/posts

  • Marek Knápek
    link
    fedilink
    722 years ago

    So what happened:

    • Someone posted a post.
    • The post contained some instruction to display custom emoji.
    • So far so good.
    • There is a bug in JavaScript (TypeScript) that runs on client’s machine (arbitrary code execution?).
    • The attacker leveraged the bug to grab victim’s JWT (cookie) when the victim visited the page with that post.
    • The attacker used the grabbed JWTs to log-in as victim (some of them were admins) and do bad stuff on the server.

    Am I right?

    I’m old-school developer/programmer and it seems that web is peace of sheet. Basic security stuff violated:

    • User provided content (post using custom emojis) caused havoc when processing (doesn’t matter if on server or on client). This is lack of sanitization of user-provided-data.
    • JavaScript (TypeScript) has access to cookies (and thus JWT). This should be handled by web browser, not JS. In case of log-in, in HTTPS POST request and in case of response of successful log-in, in HTTPS POST response. Then, in case of requesting web page, again, it should be handled in HTTPS GET request. This is lack of using least permissions as possible, JS should not have access to cookies.
    • How the attacker got those JWTs? JavaScript sent them to him? Web browser sent them to him when requesting resources form his server? This is lack of site isolation, one web page should not have access to other domains, requesting data form them or sending data to them.
    • The attacker logged-in as admin and caused havoc. Again, this should not be possible, admins should have normal level of access to the site, exactly the same as normal users do. Then, if they want to administer something, they should log-in using separate username + password into separate log-in form and display completely different web page, not allowing them to do the actions normal users can do. You know, separate UI/applications for users and for admins.

    Am I right? Correct me if I’m wrong.

    Again, web is peace of sheet. This would never happen in desktop/server application. Any of the bullet points above would prevent this from happening. Even if the previous bullet point failed to do its job. Am I too naïve? Maybe.

    Marek.

  • @[email protected]
    link
    fedilink
    52 years ago

    What are the risks for people who use Jerboa for Lemmy? I logged put and back in and there doesn’t seem to be any issues, so are the app users excluded from this?

  • AsunasPersonalAsst
    link
    fedilink
    242 years ago

    So, do we change passwords, esp those who logged on during the attack? (I created this acct right before the attack happened tho.)

  • @[email protected]
    link
    fedilink
    52 years ago

    Is it possible cookies for other websites were scraped? I was logged in to .world at the time; I have logged out of all accounts, and reset passwords as a precaution, but want to know if I should be on the lookout from this.

    • @[email protected]
      link
      fedilink
      102 years ago

      No, in general it’s not possible because the code in a page cannot access cookies that are bound to other domains. It is only possible if the “other” site misconfigured its own cookies (which is really not likely for stuff you would care about).