How I found XSS from a medium article
A reflected cross-site scripting vulnerability existed in a weather agency training site's query parameter, allowing an attacker to execute script in a victim's browser. The author found it by following a public write-up and using an automated scanner after manual payloads failed.
Heres a simple story how I got a simple XSS after reading a medium article. For full context I recommend reading the original finders article by Prince Roy found here
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 'unit' query parameter was reflected into the HTML response without proper output encoding, allowing injected markup and script to execute.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser when the victim visits a crafted link, potentially stealing session data or performing actions on the victim's behalf.
What the attacker needed
Victim clicks a crafted link; no authentication required
The fix
The vulnerability was fixed after the author followed up on the report.
How it was found
- Read a public write-up about an XSS at the same site and clicked the links in it.
- Noticed the site still returned the same response as in the original article.
- Tried the original payload and a few others, but they did not work.
- Ran an automated scanner (dalfox) against the URL with the 'unit' parameter.
- The scanner found a working payload, which was then manually confirmed to trigger an 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 takes something a user typed into the address bar and puts it directly into the page without cleaning it first. An attacker can craft a link that, when clicked, runs their own code in the victim's browser. Here, a parameter called 'unit' was reflected back into the page unsafely.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.