CentralCSP
PoliciesContent-Security-PolicyIntroduction

Directives

Every CSP directive in one list, from default-src to frame-ancestors and report-to: what each controls, the fallback it follows, which are deprecated in 2026.

Last update:

CSP directives are the named rules a Content Security Policy is built from, such as default-src, script-src, frame-ancestors and report-to: each one names a resource type or behavior and sets the rule for it. This page lists every directive by category (fetch, document, navigation, reporting, WebRTC, Trusted Types and removed), with the fallback each one follows when you leave it out and a link to its own reference.

For the rest of the policy syntax, see the values a directive accepts, including keywords such as 'self' and 'strict-dynamic', and the headers that deliver it.

Fetch directives

Fetch directives control where a page may load a given resource type from. They all take a space-separated source list (or 'none') and, unless noted below, fall back to default-src when you do not set them.

DirectiveControlsFalls back to
default-srcThe fallback source list for most fetch directivesnothing
script-srcJavaScript: elements, inline, eval, handlersdefault-src
script-src-elem<script> elementsscript-src
script-src-attrInline event handler attributesscript-src
style-srcStylesheets and inline stylesdefault-src
style-src-elem<style> and <link rel=stylesheet>style-src
style-src-attrInline style= attributesstyle-src
img-srcImages and faviconsdefault-src
font-src@font-face loadsdefault-src
media-src<audio>, <video>, <track>default-src
object-src<object> and <embed>default-src
connect-srcfetch, XHR, WebSocket, EventSource, Beacondefault-src
manifest-srcWeb app manifestdefault-src
frame-src<frame> and <iframe> sourceschild-src
child-srcFallback for frame-src and worker-srcdefault-src
worker-srcWorker, SharedWorker, ServiceWorker scriptschild-src
prefetch-srcPrefetched and prerendered resourcesdefault-src
fenced-frame-src<fencedframe> sources (deprecated)frame-src

prefetch-src is deprecated and removed from Chromium. fenced-frame-src is deprecated: Chromium still parses it, but fenced frames can no longer be navigated since Chrome removed Protected Audience and Shared Storage selectURL(), and since Chrome 156 the <fencedframe> element is a stub. style-src-elem is enforced in Safari only since 26.2; earlier Safari versions ignore it and apply style-src. The directive pages cover the status of each.

Document directives

These directives govern properties of the document itself rather than a fetch. None of them fall back to default-src.

DirectiveControls
base-uriThe URLs a <base href> may set
sandboxApplies sandbox flags to the document
plugin-typesAllowed plugin MIME types (removed)

base-uri has no fallback, so omitting it leaves the page open to base-tag injection. sandbox takes sandbox tokens rather than a source list and cannot be set through a <meta> tag. plugin-types has been removed from the CSP specification and browsers ignore it; use object-src 'none' instead.

Navigation directives restrict where the page may navigate and who may navigate to it. Neither falls back to default-src.

DirectiveControls
form-actionAllowed <form action> targets
frame-ancestorsWhich parents may embed this page

frame-ancestors is the anti-clickjacking directive and supersedes X-Frame-Options. It also cannot be set through a <meta> tag.

Reporting directives

Reporting directives say where the browser should send violation reports. They are configured per policy and have no fallback.

DirectiveControls
report-toNames a reporting endpoint group from the Reporting API
report-uriPosts reports directly to a URI (deprecated, keep alongside report-to)

report-to references a group defined in the Reporting-Endpoints header. report-uri is the legacy mechanism, and a browser that supports report-to ignores it whenever the same policy also sets report-to. report-to is supported in Chrome 70+, Safari 16.4+, and Firefox 149+ (March 2026), so keep report-uri only for older browser versions. See the CSP headers overview for how the wiring fits together.

WebRTC directives

WebRTC traffic is not covered by any fetch directive, so the spec draft adds a dedicated directive for it. It takes 'allow' or 'block' rather than a source list.

DirectiveControls
webrtcWebRTC connections (spec-only, no browser implements it as of November 2026)

Other directives and Trusted Types

These directives do not fit the categories above. None fall back to default-src.

  • upgrade-insecure-requests: a flag directive that rewrites insecure subresource and navigation URLs to HTTPS. It does not replace HSTS.
  • block-all-mixed-content: a flag directive that blocks every HTTP subresource on an HTTPS page. It is deprecated, superseded by upgrade-insecure-requests and default mixed-content blocking.
  • require-trusted-types-for: forces Trusted Types at DOM XSS sinks; its value is the token 'script'. Baseline since February 2026 (Chrome 83, Safari 26, Firefox 148).
  • trusted-types: an allowlist of Trusted Types policy names that constrains which policies the page may create. Baseline since February 2026 (Chrome 83, Safari 26, Firefox 148).

Removed directives

Three directives never became part of the standard and no current browser supports them. navigate-to and require-sri-for only ever ran behind flags, while referrer shipped in Chrome until version 56 and in Firefox until version 62 before the Referrer-Policy header replaced it. Each keeps a short reference page, since they still appear in old policies and blog posts.

DirectiveStatusWhat replaced it
navigate-to⚠️ DeprecatedNothing
referrer⚠️ DeprecatedThe Referrer-Policy header
require-sri-for⚠️ DeprecatedThe Integrity-Policy header

A fourth, disown-opener, was dropped in favor of Cross-Origin-Opener-Policy and does not get a dedicated page. prefetch-src, plugin-types and fenced-frame-src, listed above as deprecated or removed, have their own pages too.

Fallback chains

When a directive is not set, the browser walks a chain to find a rule. The most common CSP mistake is assuming default-src covers everything; it does not cover the document, navigation, reporting, or Trusted Types directives, so each of those must be set explicitly.

The graph covers every directive that participates in a fallback chain. ⚠️ marks a deprecated directive; the directives with no fallback are listed after the graph, and each directive page covers its exact status.

  • script-src-elem and script-src-attr to script-src to default-src; the -attr variant skips -elem and falls back straight to script-src
  • style-src-elem and style-src-attr to style-src to default-src, with the same skip
  • frame-src to child-src to default-src
  • worker-src to child-src to script-src to default-src; the child-src to script-src hop applies to worker loads only
  • fenced-frame-src (deprecated, Chromium-only) to frame-src to child-src to default-src
  • connect-src, font-src, img-src, manifest-src, media-src, object-src, and the deprecated prefetch-src each fall back to default-src
  • No fallback (set these explicitly): base-uri, form-action, frame-ancestors, sandbox, report-uri, report-to, upgrade-insecure-requests, block-all-mixed-content, require-trusted-types-for, trusted-types, webrtc

To check which directives a real policy is missing, run it through the CSP evaluator, or scan a live page for its headers with the CSP scanner. To put these directives together into a policy you can enforce, follow how to build a strong CSP, step by step.

See also

Sources

On this page