GHSL-2021-1002: Copy-paste XSS in jSuites editor - CVE-2021-41086
The jSuites editor did not sanitise HTML pasted into it, so a crafted clipboard payload containing an image with event handlers could execute script. An attacker could trick a victim into copying and pasting such content to run JavaScript in the context of the editor page.
Originally disclosed on GitHub Security Lab
The jSuites editor is vulnerable to copy-paste cross-site scripting (XSS). For this particular type of XSS, the victim needs to be fooled into copying a malicious payload into the text editor.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the editor inserted pasted HTML into the page without sanitising it, allowing event-handler attributes to execute.
Impact
This issue may lead to XSS with user interaction.
What the attacker needed
Victim copies attacker-supplied HTML; victim pastes it into the editor
The fix
The issue was fixed after being reported.
How it was found
- Open the proof-of-concept playground page.
- Paste the crafted HTML snippet into the HTML input field.
- Click the button to copy the content as HTML.
- Open the jSuites text editor demo page.
- Paste the copied content into the editor.
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 report has not been written yet. The Original tab links to the source.
Cross-site scripting (XSS) is when an attacker gets their own JavaScript to run inside someone else's web page. Here the editor trusted whatever HTML was pasted into it, so a booby-trapped snippet could run code when pasted. The victim has to be tricked into copying the snippet and pasting it into the editor.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.