109
submitted 1 year ago* (last edited 1 year ago) by terribleplan@lemmy.nrd.li to c/lemmy@lemmy.ml

I tried what another user reported and it worked. I submitted a github issue as the security email seems to be unmonitored based on me trying to contact it (regarding a different issue) for over a week now.

Be careful about links you click in Lemmy, I guess.

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

What is XSS?

Cross-site scripting (XSS) is an exploit where the attacker attaches code onto a legitimate website that will execute when the victim loads the website. That malicious code can be inserted in several ways. Most popularly, it is either added to the end of a url or posted directly onto a page that displays user-generated content. In more technical terms, cross-site scripting is a client-side code injection attack. https://www.cloudflare.com/learning/security/threats/cross-site-scripting/

Impact

One-click Lemmy account compromise by social engineering users to click your posts URL.

Reproduction

Lemmy does not properly sanitize URI's on posts leading to cross-site scripting. You can see this working in action by clicking the "link" attached to this post on the web client.

To recreate, simply create a new post with the URL field set to: javascript:alert(1)//

Patching

Adding filtering to block javascript: and data: URI's seems like the easiest approach.

top 12 comments
sorted by: hot top controversial new old
[-] kia@lemmy.ca 23 points 1 year ago

Yeah this needs to be addressed ASAP.

[-] devnull@sopuli.xyz 17 points 1 year ago

While this is a critical issue, it makes me trust the platform even more, thanks to people like you who are committed to improving the security. So thanks for reporting this and hopefully it will be fixed as soon as possible ๐Ÿ‘Œ

[-] s4if@lemmy.my.id 13 points 1 year ago

commit to fix this
Fixed 3 minutes ago.. cool!

[-] lemann@lemmy.one 4 points 1 year ago

Noice. Might need to let the Kbin dev know in case this affects them too

@ernest@kbin.social

hopefully that works?

[-] Lemmypy@feddit.nl 6 points 1 year ago

Shit this is baaaaaad

[-] mojo@lemm.ee 5 points 1 year ago
[-] terribleplan@lemmy.nrd.li 3 points 1 year ago

May the Lord have mercy on us all.

[-] clearedtoland@lemmy.fmhy.ml 5 points 1 year ago

Is this how u/spez will take us down?

Jk. Commenting to show activity on the post.

[-] substill@vlemmy.net 4 points 1 year ago

Well. Fuck.

[-] varsock@programming.dev 2 points 1 year ago

excellent find. well done!

[-] perviouslyiner@lemm.ee 1 points 1 year ago

Patching: Allow only beginning with https:// (and maybe http://) might avoid related issues with any other protocols that the various browsers support?

[-] terribleplan@lemmy.nrd.li 5 points 1 year ago

Agreed, I recommended filtering to only http(s) links in the github issue, I just made this x-post. I don't see a strong reason to let people link to weird things like file: and data:, or deeplink to installed apps on your computer/phone. Filtering the scheme to just http(s) is how Nutomic seems to have fixed it in the backend from what I can tell (I am not a rust dev).

this post was submitted on 06 Jul 2023
109 points (100.0% liked)

Lemmy

12506 readers
17 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 4 years ago
MODERATORS