CSP: Content Security Policy

Difficulty: Advanced

Question

How does CSP prevent XSS?

Answer

It informs the browser of trusted sources for scripts, styles, and other resources. It can disable inline scripts and the use of `eval()`, making most XSS attacks impossible.

Concepts covered

XSS, Headers