How I Found and Reported My First XSS Vulnerability
A search field reflected user input back into the page without any filtering, so the browser executed it as code. An attacker could craft a malicious link that runs script in a victim's browser when opened.
medium.com
Published on medium.com
I was just exploring how a website handled input… specifically a search box. Something we all use without thinking twice.
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 search feature inserted the user's input into the page without encoding or filtering it, so the browser interpreted it as code.
Impact
An attacker could craft a malicious link and share it with a victim; when the victim opens it, the injected script runs in their browser, enabling phishing redirection, user deception and client-side attacks.
What the attacker needed
Victim clicks a crafted link
How it was found
- Type a controlled input into the search field.
- Observe that the application reflects the input back unchanged.
- See the browser execute the input as code rather than showing it as text.
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 search box on a website takes what you type and shows it back on the results page. If the site does not clean that text first, someone can type instructions that the browser treats as a small program instead of words. When another person opens a link containing those instructions, the program runs in their browser and can do things like redirect them to a fake page.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.