File Upload XSS in image uploading of App in mopub
The image upload feature for apps did not properly validate the file type, so a file with an HTML content type could be stored and served from the image host. An attacker could upload a file containing script and get it to execute in a victim's browser when the hosted link is opened.
Originally disclosed on HackerOne
- Triaged in 11 hours
- Fixed in 7 months
- Paid in 2 days
- Disclosed after 10 months
Hi Team,
I want to report a File upload XSS in your Image upload functionality of Apps in mopub. Server doesn't check whether you are uploading a jpg/jpeg files and it upload the file on image.mopub.com .
POC link : https://images.mopub.com/app_icons/126cb3308e1a464385a49c4c7aaeac56
Steps to reproduce : 1.Go to App settings and select a html file with .jpg extension. 2.Intercept the request and change the .jpg to .html and change the content type to text/html and it will upload the file. 3.Open the link of image in new file and XSS will pop up.
HTTP request :
POST /inventory/app_icon/upload/ HTTP/1.0 Host: app.mopub.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:42.0) Gecko/20100101 Firefox/42.0 Accept: / Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate X-CSRFToken: YZ8hbuu1vB9p5s1ni2vPZ5kMrhMqeDo5 X-Requested-With: XMLHttpRequest Referer: https://app.mopub.com/inventory/app/97142808ce5d4ace895480a3ffe7d631/ Content-Length: 389 Content-Type: multipart/form-data; boundary=---------------------------1714461176134095862036612614 Cookie: [Cookie values] Connection: keep-alive Pragma: no-cache Cache-Control: no-cache
-----------------------------1714461176134095862036612614 Content-Disposition: form-data; name="image_upload"; filename="xssfileuploadcopy.html" Content-Type: text/html
HTML contetn -----------------------------1714461176134095862036612614--
Let me know if you need any other help from my side.
Best Regards ! Vijay Kumar
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the upload endpoint trusted the client-supplied filename extension and content type instead of validating the actual file content and serving uploads with a safe content type.
Impact
An attacker could host script on the image domain and have it run in a victim's browser when the link is opened, though the report does not show any further consequences.
What the attacker needed
An account able to edit app settings; victim opens the uploaded file link
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A website let people upload pictures for their apps, but it did not really check that the file was a picture. Someone could upload a file that is actually a web page with code in it, and when another person opens the link to that file, the code runs in their browser. This is called cross-site scripting, where an attacker's code runs as if it came from the trusted site.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.