-
Notifications
You must be signed in to change notification settings - Fork 9
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
No way to use WebAssembly on Chrome without 'unsafe-eval' #7
Comments
I've put together a quick example here: https://s3.amazonaws.com/webassembly-chrome-csp/csp_test.html |
Right now Chrome restricts |
Awesome. |
Out of curiosity, I just tried running your test case on Safari and got:
Does that match what you see? Based on the table on the Wasm CSP Proposal, Safari should not allow |
Safari currently doesn't implement streaming. |
I just submitted the PR for |
Has there been any movement on this? Looks like the PR has been open for over 4 months now. |
Awesome, thanks for pushing this forward. |
So just for the sake of clarity, the end goal here will be to create a CSP that allows WASM without allowing Also, unrelated question: why do I not receive this warning on Firefox? |
@twilco Yes, the proposed |
There's a PR #17 to rename the directive. However, for Chrome apps that use extension URLs, we'll likely keep the old directive for some transition time. |
So has |
Hi, we've only implemented |
I wish to be able to use WebAssembly from my extension -- this is already the case for the Firefox version of the extension. However, I do not plan to use What is the reason Chromium can't allow loading of wasm modules from same-origin Response objects? This would solve the issue of loading/executing only same-origin wasm code (i.e. the extension's packaged files) without having to resort to relaxing the default CSP in the manifest. |
I opened a bug on the Chromium bug tracker for implementing |
I've filed Support origins and SRI-style hashes in CSP for WebAssembly streaming APIs to address the concerns of @gorhill and myself. |
Hi there - @hackcasual - I am running into this error when attempting to embed Google Street View in a dashboard in Tableau Online. I am new to coding and am curious if this conversation, particularly what you mentioned about Tableau, has to do with this error and if it's resolvable: TYIA! |
Hi @kendraspock , that error is a direct result of this. It's a little confusing since it doesn't actually mean Chrome refused to compile the WebAssembly module, it's reporting that if CSP were enabled, it would refuse to compile the module. It's benign. |
I implemented successfully a compression protocol called Brotli here:
otherwise it won't work, but I though apps restrict scripts from remote URLs. |
@coderanger |
Closing |
Considering it is closed, can someone point me to which comment in this thread remedies the situation described here: |
A small follow-up. We are 'looking into this'. Not a whole lot to report yet. |
@fgmccabe So you were looking into this, is there any result yet? |
Ah or is not this fixed by w3c/webappsec-csp#293? Apparently Chrome 97 now supports a directive called |
@rugk wasm-eval does nothing, At least on Linux x86_64 tested with Chromium v99. Others have mentioned it earlier as well, Currently we're forced use 'unsafe-eval' if we need wasm. |
wasm-eval is/was always restricted to chrome extensions and chrome apps. For manifest v3, it will likely not be supported. |
Thanks for clarifying, |
Thanks! |
@abishekmuthian <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'wasm-unsafe-eval'"> |
I noticed lighthouse itself complains about CSP and 'wasm-unsafe-eval' fixes the problem. I wonder the security implications of wasm-unsafe-eval in particular for those who don't use wasm |
Can you be more specific? |
@fgmccabe Sure, I was running lighthouse from dev-tools itself with
That was mysteriously lowering the Best Practices score to 92. Then I ran CSP with report only mode and it pointed out the lighthouse tool itself was using web assembly to do its diagnosis. So I changed it the following and now score is back to 100% :
P.S my page itself doesn't use WASM anywhere. |
Got it. |
To give a bit of background, I am a software engineer at Tableau, on our online data visualization tool. We have been targeting WebAssembly for improving visualization interactivity. As part of our security efforts, we have been working on being able to support a restrictive CSP.
Currently chrome disables compileStreaming/instantiateStreaming with CSP on and not allowing 'unsafe-eval'. Other implementations (FF/Safari/Edge) at least allow the streaming versions of the compile/instantiate commands. The 8/8/2017 meeting notes seems to indicate that Chrome is following the original straw proposal. Chrome has implemented 'wasm-eval', but restricted it to apps/extensions.
Either treating the Response object as an origin according to the given CSP or adopting 'wasm-eval' would allow us to move forward.
The text was updated successfully, but these errors were encountered: