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

CSP nonce support (to be able to protect against XSS attacks) #337

Open
jonathanmoregard opened this issue Mar 14, 2022 · 0 comments · May be fixed by #341
Open

CSP nonce support (to be able to protect against XSS attacks) #337

jonathanmoregard opened this issue Mar 14, 2022 · 0 comments · May be fixed by #341

Comments

@jonathanmoregard
Copy link

jonathanmoregard commented Mar 14, 2022

My company uses elm-ui extensively. We need to be able to support CSP without unsafe-inline, in order to be security compliant. Elm-ui generates inlined css-styles, which are blocked by the CSP-policy we need to implement.

There is a way to get around this, using nonces. A nonce is a per-request cryptographically secure random value that is set as an attribute in the <style> tag. We'd like to be able to pass the nonce as an argument to layoutWith.
This would turn all the elm-ui style tags from <style> {elm-ui-stuff} </style>, to <style nonce={passed nonce}>{elm-ui-stuff}</style>. This could be added in a function that looks like: nonce : String -> Option.

The nonce can be the same across all style tags.

@jfmengels jfmengels linked a pull request Mar 20, 2022 that will close this issue
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 a pull request may close this issue.

1 participant