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

JSF code does not work if CSP forbids eval/new Function #131

Open
hilbix opened this issue Jul 3, 2023 · 0 comments
Open

JSF code does not work if CSP forbids eval/new Function #131

hilbix opened this issue Jul 3, 2023 · 0 comments

Comments

@hilbix
Copy link

hilbix commented Jul 3, 2023

If CSP forbids eval and new Function (and <script> injection) for safety, then code transpiled into JSF does no more work. As JSF transpiles the code into a string which must be evaluated.

I think this is a big flaw. Also I consider the use of eval to be cheating, as this way JSF just only does a string conversion and leaves the real dirty part to eval.

Is there a (known) subset (or variant/mode) which would make it able to transpile things into code, which does not need to be evaled? Is this even possible? Of course I think the character set must be slightly extended (like allow of = or some idiomatic function ($){ with a closing }, only used for direct function definition which is allowed under such CSP).

Sorry if this is a FAQ, but I tried myself a few hours and failed even with try to Google for something like that. Am I really the first one to ask?

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

1 participant