CVE-2021-41184: XSS in the `of` option of the `.position()` util
Impact Accepting the value of the of option of the .position() util from untrusted sources may execute untrusted code. 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.
Patches The issue is fixed in jQuery UI 1.13.0. Any string value passed to the of option is now treated as a CSS selector.
Workarounds A workaround is to not accept the value of the of option from untrusted sources.
For more information If you have any questions or comments about this advisory, search for a relevant issue in the jQuery UI repo. If you don't find an answer, open a new issue.
Other sources
jQuery jQuery-UI is vulnerable to cross-site scripting, caused by improper validation of user-supplied input by the .position() function. A remote attacker could exploit this vulnerability using the of parameter to inject malicious script into a Web page which would be executed in a victim's Web browser within the security context of the hosting Web site, once the page is viewed. An attacker could use this vulnerability to steal the victim's cookie-based authentication credentials.
— IBM
jQuery-UI is the official jQuery user interface library. Prior to version 1.13.0, accepting the value of the of option of the .position() util from untrusted sources may execute untrusted code. The issue is fixed in jQuery UI 1.13.0. Any string value passed to the of option is now treated as a CSS selector. A workaround is to not accept the value of the of option from untrusted sources.
Affected Software
Remediation
Patch Available
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2021-41184?
CVE-2021-41184 is classified as a medium severity vulnerability due to potential code execution from untrusted sources.
How do I fix CVE-2021-41184?
To remediate CVE-2021-41184, update jquery-ui to version 1.13.0 or later.
What systems are affected by CVE-2021-41184?
CVE-2021-41184 affects various versions of jquery-ui used in applications like jQuery UI Combined and jQuery UI Rails.
What is the impact of CVE-2021-41184?
The vulnerability allows the execution of untrusted code due to the acceptance of malicious input in the '.position()' method.
Can CVE-2021-41184 lead to security breaches?
Yes, CVE-2021-41184 can potentially lead to security breaches if exploited effectively by an attacker.