GitHub Advisoryadvisory · npm, Maven, NuGet, RubyGems

GHSA-2pqj-h3vj-pqgw Cross-Site Scripting in jquery

MEDIUM Published 2020-09-01 Modified 2023-06-26 Official page ↗
Aliases
CVE-2012-6708
Ecosystem
npm, Maven, NuGet, RubyGems
Packages
jquery, org.webjars.npm:jquery, jQuery, jquery-rails
Severity
Moderate
CVSS vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weaknesses
CWE-64, CWE-79
Reviewed
2020-08-31

Affected packages

• npm jquery: < 1.9.0 → fixed in 1.9.0 • Maven org.webjars.npm:jquery: < 1.9.0 → fixed in 1.9.0 • NuGet jQuery: < 1.9.0 → fixed in 1.9.0 • RubyGems jquery-rails: < 2.2.0 → fixed in 2.2.0

Description

Affected versions of `jquery` are vulnerable to cross-site scripting. This occurs because the main `jquery` function uses a regular expression to differentiate between HTML and selectors, but does not properly anchor the regular expression. The result is that `jquery` may interpret HTML as selectors when given certain inputs, allowing for client side code execution. Proof of Concept ``` $("#log").html( $("element[attribute='']").html() ); ``` Recommendation Update to version 1.9.0 or later.

Related

Alias · CVE (1)

  • CVE-2012-6708 jQuery before 1.9.0 is vulnerable to Cross-site Scripting (XSS) attacks. vulnerability

Weakness · CWE (2)

  • CWE-64 Windows Shortcut Following (.LNK) weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation weakness

References