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

Support 'strict-dynamic' in style-src #399

Open
arturjanc opened this issue Jun 5, 2019 · 3 comments
Open

Support 'strict-dynamic' in style-src #399

arturjanc opened this issue Jun 5, 2019 · 3 comments

Comments

@arturjanc
Copy link

This is related to a recent Twitter discussion about style-src-elem.

For a policy that aims to restrict styles by requiring nonces for style elements (style-src-elem 'nonce-foo'), but allows inline style attributes (style-src-attr 'unsafe-inline') it would be helpful to allow nonced/hashed stylesheets to load additional CSS without requiring a nonce for such loads; in fact, there is currently no way for @import url(foo.css) to set a nonce.

I think the main effect of supporting 'strict-dynamic' for styles would be allowing @import rules to load additional stylesheets. We could also drop the URL-based source list for backcompat, similarly to script-src.

@mikewest

@starvoter
Copy link

For myself, I have JavaScript files approved by a nonce, that dynamically generate styles. Since the JavaScript is approved by CSP, the contents - including the dynamic style should be too. I hope that a 'strict-dynamic' for style-src would help with this situation too or maybe something similar.

@martijnvankekem
Copy link

Any update on this?

@gregtalarico
Copy link

This was raised again recently in #625, but there doesn't seem to be much discussion there either.

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

4 participants