← Quiz: XSS: all 10 questions
Quiz: XSS · Question 2 of 10
What is the main fix for XSS?
What is the main fix for XSS?
- A.Remove the word "script" from input
- B.Encode output for its context (e.g. HTML-escape < > & " ')
- C.Use HTTPS
- D.Use POST instead of GET
Answer & explanation
Correct answer: Encode output for its context (e.g. HTML-escape < > & " ')
Context-aware output encoding makes the browser treat data as text. Keyword filters are easy to bypass.
Can you get the rest right without peeking?
Take the timed Quiz: XSS quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →