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 unsafe-eval in script-src #269

Closed
raciat opened this issue Dec 5, 2018 · 13 comments
Closed

CSP unsafe-eval in script-src #269

raciat opened this issue Dec 5, 2018 · 13 comments

Comments

@raciat
Copy link

raciat commented Dec 5, 2018

One of the changes you made since version 1.19.0 raised CSP error of using unsafe-eval in script-src.

Based on the logs provided below, it looks like introducing css-tree:

sanitize-csp-error

I would consider it at least minor if not major, for sure not patch.

boutell pushed a commit that referenced this issue Dec 5, 2018
…` that might or might not have XSS implications](#269).
@boutell
Copy link
Member

boutell commented Dec 5, 2018 via email

@boutell
Copy link
Member

boutell commented Dec 5, 2018

Keeping the issue open until it's clear whether css-tree may come back or not.

@jbraithwaite
Copy link
Contributor

csstree/csstree#91

@raciat
Copy link
Author

raciat commented Dec 6, 2018

I double checked and it occurs for any input and is caused by csstree/lib/walker/create.js. It doesn't even get to the point where I sanitize HTML.

Thanks for quick response! 🙇‍♂️

@boutell
Copy link
Member

boutell commented Dec 6, 2018

@raciat since @jbraithwaite is working to fix this issue upstream in csstree, can you provide suggestions on how to reproduce the tests you're doing to detect eval so it's easier for him to make sure it is entirely gone at some point?

@raciat
Copy link
Author

raciat commented Dec 6, 2018

I didn't dive too deep into this, so I don't know what's the actual content being blocked.

For me it occurs if server sends CSP header without unsafe-eval allowed for script-src. So for example, header sent for the screenshot I attached would be something like this:

Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-**'

@chris13524
Copy link

chris13524 commented Oct 7, 2019

csstree/csstree#91 was just merged with release v1.0.0-alpha.35. Can we re-apply #267 with updated dependency "css-tree": "^1.0.0-alpha.35" ?

@jbraithwaite
Copy link
Contributor

@chris13524 I believe we can.

@chris13524
Copy link

See #308

@stale
Copy link

stale bot commented Jul 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 7, 2020
@chris13524
Copy link

not stale

@stale stale bot removed the stale label Jul 7, 2020
@abea
Copy link
Contributor

abea commented Jul 7, 2020

@chris13524 Looking back at #308, it looks like css-tree would increase the size of the build. What is the benefit of switching to that?

For some context, we're looking to remove the build from this module in the v2 major version branch that's now begun, so maybe build concerns are nearly behind us?

@chris13524
Copy link

@abea ah yes, you are right!

I guess this can be closed, then?

@abea abea closed this as completed Jul 7, 2020
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

5 participants