Skip to content
XSS Write-up Intermediate

URL filter bypass, RFI and XSS

The site's playlist parameter only checked whether a whitelisted domain appeared anywhere in the supplied URL, so an attacker could host their own XML on a look-alike domain and have it loaded. By placing a javascript: URL in the XML, the attacker achieved stored cross-site scripting that required a victim to interact with the page.

Bartłomiej Bergier Follow

Published on bergee.it

In this story, I tell you how I was able to bypass the URL filtering rule to inject my own files into the server and eventually obtain stored XSS. As I can’t reveal the target let’s call it redacted.com.

bergee, on bergee.it

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 allow-list check used a substring match on the hostname instead of verifying the hostname ends with the trusted domain, and the fetched XML was rendered without sanitising URLs.

Impact

An attacker could host arbitrary XML that the site rendered, leading to an open redirect and stored XSS that required user interaction to trigger.

What the attacker needed

Attacker controls a domain containing the trusted name; victim visits the crafted embed URL

How it was found

  1. Find the embed page with a playlist parameter pointing to an XML file.
  2. Register a domain whose name contains the trusted domain and host a modified XML file there.
  3. Supply the attacker-controlled URL in the playlist parameter and observe the XML is rendered.
  4. Place a javascript: URL in the XML to turn the open redirect into stored XSS.

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 took a web address from the URL and fetched a file from it, but only checked that the trusted site's name appeared somewhere in that address. The attacker registered a domain that contained the trusted name and served their own file. Because the page then displayed a link from that file without checking it, a malicious javascript: link could run code in a victim's browser.

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 Bartłomiej Bergier

View all

11 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.