PT-2021-7968
CVE-2021-41184
·
Published
2021-05-04
·
Updated
2026-03-01
Description by
CVSS 2.0
7.8
HighMetricsAV:N/AC:L/Au:N/C:N/I:C/A:N
Name of the Vulnerable Software and Affected Versions
jQuery UI versions prior to 1.13.0
Description
The issue is related to the
.position() util in jQuery UI, where accepting the value of the of option from untrusted sources may execute untrusted code. Any string value passed to the of option is now treated as a CSS selector in version 1.13.0. A workaround is to not accept the value of the of option from untrusted sources. For example, invoking the following code:js
$( "#element" ).position( {
my: "left top",
at: "right bottom",
of: "<img onerror='doEvilThing()' src='/404' />",
collision: "none"
} );will call the
doEvilThing() function.Recommendations
To resolve the issue, update to jQuery UI version 1.13.0 or later. As a temporary workaround, consider not accepting the value of the
of option from untrusted sources. Restrict access to the .position() util to minimize the risk of exploitation. Avoid using the of option in the affected API endpoint until the issue is resolved. Found an issue in the description? Have something to add? Feel free to write us 👾