← All topics
Quiz: XSS: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. A malicious comment is saved in the database and runs in every reader's browser. This is:
- Q2. What is the main fix for XSS?
- Q3. In React, which is dangerous with user input?
- Q4. What did html.escape turn the < of the payload into?
- Q5. Which header acts as a safety net that blocks inline scripts if an XSS bug slips through?
- Q6. A search page prints "Results for" plus the q parameter without encoding, and the attacker sends a crafted link. Which type of XSS is this?
- Q7. Which line in plain JavaScript is safe for showing a user's comment?
- Q8. What does this print? (code)
- Q9. A course description must allow bold text and links from instructors. What is the safe approach?
- Q10. Why can XSS be as serious as stealing a password?