Skip to content

LAB 4 - DOM XSS in innerHTML sink using source location.search

Initial instructions

This lab contains a DOM-based cross-site scripting vulnerability in the search blog functionality. It uses an innerHTML assignment, which changes the HTML contents of a div element, using data from location.search.

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.

<img src=1 onerror=alert(1)>

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

alt text

And It will pop up the XSS.

alt text

Congratulations, you solved the lab!