Content Security Policy

CSP Level 3 Is Still Moving: How to Track Standards Without Breaking Production

CSP Level 3 continues to evolve. Learn how to track standards, check browser support, test safely, and strengthen Content Security Policy without breaking production.

Content Security Policy is one of the most useful browser security controls available to web developers. It can restrict where scripts, styles, images, frames, workers, and connections may come from, helping reduce the impact of cross-site scripting and other injection vulnerabilities.

But CSP is not a finished checklist. The specification continues to evolve, and support for individual directives and keywords varies between browsers and versions.

The current W3C CSP Level 3 Working Draft is dated 27 October 2026. That is a useful reminder for development and security teams: follow the standard, but do not assume that every draft feature is ready for production. (W3C CSP specification)

What does “CSP Level 3” mean?

CSP Level 3 is the current major version of the Content Security Policy specification. It defines how websites declare restrictions on resources and how browsers enforce those restrictions.

A CSP can control areas such as:

  • Scripts
  • Stylesheets
  • Images
  • Fonts
  • Frames
  • Web Workers
  • Network connections
  • Embedded objects
  • Form submissions
  • Base URLs
  • Reporting endpoints

A policy is normally delivered through the Content-Security-Policy HTTP response header:

Content-Security-Policy:
  default-src 'self';
  script-src 'self' https://cdn.example.com;
  object-src 'none';
  base-uri 'self';

The browser evaluates the policy for the protected page. If a resource violates the policy, the browser can block it and may send a violation report if reporting is configured.

CSP can also be supplied through a <meta> element in some cases, but the HTTP response header is generally preferred because it is available earlier and supports directives that are not available in markup.

Why the standard continues to evolve

Web applications have changed considerably since the first versions of CSP were introduced.

Modern applications commonly use:

  • Single-page application frameworks
  • Dynamic module loading
  • Server-side rendering
  • Web Workers
  • Third-party analytics
  • Embedded payment and identity services
  • WebSockets
  • Progressive Web App features
  • Trusted Types
  • Browser reporting APIs

A policy designed for a simple server-rendered website may not be suitable for a modern application. The specification needs to account for these patterns while preserving compatibility with existing browsers and deployments.

That creates a gap between three different things:

  1. What the current specification describes
  2. What browsers have implemented
  3. What websites can safely deploy today

Treating those as identical is a common source of broken pages and ineffective policies.

Read the specification, but check implementation status

The W3C specification is the authoritative source for understanding the intended behaviour of CSP. It is not, by itself, a guarantee that every browser supports every feature in the same way.

Before using a directive or keyword in production, check:

  • Whether the feature is part of a stable recommendation or a Working Draft
  • Which browsers support it
  • Whether support differs between desktop and mobile
  • Whether older browsers ignore it safely
  • Whether frameworks or proxies modify the header
  • Whether the feature has known implementation differences

MDN is useful for checking browser compatibility and practical usage notes. (MDN CSP reference)

A good rule is to use the specification to understand the model, then use browser compatibility data and real testing to decide whether a feature belongs in your production policy.

Prefer stable foundations

Most teams should begin with well-established directives and progressively strengthen their policy.

A basic policy might include:

Content-Security-Policy:
  default-src 'self';
  script-src 'self';
  style-src 'self';
  img-src 'self' data: https:;
  font-src 'self';
  connect-src 'self';
  object-src 'none';
  base-uri 'self';

This is only an example. The correct policy depends on the application’s resources and dependencies.

Stable foundations generally include:

  • Restricting scripts to known sources
  • Avoiding unnecessary wildcards
  • Disabling plugin content with object-src 'none'
  • Setting base-uri 'self' where appropriate
  • Limiting network destinations with connect-src
  • Removing unsafe-inline and unsafe-eval where practical
  • Using nonces or hashes for trusted inline scripts

These controls provide value even when a team does not use newer CSP features.

Treat newer features as an adoption process

When evaluating a newer CSP feature, do not add it directly to an enforcement policy and wait for users to report problems.

Use a controlled process:

  1. Read the current specification
  2. Check browser support
  3. Identify affected application features
  4. Test in development and staging
  5. Deploy with Content-Security-Policy-Report-Only
  6. Review violation reports
  7. Measure real user impact
  8. Enforce gradually

Report-Only mode is particularly useful because it lets teams observe potential violations without blocking resources.

During testing, define the reporting endpoint using the modern Reporting API:

