CVE-2020-11022: jQuery has a potential XSS vulnerability
Impact Passing HTML from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code.
Patches This problem is patched in jQuery 3.5.0.
Workarounds To workaround the issue without upgrading, adding the following to your code:
js jQuery.htmlPrefilter = function( html ) { return html; };
You need to use at least jQuery 1.12/2.2 or newer to be able to apply this workaround.
References https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/ https://jquery.com/upgrade-guide/3.5/
For more information If you have any questions or comments about this advisory, search for a relevant issue in the jQuery repo. If you don't find an answer, open a new issue.
Other sources
A Cross-site scripting (XSS) vulnerability exists in JQuery. This flaw allows an attacker with the ability to supply input to the ‘HTML’ function to inject Javascript into the page where that input is rendered, and have it delivered by the browser.
A cross-site scripting (XSS) vulnerability in the htmlPrefilter method of jQuery before 3.5.0.
References:
https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/ https://github.com/jquery/jquery/pull/4642 https://github.com/jquery/jquery/pull/4647 https://seclists.org/fulldisclosure/2020/Apr/46
Upstream fix:
https://github.com/jquery/jquery/commit/1d61fd9407e6fbe82fe55cb0b938307aa0791f77
— Red Hat
In jQuery starting with 1.12.0 and before 3.5.0, passing HTML from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.
— MITRE
In jQuery versions greater than or equal to 1.2 and before 3.5.0, passing HTML from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.
jQuery is vulnerable to cross-site scripting, caused by improper validation of user-supplied input by the jQuery.htmlPrefilter method. A remote attacker could exploit this vulnerability to inject malicious script into a Web page which would be executed in a victim's Web browser within the security context of the hosting Web site, once the page is viewed. An attacker could use this vulnerability to steal the victim's cookie-based authentication credentials.
— IBM
Affected Software
Remediation
Patch Available
Patch Available
Patch Available
Patch Available
Patch Available
Event History
Parent advisories
This vulnerability appears in the following advisories.
- RHSA-2020:4211
- RHSA-2020:2362
- RHSA-2021:0778
- RHSA-2020:3936
- RHSA-2020:4670
- RHSA-2020:4847
- RHSA-2023:0556
- RHSA-2023:0553
- RHSA-2023:0554
- RHSA-2023:0552
- RHSA-2020:2217
- RHSA-2020:2412
- RHSA-2020:4298
- RHSA-2020:2813
- RHSA-2023:1049
- RHSA-2023:1043
- RHSA-2023:1044
- RHSA-2023:1045
- RHSA-2020:3247
- RHSA-2020:3807
- RHSA-2022:6393
- RHSA-2023:1047
- IBM-7182522
Frequently Asked Questions
What is the severity of CVE-2020-11022?
CVE-2020-11022 is classified as a moderate severity vulnerability.
How do I fix CVE-2020-11022?
To fix CVE-2020-11022, upgrade to jQuery version 3.5.0 or later.
What types of attacks are possible with CVE-2020-11022?
CVE-2020-11022 allows for the execution of untrusted code via jQuery DOM manipulation methods.
Which applications are affected by CVE-2020-11022?
Applications using jQuery prior to version 3.5.0 are vulnerable to CVE-2020-11022.
Is there a workaround for CVE-2020-11022?
The recommended solution is to upgrade jQuery, as specific workarounds may vary based on implementation.