2015-02-17

Document Title:
===============
Ebay Inc Magento Bug Bounty #5 - Persistent Validation & Mail Encoding Web Vulnerability

References (Source):
====================
http://www.vulnerability-lab.

com/get_content.php?id=1226

eBay Inc. Bug Bounty Program ID: EIBBP-27288

Vulnerability Magazine: http://magazine.vulnerability-

db.com/?q=articles/2015/02/14/

ebay-inc-magento-2015q1-

official-bug-bounty-program-

rewards-security-researcher

Release Date:
=============
2015-02-14

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

======
1226

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

======
3.8

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 an application-side input validation and mail encoding web vulnerability in the official eBay Magento and Magento info web-application.

Vulnerability Disclosure Timeline:
==============================

====
2014-03-14: Researcher Notification & Coordination (Benjamin Kunz Mejri - Evolution Security GmbH)
2014-03-15: Vendor Notification (eBay Inc Security Team - Bug Bounty Program)
2014-03-10: Vendor Response/Feedback (eBay Inc Security Team - Bug Bounty Program)
2015-02-12: Vendor Fix/Patch (Magento Developer Team)
2015-02-13: Bug Bounty Reward (eBay Inc Security Team - Bug Bounty Program)
2015-02-14: Public Disclosure (Vulnerability Laboratory)

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

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

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

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

Technical Details & Description:
==============================

==
An application-side mail encoding web vulnerability has been discovered in the official eBay Magento & Info Web-Application.
The vulnerability allows remote attackers to bypass the outgoing mail filter validation of the magento web-server & web-application.

The vulnerability is located in the first- and lastname values of the `Talk to a Specialist` module. Remote attackers without privileged application
user account are able to inject persistent malicious script codes. The script code execution occurs in the notification mail to the specialist but
also to the active user copy mail. The persistent injected script code executes in the header section were the database context of the first- and
lastname will be displayed. The sender interacts automatically by usage of the magento.com & info.magento.com service. The validation of the db
stored outgoing values is wrong encoded and allows persistent injections of malicious script codes via POST method. The attack vector is persistent
and the injection request method is POST.

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

Vulnerable Domain(s):
[+] magento.com & info.magento.com

Vulnerable Module(s):
[+] Talk to a Specialist

Vulnerable Parameter(s):
[+] firstname
[+] lastname
[+] companyname

Affected Sender(s):
[+]  info@magento.com

Affected Receiver(s):
[+] bkm@evolution-sec.com

Affected Context Module(s):
[+] Section 1  > mktEditable

Proof of Concept (PoC):
=======================
The application-side input validation web vulnerability can be exploited by remote attackers without privileged user account and with low or medium user interaction.
For security demonstration or to reproduce the mail encoding web vulnerability follow the provided information and steps below to continue.

