How I Was Able To Find My First VALID XSS
A search field on a company careers page reflected user input without proper sanitisation, allowing an attacker to inject an input element with an event handler that executed script when the mouse moved over it. The attacker could run arbitrary JavaScript in a victim's browser in the context of the vulnerable site.
Published on medium.com
Cross-site scripting (also known as XSS) is a web security vulnerability that allows an attacker to compromise the interactions that users have with a vulnerable application. It allows an attacker to circumvent the same origin policy, which is designed to segregate different websites from each other.
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 functionality reflected user input into the page without encoding or sanitising HTML, allowing injected tags and event handlers to execute.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser when the victim interacted with the injected element, though the report does not demonstrate theft of data or account takeover.
What the attacker needed
Victim visits a crafted search URL; victim moves mouse over injected element
How it was found
- Find the search functionality in the careers section of the company website.
- Try a script tag payload, which does not execute.
- Inject an input tag and observe that an input box appears on the page.
- Add an event handler to the input tag and confirm the script executes when the mouse moves over 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.
Cross-site scripting (XSS) is when a website takes something a user typed and puts it back on the page without cleaning it first, so the browser treats it as code instead of text. Here the search box echoed back an HTML input tag, and because it included an event handler, moving the mouse over it ran JavaScript. That lets an attacker run their own code in other visitors' browsers.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.