Lemmy just had its first major hack. What happens next:

Hi all,

If you’re just now signing in for the first time in 12+ hours, you may just now be finding out that Lemmy World and other instances where hijacked. The hijackers had the full abilities of hijacked user, mod, and admin accounts. At this time, I am only aware of instance defacing and URL redirections to have been done by the hijackers.

If you were not forced to sign back in this morning, contact your instance admin to verify mitigations were completed on your instance.

How?

This occurred due to an XSS attack in the recently added custom emojis. Instance admins should follow the issue tracker on the LemmyNet GitHub, as well as the Matrix Chat. Post-Incident Activity is still on-going.

Currently, it is likely that just your session cookie was stolen, with instance admins being targeted specifically by checking for navAdmin, an HTML element only instance admins had. I do not believe this to affect users across instances, but I have yet to confirm this.

What happens next?

As I am not the developers or affected instance admins, I cannot make any guarantees. However, here is what you’ll likely see:

  1. Post Incident investigation continues. This will include inspecting code, posts, websites, and more used by the hijackers. An official incident writeup may occur. You should expect the following from that report:
  • Exactly what happened, when.
  • The incident response that occurred from instance admins
  • Information that might have helped resolve the issue sooner
  • Any issues that prevented successful resolution
  • What should have been done differently by admins
  • What should be improved by developers
  • What can be used to identify the next attack
  • What tools are needed to identify that information
  1. A CVE is created. This is an official alert of the issue, and notifies security experts (and enthusiasts), even those not using lemmy, about the issue.
  2. A code security audit is done. This will likely just be casual reviews by technical lemmy users. However, I will be reaching out to the Mozilla Foundation and Cure53 as they recently did an audit of Mastodon. If there is interest in an external audit of lemmy and the costs are affordable, I’ll look into crowdfunding this cost.
redcalcium, (edited )

This incident made me realize not to use an admin account for my primary lemmy account in my personal instance. I setup another account for instance admin purpose (with 2FA enabled) and keep it logged out, then remove my primary account from the instance admin list.

Renacles,

This is a good mindset in general, when working in AWS you are not supposed to use your root account unless it’s absolutely necessary even if you are the only user. Hosting a Lemmy instance should be no different.

kakes,

Yeah, even in Windows or what-have-you, you should always keep your admin account separate from your daily driver account for exactly this reason.

Vilian,

most, if not every, linux distro work that way

Trainguyrom,

I just setup a VPS for a Minecraft server for some friends and did exactly that. I was under a bit of a time crunch, but still took the time to think through those challenges in access for everything. Created an unprivileged user to run the server as, created a seperate unprivileged user for another service. Disabled password-based SSH login, etc.

I should probably setup a dedicated non-root admin account for administrative functions but that’s a problem for after work

BarterClub,

Yup. Basics of running a server for anything. Never use your admin account and make a default backup with 2 factor.

Crackhappy,
@Crackhappy@lemmy.world avatar

I work with 2 factor, Oath, SAML, etc. all the time for work, and for the life of me I can’t get it working properly with Lemmy.

redcalcium,

I use bitwarden, so it’s pretty simple: just copy the link from the 2fa button in Lemmy into the TOTP field in your account editor in bitwarden, and it’ll automatically recognize the format.

Crackhappy,
@Crackhappy@lemmy.world avatar

Yeah, I’m using Google Auth, and I’m getting codes just fine, but none of them work, regardless of how I try to use it.

redcalcium,

Google Authenticator doesn’t seems to support SHA256: github.com/google/…/11

Maybe try FreeOTP instead: freeotp.github.io

Notorious,

Lemmy decided to go with SHA256 for TOTP seed. This is a very odd move since many 2FA apps don’t support SHA256. I actually had to write a quick python script to spit out my 2FA code since Bitwarden doesn’t support it. Hopefully either Lemmy will change to SHA-1 or Bitwarden will start to support SHA256 seeds.

redcalcium,

Wait, I use bitwarden and it works just fine. And yes, it’s using SHA256.

Screenshot:

https://c.calciumlabs.com/pictrs/image/061e5d50-62d3-4fcf-b5aa-6927f9060427.png

Trapping5341,

wait wait wait. how did you get lemmy 2FA into bitwarden. I can only get it to set up in authy or google auth

redcalcium,

You’ll need to either subscribe to bitwarden premium ($10 / year), or deploy vaultwarden in your own server and have your bitwarden extension/app use that vaultwarden server instead of the official server.

Trapping5341,

Yeah I have premium and every account I have that offers 2fa is set up but Lemmy will only let me set it up in authy or Google auth. It won’t give bitwarden as an option or give me the code to manually add it to bitwarden.

redcalcium,

Just right click at the 2fa button and select “copy link”, then paste the link into bitwarden TOTP field. The link you copied should already be in the format otpauth://totp/xxxx which will be recognized by bitwarden.

Trapping5341,

😂 can’t believe I didn’t think of that. Thank you so much.

0x4E4F,
@0x4E4F@sh.itjust.works avatar

If there is interest in an external audit of lemmy and the costs are affordable, I’ll look into crowdfunding this cost.

