Advertisement






jQuery html() Cross Site Scripting

CVE Category Price Severity
CWE-79 Cross-Site Scripting Varies High
Author Risk Exploitation Type Date
Unknown High Remote 2020-04-28
CVSS EPSS EPSSP
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N 0.02192 0.50148

CVSS vector description

Our sensors found this exploit at: https://cxsecurity.com/ascii/WLB-2020040176

Below is a copy:

jQuery html() Cross Site Scripting
# jquery-xss-in-html
jQuery < 3.5 Cross-Site Scripting (XSS) in html()

Timmy Willison recently released a new version of jQuery. jQuery 3.5 fixes a cross-site scripting (XSS) vulnerability found in the jQuerys HTML parser. The Snyk open source security platform estimates that 84% of all websites may be impacted by jQuery XSS vulnerabilities.

Masato Kinugawa found a cross-site scripting (XSS) vulnerability in the htmlPrefilter method of jQuery, and published an example showing a popup alert window in the form of a challenge. (https://xss.pwnfunction.com/challenges/ww3/)

Below is a CodeQL query I wrote that can find user controlled values passed to html() which can be abused to perform Cross-Site Scripting.

Please check your projects, submit responsible disclosures to projects that might be affected.

```
/**
 * @name Taint-tracking to 'html' calls (with path visualization)
 * @description Tracks user-controlled values into 'html' calls (vulnerable to XSS in jQuery < 3.5)
 *              and generates a visualizable path from the source to the sink.
 * @kind path-problem
 * @tags security
 * @id js/html-taint-path
 */
import javascript
import DataFlow
import DataFlow::PathGraph
import DOM
import semmle.javascript.dependencies.FrameworkLibraries

class HtmlTaint extends TaintTracking::Configuration {
  HtmlTaint() { this = "HtmlTaint" }
  override predicate isSource(Node node) { node = DOM::locationSource() }
  override predicate isSink(Node node) { node =jquery().getACall().getAMethodCall("html").getArgument(0) }
}
from HtmlTaint cfg, PathNode source, PathNode sink, FrameworkLibraryInstance framework, string version
where cfg.hasFlowPath(source, sink) and framework.info("jquery", version)
select sink.getNode(), source, sink, "Html with user-controlled input from $@. When using jquery version $@.", source.getNode(), "here", framework, version
```

Copyright ©2024 Exploitalert.

This information is provided for TESTING and LEGAL RESEARCH purposes only.
All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use and Privacy Policy and Impressum