Skip to content
XSS Write-up Beginner

How I Found a Reflected XSS Using ParamSpider & Kxss

A reflected cross-site scripting vulnerability existed in the returnUrl parameter of a login page, where the value was echoed into an inline JavaScript event handler. An attacker could craft a URL that executes arbitrary JavaScript when a victim clicks the Sign in button.

medium.com

Published on medium.com

بس� الله الرح� ن الرحي� والح� د لله رب العال� ين، والصلاة والسلا� على أشرف الأنبياء وال� رسلين، نبيّنا � ح� د وعلى آله وصحبه أج� عين.

mohamed metwally, 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 the returnUrl parameter value into an inline JavaScript event handler without proper encoding or validation, allowing the attacker to break out of the string context.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser when the victim clicks the Sign in button, potentially leading to session hijacking or other client-side attacks.

What the attacker needed

Victim clicks a crafted link; victim clicks the Sign in button

How it was found

  1. Run ParamSpider to collect endpoints and query parameters across the target host.
  2. Feed the results into kxss to highlight parameters that are echoed back or cause immediate reflections.
  3. Open the page with the returnUrl parameter and inspect the page source to find the reflection point.
  4. Inject a payload that closes the existing string and comments out the rest to break out of the JavaScript context.
  5. Load the PoC URL containing the payload and click the Sign in button to trigger the alert.

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) lets an attacker run their own JavaScript in another user's browser. Here, the website took a value from the URL and placed it directly into a piece of JavaScript code on the page without cleaning it, so a crafted link could make the browser run the attacker's code when the victim clicked a button.

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.