Skip to content
XSS Write-up Intermediate

CVE-2020-11022/CVE-2020-11023: jQuery 3.5.0 Security Fix details

jQuery's .html() method modified sanitised HTML through its htmlPrefilter and wrapping logic, allowing an attacker to bypass HTML sanitisation and execute JavaScript. An attacker could inject malicious HTML that, when appended via jQuery, would run script in the victim's browser.

Unknown Follow

Published on mksben.l0.cm

Masato Kinugawa's detailed breakdown of the jQuery vulnerabilities CVE-2020-11022 and CVE-2020-11023 offers an exceptional insight into the security flaws that could lead to XSS attacks even after applying sanitization. His explanation is not only technical but also accessible, demonstrating how the internal behavior…

Unknown, on mksben.l0.cm

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

Impact

An attacker could execute arbitrary JavaScript in the context of a victim's browser, leading to XSS, but only if the application uses jQuery's .html() to append sanitised HTML.

What the attacker needed

Application uses jQuery .html() to append sanitised HTML; attacker can supply HTML that passes sanitisation

The fix

The issue was fixed in jQuery 3.5.0 by making htmlPrefilter an identity function and restricting the wrapping processing to MSIE9 only.

How it was found

  1. Create HTML that appears safe but contains a self-closing tag or an option element with an event handler.
  2. Pass the HTML through a sanitiser that leaves it unchanged.
  3. Append the sanitised HTML using jQuery's .html() method.
  4. Observe that the script executes because jQuery's internal processing modifies the HTML.

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.

jQuery is a popular JavaScript library that helps developers add content to web pages. Its .html() function was supposed to safely insert HTML, but it secretly changed the HTML in ways that could turn harmless-looking code into a script that runs in the user's browser. This means an attacker could trick a website into running their code even if the site tried to clean the HTML first.

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 Unknown

View all

32 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.