Skip to content
XSS Write-up Beginner

Finding and Reporting an XSS Vulnerability: My Bug Bounty Journey

The search page reflected user input into an anchor's href attribute without sanitisation, so a crafted URL could break out of the attribute and inject an SVG element with an onload handler. An attacker could run JavaScript in a victim's browser by getting them to open a link.

medium.com

Published on medium.com

Once I had the search results, I turned my attention to the JavaScript code, which appeared to be a great place to test for XSS vulnerabilities. I immediately began experimenting with escaping the input, trying different methods to inject code.

Mickael Benlolo, on medium.com

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 term was inserted into an HTML attribute without output encoding, letting quote characters close the attribute and start new markup.

Impact

The text says a real attack could lead to session hijacking or data theft, but only an alert box was demonstrated.

What the attacker needed

Victim opens a crafted link

The fix

The report suggests proper input sanitisation and output encoding to mitigate XSS risks; it does not say the issue was fixed.

How it was found

  1. Open the search results URL for a chosen search term.
  2. Remove the trailing filter path segment from the URL.
  3. Append a crafted value that closes the href attribute and adds an SVG element with an onload handler.
  4. Load the modified URL and observe the alert box, confirming script execution.

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 took part of the web address and put it straight into the page's HTML without cleaning it. By adding special characters, the tester made the browser treat their text as a new piece of HTML that runs code. This is called cross-site scripting: an attacker's code runs as if it came from the trusted site.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.