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 violations due to use of new Function() #258

Closed
nealedj opened this issue Nov 2, 2015 · 6 comments
Closed

CSP violations due to use of new Function() #258

nealedj opened this issue Nov 2, 2015 · 6 comments
Assignees

Comments

@nealedj
Copy link

nealedj commented Nov 2, 2015

It looks like new Function() is used here

It appears to be handled within the try/catch but it still raises a CSP violation in the browser.

It'd be most excellent if there was a setting where this could be disabled and the fallback behaviour was always used. I see that this was suggested in this issue.

Thanks!

@jmdobry
Copy link
Member

jmdobry commented Nov 2, 2015

Hmm, I didn't know new Function() would do this. Your link to the issue is the same as the link to the code.

@jmdobry jmdobry added the bug label Nov 2, 2015
@nealedj
Copy link
Author

nealedj commented Nov 2, 2015

Ah sorry - have updated to the actual issue (js-data/js-data-angular#242)

@jmdobry
Copy link
Member

jmdobry commented Nov 4, 2015

My proposed fix is to add a flag that forces the library to not execute the code that raises the CSP violation warning. Is that sufficient?

@jmdobry
Copy link
Member

jmdobry commented Nov 4, 2015

@nealedj Thoughts?

@nealedj
Copy link
Author

nealedj commented Nov 4, 2015

Sorry @jmdobry - was going to give that a test today but haven't got round to it yet.

The fix looks perfect though.

@jmdobry jmdobry closed this as completed in c6ced66 Nov 4, 2015
jmdobry added a commit that referenced this issue Nov 4, 2015
@nealedj
Copy link
Author

nealedj commented Nov 4, 2015

Just to follow up - tested this and it works great. Thanks!

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

2 participants