Skip to content

Replace new Function() with regular function#236

Closed
budnix wants to merge 1 commit intojstat:masterfrom
budnix:csp-violation-fix
Closed

Replace new Function() with regular function#236
budnix wants to merge 1 commit intojstat:masterfrom
budnix:csp-violation-fix

Conversation

@budnix
Copy link
Contributor

@budnix budnix commented Oct 23, 2018

This PR fixes:

  • The newest version of the vows doesn't work with this project so I've locked latest worked version. Now tests pass;
  • [most important] I've replaced the new Function() expression which violates Content Security Policy (CSP).

I didn't include /dist files because I don't know what is the release flow of this library. If you want this files I can build and include them to this PR.

Using `eval` or `new Function` violates Content Security Policy (CSP).
@jandom
Copy link

jandom commented Nov 21, 2018

@trevnorris hi man sorry to bug you – any chance this is getting merged soon? it will allow folks with content security policy to use this package (csp will by default block all "eval")

@AMBudnik
Copy link

👍

@jandom
Copy link

jandom commented Feb 19, 2019

@AMBudnik guys, if we fork this repo, could you potentially point toward a custom fork?

@AMBudnik
Copy link

I've had a discussion with the team and we'd rather create a fork cause then we'd have a 100% control over it, however, it takes more effort (maintaining, pull requests, issues, security updates...). We're already building a new formula engine so or connection to jStat may end.

Maybe @mrwillihog could help us?

trevnorris pushed a commit that referenced this pull request Jun 3, 2019
Using `eval` or `new Function` violates Content Security Policy (CSP).

PR-URL: #236
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
@trevnorris
Copy link
Member

trevnorris commented Jun 3, 2019

The new Function fix landed in 274cb8a. The changes to package.json were separated into b381456, which is also the 1.7.2 release that contains your fix, to also update uglify-js. The style changes to the file will be in a separate commit.

@trevnorris trevnorris closed this Jun 3, 2019
@budnix budnix deleted the csp-violation-fix branch June 4, 2019 05:32
@AMBudnik
Copy link

AMBudnik commented Jun 4, 2019

Glad to see you back in the game @trevnorris 👍

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

Successfully merging this pull request may close these issues.

4 participants