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

Set default-src CSP Attribute to none by default #482

Open
rzhade3 opened this issue Apr 5, 2022 · 1 comment
Open

Set default-src CSP Attribute to none by default #482

rzhade3 opened this issue Apr 5, 2022 · 1 comment
Milestone

Comments

@rzhade3
Copy link

rzhade3 commented Apr 5, 2022

At GitHub, we set the default-src CSP attribute to none. This provides the strictest possible CSP as it'll thus only allow CSP directives that the user explicitly has allowlisted.

It would be desirable to set this default in secure_headers as well:

This would be a breaking change, so if this is desirable, this would fit well in with #480

@vcsjones
Copy link
Member

At GitHub, we set the default-src CSP attribute to none. This provides the strictest possible CSP as it'll thus only allow CSP directives that the user explicitly has allowlisted.

I see the idea, but I wonder if we should have a broader “defaults” feature. For example, base-uri is a weird one. It by default allows any URI, and does not respect default-src. So maybe in that spirit we want to provide a base-uri with a default unless specifically stated, or OPT_OUT or something along those lines.

@lgarron lgarron added this to the v7 milestone Jan 4, 2023
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

No branches or pull requests

3 participants