K
kirindave
Hey folks.
With all this talk of duck typing and such, I got to thinking about some of my
code that I *thought* executed untrusted code relatively safely. I'd run code
in a safe 5 thread, let it return a string, which I checked to make sure it
was a "string." However, I now realize that concept is totally meaningless.
Unless I'm misunderstanding, doesn't this mean that there is no such thing as
an object you can "trust" in an absolute sense in Ruby. So, with that in mind,
someone could return an object that, to me as the receiver, looks like a
string, but its actual purpose is to iterate over every object in the runtime,
looking for database like objects, with the purpose of destroying them. Or it
could try and erase as much as it could.
I know these objects come out tainted, but in order to use them, we need to
untaint them. How do I know that that .upper! isn't actually going to destroy
me?
The only way I can see it is if an object could be "partially frozen", its
methods and class methods locked, but its member variables not locked. I don't
think there's any way to achieve this.
Am I totally wrong about this?
--
Dave Fayram
(e-mail address removed)
(e-mail address removed)
Coder / Idealist
--
With all this talk of duck typing and such, I got to thinking about some of my
code that I *thought* executed untrusted code relatively safely. I'd run code
in a safe 5 thread, let it return a string, which I checked to make sure it
was a "string." However, I now realize that concept is totally meaningless.
Unless I'm misunderstanding, doesn't this mean that there is no such thing as
an object you can "trust" in an absolute sense in Ruby. So, with that in mind,
someone could return an object that, to me as the receiver, looks like a
string, but its actual purpose is to iterate over every object in the runtime,
looking for database like objects, with the purpose of destroying them. Or it
could try and erase as much as it could.
I know these objects come out tainted, but in order to use them, we need to
untaint them. How do I know that that .upper! isn't actually going to destroy
me?
The only way I can see it is if an object could be "partially frozen", its
methods and class methods locked, but its member variables not locked. I don't
think there's any way to achieve this.
Am I totally wrong about this?
--
Dave Fayram
(e-mail address removed)
(e-mail address removed)
Coder / Idealist
--