This lab contains a stored cross-site scripting vulnerability in the comment functionality. To solve this lab, submit a comment that calls the alert function when the comment author name is clicked.


Explore the application and understand it :

Basic understanding: Type of Application: Blogging Platform Users can add comments for the posts


Add comments on the post

Click on “Back to blog” link.

The comments were added for the post

It looks like the name is highlighted with colour. It looks like hyperlink

Lets check the page source:

The name text is wrapped around the <a> tag with website value in its href attribute

The input type for the website is text, So I am assuming there is no regex pattern matching for checking the URL pattern, or there is no input validation

Lets try javascript URI to call the js code

Payload Execution:

Explanation: the javascript URI calling the alert() function

See the page source

So, the href attribute’s value is completely replace with the malicious xss payload input

in this case the href value is controlled fully,

I tried to break out of the href attribute, but i cannot because the " (double quotes) is HTML encoded. So could not able to break out of the attribute. That’s why I chosen the javascript URI payload to fully replace the href value