- Content Security Policy (CSP)
- A browser security mechanism that restricts which content sources a web page is allowed to load, reducing exposure to XSS and injection attacks.
- Directive
- A specific CSP instruction β such as script-src or img-src β that controls which sources are permitted for a particular content type.
- Source Whitelist
- An explicit list of approved domains, protocols, or hashes from which a browser may load a given content type under the policy.
- Cross-Site Scripting (XSS)
- An attack in which malicious scripts are injected into a trusted web page and executed in the victim's browser, typically to steal data or hijack sessions.
- Report-Only Mode
- A CSP enforcement level that sends violation reports to a designated endpoint without blocking any content, used for testing policy changes before full enforcement.
- Nonce
- A single-use cryptographic token embedded in a CSP header and matching script or style tag, allowing specific inline code to execute while blocking all other inline code.
- Hash
- A cryptographic fingerprint of an approved inline script or style that the browser checks against the CSP header before executing the code.
- 'unsafe-inline'
- A CSP keyword that permits inline scripts and styles β strongly discouraged because it bypasses one of the policy's primary XSS protections.
- Content Injection Attack
- An attack that inserts unauthorized content β scripts, iframes, or markup β into a page to manipulate its behavior or steal information from users.
- CSP Violation Report
- A JSON payload sent automatically by the browser to a designated reporting endpoint whenever a resource load is blocked by the active content security policy.
- default-src
- The fallback CSP directive that applies to all content types not covered by a more specific directive in the policy header.
- Frame Ancestors
- A CSP directive that controls which domains may embed the page in an iframe, replacing the older X-Frame-Options header.