[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JavaScript Anywhere v3.0.4 iOS - Persistent Vulnerability



Document Title:
===============
JavaScript Anywhere v3.0.4 iOS - Persistent Vulnerability


References (Source):
====================
http://www.vulnerability-lab.com/get_content.php?id=1709


Release Date:
=============
2016-02-08


Vulnerability Laboratory ID (VL-ID):
====================================
1709


Common Vulnerability Scoring System:
====================================
3.8


Product & Service Introduction:
===============================
JavaScript Anywhere is one of the oldest development environment on iOS since 2010. It`s a simple and portable editing tool 
for web engineers and designers. That`s all. JavaScript Anywhere is minimal forever.

Features:
- Write JavaScript, HTML and CSS source code.
- Preview on internal browser.
- Import project / Download images form web.
- Send e-mail / iTunes file sharing to export.
- Configure editor styles.
- Password lock
- Simple server for Wi-Fi
- Export to / Import from Dropbox.

(Copy of the Homepage: https://itunes.apple.com/us/app/javascript-anywhere/id363452277 )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Core Research Team discovered an application-side input validation web vulnerability in the official JavaScript Anywhere v3.0.4 iOS mobile web-application.


Vulnerability Disclosure Timeline:
==================================
2016-02-08:	Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Affected Product(s):
====================
Tatsuya Tobioka
Product: JavaScript Anywhere - iOS (Web-Application) 3.0.4


Exploitation Technique:
=======================
Remote


Severity Level:
===============
Medium


Technical Details & Description:
================================
A persistent input validation web vulnerability has been discovered in the official JavaScript Anywhere v3.0.4 iOS mobile web-application.
The vulnerability allows an attacker to inject own malicious script codes to the application-side of the affected module or function.

The vulnerability is located in the wifi user-interface application, that allows to share the projects with another user account. The `title` name 
value of the `New Project (+)` does not encode the inputs. After an attacker saved the malicious context as project, he is able to share it by usage 
of the wifi interface function. The wifi interface displays the project title names in a listing. The application-side execution occurs in the project 
listing of the wifi interface and the injection point is the project title name. The request method to inject is a sync via mobile app and the attack 
vector is located on the application-side.

The security risk of the application-side input web vulnerability is estimated as medium with a cvss (common vulnerability scoring system) count of 3.8. 
Exploitation of the persistent web vulnerability requires a low privileged ios device account with restricted access and low or medium user interaction. 
Successful exploitation of the vulnerabilities results in persistent phishing mails, session hijacking, persistent external redirect to malicious 
sources and application-side manipulation of affected or connected module context.

Vulnerable Module(s):
				[+] New Projects

Vulnerable Input(s):
				[+] Project Name

Vulnerable Parameter(s):
				[+] bar-title > title & list

Affected Module(s):
				[+] Wifi UI


Proof of Concept (PoC):
=======================
The persistent input validation web vulnerability can be exploited by remote attackers via file excahnge or wifi interface with low or medium user interaction.
For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue.

Manual steps to reproduce the vulnerability ...
1. Download the application and install it to your iOS v9.x device
2. Open the software and create a new project or rename an existing one
3. inject as title value for the project own malicious script code tags with external source
4. Save the entry and click to the share function
Note: After clicking to share the project becomes available via wifi web-application ui
5. The script code (payload) directly executes in the project index of the wifi interface
Note: The issue occurs because of the project name validation is wrong encoded
6. Successful reproduce of the persistent input validation vulnerability in the iOS mobile web-application!


PoC: URL (Example)
http://localhost:9000/teste%3E%22%3C[PERSISTENT INJECTED SCRIPT CODE PAYLOAD!]%20src%3Da%3E/index.html


PoC: Vulnerable Source
<header class="bar-title">
  <h1 class="title">JavaScript Anywhere</h1>
</header>
  <div class="content">
    <ul class="list"><ul>
<li><a href="/teste%3E%22%3C[PERSISTENT INJECTED SCRIPT CODE!]%20src%3Da%3E/index.html" data-ignore="push"><strong>teste>"<iframe src="a"></strong><span class="chevron"></span></a></li>
<li><a href="/test/index.html" data-ignore="push"><strong>test</strong><span class="chevron"></span></a></li>
<li><a href="/Hello%2C%20JavaScript%20Anywhere!/index.html" data-ignore="push"><strong>Hello, JavaScript Anywhere!</strong><span class="chevron"></span></a></li>
<ul></iframe></strong></a></li></ul></ul>
  </div>


--- PoC Session Logs [GET] (Execution) ---
Status: 200[OK]
GET http://localhost:9000/teste%3E%22%3C[PERSISTENT INJECTED SCRIPT CODE VULNERABILITY!]%20src%3Da%3E/index.html Load Flags[LOAD_DOCUMENT_URI  LOAD_INITIAL_DOCUMENT_URI  ] Größe des Inhalts[320] Mime Type[text/html]
   Request Header:
      Host[localhost:9000]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.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]
      DNT[1]
      Referer[http://localhost:9000/]
      Connection[keep-alive]
   Response Header:
      Content-Type[text/html]
      Content-Length[320]
      Connection[keep-alive]
-
17:30:43.974[45ms][total 45ms] Status: 200[OK]
GET http://localhost:9000/teste%3E%22%3C[PERSISTENT INJECTED SCRIPT CODE VULNERABILITY!]%20src%3Da%3E/a[PERSISTENT SCRIPT CODE EXECUTION!] 
Load Flags[LOAD_DOCUMENT_URI  ] Größe des Inhalts[23] Mime Type[text/html]
   Request Header:
      Host[localhost:9000]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.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]
      DNT[1]
      Referer[http://localhost:9000/teste%3E%22%3C[PERSISTENT INJECTED SCRIPT CODE VULNERABILITY!]%20src%3Da%3E/index.html]
      Connection[keep-alive]
   Response Header:
      Content-Type[text/html; charset=UTF-8]
      Content-Length[23]
      Connection[keep-alive]
-
Status: 200[OK]
GET http://localhost:9000/teste%3E%22%3C[PERSISTENT SCRIPT CODE EXECUTION!]%20src%3Da%3E/style.css 
Load Flags[LOAD_NORMAL] Größe des Inhalts[44] Mime Type[text/css]
   Request Header:
      Host[localhost:9000]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0]
      Accept[text/css,*/*;q=0.1]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      DNT[1]
      Referer[http://localhost:9000/teste%3E%22%3C[PERSISTENT SCRIPT CODE EXECUTION!]%20src%3Da%3E/index.html]
      Connection[keep-alive]
   Response Header:
      Content-Type[text/css]
      Content-Length[44]
      Connection[keep-alive]
-
Status: 200[OK]
GET http://localhost:9000/teste%3E%22%3C[PERSISTENT SCRIPT CODE EXECUTION!]%20src%3Da%3E/a Load Flags[LOAD_DOCUMENT_URI  ] Größe des Inhalts[23] Mime Type[text/html]
   Request Header:
      Host[localhost:9000]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.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]
      DNT[1]
      Referer[http://localhost:9000/teste%3E%22%3C[PERSISTENT SCRIPT CODE EXECUTION!]%20src%3Da%3E/index.html]
      Connection[keep-alive]
   Response Header:
      Content-Type[text/html; charset=UTF-8]
      Content-Length[23]
      Connection[keep-alive]


Note: There are multiple ways to exploit the bug remotly. Email, Dropbox & the Wifi Interface!


Solution - Fix & Patch:
=======================
The vulnerability can be patched by a secure parse and encode of the vulnerable title in the add new projects function.
Restrict the input and disallow special chars to prevent further injection attacks via wifi interface web-application.
Encode the title output value in the wifi interface and escape the context to secure.


Security Risk:
==============
The security risk of the persistent input validation web vulnerability in the javascript anywhere wifi interface is estimated as medium. (CVSS 3.8)


Credits & Authors:
==================
Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri (research@xxxxxxxxxxxxxxxxxxxxx) [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:    magazine.vulnerability-db.com	- vulnerability-lab.com/contact.php		       	- evolution-sec.com/contact
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 © 2016 | Vulnerability Laboratory - [Evolution Security GmbH]™



-- 
VULNERABILITY LABORATORY - RESEARCH TEAM
SERVICE: www.vulnerability-lab.com
CONTACT: research@xxxxxxxxxxxxxxxxxxxxx