You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 text was updated successfully, but these errors were encountered:
Actually it's not clear whether producing script-src nonce-asdf for the intersection is the right call. script-src 'unsafe-inline' nonce-asdf is equivalent on modern browsers and is as restrictive as possible on browsers which do not support nonce sources.
Yeah, on further consideration there's no safe way to do union or intersect these two policies. There is no way to express "allows any inline script, and also any script (even if external) with this nonce", nor "allows any inline script with this nonce, but not other inline scripts nor any external scripts".
The
unsafe-inline
source expression has no effect when anonce-source
orhash-source
is specified (edit: orstrict-dynamic
, in scripts). Also,nonce-source
andhash-source
are effectively stricter versions ofunsafe-inline
, not orthogonal to it. Merging needs to take this into account:script-src 'unsafe-inline'
withscript-src nonce-asdf
should producescript-src 'unsafe-inline'
, rather thanscript-src 'unsafe-inline' nonce-asdf
(which is effectivelyscript-src nonce-asdf
).script-src 'unsafe-inline'
withscript-src nonce-asdf
should producescript-src nonce-asdf
rather thanscript-src
.The text was updated successfully, but these errors were encountered: