How can I prevent XSS? Technology Community › Category: Web Security › How can I prevent XSS? 0 Vote Up Vote Down VietMX Staff asked 4 years ago XSS can be prevented by sanitizing user input to the application. Always allowed those elements as input which is absolutely essential for that field.