BreachHunter
Pricing Blog Log inSign up
● thermal huntscan engines onlineassessment only — no exploits
  1. Home
  2. Blog
  3. Content-Security-Policy Missing: What CSP Does and How to Add It Safely

Guides · ← All guides

Content-Security-Policy Missing: What CSP Does and How to Add It Safely

Published: November 14, 2026 · Last reviewed: November 14, 2026 · 8 min read

By the Ingenious AI team

The short answer: Content-Security-Policy (CSP) is an allow-list your server sends with every page: the origins your pages may load scripts, styles, images and frames from. Without it, any script that reaches your page — injected through a comment field, a compromised plugin, a poisoned ad — runs with your site's full authority. BreachHunter rates a missing CSP MEDIUM (3 points): not a breach by itself, but the removal of the browser-enforced safety net that limits what an injection can do.

Run a free BreachHunter assessment on your site →

Of the six headers in the scanner's SECURITY_HEADERS table, CSP is the one owners postpone — the others are one line each, while CSP describes your whole site. That postponement is understandable and expensive: cross-site scripting stays on every year's most-exploited list precisely because so many pages will execute whatever script lands on them.

This guide explains what CSP actually enforces, what a scanner sees when it is absent, and the staged rollout — report-only first, enforce second — that lets a small team add it without a broken checkout as the price.

What does a Content-Security-Policy actually control?

CSP is a set of directives. default-src is the fallback; script-src, style-src, img-src, font-src, connect-src and frame-ancestors refine it per resource type. A policy like default-src 'self'; script-src 'self' https://cdn.example-cdn.com tells the browser: run scripts only from our own origin and that one CDN, refuse everything else — including a script tag an attacker injected into a product review.

The scanner's own finding text puts it plainly: “Without a CSP, cross-site scripting and data-injection attacks are far easier to pull off.” The header does not patch the injection hole. It decides whether the hole, once found, is a defaced comment or a session-stealing, payment-skimming incident. That blast-radius difference is what the MEDIUM rating prices.

Why do assessments flag it if it is not a vulnerability?

Because assessments measure exposure, not just open doors. A missing CSP is recorded alongside your cookie flags and TLS settings as part of the web-audit phase described in what a website security assessment tests: the phase that reads your responses the way a browser does and inventories the protections you have declined.

There is also a reporting reality: enterprise buyers and cyber-insurance questionnaires ask about CSP by name. Having the header — and being able to show when it was added — answers a line item that “we take security seriously” does not.

Worked example: fernwickstudio.example

Fernwick Studio, a nine-person design studio, ran its portfolio and client-login site with no CSP at all. The BreachHunter web audit returned the standard finding — Missing Content-Security-Policy, MEDIUM, 3 points — and the report's curl evidence showed a response carrying HSTS and X-Frame-Options but nothing else:

curl -I https://fernwickstudio.example
HTTP/2 200
strict-transport-security: max-age=31536000
x-frame-options: DENY
(content-security-policy: absent)

Instead of enforcing a guessed policy, the studio spent one week in report-only mode. The violation reports named three origins nobody had written down: a fonts CDN, an analytics endpoint, and an embedded scheduling widget on the contact page. The enforced policy that followed allowed exactly those, plus 'self'. Total engineering time: about three hours, most of it reading reports. On retest the finding was gone and the score recovered its 3 points — with a policy the team could explain line by line, which is the version that survives a client questionnaire.

The five actions to take

Adding CSP without breaking your own site comes down to inventory before enforcement:

  1. Inventory what your pages load: crawl your five most important templates and list every script, style, font and image origin.
  2. Send Content-Security-Policy-Report-Only with your draft policy and a reporting endpoint, and run it for at least a few days of real traffic.
  3. Fix the allow-list from the violation reports — every surprise origin is either legitimate (allow it) or a finding in itself (remove it).
  4. Enforce the policy, keeping default-src 'self' as the base and frame-ancestors set if you do not also send X-Frame-Options.
  5. Re-scan and keep the before/after reports: the closed finding is your evidence for clients and insurers.

Run a free BreachHunter assessment on your site →

Frequently asked questions

Is a missing Content-Security-Policy a security breach?

No. It is a missing mitigation. The scanner rates it MEDIUM because an attacker still needs an injection point to exploit it — but if they find one, the absence of CSP is what lets injected code run unchecked. Think of it as a seatbelt finding, not a crash.

What is the safest CSP to start with?

Start in report-only mode with default-src 'self' and add the specific origins your violation reports prove you need. A strict policy you derived from your own traffic beats a permissive one copied from a tutorial, and report-only means a wrong guess breaks nothing.

Does CSP replace fixing XSS vulnerabilities?

