PT-2022-20575
CVE-2022-31160
·
Published
2022-07-18
·
Updated
2026-03-10
Description by
CVSS 3.1
6.1
MediumMetricsAV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Name of the Vulnerable Software and Affected Versions
jQuery UI versions prior to 1.13.2
Description
Initializing a checkboxradio widget on an input enclosed within a label makes that parent label contents considered as the input label. If you call
.checkboxradio( "refresh" ) on such a widget and the initial HTML contained encoded HTML entities, they will erroneously get decoded. This can lead to potentially executing JavaScript code. For example, starting with the following initial secure HTML:html
<label>
<input id="test-input">
<img src=x onerror="alert(1)">
</label>and calling:
js
$( "#test-input" ).checkboxradio();
$( "#test-input" ).checkboxradio( "refresh" );will turn the initial HTML into:
html
<label>
<!-- some jQuery UI elements -->
<input id="test-input">
<img src=x onerror="alert(1)">
</label>and the alert will get executed.
Recommendations
To remediate the issue, if you can change the initial HTML, you can wrap all the non-input contents of the
label in a span:html
<label>
<input id="test-input">
<span><img src=x onerror="alert(1)"></span>
</label>For versions prior to 1.13.2, update to jQuery UI 1.13.2 to patch the bug.
Exploitability
Exploit
Fix
Impacts
Vendors
Affected products
Found an issue in the description? Have something to add? Feel free to write us 👾