Hacking

Every website that uses jQuery Mobile, and has any open redirect is vulnerable to XSS

Every website that uses jQuery Mobile, and has any open redirect anywhere is vulnerable to cross-site scripting (XSS) attacks.

The jQuery Foundation’s jQuery Mobile project is an HTML5-based framework that allows users to design a single responsive web site or application that will work on all popular mobile devices and desktop systems.

According to the foundation, the jQuery Mobile is currently used on more than 150,000 active websites. The Google security engineer Eduardo Vela has discovered that the jQuery Mobile framework can expose websites to cross-site scripting (XSS) attacks in case they are affected also by an open redirect vulnerability.

A few months ago, Vela was searching for CSP bypasses and noticed an interesting behavior of the jQuery Mobile. The jQuery Mobile would fetch any URL in the location.hash and put it in innerHTML, this behavior would be exploited by an attacker under specific conditions.  I thought that was pretty weird, so decided to see if it was vulnerable to XSS.

Vela started searching for XSS vulnerability and devised the following attack:

  1. jQuery Mobile checks if you have anything in location.hash.
  2. If your location.hash looks like a URL, it will try to set history.pushState on it, then it will do an XMLHttpRequest to it.
  3. Then it will just innerHTML the response.

The expert explained that despite the history.pushState should prevent XSS attacks, it is still possible to exploit such kind of flaws if the website is affected by an open redirect vulnerability.

Below the demo provided by Vela:

http://jquery-mobile-xss.appspot.com/#/redirect?url=http://sirdarckcat.github.io/xss/img-src.html

According to the expert, there are many websites vulnerable to such attacks because many organizations don’t consider open redirects as security vulnerabilities, such kind of issues are present in major websites such as Google, YouTube, Facebook, Baidu, and Yahoo.

Now the bad news!

Vela reported the flaw to jQuery Mobile development team, but likely it will not be fixed due to the potential impact of a fix on the existing applications. The development team confirmed the risks to their users.

“The jQuery Mobile team explained that they consider the Open Redirect to be the vulnerability, and not their behavior of fetching and inlining, and that they wouldn’t want to make a change because that might break existing applications. This means that there won’t be a patch as far as I have been informed. The jQuery mobile team suggests to 403 all requests made from XHR that might result in a redirect.” wrote Vela.

This means that every website that uses jQuery Mobile, and has any open redirect anywhere is vulnerable to XSS.

Vela is inviting experts to try to exploit the same XSS in the absence of the open redirect vulnerability, he already tested it but without success.

“One opportunity for further research, if you have time in your hands is to try to find a way to make this bug work without the need of an Open Redirect. I tried to make it work, but it didn’t work out,” added Vela.

“In my experience, Open Redirects are very common, and they are also a common source of bugs. Perhaps we should start fixing Open Redirects. Or perhaps we should be more consistent on not treating them as vulnerabilities. Either way, for as long as we have this disagreement in our industry, we at least get to enjoy some XSS bugs”

[adrotate banner=”9″]

Pierluigi Paganini

(Security Affairs – jQuery Mobile, hacking)

Pierluigi Paganini

Pierluigi Paganini is member of the ENISA (European Union Agency for Network and Information Security) Threat Landscape Stakeholder Group and Cyber G7 Group, he is also a Security Evangelist, Security Analyst and Freelance Writer. Editor-in-Chief at "Cyber Defense Magazine", Pierluigi is a cyber security expert with over 20 years experience in the field, he is Certified Ethical Hacker at EC Council in London. The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US. Pierluigi is a member of the "The Hacker News" team and he is a writer for some major publications in the field such as Cyber War Zone, ICTTF, Infosec Island, Infosec Institute, The Hacker News Magazine and for many other Security magazines. Author of the Books "The Deep Dark Web" and “Digital Virtual Currency and Bitcoin”.

Recent Posts

Over 1,400 CrushFTP internet-facing servers vulnerable to CVE-2024-4040 bug

Over 1,400 CrushFTP internet-facing servers are vulnerable to attacks exploiting recently disclosed CVE-2024-4040 vulnerability. Over…

2 hours ago

Sweden’s liquor supply severely impacted by ransomware attack on logistics company

A ransomware attack on a Swedish logistics company Skanlog severely impacted the country's liquor supply. …

4 hours ago

CISA adds Cisco ASA and FTD and CrushFTP VFS flaws to its Known Exploited Vulnerabilities catalog

CISA adds Cisco ASA and FTD and CrushFTP VFS vulnerabilities to its Known Exploited Vulnerabilities…

15 hours ago

CISA adds Microsoft Windows Print Spooler flaw to its Known Exploited Vulnerabilities catalog

U.S. CISA added the Windows Print Spooler flaw CVE-2022-38028 to its Known Exploited Vulnerabilities catalog.…

21 hours ago

DOJ arrested the founders of crypto mixer Samourai for facilitating $2 Billion in illegal transactions

The U.S. Department of Justice (DoJ) announced the arrest of two co-founders of a cryptocurrency mixer…

22 hours ago

Google fixed critical Chrome vulnerability CVE-2024-4058

Google addressed a critical Chrome vulnerability, tracked as CVE-2024-4058, that resides in the ANGLE graphics…

1 day ago

This website uses cookies.