CVE-2021-41184: jQuery UI XSS in position() method

CVE-2021-41184 · Severity: low · CVSS 3.1 · Published 2021-10-26

jQuery UI is a popular JavaScript library providing interactive widgets and utilities for web applications. A cross-site scripting (XSS) vulnerability in the `.position()` utility function allows arbitrary JavaScript code execution when the `of` parameter accepts untrusted input, potentially compromising user sessions, stealing sensitive data, or performing unauthorized actions on behalf of affected users.

Technologies: org.webjars.npm:jquery-ui (Maven), jquery-ui (npm), jQuery.UI.Combined (NuGet), jquery-ui-rails (RubyGems). Vendors: Maven, npm, NuGet, RubyGems.

Quick answers

Is CVE-2021-41184 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2021-41184 being exploited in the wild.
How severe is CVE-2021-41184?
Low severity, with a CVSS score of 3.1, published 26 October 2021.
Which products and versions are affected?
org.webjars.npm:jquery-ui (Maven) ECOSYSTEM:introduced=0,fixed=1.13.0; jquery-ui (npm) SEMVER:introduced=0,fixed=1.13.0; jQuery.UI.Combined (NuGet) ECOSYSTEM:introduced=0,fixed=1.13.0; jquery-ui-rails (RubyGems) ECOSYSTEM:introduced=0,fixed=7.0.0.
Is there a fix for CVE-2021-41184?
Yes. org.webjars.npm:jquery-ui (Maven): upgrade to 1.13.0 or later; jquery-ui (npm): upgrade to 1.13.0 or later; jQuery.UI.Combined (NuGet): upgrade to 1.13.0 or later; jquery-ui-rails (RubyGems): upgrade to 7.0.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2021-41184 attacked?
It is attacked over the network.
Am I affected by CVE-2021-41184?
Check whether you run org.webjars.npm:jquery-ui (Maven), jquery-ui (npm), jQuery.UI.Combined (NuGet) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • org.webjars.npm:jquery-ui (Maven): upgrade to 1.13.0 or later
    # set org.webjars.npm:jquery-ui to 1.13.0 in your pom.xml or build.gradle
  • jquery-ui (npm): upgrade to 1.13.0 or later
    npm install jquery-ui@1.13.0
  • jQuery.UI.Combined (NuGet): upgrade to 1.13.0 or later
    dotnet add package jQuery.UI.Combined --version 1.13.0
  • jquery-ui-rails (RubyGems): upgrade to 7.0.0 or later
    bundle update jquery-ui-rails

Technical details

The vulnerability is a DOM-based cross-site scripting (XSS) flaw in the `.position()` utility function of jQuery UI. The root cause is that string values passed to the `of` option were not properly sanitized, allowing attackers to inject malicious HTML/JavaScript. An attacker can craft a malicious string containing HTML tags with event handlers (e.g., `<img onerror='doEvilThing()' />`) and supply it as the `of` parameter; when processed, the injected code executes in the user's browser context. The vulnerability requires the application to accept user-controlled input for the `of` parameter. The fix, released in jQuery UI 1.13.0, treats all string values passed to `of` as CSS selectors, preventing HTML injection.

Affected products

  • jQuery Foundation jQuery UI before 1.13.0

Identifiers

  • CVE-2021-41184
  • GHSA-gpqq-952q-5327

Timeline

  • 2021-10-25: disclosed: Advisory published
  • 2021-10-26: patched: jQuery UI 1.13.0 released with fix

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.