Skip to content
XSS Write-up Beginner

​"Beyond the Alert Box: Demonstrating Real-World XSS Impact"

A search parameter was reflected inside a JavaScript variable, but a filter blocked alert() calls. The tester bypassed the filter by injecting code that changed window.location, redirecting users to an attacker-controlled site.

medium.com

Published on medium.com

This is a great pivot to document. In a professional VAPT report or a technical blog, showing that you can bypass a "broken" or "filtered" environment by changing the intent of the payload is what separates a script kiddie from a security professional.

Vaibhav Vyawahare, 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 inserted user input into a JavaScript context without proper output encoding, and relied on a blacklist of function names rather than context-aware escaping.

Impact

An attacker could redirect users to a phishing site or steal data such as cookies by appending it to the redirect URL, though the text does not confirm a specific real-world theft.

What the attacker needed

Victim clicks a crafted link

How it was found

  1. Test a search parameter and observe the input reflected inside a JavaScript variable.
  2. Inject a script tag with alert(1) and see that it is blocked or filtered.
  3. Inject a payload that breaks out of the variable and sets window.location to an external site.
  4. Observe the browser redirect to the attacker-controlled site.

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 took what you typed in a search box and put it directly into a script on the page. Normally an attacker could make a pop-up appear, but the site blocked that specific pop-up command. The attacker instead used a different command to send visitors to a fake login page.

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.