Skip to content
XSS Write-up Intermediate

How I discovered XSS via triple URL encode

A search box on a blog subdomain reflected user input without proper sanitisation, allowing an attacker to inject a script. By encoding the payload three times, the attacker bypassed a web application firewall and achieved cross-site scripting.

Muhammed Mubarak Follow

Published on medium.com

Bounty$500 View original

{{media:0}}

Muhammed Mubarak, 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

Impact

An attacker could execute arbitrary JavaScript in a victim's browser on the main domain, potentially leading to account compromise or data theft.

What the attacker needed

Victim visits a crafted URL; search box reflects input

The fix

The security team fixed the issue after two days.

How it was found

  1. Find a search box on a blog subdomain.
  2. Test a simple XSS payload in the search box; it reflects but does not execute.
  3. URL-encode the payload once and test; still no execution.
  4. URL-encode the payload a second time and test; still no execution.
  5. URL-encode the payload a third time and test; the payload executes.

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 shows user input without cleaning it, so an attacker can make the site run their own JavaScript. Here, the search box reflected a script tag, but a firewall blocked the obvious version. Encoding the payload multiple times hid it from the firewall, and the browser decoded it back to a working script.

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 Muhammed Mubarak

View all

1 more disclosed report, 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.