Skip to content
XSS Write-up Beginner

Lemmy has an XSS vulnerability in the Markdown parser

Lemmy did not escape HTML in several site-level text fields such as the tagline, sidebar and legal information, so an attacker could inject markup that ran script in visitors' browsers. On lemmy.world this was used to replace the page content and redirect visitors to an external video.

sh.itjust.works

Published on sh.itjust.works

AlmightySnoo II 🐢](https://sh.itjust.works/u/AlmightySnoo) to (email protected)English •

The author, on sh.itjust.works

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Markdown/HTML rendering pipeline for site configuration fields did not sanitise or escape user-supplied markup before it was rendered in the browser.

Impact

Any visitor to an affected instance could have script run in their browser, allowing content replacement and redirection to an attacker-controlled page; the report notes the legal field payload was limited because it used double quotes.

What the attacker needed

Control of a site-level text field; victim visits the affected instance

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A website normally treats text you type as plain text, but if it inserts that text into the page without cleaning it, a browser will run any code hidden in it. Here the site's tagline, sidebar and legal page accepted such code, so anyone viewing the site could be redirected or shown fake content. This kind of flaw is called cross-site scripting, or XSS.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.