4 ms·
> A program could also be implemented in a safe language where the defined semantics rule out RCE. It doesn't seem like such a language would be very useful, u
by tgflynn 7y ago
> A program could also be implemented in a safe language where the defined semantics rule out RCE.
It doesn't seem like such a language would be very useful, unless you mean a language developed specifically for a particular application.
A language can be made safe against invalid memory accesses and undefined behavior but if it prevents RCE then it must also prevent implementing remote procedure calls, meaning it's not general purpose.
- noselasd 7y agoMaybe you have a very broad definition of RCE, one that does not match up with RCE as used by security professionals ?
- tgflynn 7y agoI've seen a couple of different definitions, but the most restrictive appears to be that RCE means the ability to execute arbitrary code on a remote host (https://en.wikipedia.org/wiki/Arbitrary_code_execution https://en.wikipedia.org/wiki/Arbitrary_code_execution). Note that the definition returned at the top of a Google search for RCE is considerably more general than this. There are many pieces of software that allow a remote user to execute arbitrary code remotely. Some examples are ssh and the Jupiter notebook running a Python or Julia kernel. Of course these types of software usually include an authentication/authorization mechanism limiting access to authorized users. Any bug in the implementation of this mechanism could potentially allow the unauthorized remote execution of arbitrary code. No "safe" language alone can prove the absence of all such bugs. At a minimum doing so would require a complete specification of who is authorized to execute what code and how they are to prove their identity to the software along with a formal proof that the implementation completely implements the spec.
- deleted 7y ago[deleted]
- tgflynn 7y agoIt appears some people haven't understood my comment so I will attempt to explain it more fully. First let me be clear that this comment only relates to the parent's statement "A program could also be implemented in a safe language where the defined semantics rule out RCE." It is this claim I take issue with, not anything about the original post, which I haven't looked at in detail. Spark allows contracts and pre- and post- conditions to be defined on procedures which together may amount to encoding a spec for the application into the source code. It may then be possible to prove the implementation correct relative to this spec. But that's very different from saying that the defined semantics of the language alone (ie. without the spec which must be provided to the verifier one way or another) prevents RCE. Now to substantiate my claim that the semantics of a general purpose language cannot alone "rule out RCE". 1) A general purpose language may be used to implement a program which provides an RPC (remote procedure call) mechanism, whether open to all or restricted to a set of authorized users. 2) A program written in a general purpose language may implement an interpreter for its own, or some other language, such as Scheme. 3) In the absence of a formal spec nothing prevents the programmer from implementing an RPC call which takes a string received from the network, with no authorization/authentication checks, and runs that string through the program's scheme interpreter. This constitutes RCE by any definition I'm aware of.
- fulafel 7y agoYep, of course RCE would have to be precisely defined in the case of this approach. You could have a turing-incomplete language that prevents interpreting, or you could have a more general language that just prevents uncontrolled RCE due to memory safety compromise. Or some formal proof of not interpreting received symbols in a way that affects control flow in a complex way..