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

Allow wasm-eval instead of unsafe-eval in the browser extension manifest #752

Closed
mossroy opened this issue Aug 22, 2021 · 2 comments · Fixed by #984
Closed

Allow wasm-eval instead of unsafe-eval in the browser extension manifest #752

mossroy opened this issue Aug 22, 2021 · 2 comments · Fixed by #984

Comments

@mossroy
Copy link
Contributor

mossroy commented Aug 22, 2021

This is a follow-up of #751 : unsafe-eval was needed to allow WASM in chromium extensions.
The goal of this issue to allow only what is necessary.

Problem is that the CSP that forced us to do that has been introduced at the beginning of 2017 (https://codereview.chromium.org/2646713002/), and the wasm-eval has been implemented at the end of 2017 (https://bugs.chromium.org/p/v8/issues/detail?id=7041).
So switching to wasm-eval would break compatibility with the chromium-based browsers of 2017.

So I suggest to also try to trap this specific exception, and automatically fallback to ASM in this case. It would only occur for these browsers of 2017 (rare case), and would allow them to work anyway. It's not a big issue if they use ASM instead of WASM.

@mossroy
Copy link
Contributor Author

mossroy commented Aug 22, 2021

Maybe another way would be to sandbox the page that loads the wasm : https://developer.chrome.com/docs/extensions/mv2/sandboxingEval/ , as suggested in https://stackoverflow.com/questions/48523118/wasm-module-compile-error-in-chrome-extension
But this page is currently www/index.html so it's probably complicated to sandbox it

@Jaifroid Jaifroid modified the milestones: v3.3, v3.4 Jan 31, 2022
@mossroy mossroy modified the milestones: v3.4, v3.5 Apr 9, 2022
@mossroy mossroy modified the milestones: v3.5, v3.6 Aug 4, 2022
@Jaifroid Jaifroid modified the milestones: v3.6, v3.7 Nov 9, 2022
@Jaifroid Jaifroid modified the milestones: v3.7, v3.8 Jan 3, 2023
@Jaifroid Jaifroid modified the milestones: v3.8, v3.9 Apr 22, 2023
@Jaifroid Jaifroid linked a pull request May 12, 2023 that will close this issue
@Jaifroid
Copy link
Member

Jaifroid commented May 12, 2023

There are a couple of Chromium-only wasm-related CSP directives. What is needed under MV3 (Manifest V3) is incorporated into #984. Note that there is no eval allowed at all under that manifest version. Therefore, realistically, to run Zimit-based archives, we needed to introduce the PWA into the Chromium extension, as an option, alongside "local" use of the Service Worker. A PR #1000 implementing the remote SW mode has now been merged into main.

@Jaifroid Jaifroid modified the milestones: v4.0, v3.9 Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants