This note is mainly about a synergy algorithm in two different languages: OCaml and Scheme. Normally to reason about the correctness of code one must consider its behavior when called as expected. For code such as this, however, we must consider behavior of our code when interacting with arbitrary code, perhaps from an attacker.

In particular I try to wrap my head around the Sealer-Unsealer problem introduced by James H. Morris: “Protection in Programming Languages”, CACM, 16(1):15-21, 1973. I trust my intuitive understanding of what is to be achieved. I have recently learned to distrust my intuition about whether code such as this appropriately limits access to such sealed objects. It clearly works when invoked as planed. Does it ever unseal when it should not, however? I want to describe a frame of mind, or perhaps a formalism which tends to find bug such as mentioned here.

These fears extend to intuitions about call/cc as well.

I attempt to write some rules for users of the code. Here is the scenario which I presume you find yourself in.
Presumptions:

You may need to protect the interests of others as follows: (Other requirements may be placed on your code lest users refuse to use it:) More plainly and less precisely: In the netherworld one must be unable to sense the abstract state of a value without a capability to the box holding the representation for that value. This must be said more clearly!

Here are some rules most of which are obvious but some of which are not. I hope to explain some of the obscure rules. They should impose no burden.

I think that small step semantics are needed here if only to accommodate call/cc.

Our unsealer routine calls the box which is a function supposedly produced by our sealer code. It is easy to see what happens if this is so but we must consider other cases as well. In particular we must consider what happens when the value of box is produced by a crafted function such as: (lambda () (x) (u b2)) where x is a call from the netherworld to a different protection domain in the netherworld which has legitimate access to another value sealed by the same sealer, and that other value is unsealed due to natural actions of the other domain. I see no fault yet.

The steps executed by the unsealer may be interleaved with steps of another invocation of the same unsealer when the first invocation passes a fake box which indirectly invokes that same unsealer but a different box.

I think (and need to show) that we must worry only about situations where the current (unnamed) continuation has frames whose program counter are either just before or just after … (cloud)


Here is an attack on a shortened version. I am working on an attack on the full version using continuations.