Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: beef up CSP headers #1759

Merged
merged 4 commits into from
May 3, 2020
Merged

fix: beef up CSP headers #1759

merged 4 commits into from
May 3, 2020

Conversation

nolanlawson
Copy link
Owner

Improves the CSP a bit, following advice from Mozilla Observatory.

  • default-src is 'none'
  • restrict form-action and frame-ancestors
  • restrict img-src and media-src to just what we need

Pinafore doesn't need to run in an iframe, and it does need to send XHRs and img/audio/video requests to arbitrary origins, but most stuff we can just block

@nolanlawson
Copy link
Owner Author

let's add base-uri 'none' while we're at it.

@nolanlawson
Copy link
Owner Author

Ah great, this actually breaks SVGs in Firefox because of a longstanding bug:

There is no solution apparently except not to use default-src 'none', which Mozilla Observatory explicitly recommends 🤦‍♂️

@nolanlawson nolanlawson merged commit 6447326 into master May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant