Comments (5)
Cool, makes sense! 👍
I'd be happy to accept a PR for this. I think calling the function toNonceUnstyled
would make sense.
from elm-css.
Published as 17.1.0
from elm-css.
@jonathanmoregard Have you perhaps figured out how to best pass a nonce?
Any attempt to pass server-generated nonce seem futile to me when the style tag is not rendered on server too. The reason for that is nonce should be hidden and browser does a lot to not reveal it: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce#accessing_nonces_and_nonce_hiding
With a nonce passed from server to Elm app via flags, we'd make it visible to the attacker. And thus defeat the purpose of CSP with nonce in first place: https://content-security-policy.com/nonce/. Is there any other option? Am I'm missing something obvious here?
from elm-css.
@pawelpacana
With a nonce passed from server to Elm app via flags, we'd make it visible to the attacker. And thus defeat the purpose of CSP with nonce in first place: https://content-security-policy.com/nonce/. Is there any other option? Am I'm missing something obvious here?
I'd like to know in which way the attacker can access the nonce when it's passed via Elm app flags. Do you have a scenario in mind?
My proposal for securely passing nonces:
I'm thinking, start the Elm app inside of an anonymous function and let the server write the nonce directly into the flags argument. Would this hide the nonce? Perhaps I'm also missing something
from elm-css.
I'm thinking, start the Elm app inside of an anonymous function and let the server write the nonce directly into the flags argument. Would this hide the nonce? Perhaps I'm also missing something
My bad. I've conflated passing nonce via flags with passing nonce via visible element attributes so that flags could read it.
from elm-css.
Related Issues (20)
- `Css.important` on `Css.batch` output only applies to last Css.Style
- Empty style node emitted if no styles HOT 1
- Cannot use elm-css with lamdera HOT 1
- Runtime type error when using CSS in an SVG element's attributes HOT 6
- Hash Collisions: FNV vs Murmur3 HOT 1
- `<span> > <style>` wrapping in elm-css 17 has unexpected side effect inside grid container HOT 3
- Different behavior for multiple`css` attributes between root of tree and children HOT 1
- Extra gap when using (display: flex) and (justify-content: space-between) HOT 3
- Css classes not rendering correctly
- 17.0.4 generated class name is not added when there's also a set class name HOT 15
- Elm HTML's non-optimized XSS warning bypassed by elm-css
- Safari animations HOT 2
- Duplicate inline styles?
- Error in documentation? HOT 1
- Alternative Stylesheets
- Support for flex box gap HOT 1
- Class names are not escaped
- Rename `generalSiblings`
- Add animation timing function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-css.