CVE-2022-31160: jQuery UI vulnerable to XSS when refreshing a checkboxradio with an HTML-like initial text label
(updated )
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:
<label>
<input id="test-input">
<img src=x onerror="alert(1)">
</label>
and calling:
$( "#test-input" ).checkboxradio();
$( "#test-input" ).checkboxradio( "refresh" );
will turn the initial HTML into:
<label>
<!-- some jQuery UI elements -->
<input id="test-input">
<img src=x onerror="alert(1)">
</label>
and the alert will get executed.
References
- blog.jqueryui.com/2022/07/jquery-ui-1-13-2-released
- github.com/advisories/GHSA-h6gj-6jjq-h8g9
- github.com/jquery-ui-rails/jquery-ui-rails/blob/master/VERSIONS.md
- github.com/jquery/jquery-ui
- github.com/jquery/jquery-ui/commit/8cc5bae1caa1fcf96bf5862c5646c787020ba3f9
- github.com/jquery/jquery-ui/security/advisories/GHSA-h6gj-6jjq-h8g9
- lists.debian.org/debian-lts-announce/2022/12/msg00015.html
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6XBR3G3JR5ZIOJDO4224M3INXDS2VFDD
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/J5LGNTICB5BRFAG3DHVVELS6H3CZSQMO
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QB2FJQXCNHO32VGVOC6DY6IPGVE4VDU6
- nvd.nist.gov/vuln/detail/CVE-2022-31160
- security.netapp.com/advisory/ntap-20220909-0007
- www.drupal.org/sa-contrib-2022-052
Detect and mitigate CVE-2022-31160 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →