Exploit-DB #27042
Description: Photo Server 2.0 iOS - Multiple Vulnerabilities
Type: webapps
Platform: ios
Date: 2013-07-23
Author: Vulnerability-Lab

Exploit:
Title:
======
Photo Server 2.0 iOS - Multiple Critical Vulnerabilities


Date:
=====
2013-07-23


References:
===========
http://www.vulnerability-lab.com/get_content.php?id=1029


VL-ID:
=====
1029


Common Vulnerability Scoring System:
====================================
8.6


Introduction:
=============
Photo Server is the free (photos only) version of Video Server. Access your device`s camera roll from any computer or 
device with a web browser on your local network router`s WiFi. With proper configuration of your WiFi router, access 
can be made from the web browser of any computer or device connected to the internet.

Video transfer can be enabled either through the in-app upgrade or by clicking on and viewing an iAd (iAds not available 
in all countries yet).

The Bluetooth option allows you to transfer photos stored in your camera roll between Apple iMobile devices such as the 
iPhone, iPod Touch, and iPad without WiFi. Once the BlueTooth connection is established between the devices, choose your 
picture and the app automatically begins transmitting it via BlueTooth to the other device. Once received on the other 
device you can view the photograph and save it to your camera roll.

(Copy of the Homepage: https://itunes.apple.com/en/app/photo-server/id397545365 )


Abstract:
=========
The Vulnerability Laboratory Research Team discovered a command injection and file include (arbitrary file upload) vulnerability in the Photo Server 2.0 application (Apple iOS - iPad & iPhone).


Report-Timeline:
================
2013-07-23:    Public Disclosure (Vulnerability Laboratory)


Status:
========
Published


Affected Products:
==================
Apple AppStore
Product: Photo Server - Application 2.0


Exploitation-Technique:
=======================
Remote


Severity:
=========
Critical


Details:
========
1.1
A local command/path injection web vulnerability is detected  in the Photo Server 2.0 application (Apple iOS - iPad & iPhone).
The vulnerability allows to inject local commands via vulnerable system values to compromise the apple mobile iOS application.

The vulnerability is located in the index file dir listing module when processing to request and list the ipad or iphone devicename.
Local attackers can change the name of the device to inject the code and request any local path or inject commands on application-side.
The malicious context with the path request executes when a user or victim is watching the file dir index listing.

Exploitation of the web vulnerability requires a local privilege iOS device account with restricted access and no user interaction.
Successful exploitation of the vulnerability results unauthorized execution of system specific commands and path requests.

Vulnerable Application(s):
				[+] Photo Server v2.0  - ITunes or AppStore (Apple)

Vulnerable Parameter(s):
				[+] device name

Affected Module(s):
				[+] Index File Dir Listing




1.2
A file include web vulnerability is detected in the Photo Server 2.0 application (Apple iOS - iPad & iPhone).
The file include vulnerability allows remote attackers to include (upload) local file or path requests to compromise the application or service.

The vulnerability is located in the upload module when processing to upload files with manipulated names via POST method. The attacker can inject 
local path or files to request context and compromise the device. The validation has a bad side effect which impacts the risk to combine the attack 
with persistent injected script code.

Exploitation of the file include web vulnerability requires no user interaction or privilege application user account. 
Successful exploitation of the vulnerability results in unauthorized local file and path requests to compromise the device or application.

Vulnerable Module(s):
				[+] Upload (Files)

Vulnerable Parameter(s):
				[+] filename 

Affected Module(s):
				[+] Index File Dir Listing



1.3
An arbitrary file upload web vulnerability is detected in the Photo Server 2.0 application (Apple iOS - iPad & iPhone).
The arbitrary file upload issue allows a remote attacker to upload files with multiple extensions to bypass the validation for unauthorized access.

The vulnerability is located in the upload module when processing to upload files with multiple ending extensions. Attackers are able to upload 
a php or js web-shells by renaming the file with multiple extensions. He uploads for example a web-shell with the following name and 
extension image.jpg.js.php.jpg . He deletes in the request after the upload the jpg to access unauthorized the malicious file (web-shell) to 
compromise the web-server or mobile device.

Exploitation of the arbitrary file upload web vulnerability requires no user interaction or privilege application user account.
Successful exploitation of the vulnerability results in unauthorized file access because of a compromise after the upload of web-shells.

Vulnerable Module(s):
				[+] Upload (Files)

Vulnerable Parameter(s):
				[+] filename (multiple extensions)

Affected Module(s):
				[+] Index File Dir Listing


Proof of Concept:
=================
1.1
The local command/path inject web vulnerability can be exploited by local attackers with device access and without user interaction.
For demonstration or reproduce ...

PoC:

<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>iPad �337 360* >"<[COMMAND/PATH INJECT VULNERABILITY]> Photo Server app's Web Browser Interface Page</title></head><body>
<center><h2>iPad �337 360* >"<[COMMAND/PATH INJECT VULNERABILITY]">'s
Photo Server App Web Browser Interface 
Page</h2></center><form action="" method="post" 
enctype="multipart/form-data" name="form1" 
id="form1"><label>Choose QuickTime (.MOV) or JPEG (.JPG or 
.jpeg) file to upload to iPad �337 360* >"<iframe src=a>: 
<inp