Difficulty: Intermediate
What is XSS and how do you prevent it?
XSS occurs when scripts are injected into web content. Prevent by sanitizing input (DOMPurify), escaping output (standard in React), and using Content Security Policy (CSP) headers.
XSS, Reflected, Stored, DOM-based, Sanitization