Back to Introduction
High Risk
Wiki Entry
Missing Content Security Policy
Your website doesn't have a Content Security Policy (CSP) header. This header tells the browser which resources are safe to load.
Why This Matters
Without a CSP, attackers who find a way to inject code into your site can load malicious scripts, steal data, or trick users. CSP acts as a safety net that limits what can run on your pages.
How to Fix
Framework-specific solutions and general best practices
Add a Content-Security-Policy header to your server responses. Start with a basic policy like: "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline';" and adjust based on your needs.
Quick Reference
Severity
High Risk
ID
missing_cspAI Assistant Prompt
Copy this prompt to ask an AI for help fixing this vulnerability:
Please fix the "Missing Content Security Policy" security vulnerability in this web application. The issue is: Your website doesn't have a Content Security Policy (CSP) header. This header tells the browser which resources are safe to load. Make a plan and implement based on my project.