Document Title: =============== USB Disk Free v1.0 iOS - File Include Vulnerability Date: ===== 2014-10-10 References: =========== http://www.vulnerability-lab.com/get_content.php?id= VL-ID: ===== 1340 Common Vulnerability Scoring System: ==================================== 6.1 Introduction: ============= USB Disk is your File Manager which support Music Player, Video Player, Photo Viewer, PDF Reader, Document Viewer and Zip & RAR Extractor . Support the following file types: - Music & Songs: MP3, M4A, W4P, WP4, AAC, WAV, CAF - Video & Movie: MP4, M4V, MOV, MPV, 3GP - Photo & Images: BMP, PNG, JPG, JPEG, GIF, TIF, TIFF, ICO - Document: PDF, TXT, PAGES, NUMBERS, KEY, DOC, DOCX, XLS, XLSX, PPT, PPTX, RTF - Archive: ZIP, RAR, 7Z (Copy of the Vendor Homepage: https://itunes.apple.com/au/app/usb-disk-free-file-manager/id908003044 ) Abstract: ========= The Vulnerability Laboratory Research Team discovered a file include vulnerability in the official USB Disk Free - File Manager & File Transfer v1.0 iOS mobile application. Report-Timeline: ================ 2014-10-10: Public Disclosure (Vulnerability Laboratory) Status: ======== Published Affected Products: ================== Yajing Qian Product: USB Disk Free (File Manager & Wifi File Transfer) - iOS Web Application v1.0 Exploitation-Technique: ======================= Local Severity: ========= High Details: ======== A local file include web vulnerability has been discovered in the official USB Disk Free - File Manager & Transfer v1.0 iOS mobile 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 `newfile upload` module. Remote attackers are able to inject own files with malicious `filename` values in the `newfile` POST method request to compromise the mobile web-application. The local file/path include execution occcurs in the index dir listing of the wifi interface context. The attacker is able to inject the local file include request by usage of the `wifi interface` in connection with the vulnerable newfile upload request. Remote attackers are also able to exploit the filename issue in combination with persistent injected script codes to execute different local malicious attack requests. The attack vector is located 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.1. Exploitation of the local file include web vulnerability requires no user interaction or privileged web-application user account. Successful exploitation of the local file include web vulnerability results in mobile application compromise or connected device component compromise. Request Method(s): [+] [POST] Vulnerable Module(s): [+] newfile Vulnerable Parameter(s): [+] filename Affected Module(s): [+] Index Path Dir Listing (http://localhost:8080/) Proof of Concept: ================= The local file include web vulnerability can be exploited by remote attackers without privileged application user account and also without user interaction. For security demonstration or to reproduce the security vulnerability follow the provided information and steps below to continue. PoC: Link POST http://localhost:8080/./[LOCAL FILE INCLUDE VULNERABILITY].* PoC: Exploit NameSize
Parent Directory -5235.jpg4.7 KB <./[FILE INCLUDE VULNERABILITY VIA FILENAME TO PATH VALUE!]"> ./[FILE INCLUDE VULNERABILITY VIA FILENAME TO PATH VALUE!].png689.0 Byte
--- PoC Session Logs [POST] --- Status: 200[OK] POST http://localhost:8080/ Load Flags[LOAD_DOCUMENT_URI LOAD_INITIAL_DOCUMENT_URI ] Größe des Inhalts[793] Mime Type[application/x-unknown-content-type] Request Header: Host[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://localhost:8080/] Connection[keep-alive] POST-Daten: POST_DATA[-----------------------------18827278717040 Content-Disposition: form-data; name="newfile"; filename="./[FILE INCLUDE VULNERABILITY VIA FILENAME TO PATH VALUE!].png" Content-Type: image/png - Status: 200[OK] GET http://localhost:8080/./[FILE INCLUDE VULNERABILITY VIA FILENAME TO PATH VALUE!] Load Flags[LOAD_DOCUMENT_URI ] Größe des Inhalts[0] Mime Type[application/x-unknown-content-type] Request Header: Host[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://localhost:8080/] Connection[keep-alive] Response Header: Accept-Ranges[bytes] Content-Length[0] Date[Thu, 09 Oct 2014 22:25:38 GMT] Solution: ========= The security vulnerability can be patched by a secure parse and encode of the file name value in the upload POST method request or sync. Encode the file dir listing names and data output values to prevent further file include attacks. Restrict the file name extension validation to fully secure the upload mechanism. Risk: ===== The security risk of the local file include web vulnerability in the wifi file manager upload module is estimated as high. Credits: ======== Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri (bkm@evolution-sec.com) [www.vulnerability-lab.com] Disclaimer: =========== 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]