Explain it in 60 seconds
Cross-site scripting (XSS)
Frontend Engineering · Frontend System Design · Beginner
What is cross-site scripting, and how do you prevent it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Attacker-controlled script runs in your page.
- Stored, reflected, DOM-based types.
- Escape output; frameworks escape by default.
- Avoid innerHTML/dangerouslySetInnerHTML with untrusted data; sanitise.
- CSP as defence in depth.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.