No. CSP is a second line of defense. Parameterized output encoding and input handling fix the hole; CSP limits what an attacker can do through any hole that remains. Assessments report both layers separately for exactly this reason.

Will CSP break my analytics or embedded widgets?

It will block them until they are allow-listed — which is why the report-only week matters. Every legitimate third-party origin shows up in violation reports with its exact hostname, so the fix is mechanical rather than guesswork.

How does the scanner check for CSP?

The web-audit phase reads your response headers and compares them against the six-header set in its check table. If content-security-policy is absent, it files the finding with the standard fix text: add a policy that whitelists the sources your site actually uses.

Rolling CSP out without breaking the site: report-only first

The safe rollout starts with a second header: Content-Security-Policy-Report-Only. The browser enforces nothing in report-only mode. It just tells you, per page, what the policy would have blocked — the analytics beacon, the chat widget, the one legacy script nobody remembers adding. Run it for a week of real traffic before you enforce anything.

Then enforce in stages. Start with the directives that cannot break layout — object-src 'none', base-uri 'self', frame-ancestors — and only then tighten script-src, which is where breakage lives. Teams that skip report-only learn about their third-party scripts from angry customers. Teams that use it learn from a log file. Same lesson, much cheaper teacher.

Sources

The authorities this guide is built on, in the form we check our own work against:

  • MDN — Content Security Policy (2025) — directive-by-directive reference for building a policy.
  • W3C Content Security Policy Level 3 (2023) — the specification browsers implement.
  • OWASP Content Security Policy Cheat Sheet (2024) — deployment patterns that avoid the usual breakage.
Share this: X · Facebook · LinkedIn · WhatsApp

Related guides

  • Website Security Test: What It Checks, What It Misses, and How to Read Yours · 9 min read
  • Website Security Cheat Sheet: Headers, TLS, Cookies and Exposed Files · 7 min read
  • What a Website Security Assessment Actually Tests · 10 min read
  • TLS/SSL Basics: What Your Certificate Says About Your Site · 8 min read
  • Common Website Misconfigurations (and How to Fix Them) · 11 min read
  • Reading Your First Pentest Report: From Score to Action · 9 min read
  • Deleted ≠ Gone: What the Wayback Machine Keeps After You Delete Your Secrets · 9 min read
  • SQL Injection in Plain English: How One Login Box Can Read Your Database · 9 min read
  • What Does a Website Security Scan Check? · 8 min read
  • Exposed .git Directory: What It Leaks and How to Check · 7 min read
  • Security Headers Missing? What Each Header Stops · 7 min read
  • How Much Does a Penetration Test Cost in 2026? · 7 min read
  • Website Security Checklist for Small Teams (60-second self-check) · 6 min read
  • Reading Your Scan Results: Which Findings Fix First? · 7 min read
  • HSTS Missing: What Strict-Transport-Security Prevents · 7 min read
  • Clickjacking and X-Frame-Options: How Framing Attacks Work · 7 min read
  • Cookie Flags Explained: Secure, HttpOnly and SameSite · 8 min read
  • Exposed .env File: What Leaks, What Attackers Do Next, What You Do First · 8 min read
  • Directory Listing Enabled: What It Shows Attackers and How to Disable It · 7 min read
  • Mixed Content: Why Your HTTPS Page Still Loads Insecure Resources · 7 min read
  • Expired SSL Certificate: What Breaks, Why Renewal Fails, and How to Catch It Early · 7 min read
  • TLS 1.0 and 1.1 Still Enabled: Why Old Protocols Show Up as a Finding · 7 min read
  • Open Ports on a Web Server: Which Ones Should Never Face the Internet · 8 min read
  • No SPF or DMARC Record: How Missing Email Auth Exposes Your Website · 7 min read
  • Subdomain Takeover: How a Dangling DNS Record Lets Attackers Claim Your Name · 7 min read
  • Forgotten Subdomains: The Staging Site You Forgot Is Still Public · 7 min read
  • WordPress Security Scan: The Exposures an Assessment Finds on WordPress Sites · 8 min read
  • Exposed Backup Files: .bak, .old and .zip Files Sitting in Your Web Root · 7 min read
  • phpinfo() in Production: The Diagnostic Page That Maps Your Server for Attackers · 7 min read
  • Server Version Banners: Why Your Headers Point Attackers to the Right Exploit · 7 min read
  • End-of-Life Software: Running a Server Stack Nobody Patches Anymore · 7 min read
  • CORS Misconfiguration: When Cross-Origin Sharing Opens Your Data to Any Site · 7 min read
  • Open Redirect Vulnerability: How Your Own Domain Sends Visitors to a Phishing Page · 7 min read
  • Dangerous HTTP Methods: What TRACE, PUT and DELETE Should Never Answer · 7 min read
  • Host Header Injection: Poisoned Reset Links and Cache Attacks Explained · 7 min read
  • What Is security.txt? The Small File That Lets Researchers Reach You · 6 min read
  • Admin Panel Exposed to the Internet: What an Assessment Flags and Why · 7 min read
  • phpMyAdmin Exposed: Why This Database Door Is a Prime Brute-Force Target · 7 min read
  • Spring Boot Actuator Exposed: Environment Dumps, Heap Leaks and Shutdown Endpoints · 7 min read
  • Debug Console in Production: The Finding That Can Become Code Execution · 7 min read
  • Exposed AWS Credentials File: The /.aws/credentials Finding, Explained · 7 min read
  • Referrer-Policy and Permissions-Policy: The Two Quiet Headers You Are Probably Missing · 6 min read
  • Exposed package.json: Your Dependency List Is a Recon Gift · 6 min read
  • DNS Zone Transfer Open (AXFR): Handing Out Your Entire DNS Map · 6 min read
  • Certificate Name Mismatch: Why the Cert Does Not Match Your Domain · 6 min read
  • Website Security Assessments for Agencies: Checking Every Client Site Without a Security Team · 8 min read
  • SaaS Security Questionnaires: What Buyers Check About Your Website First · 8 min read
  • Ecommerce Website Security: The Exposures That Put Your Checkout at Risk · 8 min read
  • Small Business Website Security: The Checks That Matter at Your Size · 7 min read
  • How to Prepare for a Website Security Assessment (and Read the Report Calmly) · 7 min read
  • Vulnerability Severity Explained: What Critical, High, Medium and Low Actually Mean · 7 min read
  • Retest After Fixes: How to Prove a Security Finding Is Actually Closed · 7 min read
  • Security Assessment vs Vulnerability Scan vs Pentest: What Is the Difference? · 7 min read
  • How Long Does a Website Security Scan Take? · 6 min read
  • Website Security Drift: Why Last Month's Clean Scan Is Already Out of Date · 7 min read
  • WordPress Site Keeps Getting Hacked After Cleanup · 8 min read
  • Google Blacklist Removal: Getting the Red Warning Off Your Site · 8 min read
  • VirusTotal Flagged My Site: How to Clear a False Positive · 8 min read

