Found my first Reflected XSS bug
A reflected cross-site scripting flaw existed in a URL parameter named Pid, allowing an attacker to run script in a victim's browser. The author confirmed it by getting an alert box to appear after adjusting the payload.
medium.com
Published on medium.com
I still can’t believe i found my first bug in just 10 mins. Still not believable
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 Pid URL parameter was reflected into the page's HTML without proper encoding, so injected markup and event handlers executed.
Impact
An attacker could craft a link that runs script in a victim's browser, which could be used to act as the victim or steal data, though the text only demonstrates an alert box.
What the attacker needed
Victim clicks a crafted link; Pid parameter reflected in page
How it was found
- Gather candidate URLs with parameters using ParamSpider.
- Scan the collected links with Dalfox and review the results.
- Notice the Pid parameter as a likely injection point.
- Try the suggested payload on the site; it did not fire because it used an onpagehide attribute.
- Change the payload to use an image with an onerror handler and reload the page.
- Observe the alert box, confirming the reflected 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 puts something a user typed into a page without cleaning it, so an attacker can slip in their own script. Here the value of a URL parameter called Pid was echoed back into the page, so a crafted link could make the browser run the attacker's code. The author confirmed this by making an alert pop up.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.