Frontend: Preventing XSS in a React App
Users can submit markdown with links and code that is rendered in your React app. Explain the XSS surface and how to close it.
Technical Reference & Key Concepts
The Challenge: XSS in User-Generated Content
Your app renders user-submitted markdown. A security review flags a stored XSS risk. You must explain the attack surface and defend it.
Core questions to address:
- Where can untrusted content escape its intended treatment in a React app?
- How do you safely render markdown, and what attack vectors remain after choosing a renderer?
- What defense-in-depth layers would you add?