[0day]jQuery Mobile XSS

來源:互聯網
上載者:User

標籤:state   角度   lan   rdo   輸出   self   1.4   code   tar   

漏洞影響範圍:

任何一個website使用了 jQuery Mobile 並且開放了重新導向都有可能存在XSS,並且目前還沒有相關補丁資訊。

應用介紹:

jQuery Mobile是jQuery 架構的一個組件(而非jquery的移動版本)。jQuery Mobile 不僅會給主流移動平台帶來jQuery核心庫,而且會發布一個完整統一的jQuery移動UI架構。支援全球主流的移動平台。jQuery MobileTeam Dev說:能開發這個項目,我們非常興奮。移動Web太需要一個跨瀏覽器的架構,讓開發人員開發出真正的移動Web網站。

詳細資料:

漏洞發現作者[Eduardo Vela (sirdar kcat)],在前幾個月研究SCP繞過的時候發現jQuery Mobile有一個非常奇怪的行為,它會取URL中的location.hash,輸出到innerHTML中。所以決定仔細的分析一下相關原因:

  漏洞資訊:

    1、檢查你的jQuery Mobile是否在location.hash中

    2、如果看到localtion.hash有URL,它會調用history.pushState,這樣你不能調用history.pushState 到跨域URL

  3、它會將innerHTML響應到頁面中

理論上這個是安全的,但是如果你有任意開放的重新導向,就會存在這個XSS,因為對於jQuery Mobile來說history.pushState開啟是相同的域

作者在2017年2月8號嘗試聯絡了,jQuery Mobile的團隊說:我們認為這個一個Open Redirect的漏洞,而不是他們擷取時候鎖造成的漏洞,並且不打算進行更新,

如果更新會破壞現有的應用,所以意味著,這個補丁也不會被更新。

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

  測試代碼:

main.py

import webapp2class MainHandler(webapp2.RequestHandler):  def get(self):  # pylint:disable-msg=invalid-name    """Handle GET requests."""    self.response.write("""<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /><script src="https://code.jquery.com/jquery-1.11.1.min.js"></script><script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>""")class RedirectHandler(webapp2.RequestHandler):  def get(self):    """Handle GET requests."""    self.redirect(str(self.request.get("url")))APP = webapp2.WSGIApplication([    (‘/redirect‘, RedirectHandler),    (‘/.*‘, MainHandler),], debug=True)

app.yaml

application: jquery-mobile-xssversion: 1runtime: python27api_version: 1threadsafe: yeshandlers:- url: /.*  script: main.APPlibraries:- name: webapp2  version: "2.5.2"

 

  從安全從業者的角度來看:每個使用jQuery Mobile,並且開放了重新導向都會存在這個XSS漏洞。

  另外值得一提的是,如果你使用了隨機數SCP策略,但是仍然還可以通過How to bypass CSP nonces with DOM XSS ??來進行竊取

 為jQuery Mobile在Stack Overflow的時間圖:

使用統計圖:

總結:

1.如果你的項目不需要開放重新導向,那麼可以可以嘗試關閉它

2.根據老司機的經驗,Open Redirects是非常常見的錯誤,也可以認為是一個通用的漏洞(其中還有一些很有意思的姿勢),無論jQuery Mobile認不認為這個是不是漏洞,但是對於安全從業者來說都是存在這個XSS漏洞的。

3.jQuery Mobile團隊也推薦使用他們的開發文檔,進行閱讀進行開發。連結

 

漏洞Eduardo Vela (sirdar kcat)

原文:http://sirdarckcat.blogspot.com/2017/02/unpatched-0day-jquery-mobile-xss.html

 

[0day]jQuery Mobile XSS

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.