Web & application

strict-dynamic

A CSP source expression that trusts scripts loaded by already-trusted (nonced or hashed) scripts and ignores host allow-lists.

'strict-dynamic' in script-src says: a script that carries a valid nonce or hash may load further scripts, and those are trusted too. In supporting browsers it makes host allow-lists, 'self' and 'unsafe-inline' ignored, so they can stay in the policy purely as fallbacks for old browsers.

It exists because modern apps load scripts dynamically (tag managers, bundler chunks) and allow-lists could not keep up without becoming bypassable. With nonce plus strict-dynamic, the trust root is markup the server rendered, not a list of domains.

Limits: propagation only covers non-parser-inserted scripts (createElement('script')), so document.write injection is blocked; and a trusted script that loads attacker-controlled URLs passes that trust on. It does nothing for DOM XSS through innerHTML; that is Trusted Types' job.

Learn it properly

Also used in

Related terms