What is CVE-2020-11023 Vulnerability?
CVE-2020-11023 is a DOM-based cross-site scripting (XSS) vulnerability in jQuery's htmlPrefilter function. In plain English, the function, which is supposed to prepare HTML for insertion into the document, can be tricked into executing malicious code. Attackers can exploit this by crafting HTML that, when processed by a vulnerable version of jQuery, executes a malicious script in the user's browser. This is a classic XSS problem with a massive attack surface due to jQuery's ubiquity.
When was it discovered?
The vulnerability was disclosed on May 28, 2020. The jQuery team released patches to address the issue, but since many websites run on older, "set-it-and-forget-it" versions of the library, the vulnerability remains a persistent threat across the internet.
Affected Products & Versions
Product | Versions Affected | Fixed Version |
jQuery | < 3.5.0 | 3.5.0 and later |
CVE-2020-11023 technical description
The vulnerability exists in how jQuery's htmlPrefilter function handles self-closing HTML tags. Before version 3.5.0, the function used a regular expression that could be bypassed. An attacker can pass a string containing a crafted HTML payload (e.g., <img src=x onerror=alert(1)>) to a function like .html(). jQuery's htmlPrefilter would fail to properly sanitize this input, causing the browser to execute the malicious script contained in the onerror attribute. This script runs with the same permissions as the site itself, allowing the attacker to steal cookies, session tokens, or manipulate the page content.
Tactics, Techniques & Procedures (TTPs)
An attacker typically exploits CVE-2020-11023 by tricking a user into clicking a malicious link or by injecting the payload into a part of the website that reflects user input, like a search bar or comment section. Once the victim's browser loads the crafted HTML, the XSS payload executes. Attackers use this to steal sensitive information (like login credentials stored in cookies), deface websites, or redirect users to phishing pages.
Indicators of Compromise
Detecting DOM-based XSS can be tricky because the payload often doesn't touch the server. Indicators are primarily client-side. Look for suspicious scripts executing in the browser's developer console. Website administrators should audit their applications for outdated jQuery versions. Security scanning tools, both static (SAST) and dynamic (DAST), can identify the use of vulnerable library versions and test for XSS flaws in user-supplied input fields.
Known Proof-of-Concepts & Exploits
Proof-of-concept exploits for this vulnerability are widely available and simple to execute. A basic PoC involves passing a string like
How to detect CVE-2020-11023 Vulnerability?
Detection starts with identifying which version of jQuery your web applications are using. You can do this by checking your project's dependencies or by using the browser's developer tools to inspect the loaded scripts. Automated tools like OWASP Dependency-Check or commercial software composition analysis (SCA) tools can scan your codebase for this and other known library vulnerabilities. Regular web application vulnerability scans will also help identify exploitable XSS vectors.
Impact & risk of CVE-2020-11023 Vulnerability
A successful exploit can have a serious impact on both the website's users and its owner. For users, it can lead to account compromise, data theft, and being redirected to malicious sites. For the business, it can result in reputational damage, loss of user trust, and potential regulatory fines if sensitive data is exposed. Since the exploit happens in the user's browser, it can be difficult to trace, but the damage to your brand's credibility is immediate.
Mitigation & remediation strategies
The primary mitigation strategy is simple: update jQuery to version 3.5.0 or later. This is the most effective fix. If updating is not immediately possible, you must implement strict input validation and output encoding on all user-supplied data that is rendered on a page. Using a Content Security Policy (CSP) can also provide an additional layer of defense by restricting the sources from which scripts can be executed, making it harder for XSS payloads to run.
CVE-2020-11023 Vulnerability FAQs