It could get VERY, VERY expensive… depends on code complexity.

static,
static avatar

Not at this stage.
Lemmy grew too fast, got many more eyes.
Step 1 is getting a security focus group selected from the people who contribute code to lemmy.

Just like the admins and coders volonteer their time, security specialists will too, money might be needed, but that is not in the the first steps.

0x4E4F,
@0x4E4F@sh.itjust.works avatar

Agreed, this is wise.

rcmaehl,
@rcmaehl@lemmy.world avatar

Yeah, specifically why I mentioned “affordable”.

kakes,

Agreed. It might be hard to swing right now, but imo this is going to be a crucial step moving forward.

0x4E4F,
@0x4E4F@sh.itjust.works avatar

The examples below might actually do most of the work for free.

barsoap,
  1. Set up a fake Nazi lemmy
  2. Have it online during the next Chaos Communication Congress
  3. ???
  4. 50 CVEs.
rcmaehl,
@rcmaehl@lemmy.world avatar
  1. Be Lemmy Devs
  2. Loudly Claim Lemmy is Bulletproof and unhackable
  3. ???
  4. 50 CVEs
kep,

This post is weird. You’re typing like you’re in charge of things, but you’re apparently not.

It’s one thing to show some initiative, but you’re literally demanding a full report like the Lemmy devs work for you. You sound like someone who does this kind of thing for a living and felt the need to flex. Because otherwise, what the hell are you even doing?

Setting neurotically-specific demands for the developers makes sense if you represent a big instance or something, but you’re literally just a dude. You could have framed this entire post in a different way and gotten away with it. Right now, it’s creepy to anybody who actually reads the entire thing.

rcmaehl,
@rcmaehl@lemmy.world avatar

These aren’t demands, but I can definitely see how they can come off that way. These are industry standard post cybersecurity incident review questions by defined by NIST (NIST SP 800-61 Rev 2 Section 3.4.1) slightly rephrased.

theangryseal,

I haven’t been able to change my password on Lemmy.world. When I click save, nothing happens and the password doesn’t update.

That’s probably something someone wants to look into.

ijeff,
@ijeff@lemdro.id avatar

Try clearing your browser data and cookies first.

theangryseal,

I specifically cleared lemmy.world data and that did it.

Thank you.

m3t00,
@m3t00@lemmy.world avatar

had a login/not logged in loop for a while yesterday. reset lemmy.world site data seems to have fixed

veganpizza69,
@veganpizza69@lemmy.world avatar

Currently, it is likely that just your session cookie was stolen, with instance admins being targeted specifically by checking for navAdmin, an HTML element only instance admins had. I do not believe this to affect users across instances, but I have yet to confirm this.

Probably because the hackers used some http request to get the data and didn’t want to wade through thousands of rows of JWT strings.

choroalp,

XSS, Seriously?

rcmaehl,
@rcmaehl@lemmy.world avatar

To add context to this. What I’ve been told is that a community running on a lemmy fork with 5 digit users had used this code for a while and backported(?) the code upstream when they federated back. I guessing there was an assumption of safety as they had been using the custom emojis code for quite a while without it being exploited.

FightMilk,

Yeah it’ll be hard to regain my trust after this one. I mean I’ll still use Lemmy but for now I’ll assume mine or any other account could be hacked at any time and act accordingly. This is a really amateur mistake even by FOSS standards.

p03locke,
@p03locke@lemmy.dbzer0.com avatar

A code security audit is done. This will likely just be casual reviews by technical lemmy users. However, I will be reaching out to the Mozilla Foundation and Cure53 as they recently did an audit of Mastodon. If there is interest in an external audit of lemmy and the costs are affordable, I’ll look into crowdfunding this cost.

You don’t need to pay money. You just need to listen to the recommendations already made by free tools.

Here, fix this shit first and then worry about a professional audit later.

PagingDoctorLove,

How do I contact my instance admin?

I went ahead and logged out and back in on my own, but I was not prompted to do so by Lemmy and I don’t know enough about this stuff to say whether or not doing it on my own would’ve helped. I’m still pretty overwhelmed trying to figure this site out, so I apologize if this is a dumb question, just want to make sure I’m doing what I can to protect my own privacy.

I don’t want to fall for the millennial version of a Nigerian prince scam, lol.

TimewornTraveler,

I wonder which instances required logins. I had to relog into my .world account, but my .ee account was still logged in.

gila,

I heard lemm.ee wasn’t vulnerable, so logging users out shouldn’t be necessary. To be vulnerable there would need to be custom emotes defined on the local instance by the admins, so I’m guessing they had none.

BadAtNames,

You’re on the lemmy.world instance, so you can reach the admins by emailing info@lemmy.world, or posting in the support forum !support

Now to answer whether there’s a difference between being promoted and doing it yourself - In this case, it’s suspected that session tokens were compromised. You know how when you enter some events, they vet you/your ticket once at the door and then put a stamp on your hand? If you go out and want to get back in, you don’t have to do the whole verification song and dance again, just show them your stamp? Well, that’s pretty much what a session token is - Lemmy vets your password once when you log in, and gives an unique session token to whatever browser or app you used to log in. That way, when you reopen Lemmy, you don’t have to enter your password again.

