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

An Icebox is better than a bad sandbox #14

Closed
wants to merge 1 commit into from

Conversation

ricochet1k
Copy link
Contributor

@ricochet1k ricochet1k commented Sep 1, 2017

Since it is difficult to sandbox JS, this is a different approach. It is possible and easy to get access to the prototypes of the outside world's primitive objects, but that alone is not dangerous. It becomes dangerous when the host's prototypes are modified. So lets create an icebox by freezing the host's objects and prototypes.

Unfortunately, Object.freeze blocks child objects from overriding properties, so this is a customized version of Object.freeze that allows children to overwrite properties. The effects on the frozen object are identical.

The security violation checking code has been removed since it was checking property descriptors, and it is now impossible to violate.

While this doesn't guarantee that user code can't escape, it does dramatically reduce the amount of code that can be exploited.

@artch
Copy link
Contributor

artch commented Sep 1, 2017

This is quite interesting! However, it's a major refactor and it will take some time to get it properly tested. And actually right now we're working on a total re-design of the entire runtime engine based on isolated-vm (see here), so I cannot guarantee this PR will ever make it to production.

laverdet pushed a commit to laverdet/driver that referenced this pull request Oct 22, 2018
@ricochet1k ricochet1k closed this Aug 16, 2023
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

Successfully merging this pull request may close these issues.

2 participants