My Journey from being SAD TO GETTING A XSS
An authenticated search bar and a profile 'First Name' field reflected and stored user input without filtering, so injected HTML with an event handler executed script in the page. An attacker could run script in a victim's browser session, potentially reading cookies.
medium.com
Published on medium.com
Pentesting is a rollercoaster. One moment you’re full of hope, and the next… you’re staring at a static site wondering where it all went wrong.
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
Impact
Script could run in a victim's browser and read document.cookie, though the text does not show whether cookies were protected from script access.
What the attacker needed
A user account; victim views the injected page or profile
How it was found
- Log in as a user to reach features behind authentication.
- Find the search bar and test special characters and tags for filtering.
- Submit an image tag with an event handler and hover it to confirm script runs.
- Try a script tag, see it rendered as text, then break out of the attribute context to execute it.
- Inject the same payload into the First Name field of the profile update feature to store it.
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 sometimes puts whatever you type back into the page without cleaning it. If the text you type is treated as code by the browser, an attacker can make the page run their own script, which can read things like the visitor's login cookie. Here the search box and a profile name field both did this.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.