Skip to main content
Sealed steel shipping containers stacked at a port terminal under gantry cranes.
Photo by OSG Containers on Unsplash
  1. Research/

XSS via XML File Upload on PayPal

Patrik Grobshäuser
Author
Patrik Grobshäuser
Security researcher at Assetnote / Searchlight Cyber. Before that, seven years triaging other people’s reports at HackerOne and Shopify. Hunting bugs since 2012, published as Patrik Fehrenbach until 2025.
Table of Contents

One of my findings on PayPal.com. When creating an invoice, PayPal lets users upload attachments, and one of the allowed attachment types is an XML file. What the developers appear to have missed is that you can embed HTML inside an XML file: the xmlns namespace declaration lets you pull in XHTML, so a valid file looks something like this:

<html>
<head></head>
<body>
<something:script xmlns:something="http://www.w3.org/1999/xhtml">alert(1)</something:script>
</body>
</html>

Proof of concept
#

When I uploaded a file with this content and a .xml extension, the interpreter on PayPal’s side executed the payload — in this case alert(1). To meet the requirements for a bounty you always have to show that such a vulnerability is exploitable and therefore a real risk to other PayPal users. In this case it was pretty easy, you could either send the link to the file directly (it does not matter whether the victim is logged in or not) or attach it to an invoice and wait for the recipient to click it.

Related