Reflected XSS Exploitation: My First Hands-On Attack!
A search function reflected user input into the HTML page without encoding, so a script tag entered in the search box executed in the browser. An attacker could run JavaScript in a victim's session by getting them to submit a crafted search.
medium.com
Published on medium.com
In this blog, I’ll walk you through how I successfully exploited a Reflected XSS vulnerability in (Lab: Reflected XSS into HTML context with nothing encoded)using my own logic and tools — with proof, reasoning, and screenshots of every step.
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
What the attacker needed
Victim submits a crafted search
The fix
User input should be HTML-encoded before being reflected into the page.
How it was found
- Visit the lab and find the blog search function.
- Enter a simple test string in the search box and observe it reflected in the results.
- Enter a script tag payload in the search box and submit the search.
- Observe the JavaScript alert execute, confirming the vulnerability.
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.
When you type something into a search box, the site usually shows it back to you. Here the site put the text straight into the page without making it safe, so if the text was a small program (a script), the browser ran it. That lets an attacker make a link that runs their code in someone else's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.