Content Security Policy

An HTTP response header that tells the browser which sources of scripts and other content a page may load, limiting what injected markup can do.

In more detail

CSP stands for Content Security Policy. A strict policy using nonces or hashes stops injected inline scripts from running, making XSS far harder to exploit. Test a new policy in Report-Only mode first.

Examples

Content-Security-Policy: script-src 'nonce-r4nd0m' 'strict-dynamic'; object-src 'none'; base-uri 'none'
The course's dynamic scan checks that the header is present.

Related terms

Taught in

References