# XSS: Cross-Site Scripting

> What is Cross-Site Scripting (XSS), what are its types, and how do you prevent it in a modern web app?

Canonical: https://www.internhack.in/learn/interview/web-security/security-xss-mitigation
Last updated: 2026-11-28

Difficulty: Intermediate

## Question

What is Cross-Site Scripting (XSS), what are its types, and how do you prevent it in a modern web app?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

Stored XSS, Reflected XSS, DOM-based XSS, Output Encoding, Content Security Policy, DOMPurify

Previous: [JWT Security](https://www.internhack.in/learn/interview/web-security/security-jwt-structure) · Next: [CSRF: Cross-Site Request Forgery](https://www.internhack.in/learn/interview/web-security/security-csrf-explanation) · [All of Web Security (OWASP, JWT, XSS, CSRF)](https://www.internhack.in/learn/interview/web-security)

## More Web Security (OWASP, JWT, XSS, CSRF) questions

- [CORS (Cross-Origin Resource Sharing)](https://www.internhack.in/learn/interview/web-security/security-cors-fundamentals)
- [SQL Injection (SQLi)](https://www.internhack.in/learn/interview/web-security/security-sql-injection-prevention)
- [Hashing vs. Encryption](https://www.internhack.in/learn/interview/web-security/security-hashing-vs-encryption)
- [HTTPS & TLS](https://www.internhack.in/learn/interview/web-security/security-https-tls-handshake)
- [Rate Limiting & Brute Force](https://www.internhack.in/learn/interview/web-security/security-brute-force-rate-limiting)
- [Security Headers (Helmet)](https://www.internhack.in/learn/interview/web-security/security-secure-headers)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Web Security (OWASP, JWT, XSS, CSRF)](https://www.internhack.in/learn/interview/web-security)
