Skip to content
XSS Write-up Advanced

mXSS: The Vulnerability Hiding in Your Code

The article explains mutation cross-site scripting (mXSS), where HTML sanitizers and browsers parse the same markup differently, allowing an attacker to bypass sanitization and inject JavaScript. It describes a case study in Joplin (CVE-2023-33726) where a parser differential led to arbitrary command execution.

Yaniv Nizry Follow

Published on sonarsource.com

Cross-site scripting (XSS) is a well-known vulnerability type that occurs when an attacker can inject JavaScript code into a vulnerable page. When an unknowing victim visits the page, the injected code is executed in the victim’s session.

Yaniv Nizry (@YNizry), on sonarsource.com

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

What the attacker needed

Victim opens a malicious note

How it was found

  1. The attacker creates a note containing HTML that exploits the parser differential.
  2. The victim opens the malicious note in Joplin.
  3. The sanitizer's parser fails to recognise the malicious element, but the renderer does.
  4. The injected event handler executes arbitrary code when the note is rendered.

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.

Websites often clean user-supplied HTML to remove dangerous code, but this cleaning can be fooled because browsers and cleaning tools sometimes interpret the same HTML differently. An attacker can craft HTML that looks safe to the cleaner but becomes malicious when the browser displays it, allowing them to run their own JavaScript in a victim's session.

What is XSS?

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

More by Yaniv Nizry

View all

7 more disclosed reports, best first.

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.