Skip to content
XSS Write-up Intermediate

I hack the online gambling via xss upload (part 2) (3500 USD)

After a first fix removed event handlers from uploaded SVG files, the upload filter still allowed an SVG element containing an onload handler, so an attacker could run script in the site's context. The session cookie also lacked the Secure flag, so the attacker could steal it and reuse it despite extra cookie validation.

bytesnull44 Follow

Published on bytesnull44.medium.com

I hack the online gambling via xss upload (part 1) 5000 USD) Lets dive directly on the bug so your reading time will not be wasted.bytesnull44.medium.com

Bytesnull, on bytesnull44.medium.com

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 sanitiser only stripped event handlers and tags outside the SVG element, leaving an onload handler inside the SVG intact, and the session cookie was issued without the Secure flag.

Impact

An attacker could run script through an uploaded SVG to steal session tokens, and because the cookie lacked the Secure flag it could be taken over plain connections; the text does not show whether the added cookie validation fully blocked reuse.

What the attacker needed

Ability to upload an SVG file; victim views the uploaded file

The fix

The developers later encoded the angle brackets of tags, and the report says the issue was fixed.

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 image files, and it accepted SVG files, which are images that can contain code. The site tried to block dangerous code but only removed some of it, so a crafted image could still run code in a victim's browser and read their login cookie. A cookie is the small piece of data that keeps you logged in, so stealing it can let someone act as you.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by bytesnull44

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.