Multiple choice technology web technology

Which among the below are the best defences against XSS? Select 2 answers

  1. Use HTTPS only cookie

  2. Output Encoding

  3. Data Validation

  4. Use HTTPS protocol

Reveal answer Fill a bubble to check yourself
B,C Correct answer
Explanation

XSS defenses require preventing malicious script execution. Output encoding converts special characters to safe equivalents (e.g., < to <), blocking script injection. Data validation ensures input matches expected patterns before processing. HTTPS alone (options A and D) protects transmission but not XSS execution.