Reporting-Endpoints:
  csp-endpoint="https://reports.example.com/csp"

The CSP policy can then refer to that endpoint by name:

Content-Security-Policy-Report-Only:
  default-src 'self';
  script-src 'self' 'nonce-example';
  connect-src 'self' https://api.example.com;
  report-to csp-endpoint;
  report-uri https://reports.example.com/csp;

The report-to directive is the current approach. The report-uri directive is retained as a compatibility fallback for browsers that do not support the Reporting API. (MDN report-to documentation)

Report-Only mode sends violation reports but does not block the resources that violate the policy. It is therefore a monitoring and rollout tool, not a replacement for an enforced policy.

Do not confuse browser support with security effectiveness

A browser may recognise a directive without making the overall policy strong.

For example, a policy can be technically valid but still provide limited protection if it contains:

  • Broad wildcard sources
  • Untrusted third-party domains
  • unsafe-inline
  • unsafe-eval
  • Overly permissive data: or blob: sources
  • No restrictions on connections
  • No controls for sensitive frames or forms

This is why security-header scanning should evaluate policy quality rather than only checking whether the header exists.

A scanner or dashboard should help answer questions such as:

  • Which directives are present?
  • Which sources are trusted?
  • Are wildcards used?
  • Are unsafe keywords present?
  • Which pages send different policies?
  • Are violations increasing after a release?
  • Are new third-party domains appearing?

Presence is a useful starting point, but it is not the same as protection.

Watch for policy differences across environments

A CSP that works in staging may fail in production because the environments do not load the same resources.

Common differences include:

  • Different content delivery networks
  • Separate analytics identifiers
  • Additional production monitoring scripts
  • Different API domains
  • Feature flags
  • Preview deployments
  • Authentication providers
  • Proxy or CDN header transformations

Compare the final response headers received by the browser, not only the configuration files in source control.

It is also important to test error pages, redirects, static assets, API responses, and alternate subdomains for security-header consistency. CSP primarily governs protected documents and certain worker responses, while other headers may be relevant to different response types.

For example, an API response may not need the same document-level CSP as an HTML page, but it may still need appropriate controls such as X-Content-Type-Options, cache directives, or CORS settings.

Pay attention to workers and embedded content

CSP behaviour is not identical for every resource type.

Workers can have their own policy. In general, a worker script is governed by the CSP delivered with the worker response rather than automatically inheriting the policy of the document that created it. Blob and data URL workers have additional inheritance rules.

This makes worker-heavy applications a good example of why documentation, browser testing, and response-level inspection all matter.

The same principle applies to frames and embedded applications. A parent document’s policy and a child document’s policy can both influence behaviour, but they are not interchangeable. Test the complete browser flow rather than assuming that one header covers every origin involved.

Monitor specification and browser changes

Standards tracking should be part of normal security maintenance.

Useful sources include:

  • The W3C CSP specification and change history
  • Browser vendor release notes
  • MDN compatibility data
  • Framework security documentation
  • CSP violation reports
  • Internal release and dependency records

When a browser changes its interpretation of a policy, the impact may appear first as a change in reports or blocked resources.

A sudden increase in violations may be caused by:

  • A new application release
  • A third-party script change
  • A browser update
  • A CDN configuration change
  • A new policy directive
  • A previously hidden dependency becoming visible

Historical reporting makes these changes easier to investigate.

Use reporting as feedback, not as a permanent substitute for enforcement

CSP reports are valuable during rollout and maintenance, but a policy that remains in Report-Only mode indefinitely is not providing its full protective benefit.

A practical rollout may look like this:

  • Start with Report-Only
  • Remove unnecessary sources
  • Fix recurring violations
  • Test important user journeys
  • Enforce on low-risk routes
  • Expand enforcement gradually
  • Continue monitoring after enforcement

The policy should be reviewed whenever the application adds a vendor, changes its frontend architecture, introduces a new API, or changes hosting infrastructure.

The practical lesson

CSP Level 3 is still developing because the web platform is still developing. That is a strength, but it means teams need to separate specification status, browser support, and production readiness.

Use the W3C specification to understand where the standard is going. Use browser compatibility information to understand what users can handle. Use Report-Only policies and violation monitoring to understand what your application actually does.

The safest production policy is not necessarily the newest one. It is the strongest policy that is understood, tested, monitored, and enforced consistently across the environments your users rely on.