Skip to content
XSS Write-up Beginner

How an SVG Image Exposed a Stored XSS on a Fake Marketplace (And

The image upload feature blocked SVG files in the browser but did not re-check the file type or content on the server, so a request edited to carry an SVG with script was accepted. The stored file then ran script when the product page was viewed, which could let an attacker read cookies and take over accounts.

Mohamednaddaa Follow

Published on medium.com

Bug bounty hunting is full of surprises — sometimes good, sometimes disappointing, and sometimes just strange. This is the story of how I found a severe stored XSS vulnerability on what I believed was a legitimate marketplace platform… only to later discover that the entire bug bounty program was fake.

Mohamednaddaa, 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 upload validation was only enforced client-side or on the original request, with no server-side check of the file extension, MIME type or content before storing and serving the file.

Impact

Anyone viewing the product page would run the attacker's script, so cookies could be stolen and account takeover was possible.

What the attacker needed

Ability to upload a product image; victim views the product page

How it was found

  1. Upload a normal JPG image and intercept the request with a proxy.
  2. Change the file extension in the request from .jpg to .svg.
  3. Replace the image content with an SVG containing script.
  4. Forward the request, which the server accepts.
  5. Open the product page to view the uploaded image, and the script runs.

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 that lets people upload pictures should check the file on its own servers, not just in the browser. Here the check could be skipped by editing the upload request, so a file that contains code was saved and later ran in visitors' browsers. That kind of saved code is called stored cross-site scripting, and it can let an attacker 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.