XSS Attack Quiz
Multiple Choice Medium
Question
What is a cross-site scripting (XSS) attack?
Hint
The name contains 'scripting' — it is about injecting scripts.
Explanation
XSS occurs when an attacker injects malicious JavaScript into a web page that is then executed in other users' browsers. This can steal cookies, session tokens, or sensitive data. Prevention includes escaping user input, using textContent instead of innerHTML, and implementing a strict Content Security Policy (CSP).
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.