$500 Bounty for Stored SVG-based Script Execution Vulnerability in target.com’s Chat System
Uploaded SVG files were stored and served without sanitisation, so any embedded JavaScript ran when the file was opened in a browser. An attacker could upload a malicious SVG and share its link to execute script in the context of the asset domain.
While exploring file upload functionalities at Target.com, I uncovered a high-severity vulnerability that allowed stored JavaScript execution via SVG files. This bug was responsibly disclosed through their security program, and I was awarded $500 for the report.
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 pipeline accepted SVG files and served them with a content type that lets browsers execute embedded scripts, without sanitising or converting the files.
Impact
An attacker could upload a malicious SVG and share its link to run script in victims' browsers, potentially stealing data or session tokens if cookies were shared, and the file would stay hosted until removed.
What the attacker needed
Ability to upload files; victim opens the asset URL
The fix
The issue was addressed by sanitising or converting uploaded assets and isolating them on a separate domain with strict headers.
How it was found
- Upload a test SVG file containing a script tag that shows an alert.
- The file is accepted and stored with a signed public URL.
- Open the URL in a browser and the script executes.
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 is an image format that can also contain code. The site let people upload SVGs and then served them back unchanged, so the code inside ran in the visitor's browser. This is called stored cross-site scripting because the harmful file is saved on the server and affects anyone who opens it.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.