# CVE-2021-41182: XSS in the `altField` option of the Datepicker widget

> Attackers can execute arbitrary JavaScript via the Datepicker altField option if untrusted input is accepted, affecting applications using jQuery UI.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/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:** 26 Oct 2021
- **Updated:** 13 Feb 2025
- **Also known as:** BIT-drupal-2021-41182, CLEANSTART-2024-NF15761, DEBIAN-CVE-2021-41182, GHSA-9gj3-hwp5-pmwc, MINI-pj36-f7xg-547x, UBUNTU-CVE-2021-41182

## What is CVE-2021-41182?

CVE-2021-41182 is a medium-severity cross-site scripting vulnerability in Debian Debian Linux, published on 26 Oct 2021. 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 the official jQuery user interface library. Prior to version 1.13.0, accepting the value of the `altField` option of the Datepicker widget from untrusted sources may execute untrusted code. The issue is fixed in jQuery UI 1.13.0. Any string value passed to the `altField` option is now treated as a CSS selector. A workaround is to not accept the value of the `altField` option from untrusted sources.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2021-41182?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.webjars.npm:jquery-ui` | Maven | All versions | 1.13.0 |
| `org.webjars.npm:jquery-ui` | Maven | All versions | 1.13.0 |
| `drupal` | Bitnami | From 7.0.0 | 7.86.0 |
| `jQuery.UI.Combined` | NuGet | All versions | 1.13.0 |
| `jQuery.UI.Combined` | NuGet | All versions | 1.13.0 |
| `jquery-ui-rails` | RubyGems | All versions | 7.0.0 |
| `jquery-ui-rails` | RubyGems | All versions | 7.0.0 |
| `jquery-ui` | npm | All versions | 1.13.0 |
| `jquery-ui` | npm | All versions | 1.13.0 |

Products: Debian Debian Linux, Drupal Drupal, Fedoraproject Fedora, Jqueryui Jquery Ui, Netapp H300e Firmware, Netapp H300s Firmware, Netapp H410c Firmware, Netapp H410s Firmware, Netapp H500e Firmware, Netapp H500s Firmware, Netapp H700e Firmware, Netapp H700s Firmware, Oracle Agile Product Lifecycle Management, Oracle Application Express, Oracle Banking Platform, Oracle Big Data Spatial and Graph, Oracle Communications Interactive Session Recorder, Oracle Communications Operations Monitor, Oracle Hospitality Inventory Management, Oracle Hospitality Materials Control and 9 more.

## How do I fix CVE-2021-41182?

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

## Is CVE-2021-41182 being exploited?

There is no known exploitation of CVE-2021-41182 in the wild and no public exploit code.

Public exploit code:

- Some test files to make a good nuclei template for a JQuery UI XSS vuln (github_poc): https://github.com/aredspy/CVE-2021-41182-Tester

## 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-2021-41182 and fix it if it is affected.

What it is: CVE-2021-41182 is a medium-severity cross-site scripting vulnerability in Debian Debian Linux, published on 26 Oct 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2021-41182 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.webjars.npm:jquery-ui (Maven): affected all versions; fixed in 1.13.0
- org.webjars.npm:jquery-ui (Maven): affected all versions; fixed in 1.13.0
- drupal (Bitnami): affected from 7.0.0; fixed in 7.86.0
- jQuery.UI.Combined (NuGet): affected all versions; fixed in 1.13.0
- jQuery.UI.Combined (NuGet): affected all versions; fixed in 1.13.0
- jquery-ui-rails (RubyGems): affected all versions; fixed in 7.0.0
- jquery-ui-rails (RubyGems): affected all versions; fixed in 7.0.0
- jquery-ui (npm): affected all versions; fixed in 1.13.0
- jquery-ui (npm): affected all versions; fixed in 1.13.0

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-2021-41182/ (Markdown: https://insights.sbomify.com/CVE-2021-41182/index.md)
```

## Sources

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

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