Multiple choice technology security

Which set of security API methods could be used as the best defense against Cross Site Scripting?

  1. Input Validation and OutPut Encoding

  2. Authentication and Authorization

  3. Data Protection and Cryptography

  4. HTTP and Communication Security

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Combining input validation and output encoding forms the best defense against Cross-Site Scripting (XSS). Input validation rejects malformed data, while context-aware output encoding ensures that any allowed user input is treated as text rather than executable script when rendered in the browser. Other options address authentication or cryptography.