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.
| Directive | Controls | Falls back to |
|---|---|---|
| default-src | The fallback source list for most fetch directives | nothing |
| script-src | JavaScript: elements, inline, eval, handlers | default-src |
| script-src-elem | <script> elements | script-src |
| script-src-attr | Inline event handler attributes | script-src |
| style-src | Stylesheets and inline styles | default-src |
| style-src-elem | <style> and <link rel=stylesheet> | style-src |
| style-src-attr | Inline style= attributes | style-src |
| img-src | Images and favicons | default-src |
| font-src | @font-face loads | default-src |
| media-src | <audio>, <video>, <track> | default-src |
| object-src | <object> and <embed> | default-src |
| connect-src | fetch, XHR, WebSocket, EventSource, Beacon | default-src |
| manifest-src | Web app manifest | default-src |
| frame-src | <frame> and <iframe> sources | child-src |
| child-src | Fallback for frame-src and worker-src | default-src |
| worker-src | Worker, SharedWorker, ServiceWorker scripts | child-src |
| prefetch-src | Prefetched and prerendered resources | default-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.
| Directive | Controls |
|---|---|
| base-uri | The URLs a <base href> may set |
| sandbox | Applies sandbox flags to the document |
| plugin-types | Allowed 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
Navigation directives restrict where the page may navigate and who may navigate
to it. Neither falls back to default-src.
| Directive | Controls |
|---|---|
| form-action | Allowed <form action> targets |
| frame-ancestors | Which 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.
| Directive | Controls |
|---|---|
| report-to | Names a reporting endpoint group from the Reporting API |
| report-uri | Posts 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.
| Directive | Controls |
|---|---|
| webrtc | WebRTC 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-requestsand 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.
| Directive | Status | What replaced it |
|---|---|---|
| navigate-to | ⚠️ Deprecated | Nothing |
| referrer | ⚠️ Deprecated | The Referrer-Policy header |
| require-sri-for | ⚠️ Deprecated | The 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-elemandscript-src-attrtoscript-srctodefault-src; the-attrvariant skips-elemand falls back straight toscript-srcstyle-src-elemandstyle-src-attrtostyle-srctodefault-src, with the same skipframe-srctochild-srctodefault-srcworker-srctochild-srctoscript-srctodefault-src; thechild-srctoscript-srchop applies to worker loads onlyfenced-frame-src(deprecated, Chromium-only) toframe-srctochild-srctodefault-srcconnect-src,font-src,img-src,manifest-src,media-src,object-src, and the deprecatedprefetch-srceach fall back todefault-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
- MDN, Content-Security-Policy
- W3C, Content Security Policy Level 3
- blink-dev, Intent to Deprecate and Remove: CSP 'referrer' directive
- Mozilla bug 1302449, deprecating the referrer directive in CSP
- web.dev, Mitigate cross-site scripting with a strict CSP
- Chrome Platform Status, Remove FencedFrame element and window.fence APIs
- MDN browser-compat-data, Content-Security-Policy
What it is
CSP, or Content Security Policy, is the HTTP header that limits which scripts a page may run, to stop XSS. Get a strict policy to copy and check your site free.
Values
Every value a CSP directive accepts: keywords like 'self', host and scheme sources, nonces, hashes and report-sample, with links to each reference page.