I hack the online gambling via xss upload (part 1) 5000 USD)
A profile image upload accepted an SVG file whose embedded script ran in the browser, so an attacker could steal another user's session token by sending them a profile link. The token was stored in local storage rather than a cookie, which made it readable by the injected script.
Published on bytesnull44.medium.com
I was gambling with some extra money just for fun. As usual, I placed bets at the casino while exploring some extra functionality.
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 only checked the file extension or declared type and served the file inline, so SVG content with script was rendered by the browser instead of being treated as an inert image.
What the attacker needed
A user account; victim opens the attacker's profile link
How it was found
- Upload an SVG containing script as the profile image
- Confirm the script runs when the image is viewed
- Check where the session is stored and find the token in local storage
- Craft code that reads the token and sends it out
- Upload the file with a png name but SVG content
- Send the profile link to a victim and receive their session
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 profile picture. The site checked the file name but not what was inside, so a file that looks like an image can actually contain a small program. When another person opens that profile, their browser runs the program, and it can read the login token the site keeps in the browser and send it to the attacker.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.