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

eval usage is not allowed when using a sensible CSP #106

Closed
buesing opened this issue Jun 4, 2021 · 1 comment
Closed

eval usage is not allowed when using a sensible CSP #106

buesing opened this issue Jun 4, 2021 · 1 comment

Comments

@buesing
Copy link

buesing commented Jun 4, 2021

I recently added a content security policy to my site and now I'm seeing this error:
nextZero EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' blob:".. It's because this library is using an eval call here:

result[key] = eval(value.replace(/^BIC_FN:::/, ''))

I'm wondering if this can be rewritten to use a different parsing strategy. Using eval is generally discouraged.

@Donaldcwl
Copy link
Owner

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

2 participants