XSS enables attackers to inject client-side scripts into web pages viewed by other users may can be lead to cookie stealing. Sometimes we had vulnerabilities in pure javascript which is written in js file or html file. For example we have created an array which we are rendering to give the output in HTML field.
The Code:
Preview:
That's code work properly but have some vulnerability. when the user give payload like this