Skip to content
XSS Write-up Intermediate

URL Redirection To DOM XSS on Hackerone Programs — Bug Bounty Tuesday

A QR-code endpoint read two URL parameters and passed one of them into a JavaScript function that handled the supplied URL. The author states this led to DOM-based cross-site scripting, though the text does not show the sink or a working payload.

kerstan Follow

Published on medium.com

kerstan

kerstan, 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 page passed an attacker-controlled URL parameter into a JavaScript URL-handling function that wrote it into the DOM without sanitisation.

Impact

The text claims DOM XSS was possible, which could let an attacker run script in a victim's browser, but it gives no demonstration of execution or of what that script could reach.

What the attacker needed

Victim opens a crafted link

How it was found

  1. Review proxy history and spot a QR-code link with URL parameters.
  2. Inspect the front-end code of that page.
  3. Note that the page reads the k and v parameters.
  4. Note that when k equals url, the v value goes into a handleUrl function.

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 web page can read values from the address bar and use them in its own JavaScript. If it puts those values into the page without cleaning them, an attacker can make the page run their script in a victim's browser; this is called DOM-based cross-site scripting. The article only describes the first half of that flow.

What is XSS?

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

More by kerstan

View all

7 more disclosed reports, best first.

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.