{"action":"created","issue":{"url":"https://api.github.com/repos/textpattern/textpattern/issues/1142","repository_url":"https://api.github.com/repos/textpattern/textpattern","labels_url":"https://api.github.com/repos/textpattern/textpattern/issues/1142/labels{/name}","comments_url":"https://api.github.com/repos/textpattern/textpattern/issues/1142/comments","events_url":"https://api.github.com/repos/textpattern/textpattern/issues/1142/events","html_url":"https://github.com/textpattern/textpattern/issues/1142","id":294823452,"number":1142,"title":"Inline JS and CSS and Content Security Policy","user":{"login":"philwareham","id":413665,"avatar_url":"https://avatars2.githubusercontent.com/u/413665?v=4","gravatar_id":"","url":"https://api.github.com/users/philwareham","html_url":"https://github.com/philwareham","followers_url":"https://api.github.com/users/philwareham/followers","following_url":"https://api.github.com/users/philwareham/following{/other_user}","gists_url":"https://api.github.com/users/philwareham/gists{/gist_id}","starred_url":"https://api.github.com/users/philwareham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philwareham/subscriptions","organizations_url":"https://api.github.com/users/philwareham/orgs","repos_url":"https://api.github.com/users/philwareham/repos","events_url":"https://api.github.com/users/philwareham/events{/privacy}","received_events_url":"https://api.github.com/users/philwareham/received_events","type":"User","site_admin":false},"labels":[{"id":134794258,"url":"https://api.github.com/repos/textpattern/textpattern/labels/Security","name":"Security","color":"000000","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/textpattern/textpattern/milestones/4","html_url":"https://github.com/textpattern/textpattern/milestone/4","labels_url":"https://api.github.com/repos/textpattern/textpattern/milestones/4/labels","id":1350218,"number":4,"title":"v4.8","description":"","creator":{"login":"philwareham","id":413665,"avatar_url":"https://avatars2.githubusercontent.com/u/413665?v=4","gravatar_id":"","url":"https://api.github.com/users/philwareham","html_url":"https://github.com/philwareham","followers_url":"https://api.github.com/users/philwareham/followers","following_url":"https://api.github.com/users/philwareham/following{/other_user}","gists_url":"https://api.github.com/users/philwareham/gists{/gist_id}","starred_url":"https://api.github.com/users/philwareham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philwareham/subscriptions","organizations_url":"https://api.github.com/users/philwareham/orgs","repos_url":"https://api.github.com/users/philwareham/repos","events_url":"https://api.github.com/users/philwareham/events{/privacy}","received_events_url":"https://api.github.com/users/philwareham/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":4,"state":"open","created_at":"2015-10-12T08:10:27Z","updated_at":"2018-02-06T16:26:42Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-02-06T16:26:42Z","updated_at":"2018-02-06T17:04:57Z","closed_at":null,"author_association":"OWNER","body":"Currently, the reliance on inline JavaScript and inline CSS makes it near impossible to create a secure [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) for Textpattern.\r\n\r\nSure, you can set strict rules in your root `.htaccess` file that disallow inline JS and CSS for the site itself but you then need to create another `.htaccess` in your `textpattern` subdirectory with `'unsafe-inline'` directives set to get Textpattern's control panel to work. That takes away a large chunk of the security provided by CSP.\r\n\r\nIf possible we need to move core JavaScript to external files and use classnames instead of inline CSS `style` attributes.\r\n\r\nObviously plugin authors are a separate issue, but at least we can then say the core can be covered by CSP."},"comment":{"url":"https://api.github.com/repos/textpattern/textpattern/issues/comments/363492340","html_url":"https://github.com/textpattern/textpattern/issues/1142#issuecomment-363492340","issue_url":"https://api.github.com/repos/textpattern/textpattern/issues/1142","id":363492340,"user":{"login":"philwareham","id":413665,"avatar_url":"https://avatars2.githubusercontent.com/u/413665?v=4","gravatar_id":"","url":"https://api.github.com/users/philwareham","html_url":"https://github.com/philwareham","followers_url":"https://api.github.com/users/philwareham/followers","following_url":"https://api.github.com/users/philwareham/following{/other_user}","gists_url":"https://api.github.com/users/philwareham/gists{/gist_id}","starred_url":"https://api.github.com/users/philwareham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philwareham/subscriptions","organizations_url":"https://api.github.com/users/philwareham/orgs","repos_url":"https://api.github.com/users/philwareham/repos","events_url":"https://api.github.com/users/philwareham/events{/privacy}","received_events_url":"https://api.github.com/users/philwareham/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T17:04:57Z","updated_at":"2018-02-06T17:04:57Z","author_association":"OWNER","body":"In the `<head>` the inline `<script>` that defines `var textpattern` is a biggie. As is the `<script>` in the `<footer>`.\r\n\r\nCSS is mainly stuff like `style=\"display:none\"` which could and should be replaced with a suitable `class` and so on. CSS isn't really as crucial as JS as it's less of a security risk but if we can shore it up we should."}}
{"actor":{"display_login":"philwareham"}}