Code Monkey home page Code Monkey logo

Comments (3)

caridy avatar caridy commented on August 15, 2024

Some browses are using internal slots for Errors (Firefox, we are looking at you), which might interfere with the remapping mechanism because some accessors might through when an error is passed from outer realm into sandbox (think of Promise.catch maybe). We should validate this.

from near-membrane.

mmis1000 avatar mmis1000 commented on August 15, 2024

It looks like things like Date.prototype.getTime() Map.prototype.get can't be remapped safely unless you remap the methods and re-dispatch based on where they are object of remote realm or object of current realm.

https://github.com/mmis1000/secure-ecmascript-sandbox/blob/4afbe936ec5e309c6d56ac9758e2a4139d07d8a2/src/browserRealm.ts#L855-L863

but that has another problem.
unless you also remap the methods in outer realm.
Date/Map and other object that relies on internal slot created in inner realm won't work in outer realm.

Some class I found that has method/getter relies on internal slot

https://github.com/mmis1000/secure-ecmascript-sandbox/blob/4afbe936ec5e309c6d56ac9758e2a4139d07d8a2/src/browserRealm.ts#L87-L120

These won't work unless you remap the methods.

In turns, it means these need to be whitelisted as this object when calling methods of these class. But that sounds dangerous to me though.

from near-membrane.

caridy avatar caridy commented on August 15, 2024

I have identified another small list of intrinsics that are present in node 12.x when creating a new VM:

  [ 'BigUint64Array', 'BigInt64Array', 'BigInt', 'WebAssembly' ]

from near-membrane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.