Cross Site Scripting (XSS)
What is XSS ? Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into websites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a user. Flaws that allow these attacks to succeed are quite widespread and occur anywhere a web application gets input from a user within the output it generates without validating or encoding it. An attacker use this XSS vulnerability to send a malicious script to an unsuspecting user. The user’s browser has no way to know that the script should not be trusted, and will execute the script. Because it thinks the script came from a trusted source, so the malicious script can access any cookies, session tokens, or other sensitive data retained by the browser and used with that website. These scripts can even rewrite the content of the HTML page. Ex - document . body . innerHTML = ""; Types of XSS : Reflected XSS (A