Skip to content
XSS Write-up Beginner

My First Encounter with Stored XSS ️‍♂️

A forum feature on the target site accepted user input without sanitisation, allowing an attacker to inject a script that executed in visitors' browsers. The stored script ran for both authenticated and unauthenticated users, so an attacker could steal session cookies.

infosecwriteups.com

Published on infosecwriteups.com

Hello everyone, I am Dishant. Today in this write-up I am going to discuss how I find my first stored xss and which lead me to get HOF in self-hosted program.

cryptoshant🇮🇳, on infosecwriteups.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 forum input fields were not sanitised or escaped before being stored and displayed, allowing HTML and JavaScript injection.

Impact

An attacker could steal cookies from both authenticated and unauthenticated users who view the forum post, potentially leading to account takeover.

What the attacker needed

Victim visits the forum post URL; no authentication required

The fix

The company removed the forum feature, but the proper fix would be to sanitise or escape user input before storing and displaying it.

How it was found

  1. Visit the about page and click the button to create a forum post.
  2. Enter a script payload in both the subject and message fields.
  3. Submit the form and observe the script executing in the browser.
  4. Refresh the page and see the script execute again, confirming it is stored.
  5. Open the post URL in incognito mode to confirm it also executes for unauthenticated users.

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.

The website had a form where you could post messages, and it did not clean up what you typed before showing it to other people. A malicious user could type code that runs in the browser of anyone who views the message, which is called stored cross-site scripting (XSS). This let the attacker read the cookies (small pieces of data that keep you logged in) of other users.

What is XSS?

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

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.