CVE-2021-41182
JSON

6.5medium

XSS in the `altField` option of the Datepicker widget

Severity
6.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
41.3% (higher than 98% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-9gj3-hwp5-pmwcBIT-DRUPAL-2021-41182

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.

Affected

Product or packageVersionsReported by
jquery jquery-ui< 1.13.0CVE List
jquery-ui (npm)before 1.13.0GitHub Advisory Database
jQuery.UI.Combined (NuGet)before 1.13.0GitHub Advisory Database
jquery-ui-rails (RubyGems)before 7.0.0GitHub Advisory Database
org.webjars.npm:jquery-ui (Maven)before 1.13.0GitHub Advisory Database
jqueryui jquery_uibefore 1.13.0NVD
fedoraproject fedora33, 34, 35, 36NVD
netapp h500s_firmwareNot specifiedNVD
netapp h700s_firmwareNot specifiedNVD
netapp h300e_firmwareNot specifiedNVD
netapp h500e_firmwareNot specifiedNVD
netapp h700e_firmwareNot specifiedNVD

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
GitHub6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD4.3medium CVSS:2.0AV:N/AC:M/Au:N/C:N/I:P/A:N
Bitnami Vulnerability Databasemedium rating

Classification

What each source says

CVE List

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.

GitHub Advisory Database
Impact

Accepting the value of the altField option of the Datepicker widget from untrusted sources may execute untrusted code. For example, initializing the datepicker in the following way:

$( "#datepicker" ).datepicker( {
	altField: "<img onerror='doEvilThing()' src='/404' />",
} );

will call the doEvilThing function.

Patches

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.

Workarounds

A workaround is to not accept the value of the altField option from untrusted sources.

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.

NVD (es)

jQuery-UI es la biblioteca oficial de interfaz de usuario de jQuery. Antes de la versión 1.13.0, aceptar el valor de la opción "altField" del widget Datepicker desde fuentes no confiables puede ejecutar código no confiable. El problema es corregido en jQuery UI versión 1.13.0. Cualquier valor de cadena pasado a la opción "altField" se trata ahora como un selector CSS. Una solución es no aceptar el valor de la opción "altField" de fuentes no confiables

References

https://github.com/jquery/jquery-ui/security/advisories/GHSA-9gj3-hwp5-pmwcadvisory, exploit, mitigation, third-party-advisory, web
https://github.com/jquery/jquery-ui/pull/1954/commits/6809ce843e5ac4128108ea4c15cbc100653c2b63advisory, patch, third-party-advisory, web
https://blog.jqueryui.com/2021/10/jquery-ui-1-13-0-released/advisory, release-notes, vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/O74SXYY7RGXREQDQUDQD4BPJ4QQTD2XQ/advisory, mailing-list, third-party-advisory, vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SNXA7XRKGINWSUIPIZ6ZBCTV6N3KSHES/advisory, mailing-list, third-party-advisory, vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NXIUUBRVLA4E7G7MMIKCEN75YN7UFERW/advisory, mailing-list, third-party-advisory, vendor-advisory
https://lists.debian.org/debian-lts-announce/2022/01/msg00014.htmladvisory, mailing-list, third-party-advisory, web
https://www.drupal.org/sa-core-2022-002advisory, third-party-advisory, web
https://www.oracle.com/security-alerts/cpuapr2022.htmladvisory, patch, third-party-advisory, web
https://security.netapp.com/advisory/ntap-20211118-0004/advisory, third-party-advisory
https://www.drupal.org/sa-contrib-2022-004advisory, third-party-advisory, web
https://www.oracle.com/security-alerts/cpujul2022.htmladvisory, patch, third-party-advisory, web

Sources

SourceRecordLicence
CVE ListCVE-2021-41182 changed 2025-02-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-9gj3-hwp5-pmwc changed 2026-07-08CC-BY-4.0
NVDCVE-2021-41182 changed 2026-08-25Public domain
Bitnami Vulnerability DatabaseBIT-DRUPAL-2021-41182 changed 2026-09-08Apache-2.0