Skip to content
XSS Write-up Intermediate

Modify the request path to bypass upload restrictions, leading to an XSS vulnerability.

The upload endpoint blocked dangerous file types such as SVG, HTML and XML, but alternative endpoint names accepted the same uploads. An attacker could upload an SVG containing script and have it execute when the uploaded file was opened.

xiaodongsec Follow

Published on medium.com

this time I bring a simple article mainly to share an XSS vulnerability I discovered through uploading in a bug bounty project.

Mu1berry, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the file-type restriction was enforced only on the original upload endpoint, while sibling upload endpoints performed no equivalent validation.

Impact

An attacker could upload a file containing script and have it execute in a victim's browser when the uploaded file is opened, though the text does not describe any further consequences.

What the attacker needed

Access to an upload feature; victim opens the uploaded file

How it was found

  1. Identify the upload endpoint used by the customer service and feedback interfaces.
  2. Try uploading SVG, HTML and XML files to that endpoint and observe the error.
  3. Fuzz for alternative endpoint names on the same path.
  4. Upload an SVG containing an XSS payload to an alternative endpoint that accepts it.
  5. Open the uploaded file's path to trigger the script.

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 write-up has not been written yet. The Original tab links to the source.

A website let people upload files but tried to block risky types like SVG, which can contain code that runs in a browser. The author guessed other similar upload addresses on the same server, and those did not check the file type. Uploading a crafted SVG there and opening it made the code run.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by xiaodongsec

View all

11 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.