From SVG to XSS: How I Found a Stored XSS in a Real Bug Bounty Ta
The application allowed uploading SVG files without validation, and when a victim opened the uploaded SVG in a new tab, the embedded script executed, resulting in stored cross-site scripting. The attacker could run arbitrary JavaScript in the victim's browser, though cookie theft was blocked because the session cookie was not accessible.
Published on medium.com
While hunting on a public bug bounty program, I came across an interesting vulnerability that I wasn’t expecting — a Stored XSS via SVG upload! 🔥
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
Impact
An attacker could execute arbitrary JavaScript in a victim's browser when the victim opened the shared note and interacted with the hidden SVG, though cookie theft was not possible because the session cookie was not accessible.
What the attacker needed
A free account; victim added to shared note; victim opens note and clicks hidden element
How it was found
- Create two accounts: one attacker and one victim.
- Add both accounts to the same shared note.
- Upload a malicious SVG file from the attacker account.
- Open the uploaded SVG in a new tab to trigger the payload.
- Switch to the victim account and open the same shared note.
- Hover over the thin blue line and open it in a new tab to execute the payload from the victim's perspective.
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.
An SVG file is an image format that can contain scripts. If a website lets you upload an SVG and then shows it to other users without checking it, those scripts can run in the victim's browser. This is called stored cross-site scripting (XSS) because the malicious code is saved on the server and later executed when someone views it.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.