Cross site scripting (XSS) is a security attack where an attacker injects malicious script into a trusted website. XSS vulnerabilities can be prevented using validation, encoding, and testing. XSS can be exploited for session hijacking and phishing attacks. Prevent attackers from exploiting this vulnerability by using automatic source code scanning, checking third party packages, and conducting a penetration test.