Skip to content
XSS Write-up Intermediate

Stored SVG JavaScript Execution, Redirects & Phishing — Bug Bounty $$

An SVG file uploaded as a profile image could contain external references that made the server fetch a URL, revealing the victim's IP, and could also include a link that redirected the victim to an attacker-controlled site. The author also claims stored JavaScript execution and phishing page hosting, but the text shows the alert ran on the attacker's own domain.

abdelfattahelsabagh Follow

Published on medium.com

leaks victim’s IP, Stored SVG JavaScript Execution, Redirects & Phishing — Bug Bounty $$$

Abdelfattah Elsabagh, 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 image upload only checked that the file was an image and did not sanitise or block active content and external references inside SVG files.

Impact

An attacker could learn a victim's IP address and redirect them to a phishing site, though the JavaScript alert ran on the attacker's own domain rather than the target's.

What the attacker needed

Ability to upload a profile image; victim visits the uploaded image URL

How it was found

  1. Upload an SVG containing an external image reference to the profile image upload endpoint.
  2. Navigate to the uploaded image's download URL.
  3. Observe the request to the external collaborator server.
  4. Upload an SVG containing a link to an external JavaScript file and click the link.
  5. Observe the redirect to the external site.

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.

When you upload a picture, the website may not fully check what is inside the file. An SVG file is a kind of image that can contain links and instructions for the browser. Here, the site accepted an SVG that pointed to another server, so the server or the victim's browser contacted that server, and a link inside the SVG could send the victim to a fake login page.

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 abdelfattahelsabagh

View all

1 more disclosed report, 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.