This lab contains a vulnerability in the search blog functionality where angle brackets are HTML-encoded. To solve this lab, perform a cross-site scripting attack that injects an attribute and calls the alert
function.
After accessing the lab, I tried injecting various tags and XSS payloads into the search bar, but they were all filtered. I then sent a request to Burp Suite Repeater and noticed that the input was placed as the value of an attribute inside a tag. For example, when I sent ichyaboy
:
I noticed that it appeared here:
To escape this context, I tried inserting another "
to close the current attribute and set a new one to trigger my XSS. I used the following payload:
After sending this payload, I received an alert box, which solved the lab.