Skip to content

LAB 3 - DOM XSS in document.write sink using source location.search

Initial instructions

This lab contains a DOM-based cross-site scripting vulnerability in the search query tracking functionality. It uses the JavaScript document.write function, which writes data out to the page. The document.write function is called with data from location.search, which you can control using the website URL.

To solve this lab, perform a cross-site scripting attack that calls the alert function.

To complete this lab I used the following XSS payload.

"><svg onload=alert(1)>

I entered this payload into the search bar and clicked Search.

alt text

If worked will see the following pop up.

alt text

Congratulations, you solved the lab!