Advisory

GHSA-2pqj-h3vj-pqgw

Also known as: CVE-2012-6708

Summary

Cross-Site Scripting in jquery

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2020-09-01 16:41 UTC
Modified
2024-03-08 05:20 UTC

Affected packages and fixes

jquery

npm · All systems

Affected

  • introduced 0, fixed 1.9.0 (semver)

Fixed versions

1.9.0

Fix

jQuery

NuGet · All systems

Affected

  • introduced 0, fixed 1.9.0 (ecosystem)

Fixed versions

1.9.0

Fix

The export has no generic command for this ecosystem.

jquery-rails

RubyGems · All systems

Affected

  • introduced 0, fixed 2.2.0 (ecosystem)

Fixed versions

2.2.0

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences