Cross-site scripting (XSS) and cross-site request forgery (CSRF) are web security vulnerabilities. XSS occurs when a malicious script is executed in a user's browser session from a web application. CSRF tricks a user's browser into making requests to a trusted site where the user is currently authenticated. The Samy worm exploited an XSS vulnerability on MySpace to propagate to over 1 million user profiles in under 24 hours. Developers can prevent XSS by validating and encoding all user input, and prevent CSRF by requiring secret tokens in POST requests.