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.
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.
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
- Find the embed page with a playlist parameter pointing to an XML file.
- Register a domain whose name contains the trusted domain and host a modified XML file there.
- Supply the attacker-controlled URL in the playlist parameter and observe the XML is rendered.
- 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.