CVE-2021-41182 Overview
CVE-2021-41182 is a Cross-Site Scripting (XSS) vulnerability in jQuery UI, 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. This vulnerability allows attackers to inject and execute malicious scripts in the context of a user's browser session when the altField option is populated with attacker-controlled input.
Critical Impact
Applications using jQuery UI Datepicker with user-controlled altField values are vulnerable to XSS attacks, potentially leading to session hijacking, credential theft, and malicious content injection across numerous enterprise platforms including Oracle, Drupal, and NetApp products.
Affected Products
- jQuery UI versions prior to 1.13.0
- Drupal (multiple versions)
- Oracle WebLogic Server 12.2.1.3.0, 12.2.1.4.0, 14.1.1.0.0
- Oracle PeopleSoft Enterprise PeopleTools 8.58, 8.59
- Oracle MySQL Enterprise Monitor
- Oracle Application Express
- Oracle Primavera Unifier (multiple versions)
- Fedora 33, 34, 35, 36
- Debian Linux 9.0
- NetApp H-Series firmware (H300S, H500S, H700S, H300E, H500E, H700E, H410S, H410C)
- Tenable.sc
Discovery Timeline
- 2021-10-26 - CVE-2021-41182 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2021-41182
Vulnerability Analysis
This vulnerability exists in the jQuery UI Datepicker widget's handling of the altField option. The altField option is designed to specify an alternate field to populate with the selected date value. In vulnerable versions, when the altField option accepts a string value from untrusted sources, jQuery UI improperly processes this input, allowing arbitrary code execution through DOM manipulation.
The vulnerability is exploitable over the network and requires user interaction, such as visiting a malicious page or clicking a crafted link. Successful exploitation can compromise confidentiality and integrity of data within the affected web application context.
Root Cause
The root cause of this vulnerability is the improper sanitization of the altField option value. Prior to the fix in version 1.13.0, the Datepicker widget treated the altField value as a jQuery selector that could execute arbitrary JavaScript code when processed. The fix implemented in jQuery UI 1.13.0 ensures that any string value passed to the altField option is now strictly treated as a CSS selector, preventing script execution.
Attack Vector
The attack vector is network-based, requiring an attacker to craft malicious input that gets processed by the Datepicker widget's altField option. An attacker can exploit this vulnerability through several scenarios:
- Applications that allow user-controlled values to be passed to the Datepicker's altField configuration
- Form fields or URL parameters that influence the altField option dynamically
- Stored XSS scenarios where malicious payloads are persisted and rendered to other users
When a victim interacts with a page containing the malicious payload, the attacker's JavaScript code executes in the victim's browser context. This enables session token theft, keylogging, phishing attacks, or defacement of the web application.
The vulnerability manifests when untrusted input is passed to the Datepicker widget's altField option. Prior to the fix, jQuery UI would interpret certain string patterns as executable code rather than simple CSS selectors. For technical details and the specific code changes, refer to the GitHub Security Advisory GHSA-9gj3-hwp5-pmwc and the fix commit.
Detection Methods for CVE-2021-41182
Indicators of Compromise
- Unusual JavaScript execution patterns in web application logs associated with Datepicker widget interactions
- Unexpected modifications to form fields or DOM elements when users interact with date selection components
- User reports of suspicious redirects, pop-ups, or credential prompts when using date picker functionality
- Web application firewall (WAF) alerts for XSS patterns targeting jQuery UI components
Detection Strategies
- Implement Content Security Policy (CSP) headers and monitor for CSP violation reports indicating injection attempts
- Deploy web application firewalls with rules specifically designed to detect XSS payloads in jQuery UI widget parameters
- Audit application source code for instances where altField option receives user-controlled input
- Use static application security testing (SAST) tools to identify vulnerable jQuery UI versions in your codebase
Monitoring Recommendations
- Monitor browser console errors and security exceptions that may indicate blocked XSS attempts
- Track jQuery UI version usage across your application portfolio using software composition analysis (SCA) tools
- Configure logging for Datepicker widget initialization events to identify suspicious configurations
- Implement real-time alerting for anomalous JavaScript execution patterns in user sessions
How to Mitigate CVE-2021-41182
Immediate Actions Required
- Upgrade jQuery UI to version 1.13.0 or later across all affected applications
- Audit all instances of Datepicker widget usage to identify where altField option values may originate from untrusted sources
- Implement input validation and sanitization for any user-controlled values that could influence widget configuration
- Deploy Content Security Policy headers to provide an additional layer of XSS protection
Patch Information
The vulnerability is fixed in jQuery UI version 1.13.0, released in October 2021. The fix ensures that all string values passed to the altField option are treated strictly as CSS selectors, preventing code execution. Organizations should upgrade to jQuery UI 1.13.0 or later. For detailed information about the release, see the jQuery UI 1.13.0 Release Announcement.
Downstream vendors have also released patches:
- Drupal: See SA-CORE-2022-002 and SA-CONTRIB-2022-004
- Oracle: Patches available in CPU April 2022 and CPU July 2022
- Tenable: See TNS-2022-09
- NetApp: See NTAP-20211118-0004
Workarounds
- Do not accept the value of the altField option from untrusted sources until patching is complete
- Implement server-side validation to ensure altField values match expected CSS selector patterns only
- Use a web application firewall to filter malicious input patterns targeting jQuery UI widgets
- Consider disabling Datepicker functionality temporarily in high-risk applications until the patch is applied
# Verify jQuery UI version in your project
grep -r "jquery-ui" package.json package-lock.json
npm list jquery-ui
# Update jQuery UI to patched version
npm update jquery-ui@1.13.0
# or
yarn upgrade jquery-ui@1.13.0
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


