Stored Xss Using Svg File
The profile picture upload accepted SVG files without sanitising their content, so an attacker could upload an SVG containing a script that executed when the file was viewed. This allowed stored cross-site scripting.
Published on infosecwriteups.com
Hey guys, hope you all are doing well. I am Bharat Singh a Security Researcher and bug hunter from India.
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 feature accepted SVG files and served them without sanitising or restricting script content, so embedded JavaScript executed in the browser.
Impact
An attacker could execute arbitrary JavaScript in the context of the site when a victim views the uploaded SVG, potentially leading to account compromise or other actions; the report only demonstrates an alert.
What the attacker needed
Ability to upload a profile picture
How it was found
- Upload a .txt file to the profile picture upload and observe it is accepted.
- Upload a .svg file containing a script to the profile picture upload.
- Open the uploaded image in a new tab and see the script execute.
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 a picture for their profile. It allowed a type of image file called SVG, which can contain code. The attacker put code in the image that ran when someone opened it, letting them run their own script in the victim's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.