CVE-2022-31160
jQuery UI vulnerable to XSS when refreshing a checkboxradio with an HTML-like initial text label
Description
Impact
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.
Patches
The bug has been patched in jQuery UI 1.13.2.
Workarounds
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:
<label>
<input id="test-input">
<span><img src=x onerror="alert(1)"></span>
</label>
References
https://blog.jqueryui.com/2022/07/jquery-ui-1-13-2-released/
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.
Affected Maven artifacts (3)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.webjars.npm » jquery-ui | < 1.13.2 | 1.13.2 |
| org.mvnpm » jquery-uivia npm jquery-ui | < 1.13.2 | 1.13.2 |
| org.webjars » jquery-uivia npm jquery-ui | < 1.13.2 | 1.13.2 |
| org.webjars.npm » jquery-uivia npm jquery-ui | < 1.13.2 | 1.13.2 |
Blast radius
71% of the dependent artifacts (513) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 2,069 |
| 2 hops | 11,531 |
| 3 hops | 8,159 |
| 4 hops | 2,860 |
| 5 hops | 347 |
| 6 hops | 19 |
Most used dependents
- de.tudarmstadt.ukp.inception.app » inception-model90 usages
- de.tudarmstadt.ukp.inception.app » inception-support87 usages
- de.tudarmstadt.ukp.inception.app » inception-api76 usages
- com.haulmont.cuba » cuba-web71 usages
- org.carewebframework » org.carewebframework.shell70 usages
- org.xwiki.platform » xwiki-platform-panels-ui62 usages
- de.agilecoders.wicket » wicket-bootstrap-extensions59 usages
- de.tudarmstadt.ukp.inception.app » inception-api-annotation56 usages
- com.haulmont.cuba » cuba-web-tests54 usages
- com.haulmont.cuba » cuba-web-toolkit53 usages
- de.tudarmstadt.ukp.inception.app » inception-security53 usages
- de.tudarmstadt.ukp.inception.app » inception-api-schema50 usages
- de.tudarmstadt.ukp.clarin.webanno » webanno-api-annotation43 usages
- de.tudarmstadt.ukp.inception.app » inception-api-render39 usages
- org.apache.isis.viewer » isis-viewer-wicket-ui32 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) NuGet (1 package) RubyGems (1 package) . See all on OSV
References
| Advisory | NVD CVE-2022-31160 | nvd.nist.gov |
| Package | jquery/jquery-ui | github.com |
| Web | jquery/jquery-ui advisory GHSA-h6gj-6jjq-h8g9 | github.com |
| Web | jquery/jquery-ui commit 8cc5bae | github.com |
| Web | 2022/07/jquery-ui-1-13-2-released | blog.jqueryui.com |
| Web | jquery-ui-rails/jquery-ui-rails VERSIONS.md | github.com |
| Web | jquery-ui-rails/jquery-ui-rails release v8.0.0-release | github.com |
| Web | rubysec/ruby-advisory-db CVE-2022-31160.yml | github.com |
| Web | debian-lts-announce/2022/12/msg00015.html | lists.debian.org |
| Web | archives/list/package-announce@lists.fedoraproject.org/message/6XBR3G3JR5ZIOJDO4224M3INXDS ... | lists.fedoraproject.org |
| Web | archives/list/package-announce@lists.fedoraproject.org/message/J5LGNTICB5BRFAG3DHVVELS6H3C ... | lists.fedoraproject.org |
| Web | archives/list/package-announce@lists.fedoraproject.org/message/QB2FJQXCNHO32VGVOC6DY6IPGVE ... | lists.fedoraproject.org |
| Web | advisory/ntap-20220909-0007 | security.netapp.com |
| Web | sa-contrib-2022-052 | drupal.org |
