Skip to content

CSP

CSP

Medium — good to knowSecurity

ELI5 — The Vibe Check

CSP stands for Content Security Policy. It's a header you add to your web server's responses that tells the browser 'only run scripts from these places, only load images from those places'. It's one of the strongest defenses against XSS because even if an attacker injects a script tag, the browser refuses to run it.

Real Talk

CSP is implemented as the Content-Security-Policy HTTP header. A strict policy like script-src 'self' blocks all inline scripts and external scripts from untrusted origins. CSP Level 3 supports nonces and hashes for inline scripts without allowing all inline code.

When You'll Hear This

"Our CSP blocks all third-party scripts unless explicitly whitelisted." / "Use CSP nonces to allow specific inline scripts without 'unsafe-inline'."

Made with passive-aggressive love by manoga.digital. Powered by Claude.