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

Code does not comply with Content-Security-Policy when 'unsafe-inline' is not present. #232

Closed
kevinmartin opened this issue Oct 21, 2014 · 7 comments

Comments

@kevinmartin
Copy link

I am currently using Quill on one of my apps that I will be releasing this week.

The app using a very strict CSP header (currently in Report-Only mode), which disallows unsafe-inline. The CSP header emits an error when Quill calls addStyles(...).

@kevinmartin kevinmartin changed the title Modify code to comply with Content-Security-Policy with 'unsafe-inline' is not present. Code does not comply with Content-Security-Policy with 'unsafe-inline' is not present. Oct 21, 2014
@kevinmartin kevinmartin changed the title Code does not comply with Content-Security-Policy with 'unsafe-inline' is not present. Code does not comply with Content-Security-Policy when 'unsafe-inline' is not present. Oct 21, 2014
@kevinmartin
Copy link
Author

This issue is also present with the icons inserted with data-uri's, but I was able to fix it by adding data: to the img-src section.

@jhchen
Copy link
Member

jhchen commented Oct 22, 2014

Can you include the exact header?

@kevinmartin
Copy link
Author

Sure:

Content-Security-Policy-Report-Only:default-src 'self';script-src 'self' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com http://google-maps-utility-library-v3.googlecode.com https://ajax.googleapis.com http://cdnjs.cloudflare.com https://mts1.googleapis.com http://fonts.googleapis.com http://mt1.googleapis.com http://maps.gstatic.com/mapfiles http://googleapis.com;object-src 'self';img-src 'self' data: https://dpbob3sbronwq.cloudfront.net https://maps.gstatic.com https://mts0.googleapis.com https://mts1.googleapis.com https://maps.googleapis.com https://csi.gstatic.com http://mt1.googleapis.com;media-src 'self';frame-src 'self';font-src 'self' http://fonts.gstatic.com https://fonts.gstatic.com http://maxcdn.bootstrapcdn.com;connect-src 'self';style-src 'self' http://fonts.googleapis.com https://fonts.googleapis.com http://maxcdn.bootstrapcdn.com;report-uri /api/csp

@jhchen
Copy link
Member

jhchen commented Nov 7, 2014

You can now pass in false to the style config to prevent Quill from adding style tags.

@jhchen jhchen closed this as completed Nov 7, 2014
@timshannon
Copy link

That style config link is no longer valid. What's the most current way to handle this?

@binarious
Copy link

@jhchen What's the solution for the current Quill version to prevent inline style?

@Gladskih
Copy link

@jhchen May be we should go back to iframe for sandboxing unsafe Quill?

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