Exploit-DB #36922
Description: vPhoto-Album 4.2 iOS - Local File Inclusion
Type: webapps
Platform: ios
Date: 2015-05-06
Author: Vulnerability-Lab

Exploit:
Document Title:
===============
vPhoto-Album v4.2 iOS - File Include Web Vulnerability


References (Source):
====================
http://www.vulnerability-lab.com/get_content.php?id=1477


Release Date:
=============
2015-05-05


Vulnerability Laboratory ID (VL-ID):
====================================
1477


Common Vulnerability Scoring System:
====================================
6.2


Product & Service Introduction:
===============================
vPhoto Pro is your side of the most powerful local album management software that allows you to easily manage your massive photos, 
while giving you an unprecedented user experience. No in-app purchase, no functional limitations.

(Copy of the Homepage:  https://itunes.apple.com/us/app/veryphoto-album-password-wifi/id720810114 )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research team discovered a local file include web vulnerability in the official vPhoto-Album v4.2 iOS mobile web-application.


Vulnerability Disclosure Timeline:
==================================
2015-05-05: Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Affected Product(s):
====================
Cheng Chen
Product: vPhoto-Album - iOS Web Application (Wifi) 4.1


Exploitation Technique:
=======================
Remote


Severity Level:
===============
High


Technical Details & Description:
================================
A local file include web vulnerability has been discovered in the official vPhoto-Album v4.2 iOS mobile 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 vulnerability is located in the `name` value of the wifi interface module. Local attackers are able to manipulate the 
wifi web interface by usage of the vulnerable sync function.  The sync does not encode or parse the context of the albumname.

Local attacker are able to manipulate the input of the folder path value to exploit the issue by web-application sync. 
The execution of unauthorized local file or path request occurs in the index file dir listing module of the wifi web-application.
The request method to inject is a sync and the attack vector is located on the application-side of the affected service.

The security risk of the local file include web vulnerability is estimated as high with a cvss (common vulnerability scoring system) count of 7.1. 
Exploitation of the 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 or connected device component compromise.

Vulnerable Method(s):
				[+] [Sync]

Vulnerable Module(s):
				[+] Albumname

Vulnerable Parameter(s):
				[+] name

Affected Module(s):
				[+] File Dir Index


Proof of Concept (PoC):
=======================
The local file include web vulnerability can be exploited by local attackers with restricted physical device access and no user interaction.
For security demonstration or to reproduce the security vulnerability follow the provided information and steps below to continue.


PoC: http://localhost:8080/

<script type="text/javascript">
            var albumArray = getAllAlbum();
            var numberOfAlbums = getNumberOfAlbums();

           for (var i=0; i<numberOfAlbums; i=i+4)
            {
                document.write("<tr>");
                
                document.write("<td height=\"170\" width=\"150\">");
                if (i+0 < numberOfAlbums)
                {
                    document.write("<p align=\"center\"><img border=\"0\" src=\"getCoverImage?"+encodeURI(JSON.stringify(albumArray[i+0]))+"\" width=\"170\" height=\"150\" onclick=albumClick('"+(i+0)+"')>");
                }
                document.write("</td>");
                
                document.write("<td height=\"170\" width=\"50\"></td>");
                
                document.write("<td height=\"170\" width=\"150\">");
                if (i+1 < numberOfAlbums)
                {
                    document.write("<p align=\"center\"><img border=\"0\" src=\"getCoverImage?"+encodeURI(JSON.stringify(albumArray[i+1]))+"\" width=\"170\" height=\"150\" onclick=albumClick('"+(i+1)+"')>");
                }
                document.write("</td>");
                
                document.write("<td height=\"170\" width=\"50\"></td>");
                
                document.write("<td height=\"170\" width=\"150\">");
                if (i+2 < numberOfAlbums)
                {
                    document.write("<p align=\"center\"><img border=\"0\" src=\"getCoverImage?"+encodeURI(JSON.stringify(albumArray[i+2]))+"\" width=\"170\" height=\"150\" onclick=albumClick('"+(i+2)+"')>");
                }
                document.write("</td>");
                
                document.write("<td height=\"170\" width=\"50\"></td>");
                
                document.write("<td height=\"170\" width=\"150\">");
                if (i+3 < numberOfAlbums)
                {
                    document.write("<p align=\"center\"><img border=\"0\" src=\"getCoverImage?"+encodeURI(JSON.stringify(albumArray[i+3]))+"\" width=\"170\" height=\"150\" onclick=albumClick('"+(i+3)+"')>");
                }
                document.write("</td>");
                
                document.write("</tr>");
                
                
                document.write("<tr>");
                
                document.write("<td height=\"20\" > <p align=\"center\">");
                if (i+0 < numberOfAlbums)
                {
                    
                    document.write("<font face=\"Courier New\" si