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

Allow attributes to be set on generated style tag for CSP #119

Open
crisbeto opened this issue Mar 13, 2023 · 0 comments
Open

Allow attributes to be set on generated style tag for CSP #119

crisbeto opened this issue Mar 13, 2023 · 0 comments

Comments

@crisbeto
Copy link

Inline styles aren't compatible with the style-src directive of CSP. It can be opted into, but that can introduce a security vulnerability since it allows all inline styles. One way to make it work is to set the nonce attribute on the stylesheet to an expression that is replaced by the nonce by the server when the stylesheet is served, e.g. <style nonce="{% nonce %}">/* styles go here */</style>. Currently this isn't possible, because Critters doesn't allow for attributes to be added to the style tag.

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

1 participant