Skip to content
XSS Write-up Beginner

XSS via file upload

An SVG file uploaded through the email design feature was stored on cloud storage and served back in a way that executed script, giving cross-site scripting. After the original path was patched, the reporter found that removing a conversion parameter from the image-serving URL still returned the raw SVG and the script ran again.

Jay Sharma Follow

Published on sharmajijvs.medium.com

I found xss via file upload here i uploaded svg file which stored in google cloud and reflected with xss

Jay Sharma, on sharmajijvs.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 upload accepted SVG files without sanitising them, and the image delivery endpoint served the stored file with a content type that let the browser execute embedded script.

Impact

An attacker could run script in the context of the image domain, though the report does not show what that script could reach beyond a pop-up.

What the attacker needed

A logged-in account; access to email design settings

The fix

The original upload path was patched, but the bypass through the image URL parameter was still open when reported and was triaged.

How it was found

  1. Log in to the application.
  2. Open the online store settings, then Email Notification, then Email design.
  3. Click edit.
  4. Upload a file containing an SVG payload.
  5. Save the file and open the image in a new tab.
  6. After the fix, remove the convert part from the image URL to trigger the pop-up again.

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 an image file, but it did not check that the file was really an image. The reporter uploaded a file that is both a picture and a small program, so when the browser opened it, the program ran. That kind of injected program is called cross-site scripting, and it can act as the logged-in user.

What is XSS?

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

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.