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

v4 Modal transition (fade) violates CSP (script-src 'unsafe-inline') #17964

Closed
deilv opened this issue Oct 18, 2015 · 3 comments
Closed

v4 Modal transition (fade) violates CSP (script-src 'unsafe-inline') #17964

deilv opened this issue Oct 18, 2015 · 3 comments

Comments

@deilv
Copy link
Contributor

deilv commented Oct 18, 2015

Modals with the .fade class trigger an error on show, causing the modal to fail to show and scripts to stop working requiring a page reload. This wasn't a problem in v3 and seems to be caused by the reflow function trying to eval() and inject javascript in the page.

Using branch v4-dev in a Meteor app.

@deilv
Copy link
Contributor Author

deilv commented Oct 18, 2015

This is the cause of the problem (in util.js):

reflow: function reflow(element) {
  new Function('bs', 'return bs')(element.offsetHeight);
},

I'm trying to figure an alternative way to access the proper global object, without using the function constructor, unless you want to classify this as WontFix as well.

@deilv
Copy link
Contributor Author

deilv commented Oct 18, 2015

I wonder, wouldn't something like this cause a reflow without creating a new function?

reflow: function reflow(element) {
  return element.offsetHeight;
},

@cvrebert
Copy link
Collaborator

That strange coding style might be a remnant from earlier drafts of v4 which used the Google Closure compiler, presumably to prevent that function from being optimized away completely.
CC: @fat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants