A secure membrane is a boundary between object graphs A
and B
such that:
- No objects in
A
hold a direct reference to an object inB
- No objects in
B
hold a direct reference to an object inA
- All data flow between
A
andB
is mediated by code associated with the membrane
A shadow target is a proxy target, distinct from the wrapped object, used by a membrane-proxy to record object model stability claims for the purpose of invariant enforcement. The shadow target is only accessible from its associated proxy.
Assume that an object reachable from the global scope of both graphs is not frozen. Then code in A
can store a reference to an object in A
by adding a property to an object reachable from the global scope. Code in B
can then read that property and obtain a direct reference to an object in A
.
C2. No objects in A
or B
hold a direct reference to a membrane-proxy wrapping an object in its own graph.
Assume that an object in A
has a reference to a membrane-proxy that wraps an object in A
.
- Let
P_a1
be the membrane-proxy that wrapsa1
. - Let
a2
be a different object inA
. - Code in
A
performsP_a1.[[Set]](a2, "$")
. P_a1
thinks thata2
is an object inB
and wraps it in a proxyP_a2
before sending it toa1
.- Let
P_b1
be the membrane-proxy for an objectb1
inB
. - Responding to the set operation,
a1
performsP_b1.[[Set]](P_a2, "$")
, - The proxy
P_b1
unwrapsP_a2
and sendsa2
tob1
. b1
now has a direct reference toa2
.
C4. No object in A
can read or write to a private-symbol-named property of a shadow target for an object in A
Since the shadow target is not accessible outside of its associated membrane-proxy, the only way to read or write private-symbol named properties on a shadow target is through a direct reference to the membrane-proxy. But by C2 no object in A
holds a direct reference to a membrane-proxy wrapping an object in A
.
C5. A secure membrane whose proxies use shadow targets remains secure when a private symbol is passed between A
and B
.
Assume that a private symbol pSym
is passed from A
to B
and that an object in B
has obtained a direct reference to an object in A
. Then pSym
must have been used to obtain the reference by application to one of the following:
- A shared global reference
- An object in
B
- A membrane-proxy for an object in
A
If pSym
was used against a shared global reference, then the global reference was not frozen prior to code from A
executing. By C1, this not possible for a secure membrane.
If pSym
was used against an object in B
, then an object in B
would have already had a direct reference to an object in A
. But this is not possible since the membrane was secure.
If pSym
was used against a membrane-proxy for an object in A
, then the proxy's shadow target would have already had direct reference to an object in A
stored in a private-symbol named property. Code in A
must have placed it there. But by C4, this is not possible for a secure membrane.