CVE-2022-31160 jQuery UI contains potential XSS vulnerability when refreshing a checkboxradio with an HTML-like initial text label

Medium 6.1 Published Updated

An attacker can execute arbitrary JavaScript via XSS when refreshing a checkboxradio widget with encoded HTML entities in the label.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-31160?

CVE-2022-31160 is a medium-severity cross-site scripting vulnerability in Debian Debian Linux, published on 20 Jul 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of jQuery. Versions prior to 1.13.2 are potentially vulnerable to cross-site scripting. Initializing a checkboxradio widget on an input enclosed within a label makes that parent label contents considered as the input label. Calling `.checkboxradio( "refresh" )` on such a widget and the initial HTML contained encoded HTML entities will make them erroneously get decoded. This can lead to potentially executing JavaScript code. The bug has been patched in jQuery UI 1.13.2. To remediate the issue, someone who can change the initial HTML can wrap all the non-input contents of the `label` in a `span`.

Weakness: CWE-79

Which versions are affected by CVE-2022-31160?

8 open source packages ship an affected version, including org.webjars.npm:jquery-ui, jQuery.UI.Combined and jquery-ui-rails. It affects 10 products.

PackageAffectedFixed in
org.webjars.npm:jquery-ui MavenAll versions1.13.2
org.webjars.npm:jquery-ui MavenAll versions1.13.2
jQuery.UI.Combined NuGetAll versions1.13.2
jQuery.UI.Combined NuGetAll versions1.13.2
jquery-ui-rails RubyGemsAll versions8.0.0
jquery-ui-rails RubyGemsAll versions8.0.0
2 more packages
jquery-ui npmAll versions1.13.2
jquery-ui npmAll versions1.13.2

Products include Debian Debian Linux, Drupal Jquery Ui Checkboxradio, Fedoraproject Fedora, Jqueryui Jquery Ui, Netapp H300s Firmware, Netapp H410c Firmware and 4 more.

How do I fix CVE-2022-31160?

Upgrade org.webjars.npm:jquery-ui to 1.13.2 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2022-31160 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-31160 exists.

Public exploit code: 1 proofs of concept on GitHub.

All Debian Debian Linux vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-31160, GHSA-h6gj-6jjq-h8g9, MINI-v2vg-wgqv-w7fc, UBUNTU-CVE-2022-31160.

Is CVE-2022-31160 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free