Skip to content
XSS Disclosed report Beginner

XSS via SVG file

An SVG file containing an XSS payload could be uploaded to the community gallery, and when a victim visits the link the script executes and can steal the victim's cookie. The upload succeeded even though the file contained an error.

0xspade Follow

Originally disclosed on HackerOne

  • Disclosed after 52 days

Hello Ubuquiti,

Details

I was able to upload an svg file to here. so i uploaded an SVG file with XSS on its code and if the attacker give the link to his victim he can grab it's victim's cookie. and regarding to the your Upload image svg file it uploaded even it has an error..

PoC

link

xss.png
xss.png From the original on HackerOne

Fix

Dont allow to upload an svg file because attacker can put his payload to a SVG files.

The original report as published on HackerOne, by 0xspade. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 application allowed SVG files to be uploaded and served them without sanitisation, so embedded scripts executed in the victim's browser.

Impact

An attacker could steal a victim's cookie by getting them to open a crafted link.

What the attacker needed

Ability to upload an SVG file; victim clicks the crafted link

The fix

The application should not allow SVG files to be uploaded.

How it was found

  1. Upload an SVG file containing an XSS payload to the community gallery.
  2. Send the resulting link to a victim.
  3. The victim opens the link and the script runs, allowing the attacker to grab the victim's cookie.

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, including a type called SVG that can contain code. The uploader put harmful code in the SVG, and when someone opened the link the code ran in their browser and could steal their login cookie. The fix is to stop allowing SVG uploads.

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 0xspade

View all

9 more disclosed reports, best first.

More from Ubiquiti Inc.

View all

The newest disclosed reports for this program.

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.