The unsafe-inline source expression has no effect when a nonce-source or hash-source is specified (edit: or strict-dynamic, in scripts). Also, nonce-source and hash-source are effectively stricter versions of unsafe-inline, not orthogonal to it. Merging needs to take this into account:
- Unioning
script-src 'unsafe-inline' with script-src nonce-asdf should produce script-src 'unsafe-inline', rather than script-src 'unsafe-inline' nonce-asdf (which is effectively script-src nonce-asdf).
- Intersecting
script-src 'unsafe-inline' with script-src nonce-asdf should produce script-src nonce-asdf rather than script-src.
The
unsafe-inlinesource expression has no effect when anonce-sourceorhash-sourceis specified (edit: orstrict-dynamic, in scripts). Also,nonce-sourceandhash-sourceare effectively stricter versions ofunsafe-inline, not orthogonal to it. Merging needs to take this into account:script-src 'unsafe-inline'withscript-src nonce-asdfshould producescript-src 'unsafe-inline', rather thanscript-src 'unsafe-inline' nonce-asdf(which is effectivelyscript-src nonce-asdf).script-src 'unsafe-inline'withscript-src nonce-asdfshould producescript-src nonce-asdfrather thanscript-src.