-
Notifications
You must be signed in to change notification settings - Fork 22
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
Move template engine and brick evaluation to Chrome sandbox #105
Comments
I think you're suggesting to run that code in the Related: #430 There are a couple of things that will make a little awkward:
|
I'm not yet familiar with the capabilities of bricks, but the sandbox won't have access to the webpage at all (unlike the user scripts), would that be a problem? Would it require bricks to run in 2 places at once? Given that TamperMonkey is already able to inject user scripts, I wonder if I can make a Edit: From a quick look, it appears that TamperMonkey injects the user script with a plain Related links with possibly more details/context: Scripting in chrome, especially in MV3: https://groups.google.com/a/chromium.org/g/chromium-extensions/c/q9H8KwFLkMs SO question with links related to communication between user scripts and content scripts: |
Thanks for starting to look into this! This issue isn't urgent, as we're still in a world where people are creating for themselves or running bricks made by their company's development team. I need to write up a wiki page on formally detailing the threat/security model so we can determine best way to leverage sandbox. The main potential attack vectors from a malicious brick creator would be:
For each, the surface area pretty well-defined because we don't support arbitrary JS in bricks. Therefore, each brick/class of brick can have its own mitigation mechanisms. For example, the markdown brick runs When I originally wrote this issue, the implementation sketch I had in mind for initial sandboxing was:
These don't require access to the page or network connection, as they're just transforming data. On iframe and MV3:
|
You mentioned this in the other issue but I want to clarify here: Do you intend to use the sandbox only in Chrome for now? And then allow the code to run locally in Firefox? |
I think we have to, as I'm not sure Firefox has a sufficient analog. (It has a UserScripts API, but IIRC that isn't a good fit for this granular of call) |
My understanding is that you want to only bring the execution of specific parts of the bricks to the sandbox, for example:
If so, we'll have to create a sandbox.js bundle with just the specific handlers, rather than moving the whole engine there. Can you list these sandboxable bricks so we can move this ticket forward? |
Correct, the things that need to be moved to sandbox are:
For a POC of this ticket, I think we should modify engineRenderer to use the sandbox under the hood. This will allow us to see what the impact on brick execution speed.
Runtime:
Bricks: |
Sandboxing coming to the web 😮 (safe |
References/Documentation:
The text was updated successfully, but these errors were encountered: