Skip to main content

Cybersecurity glossary

What is content Security Policy?

Also known as: CSP

Definition

Content Security Policy (CSP) is an HTTP response header that tells the browser which sources a page may load scripts, styles, images and frames from.

Why it matters

A strict CSP limits the damage of cross-site scripting by refusing to run scripts the site did not approve. The frame-ancestors directive also controls which sites may embed the page, which helps prevent clickjacking.

Roll out with Content-Security-Policy-Report-Only first, then enforce once nothing legitimate is blocked.

Common questions about content Security Policy

See also

Sources