GHSA-2pqj-h3vj-pqgwMediumCVSS 6.1

Cross-Site Scripting in jquery

Published
September 1, 2020
Last Modified
July 10, 2023

🔗 CVE IDs covered (1)

📋 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='<img src=\"x\" onerror=\"alert(1)\" />']").html()
);

Recommendation

Update to version 1.9.0 or later.

🎯 Affected products4

  • npm/jquery:<= 1.8.3
  • maven/org.webjars.npm:jquery:<= 1.8.3
  • nuget/jQuery:<= 1.8.3
  • rubygems/jquery-rails:< 2.2.0

🔗 References (22)