Goal
- Reduce the risk of executing or serving content that is undesirable or that comes from an unauthorized source.
Implementation
Enable the Content-Security-Policy HTTP header with the appropriate CSP 1 directives:
The server sends a page containing various elements (JavaScript files, CSS, webfonts, etc.) to the browser, which will download and display everything as quickly and efficiently as possible... without questioning the legitimacy of what it is doing. The system called Content Security Policy allows the browser to indicate rules regarding the origin of this content. This makes it possible to determine exactly what it is allowed to execute or display, and thus increases security for users.