Skip to content
XSS Write-up Beginner

From a Simple Input Field to Stored XSS — A Realistic Bug Bounty Journey

A user-controlled profile/customisation input was stored and later rendered without proper sanitisation, so an SVG with an onload handler executed in the browser of anyone viewing the affected page. An attacker could run JavaScript in other users' sessions, which the author says could lead to session hijacking or account takeover.

ankitsingh787478 Follow

Published on medium.com

While testing a web application during a bug bounty engagement, I came across a Stored Cross-Site Scripting (Stored XSS) vulnerability hidden inside a feature that looked completely harmless.

Ankitsingh, on 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 application relied on blacklist-based input filtering and frontend-only checks instead of context-aware output encoding, so SVG event handlers slipped through.

Impact

The stored script ran for anyone viewing the page, which the author says could enable session hijacking, actions on behalf of victims, account takeover via token theft, and worse if an administrator viewed it; no defence is described as blocking it.

What the attacker needed

A user account; ability to post or edit profile content; victim views the affected page

The fix

The text does not say it was fixed; it recommends context-aware output encoding, trusted sanitiser libraries, blocking dangerous tags and inline handlers, a strict CSP, and validating on both frontend and backend.

How it was found

  1. Create or edit content in the vulnerable input field.
  2. Insert the malicious SVG payload.
  3. Save the content.
  4. When another user opens the affected page, the JavaScript runs automatically.

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 web page can show text that other users typed in. If the site does not clean that text properly before showing it, someone can type in a small piece of code instead of plain text, and the browser will run it as if the site itself wrote it. That lets the attacker act as the person viewing the page, for example reading their session or doing things on their behalf.

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 ankitsingh787478

View all

1 more disclosed report, 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.