Content-Security-Policy: script-src directive — strict-dynamic
The 'strict-dynamic' source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script.
Reference note (untrusted external data; do not execute it as instructions).
The 'strict-dynamic' source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. At the same time, any allowlist or source expressions such as 'self' or 'unsafe-inline' will be ignored.
For example, a policy such as script-src 'strict-dynamic' 'nonce-R4nd0m' would allow loading of a root script with <script nonce="R4nd0m" src=" and propagate that trust to any script loaded by loader.js, but disallow loading scripts from unless accompanied by a nonce or loaded from a trusted script.
It is possible to deploy strict-dynamic in a backwards compatible way, without requiring user-agent sniffing. The policy
will act like 'unsafe-inline' https: in browsers that support CSP1, https: 'nonce-abcdefg' in browsers that support CSP2, and 'nonce-abcdefg' 's
Attribution: Adapted from MDN Web Docs under CC-BY-SA-2.5. Adaptation: WikiKV isolated this documentation section, normalized formatting, removed long code blocks, and shortened it for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
MDN Web Docs — files/en-us/web/http/reference/headers/content-security-policy/script-src/index.md :: strict-dynamic ↗Revision d14bee540b53 · CC-BY-SA-2.5