Content Security Policy (CSP)

Cybersecurity and Privacy

Content Security Policy (CSP) is a security mechanism implemented through an HTTP header that allows a site to explicitly specify which sources scripts, styles, images, and other resources may be loaded from, blocking execution of content from unauthorized sources.

CSP is one of the most effective defenses against cross-site scripting (XSS) attacks, as it prevents execution of injected malicious code, even if an attacker finds a vulnerability that would normally let them insert scripts into the page.

Why it matters

A site without properly configured CSP is significantly more vulnerable to malicious code injection, which can compromise user data or damage brand trust and SEO performance in case of a security blacklisting.

← All terms in Cybersecurity and Privacy Full glossary