Skip to content
XSS Write-up Intermediate

When Reflected Becomes Stored

The report describes how a reflected XSS becomes stored XSS because the application encodes user input into a URL-safe form and permanently stores it in the database. An attacker could craft a URL containing a payload that, when decoded and reflected, executes script in the victim's browser.

Ashar Javed Follow

Published on respectxss.blogspot.com

The original lives on respectxss.blogspot.com

We do not hold its text, 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

Impact

An attacker could execute arbitrary JavaScript in a victim's browser when the victim visits a crafted URL, potentially leading to session theft or other client-side attacks.

What the attacker needed

Victim clicks a crafted link

The fix

The application should follow the principle of filtering input and encoding output to prevent XSS.

How it was found

  1. Enter a harmless probe string in the search bar and observe the resulting URL with encoded input.
  2. Inspect the page source to see the probe string reflected inside a JavaScript function using single quotes.
  3. Craft a payload that breaks out of the single-quoted string and executes script.
  4. Visit the crafted URL to trigger the XSS.

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.

Cross-site scripting (XSS) is when a website shows user input without proper cleaning, letting an attacker run their own JavaScript in a victim's browser. Here, the site takes what you type, encodes it into a URL-friendly string, and saves it. Later, when someone visits that saved URL, the site decodes it and puts it back on the page unsafely, so the script runs.

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 Ashar Javed

View all

14 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.