Document Title: =============== PayPal Inc - Filter Bypass & Arbitrary Code Execution Vulnerability References (Source): ==================== http://www.vulnerability-lab.com/get_content.php?id=936 Video: http://www.vulnerability-lab.com/get_content.php?id=1275 Vulnerability Magazine: http://magazine.vulnerability-db.com/?q=articles/2014/11/05/paypal-inc-fixed-filter-bypass-profile-code-execution-during-infrastructure Release Date: ============= 2014-11-05 Vulnerability Laboratory ID (VL-ID): ==================================== 936 Common Vulnerability Scoring System: ==================================== 9.1 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. 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. (Copy of the Homepage: www.paypal.com) [http://en.wikipedia.org/wiki/PayPal] Abstract Advisory Information: ============================== The Vulnerability Laboratory Research Team discovered a persistent script code injection web vulnerability in the official PayPal Inc core application. Vulnerability Disclosure Timeline: ================================== 2013-04-25: Researcher Notification & Coordination (PayPal Inc - Bug Bounty Program) 2013-04-26: Vendor Notification (PayPal Inc - Bug Bounty Program) 2013-05-01: Vendor Response/Feedback (PayPal Inc - Bug Bounty Program) 2013-09-12: Vendor Response/Feedback (Ebay Inc - Bug Bounty Program) 2014-10-01: Vendor Response/Feedback (Ebay Inc - Bug Bounty Program) 2014-10-12: Vendor Fix/Patch (PayPal Inc - Developer Team) 2014-11-04: Public Disclosure (Vulnerability Laboratory) Discovery Status: ================= Published Affected Product(s): ==================== PayPal Inc Product: Core Application 2013 Q1 Exploitation Technique: ======================= Remote Severity Level: =============== Critical Technical Details & Description: ================================ A system specific arbitrary code execution vulnerability has been discovered in the official in the official PayPal Inc Web-Application & API. A filter bypass and persistent bug has also been revealed during the tests in the same vulnerable parameter location. The system specific arbitrary code execution vulnerability is located in the developer api portal with connection and account access to the paypal portal api. First the attacker registers an user account and includes to the `cardholder confidential` and `accountSelName` value own malicious persistent script codes or local web-server files. To attack, the help center data of the malicious profile requires a second registration to the developer api portal with same credentials (connected). The accountSelName and the confidential values are not limited on input. The attacker is able to load script codes but can also remotly execute arbitrary codes to access local web-server files or configs. The filter bypass occurs during the execution onclick by opening the profile. The trusted context of the dev api user account will be streamed through the help center link on GET method requests. The regular filter of paypal prevents the external inject of frames to other websites but in case of this issue the trusted context is directly executed on top of the profile. The execution and inject can occur remotly by attackers and the attack typus is pending from persistent xss to arbitrary code execution and local web-server file request through the profile. The web-server and misconfiguration allows the attacker to for example include a frame with a local request through the trusted context to capture unauthorized data of the system. A webshell inject could also be possible during the execution point of the paypal users profile. The attack vector is on the application-side of the paypal service and the injection request method is POST (dev api & help center). The security risk of the local command/path inject vulnerability is estimated as medium with a cvss (common vulnerability scoring system) count of 9.1. Exploitation of the system specific code execution vulnerability requires a low privileged paypal inc account with restricted access and no user interaction. Successful exploitation of the vulnerability results in unauthorized execution of system specific codes, webshell injects via POST method, unauthorized path/file value requests to compromise the application or the connected module components. Request Method(s): [+] POST Vulnerable Module(s): [+] helpcenter/home/ ( https://www.paypal.com/webapps/helpcenter/home/ ) [+] developer.paypal.com ( https://developer.paypal.com/webapps/developer/support ) Vulnerable Parameter(s): [+] accountSelName confidential [+] confidential Affected Module(s): [+] PayPal Inc – Profile User Index (Main) – Execution through > https://developer.paypal.com/webapps/developer/support ) Proof of Concept (PoC): ======================= The system specific code execution and persistent issue (filter bypass) can be exploited by remote attackers with low privileged application user account. For security demonstration or to reproduce the security vulnerability follow the provided information and steps below to continue. Manual Steps to reproduce the vulnerability ... 1. First register and account to the developer portal api 2. Second connect the paypal account to the help center by registration (2. to 1. also possible) Note: On registration it`s required to include own payloads (code execution [path|file|config]or script code[html|php|js]) to the AccountSelName & cardholder confidential input. 3. Save the payload to your profile 4. Open the dev webportal & include the same data (payload) to your dev api profile values. Note: On our tests we did but we are not if this is a requirement for a successful test. 5. Now surf to the following internal dev websitehttps://developer.paypal.com/webapps/developer/support ) Note: On bottom of the page is now the paypal support link with the malicious injected code 6. Click the "Visit PayPal Support" link 7. The website redirect to the local paypal profile with the new api template theme. The system specific code execution occurs directly in the middle were the streamed data of the helpcenter through dev api portal will become visible. The vulnerable executable values are `AccountSelName` and cardholder `confidential` account data. Note: If you injected script code the script code execution on the main profile request throught the dev api service or a local config/file of the web-server will be loaded. 8. Successful reproduce of the remote vulnerability in the paypal infrastructure! Note: DETAILS $ PAYPAL TO AUTHORIZED USAGE Reference(s): >From < https://developer.paypal.com/webapps/developer/support Through API > https://www.paypal.com/webapps/helpcenter/home/ To < https://www.paypal.com/webapps/helpcenter/home/a [ARBITRARY CODE EXEUCTION!] PoC: Help Center Index - confidential & accountSelName confidential