Loading...
Skip to main content

CVE-2022-31160 — Vulnerability in jquery-ui — CVE Details

MEDIUM

jQuery UI vulnerable to XSS when refreshing a checkboxradio with an HTML-like initial text label

Published July 18, 2022Updated July 21, 2025Source: osv

Summary

### 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: ```html <label> <input id="test-input"> &lt;img src=x onerror="alert(1)"&gt; </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. ### 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`: ```html <label> <input id="test-input"> <span>&lt;img src=x onerror="alert(1)"&gt;</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](https://github.com/jquery/jquery-ui/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). If you don't find an answer, open a new issue.

Advisory Timeline

  • First published July 18, 2022 (1547 days ago).
  • Last revised July 21, 2025 — 1099 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update jquery-ui to 1.13.2 or later
npm install jquery-ui@1.13.2
Maven
Update org.webjars.npm:jquery-ui to 1.13.2 or later
<!-- Update pom.xml dependency version to 1.13.2 for org.webjars.npm:jquery-ui -->
Bundler
Update jquery-ui-rails to 8.0.0 or later
gem install jquery-ui-rails -v 8.0.0
NuGet
Update jQuery.UI.Combined to 1.13.2 or later
dotnet add package jQuery.UI.Combined --version 1.13.2

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (4)

Affects 4 ecosystems: maven (1), npm (1), nuget (1), rubygems (1).

PackageEcosystemAffectedFixed In
jquery-ui
npm
All versions1.13.2
org.webjars.npm:jquery-ui
maven
1.10.4, 1.10.5, 1.12.0, 1.12.0-rc.2 (+5 more)1.13.2
jquery-ui-rails
rubygems
0.0.1, 0.0.2, 0.1.0, 0.2.0 (+34 more)8.0.0
jQuery.UI.Combined
nuget
1.10.0, 1.10.1, 1.10.2, 1.10.3 (+31 more)1.13.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Frequently Asked Questions

What is CVE-2022-31160?
jQuery UI vulnerable to XSS when refreshing a checkboxradio with an HTML-like initial text label This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
How do I check if my project is affected by CVE-2022-31160?
CVE-2022-31160 affects jquery-ui, org.webjars.npm:jquery-ui and jquery-ui-rails (and 1 more). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-31160 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.1

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-h6gj-6jjq-h8g9

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies