'unsafe-inline'

A CSP keyword that allows all inline scripts or styles, which removes most of the protection CSP offers against XSS.

It lets any injected inline script run, defeating the main purpose of the policy.

In more detail

Use nonces or hashes instead. Browsers ignore 'unsafe-inline' when a nonce or hash is also present, which keeps older browsers working.

Related terms

Taught in

References