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

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

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **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:** Yes
- **Published:** 20 Jul 2022
- **Updated:** 22 Apr 2025
- **Also known as:** DEBIAN-CVE-2022-31160, GHSA-h6gj-6jjq-h8g9, MINI-v2vg-wgqv-w7fc, UBUNTU-CVE-2022-31160

## 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 (Improper Neutralization of Input During Web Page Generation)

## 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.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.webjars.npm:jquery-ui` | Maven | All versions | 1.13.2 |
| `org.webjars.npm:jquery-ui` | Maven | All versions | 1.13.2 |
| `jQuery.UI.Combined` | NuGet | All versions | 1.13.2 |
| `jQuery.UI.Combined` | NuGet | All versions | 1.13.2 |
| `jquery-ui-rails` | RubyGems | All versions | 8.0.0 |
| `jquery-ui-rails` | RubyGems | All versions | 8.0.0 |
| `jquery-ui` | npm | All versions | 1.13.2 |
| `jquery-ui` | npm | All versions | 1.13.2 |

Products: Debian Debian Linux, Drupal Jquery Ui Checkboxradio, Fedoraproject Fedora, Jqueryui Jquery Ui, Netapp H300s Firmware, Netapp H410c Firmware, Netapp H410s Firmware, Netapp H500s Firmware, Netapp H700s Firmware, Netapp Oncommand Insight.

## How do I fix CVE-2022-31160?

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

## 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:

- jquery XSS Proof of Concept (PoC) (github_poc): https://github.com/CyberOne-TeamARES/jquery-cve-2022-31160

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-31160 and fix it if it is affected.

What it is: 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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-31160 exists.

Affected packages and fixed versions:
- org.webjars.npm:jquery-ui (Maven): affected all versions; fixed in 1.13.2
- org.webjars.npm:jquery-ui (Maven): affected all versions; fixed in 1.13.2
- jQuery.UI.Combined (NuGet): affected all versions; fixed in 1.13.2
- jQuery.UI.Combined (NuGet): affected all versions; fixed in 1.13.2
- jquery-ui-rails (RubyGems): affected all versions; fixed in 8.0.0
- jquery-ui-rails (RubyGems): affected all versions; fixed in 8.0.0
- jquery-ui (npm): affected all versions; fixed in 1.13.2
- jquery-ui (npm): affected all versions; fixed in 1.13.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-31160/ (Markdown: https://insights.sbomify.com/CVE-2022-31160/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-31160
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-31160
- OSV: https://osv.dev/vulnerability/CVE-2022-31160

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-31160/
Summaries are generated and may contain mistakes; the official description above is the record.
