Content security policy is a browser feature available that helps prevent XSS attacks based on headers sent by the site.
Inline JS is not compatible with enabling a reasonable secure content security policy, so this issue is postponed until the Drupal settings are fixed in the related issue
Implement a basic and reasonably secure CSP header for Drupal core, such as
Content-Security-Policy: default-src 'self'; frame-ancestors 'self';
Possibly (or as a follow-up or in contrib): Add a callback to receive and log CSP violation reports to watchdog. e.g. with CSP report-uri directive like:
Content-Security-Policy: default-src 'self'; frame-ancestors 'self'; report-uri /system/csp-report-logger;
Likely this reporting should be supported only as a something that can be temporarily enabled for debugging. It has obvious potential for abuse (DoS attacks, bogus data, etc) such as outlined at https://www.virtuesecurity.com/blog/abusing-csp-violation-reporting/
User interface changes
Possibly an admin page to configure some aspects of the CSP (optional for 8.0.x)
API addition to allow modules to alter or add to the CSP header for each page/or response event.
Beta phase evaluation
|Issue category||Task because it is security hardening.|
|Issue priority||Major because CSP is an important security practice.|
|Prioritized changes||The main goal of this issue are security improvements.|
|Disruption||Likely not disruptive for contributed modules - unless they embed iframe or load 3rd party JS.|