Vulnerability A3 Cross-Site Scripting (XSS) Description:
People want you to store your favorite links here. However, you are not into that, you just want to do some XSS magic to the page. Add an alert with the message ‘Ex1’ to the page (My Sites:)
For almost all levels I will be using Burpsuite. Burpsuite is an interception proxy that lets us modify the HTTP request / response by intercepting the data between the browser and the web server.
Both forms have some HTML input validation, the site-name input field has a pattern with allowed regex “[A-Za-z]+”, maxsize of 10 characters. URL field have type=”url” and maxsize=”15”.
Since all the data is on the client side, we can just simply delete all the validations. Let’s try deleting the pattern and max size from the site-name field first and resubmitting our payload (right-click on the site-name field, InspectElement and delete the pattern and maxsize attributes).
Ok, we were able to submit the payload however, there was no pop-up and there was no request intercepted by Burp.
This means that
On line 18 and 19 we can see that <> signs are substituted with < and > which is the sanitation function.
And… level 1 complete.