304 North Cardinal St.
Dorchester Center, MA 02124

Work Hours
Monday to Friday: 7AM - 7PM
Weekend: 10AM - 5PM

More Intigriti XSS – Just Shy of Success

I attempted another Intigriti XSS challenge a few months ago and wanted to share my attempts.

More Intigriti XSS – Introduction

If you saw my last post, then you are at least partially familiar with these XSS challenges.

This was another interesting challenge that they posted, and I wanted a shot at it.

Unfortunately, I was unable to solve this challenge at all completely. That said, I found a lot of great solutions, and got close in the end.

The Challenge

If Intigriti removes the the challenge, then you can find the vulnerable code snippet below.

  const whitelist = ['',''];
  var url = new URL(location.hash.substr(1));
  if(whitelist.indexOf(url.hostname) > -1){
    document.write("Redirecting you to " + encodeURIComponent(url.href) + "...");
      location = location.hash.substr(1);
    document.write(url.hostname + " is not a valid domain.")

You can find the challenge specifics below as well.

  • Goal: trigger a javascript pop-up on using a XSS vulnerability introduced by the javascript snippet above in the latest version of Google Chrome or Firefox
  • Tips: We’ll tweet out a tip for every 100 likes at
  • Done?: Submit your solution to
  • Date: This challenge runs from Monday Nov 18 until Sunday Nov 24
  • Prize: The winner gets a Burp Suite Pro License
  • Winner: Out of all correct submissions, we’ll randomly draw a winner and announce it on our Twitter profile on Nov 25th

Finally, here are the hints that Intigriti tweeted.

  • 100 likes, time for the first tip! You all need a timeout!
  • 200 likes, tip time! Bug bounty is always a bit like a race…
  • Did someone just buy likes? 😂 Another tip: follow the thread
  • 400 likes, time for another tip! #1 #2
  • Another hint: it might take a few tries

Intigriti XSS – Attempted Solution(s)

With the challenge in hand, I started to work on my solution.

First, I tried to understand how the URL constructor worked.

> var url = new URL('');
VM36:1 Uncaught TypeError: Failed to construct 'URL': Invalid URL
    at <anonymous>:1:11

More Intigriti XSS - Failed URL

As it turns out, the protocol is needed, so that immediately eliminated a few of my first ideas.

> var url = new URL('');
> url
URL {href: "", origin: "", protocol: "https:", username: "", password: "", ...}
> url.hostname

Next, I tried using a subdomain (www) of one of the white-listed URLs.


I also spent a lot of time reading the URL spec, so at least I learned something.

When that didn’t work, I used a site from the list itself, to verify functionality.

Successful redirect

Next, I wanted to see how JavaScript handled multiple hashes in one URL. Unfortunately, it appeared that only the first one was considered the location.hash.

> location.hash
> var url = new URL(location.hash.substr(1));
> url
URL {href: "", origin: "", protocol: "https:", username: "", password: "", ...}hash: "#"host: ""hostname: ""href: ""origin: ""password: ""pathname: "/"port: ""protocol: "https:"search: ""searchParams: URLSearchParams {}username: ""__proto__: URL

Additionally, I tried to inject some HTML in the location.hash, in spite of the encodeURIComponent call.

Unfortunately, this did not work, and I did not inject any HTML.

Redirecting you to

More Intigriti XSS - Injection attempt

Nearly Successful

Between the hints and my attempts, I had a pretty good handle on the solution.

I thought (correctly) that I needed to exploit a race condition on the hash between the white-list and the redirect.

First, to verify this, I used a valid URL before the redirect.

Redirect paused

Once I got to the redirect line, I changed the hash and resumed execution.

Debugger alert

This worked and confirmed that I was on the right path.

Unfortunately, I was unable to progress past this point, and the challenge ended.

Correct Solution

After the challenge ended, I read a few solutions, and realized that I was on the right path.

In the end, I would have used a page like this for my solution.

<title>Intigriti XSS Challenge</title>	

    <iframe id= "xss" src=""></iframe>

    setTimeout(function(e){document.getElementById('xss').src = ""},200);


As you can see, this successfully popped my alert!

More Intigriti XSS - Successful alert

That said, I didn’t realize this was in the spirit of the competition, and that was my fault.

More Intigriti XSS – Conclusion

This was a fun challenge, although I’m a little disappointed that I couldn’t solve it in time.

I’m looking forward to more XSS posts or challenges, so stay tuned.

Here are just a few of the solutions that I read when it was over, and it was awesome seeing such variety between them. If you have another unique solution that you’d like me to see or add, then let me know!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.