Executive brief
jQuery Mobile is a JavaScript framework used to build mobile-optimized web applications. The framework fetches external content via AJAX and renders it into pages without validating the response type, allowing attackers to inject malicious scripts through crafted URLs. An attacker can trick users into clicking a link that causes arbitrary JavaScript code to execute in their browser, potentially stealing session data or performing actions on the user's behalf.
Technical details
This is a reflected cross-site scripting (XSS) vulnerability (CWE-79) in jQuery Mobile's AJAX handling code. The vulnerability exists because the framework processes location.hash parameters to fetch remote content via XMLHttpRequest, then renders the response as HTML using innerHTML without validating the Content-Type header. An attacker can craft a malicious URL with query parameters containing HTML/JavaScript payloads that will be executed in the context of the page. The attack requires user interaction (clicking a malicious link), but no authentication or special network position is needed. Patches were merged into the repository (PR #8649 and #8650) in 2019, but the advisory notes no official release with the fix was made available at publication time.
Affected products
- jQuery Mobile all versions
Timeline
- 2020-09-02: disclosed
- 2019-06-13: patched: Patches merged in PR #8649 and #8650, but no official release with fix was available at advisory publication