How a Simple Note Feature Turned Into a Stored XSS (₹7,500 Bounty)
A note feature on a financial research platform accepted HTML file uploads and served them back as text/html, so JavaScript inside the file ran in the browser. An attacker could upload such a file and get a victim to click it, executing script in the platform's origin.
Published on medium.com
While testing a financial research platform, I was casually exploring features like a normal user. One feature that caught my attention was the Note — a place where users can upload files and save content while researching companies.
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
The upload feature allowed HTML files and served them back with a text/html content type instead of forcing a download or restricting file types.
Impact
An attacker could run script in the victim's browser on the financial platform, potentially stealing session cookies, acting as the victim, redirecting to phishing pages, or launching CSRF attacks, though the report only demonstrates an alert and redirect.
What the attacker needed
A user account on the platform; victim clicks the uploaded file
The fix
The upload feature should block HTML-family extensions, allow only whitelisted MIME types, force downloads with Content-Disposition: attachment, and never serve user uploads as text/html.
How it was found
- Log in to the application and search for a company.
- Open the Note section.
- Create an HTML file containing script and upload it, then save the Note.
- Click the uploaded file to trigger the script.
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 lets people upload files to attach to notes. The site did not check that the file was a harmless image; it also accepted a web page file. When someone opened that file, the browser treated it as part of the site and ran the code inside it, which is called stored cross-site scripting because the harmful file is saved on the server.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.