Add support for Content Security Policy
Content Security Policy is a modern browser security feature and support for using CSP in YOURLS would be a significant step forwards.
The biggest problem for deploying CSP in YOURLS right now is that there are several inline scripts in pages that means the 'unsafe-inline' keyword is required in a CSP, vastly reducing the protection offered. Inline script tags are injected into pages in many locations such as:
https://github.com/YOURLS/YOURLS/blob/master/includes/functions-html.php#L871
If these scripts could be externalised then deploying CSP in YOURLS would require minimal additional effort as content is loaded from the host. For testing purpose you can issue the following HTTP response header to configure CSP:
Content-Security-Policy-Report-Only: default-src 'self'This header will not have any negative effects as it is report only mode, check the console as you navigate the site for errors. I'm happy to provide input where needed!
Source: YOURLS/YOURLS