Now that token is compromised, you have to assume a hacker has your unique token. When you logged yourself back in, Lemmy did the whole validation process again and gave your browser/app a new, unique session token - that’s just how logging in works. But the important question is, did it invalidate the old session token when you logged out? Otherwise the hacker can still show the old token and pretend to be you.

Now if your browser/app prompted you to log-in today, you can be sure that your browser/app tried to get into Lemmy and was denied access. That means you can be sure your old stamp/token is now invalid. Logging out and in yourself doesn’t give you the same guarantee - you will have to check Lemmy code (or run some experiments) to know if logout does actually invalidate the old token. I haven’t validated Lemmy’s code, but I will say most half decent software will invalidate your token when you log out. If you want an extra layer of protection, change your password as well - even the software devs that forget to invalidate tokens on logout usually remember to invalidate them on password changes.

phileashog,

XSS, classic

Thanks for your hard work, fuck the trolls that always have to poke holes in shit

subash,

thanks for the update

hackitfast,
@hackitfast@lemmy.world avatar

Honestly, I see it as a win.

The people that did this didn’t really act out in a coordinated attack. They were just kind of playing around, redirecting to lemonparty, changing page elements.

It could have been a lot worse. The site could have been redirecting to malicious websites, downloading trojans, doing a lot of bad things. Instead, we got direct attention to the security vulnerabilities in question, and they’re being worked on and patched out relatively quickly. Helps that a lot of those on these communities are focused in programming and cybersecurity.

phileashog,

That’s fair, I was a little harsh. Not all hackers are looking to cause damage!

dudebro,

Yes, exactly. This could’ve been way worse.

drdaeman,
@drdaeman@lemmy.zhukov.al avatar

The fundamental issue is not that emoji XSS (that’s just a vector), but how JWTs are implemented and [not] secured. I’ve read that it was reported at least this January (akkoma.nrd.li/notice/AXXhAVF7N5ZH1V972W).

So, developers were already aware, yet - as I’m checking 0.18.1 - they have not fixed the unsafe-inline and unsafe-eval CSP, haven’t made jwt cookie HttpOnly, and haven’t done anything about exp and jti in the JWTs. I hope the recent events will make them do to so, and not just patch this particular XSS.

p03locke,
@p03locke@lemmy.dbzer0.com avatar

Kegan may have been better off submitting a GitHub issue. And if issues haven’t been open for these critical security flaws, you should, too.

sneakyninjapants,

Agree completely. In the grand scheme of things the damage that appears to have happened here is small potatoes, but it brought attention to the vulnerability so it was patched quickly. Going forward now, the authors and contributors to the project might be a bit more focused on hardening the software against these types of vulnerabilities. Pen testing is invaluable on wide user-base internet accessible platforms like this because it makes better, more secure software. Unfortunately this breech wasn’t under the “ethical pen testing” umbrella but it sure as hell brought the vulnerability to the mindshare of everyone with a stake in it, so I view it as a net win.

where_am_i,

also, I cannot properly login into my lemmy.world account anymore. username/password work, but when I try to upvote it tells me i gotta be logged in. Tried apps and web.

Alkider,

sometimes just logging in again works. if you have it set to automatically log in, that happens sometimes.

Trapping5341,

I had the same problem on the liftoff app. Had to delete the account then sign back in and everything worked perfectly again. Personally I also changed my password because it made me feel better.

cnhguy,

For liftoff, you can just add the same .world account again and it’ll work, it worked for me.

Yoz,

Clear cache of the app

jennwiththesea,
@jennwiththesea@lemmy.world avatar

For me it was cache and storage. Just cache didn’t work. (Using Liftoff)

POTUS,

Thank you so much! I had the same problem but didn’t think of clearing the cache…

Yoz,

Cheers. Happy to help

roy_mustang76,

Try clearing cookies (or app cache, on app), that will most likely resolve the issue.

Fireinthesky7,

I had to clear the app cache and local storage before it would work. Cache alone didn’t work.

nobloat,

Is the sudden unannounced disappearance of Vlemmy related to this ? I had my main account there and it just disappeared

amanaftermidnight,

The most probable theory is that the server owner found illegal federated content on their server and decided to nuke the place entirely.

Uriel238,

Having recently migrated from Reddit (and kept up with commercial social media hacks) I’m used to Nothing To See Here! We totally didn’t store your personal information in plaintext for hackers to snatch. Oh and maybe please change your passwords. All Part Of The Show!

So, by comparison, the response here is downright heartwarming.

Alkider,

Whoops! Reddit spazzed out and couldn’t send your post because it hurts spez’s feelings!

jcrabapple,

Sometimes you just have to learn the hard way.

luis123456,

Sure thing. So happy to see all good aga8n.

uhvayga,
uhvayga avatar

deleted_by_author

  • Loading...
  • DudePluto,

    I’d just log off lol

    Cybermass,

    Toxic social media < no social media

    0x4E4F,
    @0x4E4F@sh.itjust.works avatar

    Exactly 👍.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • fediverse@lemmy.world
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines