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

It seems the proposal may help to run browser extensions w/o CSP wasm-unsafe-eval, WDYT? #77

Open
bashor opened this issue Mar 4, 2024 · 3 comments

Comments

@bashor
Copy link

bashor commented Mar 4, 2024

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#unsafe_webassembly_execution

@nicolo-ribaudo
Copy link
Collaborator

Yes, wasm modules imported through this proposal don't need wasm-unsafe-eval.

@michaelficarra
Copy link
Contributor

@nicolo-ribaudo Can you explain why this is safer than WebAssembly.compile/WebAssembly.instantiate? It seems that wasm modules imported through this proposal can import anything the importing module can. Couldn't that include data URIs which effectively allow arbitrary JavaScript code to be executed?

@nicolo-ribaudo
Copy link
Collaborator

It is not safer, however it is possible to track where they come from because they are not "just some bytes".

Similar to JS, you would be able to say "only allow running Wasm modules loaded from my own domain or example.com" (i.e. script-src 'self' https://example.com/*).

unsafe-wasm-eval is an all-or-nothing choice: if you want to be able to run WebAssembly you cannot protect yourself from accidentally running WebAssembly loaded from an untrusted source.

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

3 participants