Advisory

GHSA-gxr4-xjj5-5px2

Also known as: BIT-drupal-2020-11022, CVE-2020-11022

Summary

Potential XSS vulnerability in jQuery

Details

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:

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2020-04-29 22:18 UTC
Modified
2026-09-10 03:48 UTC

Affected packages and fixes

jquery

npm · All systems

Affected

  • introduced 1.12.0, fixed 3.5.0 (semver)

Fixed versions

3.5.0

Fix

jquery

NuGet · All systems

Affected

  • introduced 1.12.0, fixed 3.5.0 (ecosystem)

Fixed versions

3.5.0

Fix

The export has no generic command for this ecosystem.

jquery-rails

RubyGems · All systems

Affected

  • introduced 0, fixed 4.4.0 (ecosystem)

Fixed versions

4.4.0

Fix

The export has no generic command for this ecosystem.

maximebf/debugbar

Packagist · All systems

Affected

  • introduced 0, fixed 1.19.0 (ecosystem)

Fixed versions

1.19.0

Fix

The export has no generic command for this ecosystem.

athlon1600/youtube-downloader

Packagist · All systems

Affected

  • introduced 0, fixed 4.0.1 (ecosystem)

Fixed versions

4.0.1

Fix

The export has no generic command for this ecosystem.

components/jquery

Packagist · All systems

Affected

  • introduced 1.12.0, fixed 3.5.0 (ecosystem)

Fixed versions

3.5.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