Which of the following is one of the most effective ways to prevent Cross-site Scripting (XSS) flaws in software applications?
Validate and escape all information sent to a server
Use security policies and procedures to define and implement proper security settings
Verify access right before allowing access to protected information and UI controls
Use digital certificates to authenticate a server prior to sending data
Contextual output encoding/escaping could be used as the primary defense mechanism to stop Cross-site Scripting (XSS) attacks.
References: https://en.wikipedia.org/wiki/Cross-site_scripting#Contextual_output_encoding.2Fescaping_of_string_input
Submit