Disable dynamic execution in WASM build to allow removal of unsafe-eval#323
Open
gfodor wants to merge 1 commit intoBinomialLLC:masterfrom
Open
Disable dynamic execution in WASM build to allow removal of unsafe-eval#323gfodor wants to merge 1 commit intoBinomialLLC:masterfrom
gfodor wants to merge 1 commit intoBinomialLLC:masterfrom
Conversation
gfodor
added a commit
to webspace-sdk/three.js
that referenced
this pull request
Sep 14, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current WASM build generates a loader that uses
new Function(), which performs a Javascripteval. This is problematic if you want to use a CSP on your site that does not allowunsafe-eval- in other words, if you want to use the transcoder, you're forced to enableevalon your site, which is a security risk.The
NO_DYNAMIC_EXECUTIONflag can be used to disable the dynamic execution facilities of the module, which avoids the use of eval but drops support for a few emscripten functions (https://github.com/emscripten-core/emscripten/blob/main/src/settings.js#L1256) which seem unneeded for Basis's use cases. (I may be wrong about this, so hope the PR reviewer can confirm.)This PR enables this option which re-enables site admins to disable
evalon sites which use the basis transcoder.Thanks for considering the PR!