Manual steps to reproduce of the vulnerability ...
1. You do not need to register an account ;)
2. Open up the main website and switch to the magento.com contacts site
3. On the bottom you need to click the `talk to specialist` button
4. You get redirect to a regular valid formular with a mod specialist notification
5. Inject your script code payloads as first-, last- and companyname values
6. Click the send request button ...
Note: Now, you will be redirected by the service after choosing a specialist ... we used `E.C. Kraus` (#sry ;)
7. Send the same request from the input below to the specialist with a non malicious test payload
8. The persistent code execution occurs in the mail to the manager aka specialist but also to the sender of the notification itself (without user auth!)
9. Successful reproduce of the persistent script code injection web vulnerability via POST method request

PoC: Your E.C. Kraus Magento Enterprise Case Study Download

<html><head>
<title>Your E.C. Kraus Magento Enterprise Case Study Download</title>
<link rel="important stylesheet" href="chrome://messagebody/

skin/messageBody.css">
</head>
<body>
<table class="header-part1" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody><tr><td><b>Betreff: </b>Your E.C. Kraus Magento Enterprise Case Study Download</td></tr><tr><td>
<b>Von: </b>Magento <info@magento.com></td></tr><

tr><td><b>Datum: </b>15.03.2014 20:27</td></tr></tbody></

table>
<table class="header-part2" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td><

b>An: </b>bkm@evolution-sec.com</td>

</tr></tbody></table><br>
<meta http-equiv="Content-Type" content="text/html; ">
<title></title>
<div id="Section 1" class="mktEditable"><p>Dear a "><[PERSISTENT INJECTED SCRIPT CODE 1!]">%20<[PERSISTENT INJECTED SCRIPT CODE 2!]>,</p>
<p>Thank you for requesting the Magento Enterprise Case Study on E.C. Kraus.  You can download the Case Study here:</p>
<p><a href=
"http://email.magento.com/

397EXO8770000EP01aGC801"
>Download</a></p>
<p>Check out our complete list of <a href=
"http://email.magento.com/

397EXO8770000EQ01aGC801"
>Magento Case Studies</a></p>
<p>To learn more about Magento Enterprise or to reqeust a personalized quote, please <a href=
"http://email.magento.com/

397EXO8770000ER01aGC801"
>contact out Magento Enterprise team</a>.</p>
<p>Thank you,</p>
<p>The Magento Team</p></div>
<IMG SRC="http://email.magento.com/

trk?t=1&mid=

Mzk3LUVYTy04Nzc6MDozMzkyOjExMz

I1OjA6MzMxNzo3OjE3MzIzNDI4LTE6

bnVsbA%3D%3D" WIDTH="1" HEIGHT="1" BORDER="0" ALT="" />
</body>
</html>
</body>
</html>
</iframe></p></div></body></

html>

--- PoC Session Logs [POST] ---
21:15:18.356[654ms][total 2913ms]
Status: 200[OK]
GET http://magento.com/explore/

contact-sales
Load Flags[LOAD_DOCUMENT_URI  LOAD_INITIAL_DOCUMENT_URI  ] Größe des Inhalts[-1] Mime Type[text/html]
Request Header:
Host[magento.com]
User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0]
Accept[text/html,application/

xhtml+xml,application/xml;q=0.

9,*/*;q=0.8]
Accept-Language[de-de,de;q=0.

8,en-us;q=0.5,en;q=0.3]
Accept-Encoding[gzip, deflate]
Referer[http://magento.com/

customers/customer-showcase]
Cookie[optimizelySegments=%7B%

22239237138%22%3A%22direct%22%

2C%22237962548%22%3A%22ff%22%

2C%22238367687%22%3A%22false%

22%7D; optimizelyEndUserId=

oeu1394911379094r0.

20693940633527685; optimizelyBuckets=%7B%7D; _ga=GA1.2.394130418.

1394911379; has_js=1; ClrSSID=1394911380598-4406; ClrOSSID=1394911380598-4406; ClrSCD=1394911380598; s_cc=true; s_fid=5EF56BF224B1A40C-

0256902EC3CD13C6; gpv_pn=%2Fcustomers%

2Fcustomer-showcase; undefined_s=First%20Visit; s_vnum=1396303200710%26vn%3D1; s_invisit=true; s_sq=magentomagento%

2Cmagentoglobal%3D%2526pid%

253D%25252Fcustomers%

25252Fcustomer-showcase%

2526pidt%253D1%2526oid%

253Dhttp%25253A%25252F%

25252Fmagento.com%

25252Fexplore%25252Fcontact-

sales_1%2526oidt%253D1%2526ot%

253DA%2526oi%253D1; s_ppv=-%2C84%2C84%2C2200; utm_src=a%3A6%3A%7Bs%3A8%3A%

22campaign%22%3Bs%3A0%3A%22%

22%3Bs%3A6%3A%22medium%22%3Bs%

3A0%3A%22%22%3Bs%3A6%3A%

22source%22%3Bs%3A11%3A%22mage

nto.com%22%3Bs%3A7%3A%

22keyword%22%3Bs%3A0%3A%22%22%

3Bs%3A3%3A%22url%22%3Bs%3A11%

3A%22magento.com%22%3Bs%3A4%

3A%22time%22%3Bi%3A1394911525%

3B%7D; _mkto_trk=id:397-EXO-877&

token:_mch-magento.com-

1394911532816-55587; _tsm=m%3DDirect%2520%252F%

<span style="background-color: white; color: #222

Show more