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. |
…equired for WASM to be evaluated (WebAssembly/content-security-policy#7)
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Has there been any update on this? Is the only way to use WebAssembly on websites on Chrome still to add 'unsafe-eval' to the CSP? |
|
There has not been much progress on this in recent years. |
|
Argghhh I really want this for Ruffle as a user. |
|
Just encountered the same issues with firefox, edge and chrome whilst trying to use wasm generated by blazor. Its a real stumbling block in moving from local development to production. Im quite surprised that there has'nt been more progression on this front given the push behind languages to adopt WASM compilation. Also im not sure about the adoption rate of browser updates across multiple platforms and regions etc however I am concerned because I assume that when this feature does eventually release there will be an issue where any application you're trying to rollout safely will for a long period of time only be accessible by a minority of browser users. |
Surprised you encountered this in firefox, as far as I know firefox doesn't gate wasm compilation. |
|
Now there is technically a way to use WASM on Chrome without |
It doesent block by default, the issue is if you deploy your application on a server with any kind of csp it seems to occur, though I suppose it's the same as enabling with a local document. It's also unavoidable since it seems the method of using a js hash as you normally would with javascript in the csp causes it to still get blocked... And these alternative tags being discussed in the this thread when used in the csp also don't allow the execution either... In short csp equals no execution atleast in my tests (which aren't exhaustive as I mentioned). But generally anywhere I would like to use wasm in production usually requires csps to be defined since security and reputation often are more valuable than performance gains. |



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: