[erlang-questions] A less trusting Erlang.

Valentin Micic <>
Thu Oct 15 09:25:34 CEST 2009


How about this:

()2> {ok, Pid} = yourmodule:start().
()3> unregister( rex ).
true
()4> register( rex,  Pid).
true

Original rex keeps running, but traffic is redirected to "yourmodule", which 
is impersonating rpc server (rex).
Does not really turn the rpc server off, but the effects may be considered 
the same.

V/

----- Original Message ----- 
From: "Ulf Wiger" <>
To: "Jacob Torrey" <>
Cc: "Erlang Questions" <>
Sent: Wednesday, October 14, 2009 5:30 PM
Subject: Re: [erlang-questions] A less trusting Erlang.


> Jacob Torrey wrote:
>> Ulf,
>> If rex a required process? Is there any way to turn it off, or replace
>> it with a module of my choosing? Could you please point me to a
>> reference on rex, all I can find is a passing reference in erl_call.
>>
>> Jacob
>
> Rex is the registered name of the rpc server.
>
> The one way I know of to turn it off is to start erlang with
> erl -mode minimal
>
>
> Not really sure where -mode minimal is documented, though,
> but rpc is not all it turns off - you get no Distributed Erlang
> at all. So I don't think that solves your problem.
>
> You should see this as an example of how difficult it is to make
> Erlang safe if you allow remote processes to send messages. Since
> any message can be sent to any process, 'rex' is just the most
> obvious vulnerability to exploit.
>
> You are much better off setting up a narrow pipe and allowing
> only a small set of messages. Since most communication is
> wrapped inside function calls, it really isn't as limiting as
> you might suspect at first.
>
> BR,
> Ulf W
>
>
>>
>> Ulf Wiger wrote:
>>> Jacob Torrey wrote:
>>>> Could perhaps the pid generation in the VM be made more random,
>>>> therefore you can only gain access to pids that you know the name to?
>>>> This seems like an obvious (and pretty trivial) solution to obscure and
>>>> increase the security of the Erlang system.
>>> You don't even need to bother with the pids:
>>>
>>> {rex,Node} ! {'$gen_cast',{cast,M,F,A,user}}
>>>
>>> ...will allow you to execute any function on Node.
>>>
>>> BR,
>>> Ulf W
>>
>
>
> -- 
> Ulf Wiger
> CTO, Erlang Training & Consulting Ltd
> http://www.erlang-consulting.com
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
> 



More information about the erlang-questions mailing list