Related from the Ingenious AI suite

  • Ingenious AI — the full suite of security and compliance tools
  • DomainGuard — domain impersonation and typosquat defense
  • See BreachHunter pricing →
BreachHunter · by Ingenious AI · read-only security assessment — scan only targets you own or are authorized to test
About · Contact · Blog · vs Intruder · Privacy · Terms · Security · Threats · Nextcloud Check · Verify Evidence · Help · Redeem
More from Ingenious AI:
DisclosureGuard — AI disclosure compliance · Vibe-Code Audit — AI code security scanner · Rogue-Agent Defense — AI agent firewall · ChatBreaker — AI chatbot red-teaming · ModelMinder — AI model deprecation radar · TermsWatch — AI vendor terms monitor · Agent Flight Recorder — tamper-evident agent audit trails · Agent Auth Gateway — agent credentials & kill switch · DomainGuard — domain impersonation defense · Agent Passport — Know-Your-Agent registry · AgentGate — agent policy publisher · AgentBlock — AI agent & crawler access control · BoundaryVault — agent log forensics · Agentic Receipts — verifiable agent payment receipts · EvalEgress — eval-to-production exposure scan · HomeShield MCP — home AI server exposure check · WireWatch — payment verification ceremony · ADMT Notice Kit — AI decision notice compliance · DueLadder — human-approved invoice chasing · Agent-Ready Store Audit — can AI agents buy from your store · ContentCraft AI — content operations · AgentReady — agent-readiness checks · AI Audit Exchange — AI audit exchange · CallbackShield — callback & webhook protection · CompanionGuard — AI companion safety guardrails · CRAClock — EU Cyber Resilience Act deadline clock · EInvoice Translator — e-invoice format translator · GEOFixer — geo & local listing fixes · MandateGuard — agent spending mandates · OutcomeMeter — AI outcome measurement · ProvenanceGuard — content provenance checks · ReviewDesk — review response desk · ReviewProof — verified review evidence · TakedownCoop — coordinated phishing takedowns · TrustGate — trust & safety gating · BreachHunter — website penetration testing · All 36 platforms — the Ingenious AI portfolio

We use cookies. Necessary cookies keep the site working. With your permission we also use analytics cookies (to understand usage) and marketing cookies (for ads). Read our privacy policy.

NecessaryRequired for login, security and core features. Always on.
AnalyticsHelps us understand which pages are useful.
MarketingUsed for advertising and measuring ad performance.

    No match. Try “pricing”, “php2shell” or “contact” — or press Esc to close.

    ↑↓ navigate · Enter open · Esc close