Lucene search
K

Ebay Magento Bug Bounty #6 - Persistent Mail Web Vulnerability

Magento persistent mail encoding web vulnerability discovered. Allows remote attackers to inject malicious payloads via registration fields, compromising service mails

Code
Document Title:
===============
Ebay Magento Bug Bounty #6 - Persistent Mail Web Vulnerability


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

EIBBP-31097


Release Date:
=============
2015-06-01


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


Common Vulnerability Scoring System:
====================================
3.3


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 persistent mail encoding web vulnerability in the official Magento Website Web-Application (Framework).


Vulnerability Disclosure Timeline:
==================================
2015-06-02: Public Disclosure (Vulnerability Laboratory)


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


Affected Product(s):
====================
Ebay Inc.
Product: Magento - Web Application Service 2015 Q1


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


Severity Level:
===============
Low


Technical Details & Description:
================================
An application-side mail encoding web vulnerability has been discovered in the official Magento Website Web-Application (Framework).
The vulnerability allows remote attackers to bypass the web validation to compromise service mails by persistent script code injection.

The persistent vulnerability is located in the `name` value of the http://magento.com/training/catalog/fundamentals-of-magento-development
website web-application. The context validation vulnerability itself is located in the firstname and lastname values of the site registration module. 
Remote attackers are able to inject malicious payloads (script code) to the firstname and lastname input fields of the registration (POST). 
The remote vulnerability can be exploited by remote attackers or with automatic post scripts to send customers, clients and other random people 
malicious mails with injected script codes by the trusted magento mail server. The attack vector is persistent on the application-side and the 
request method to inject the payload is POST. 

The security risk of the vulnerability is estimated as medium but the issue affects the full developer event web-server. The validation of the 
server does not encode the payload to prevent an execution on registration and fails to parse in the second instance (send mailings) the database names.
The magento panel itself is not affected by the validation issue but the feature to register with special chars should be permanently blocked to prevent.

The security risk of the persistent mail encoding web vulnerability is estimated as medium with a cvss (common vulnerability scoring system) count of 3.3.
Exploitation of the web vulnerability requires a low privileged web-application user account (unverified registration) and low or medium user interaction. 
Successful exploitation of the vulnerability results in session hijacking, persistent phishing, persistent external redirect and persistent manipulation of 
web header mail context.


Request Method(s):
				[+] POST

Vulnerable Domain(s):
				[+] Magento - (magento.com)

Vulnerable Service(s):
				[+] Developer (Event) - Registration

Vulnerable Parameter(s):
				[+] name

Affected Sender(s):
				[+] [email protected]

Note: The issue is not connected to the already reported mail encoding issues affecting the partners and go service.


Proof of Concept (PoC):
=======================
The persistent input validation web vulnerability can be exploited by remote attackers with low privileged application user account with low or medium 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 security vulnerability ...
1. Open the website of magento.com and surf to the fundamentals-of-magento-development site
URL: http://magento.com/training/catalog/fundamentals-of-magento-development-5-day?mkt_tok=3RkMMJWWfF9wsRojuqvMcu

%2FhmjTEU5z16usuW6Syi5Z41El3fuXBP2XqjvpVQcdkN7rKRw8FHZNpywVWM8TIL9kXt9BlJAzqD2w%3D#.VKvFansvnZx
2. Click the register button that redirects to the following location
URL:http://magento.com/training/catalog/checkout/cart/
3. Click the checkout button without included credentials or non expired session 
URL: https://magento.com/training/catalog/checkout/onepage/
4. Inject payload in the name values and save it. Then proceed to include your paypal test payment information to continue.
Note: <script>, basic <frame> and <div> tags are restricted by the web-server validation. <img> & <iframe> tags with onload and alert can bypass the validation. (Pictures 1-10.png)
5. After some weeks/days a mail arrives with the topic `Learn Magento Development Fundamentals`.
6. The persistent injected script code executes in the introduction (Dear Username[X]) context thats displays the vulnerable name. The sender is [email protected] that is connected to 

the email.magento.com
7. Successful reproduce of the vulnerability!


PoC: Learn the Fundamentals of Magento Development in Munich (Learn Magento Development Fundamentals.html)

<tr><td class="mktEditable" id="Title" style="text-align:left; font-family:Georgia, sans-serif; 
font-size:26px; color:#333; " valign="top"><p style="mso-table-lspace:0;mso-table-rspace:0; margin:0;">
Learn the Fundamentals of Magento Development in Munich</p>
</td></tr>
<tr><td height="20"> </td>
</tr>
<tr><td><table class="deviceWidth" style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#858585; " 
border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="mktEditable" id="Intro" style="text-align:left; 
font-family:Helvetica, sans-serif; font-size:13px; line-height:20px; color:#666; " valign="top">
<p style="margin: 1em 0;">Hello ">[PERSISTENT INJECTED SCRIPT CODE EXECUTION!]<img src="http://www.evolution-sec.com/x" onerror="prompt(7357);">   "><i,< p="">
</i,<></p><p style="margin: 1em 0;">Magento U is hosting their <a style="color: #0c7eb2; text-decoration: none;" 
href="http://email.magento.com/gU0thvn0D10mXO0FE100XGG">Fundamentals of Magento Development</a> 
course in Munich! This is a fantastic opportunity for developers in the area to learn the architecture, terminology, 
and core functionality of Magento Enterprise Edition that will save them time and money with more efficient and effective deployments.</p>
<p style="margin: 1em 0;"><strong>Munich</strong><br> March 9 - 13, 2015</p></td>
</tr>
</tbody>
</table>


Reference(s):
http://magento.com/training/catalog/fundamentals-of-magento-development-5-day?mkt_tok=3RkMMJWWfF9wsRojuqvMcu

%2FhmjTEU5z16usuW6Syi5Z41El3fuXBP2XqjvpVQcdkN7rKRw8FHZNpywVWM8TIL9kXt9BlJAzqD2w%3D#.VKvFansvnZx
http://magento.com/training/catalog/checkout/cart/
https://magento.com/training/catalog/checkout/onepage/


Picture(s):
			../1.png
			../2.png
			../3.png
			../4.png
			../5.png
			../6.png
			../7.png
			../8.png
			../9.png
			../10.png

Resource(s):
			../Learn Magento Development Fundamentals.eml
			../Learn Magento Development Fundamentals.html
			../poc-dom.txt


Solution - Fix & Patch:
=======================
The vulnerability can be patched by a secure parse and encode of the name value in the outgoing mails. Reconfigure the filter and capture img onload payloads.
Restrict and filter the registration of the fundamental developer service (event) to prevent executions in other website sections and layers.
Encode the db user values to prevent persistent execution in further emails. Search for script code payloads in the name value table of the dbms.


Security Risk:
==============
The security risk of the application-side mail encoding web vulnerability is estimated as medium. (CVSS 3.3)


Credits & Authors:
==================
Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri ([email protected]) [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:    [email protected] 	- [email protected] 	       		- [email protected]
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 
([email protected] or [email protected]) to get a permission.

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



Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation