-
Notifications
You must be signed in to change notification settings - Fork 206
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
Capability leak by fulfilling with a non-fresh handled presence #10
Comments
Can we do: resolve(myObj, fulfilledhandler)
Innerresolve(Object.create(myObj)) The resolution would just be a fresh object whose prototype is myObj. |
That would work and has some nice properties. But given the semantics of omitting the |
Maybe the third argument to the executor should be I misspoke once that this was already the case. Perhaps it should be that way. |
I like that. |
|
Should be called fulfillWithPresence(fulfilledHandler,
optParent = Object.prototype,
optDescriptors = undefined) -> presence since only the |
Should the fulfilledHandler be called the |
I like fulfillWithPresence(presenceHandler) -> Object.create(null) and so they can only mutate the presence, set the prototype or property descriptors if they have access to the Reflect API parts that can do that? That way we can include this constructor in Jessie without a privilege leak. |
Nice! I hadn't thought about the Jessie implications. Yes. |
Add send command to cli
This is implemented. |
Our way of fulfilling a handled promise with a fulfillment handler has a capability leak: Say Alice and Bob are within the same frozen root realms and supposedly isolated from each other. Alice creates a handled promise and then does
Resolve(Object, fulfilledHandler)
, which fulfills it withObject
. Bob then doesPromise.resolve(Object)
and retrieves Alice's handled promise.Our presences are only safe when they are fresh. To enforce freshness, the presence should be created by the eventual-send package in the act of fulfilling a handled promise with a fulfilled handler. I don't see any way to do this while preserving the elegance of the current
HandledPromise
constructor.API details aside, the most general way I can think of to ask the TCB to create a new fresh object, while still providing flexibility for what the object is, is to provide the parameters of
Object.create
and leave the creation up to the TCB.Fortunately, there should be no motivated use case for simultaneously fulfilling a handled promise with a pre-existing object while also providing a fulfilled handler for that case. Fulfilled handlers should only be needed for fresh presences, so there shouldn't be any loss of needed functionality.
The text was updated successfully, but these errors were encountered: