Skip to content
XSS Advisory Intermediate CVE-2021-32855

GHSL-2021-1006: Copy-paste XSS in vditor text editor - CVE-2021-32855

The vditor text editor is vulnerable to copy-paste cross-site scripting (XSS). An attacker could trick a victim into copying a malicious payload and pasting it into the editor, leading to script execution.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

The vditor text 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.

ghsecuritylab, on GitHub Security Lab

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 fails to sanitise pasted HTML content, allowing event handler attributes to execute.

Impact

This issue may lead to XSS with user interaction.

What the attacker needed

Victim copies malicious payload; victim pastes into editor

The fix

The issue was fixed in commit 1b2382d.

How it was found

  1. Open the provided playground page.
  2. Paste the malicious HTML code into the 'HTML Input' field.
  3. Click 'Copy as HTML' to copy the payload.
  4. Open the vditor demo page.
  5. Paste the copied content into the text 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 a security flaw where an attacker can inject malicious code into a trusted website. In this case, the vditor text editor does not properly clean up content that is pasted into it, so if a victim copies a specially crafted piece of HTML and pastes it into the editor, the malicious code runs in their browser. The attacker must first trick the victim into copying the payload, for example by providing a webpage that copies it to the clipboard.

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 ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

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.