This lab contains a vulnerability in the comment functionality. To solve this lab, submit a comment that calls the alert
function when the comment author name is clicked.
After accessing the lab, I went straight to the comment section. After filling in all the fields and sending the comment, I ensured that my FoxyProxy extension was enabled so I could proxy all the requests through Burp Suite:
After sending this request and checking the response in Burp Suite, I observed that my URL data was stored and reflected in the href
attribute of the a
tag:
So, all I had to do was inject the JavaScript pseudo-protocol inside the href
attribute to achieve script execution. This was my payload:
After injecting that into the website input and posting the comment, I could see that when I went back to the blog post and clicked on my comment's username, the alert was triggered, and an alert box popped up. This confirmed that the XSS attack was successful and the lab was solved.