Okay, the thread on “Why Living Dangerous can be A Good Thing” is
going quite well.
I’d like to start drafting up notes for my article, so I’ve put them
on a wiki page.
Feel free to add sections, tweak definitions, etc etc and add your own
content.
However, please be mindful of the fact that this is intended to be a
summary of the community consensus, so please do ask here on RubyTalk
if you have doubts that you’re opinion would be at least generally in
line with that of the community before adding it to the notes on the
wiki.
Please do reference any websites you are getting your materials from,
if you do so.
keep in mind, the key issues are:
Defining what the open nature of ruby is.
Addressing the concerns of those who find ruby ‘dangerous’
Showing the benefits of ruby’s openness and dynamicity.
Exposing the potential issues that arise from this, and how to avoid
them
As usual, I am overwhelmed by the RubyTalk effect, so please keep
those contributions coming!
On Mon, Jan 09, 2006 at 08:10:04AM +0900, Gregory B. wrote:
Okay, the thread on “Why Living Dangerous can be A Good Thing” is
going quite well.
I’d like to start drafting up notes for my article, so I’ve put them
on a wiki page.
summary of the community consensus, so please do ask here on RubyTalk
if you have doubts that you’re opinion would be at least generally in
line with that of the community before adding it to the notes on the
wiki.
If this is a Ruby community thing, would it make more sense to collect
this info on the RubyGarden wiki?
However, please be mindful of the fact that this is intended to be a
Defining what the open nature of ruby is.
To me Ruby seems a little schizophrenic. It has the concept of classes
as
object templates, but they are almost like prototypes, mutable after
creation. So a cross between C++/Java Class style and Javascript/IO
prototype OO. There is no concept of Interfaces, so no limiting the
coupling
‘surface area’ of caller/callee interaction. Its a nice mix because you
don’t ‘have’ to make use of mutable Objects/Classes, but they are like
programmer candy if you need them. I’m hoping Ruby 2/Rite goes even
further,
allowing fully ‘custom’ OO.
Addressing the concerns of those who find ruby ‘dangerous’
Showing the benefits of ruby’s openness and dynamicity.
Exposing the potential issues that arise from this, and how to avoid
them
As usual, I am overwhelmed by the RubyTalk effect, so please keep
those contributions coming!
I wanted to change the wiki but I’m not sure what I think is right
really is.
It seems to me that you forgot two cases where ruby’s open nature is an
inconvenient. Due to ruby’s open-class and lack of contraints, it seems
to me that you can’t trust ruby code right away. You can’t execute an
external code in your application in a specific boundary. You can’t
trust it to be “evil” without reviewing it.
I have two example in mind.
First example. Imaging you’re building a big web application where
users can submit their templates (eg. blog or wiki hosting) and you’re
using embedded ruby in html. How can you trust that the user won’t send
an “evil” template without reviewing it ? (disregarding javascript XSS
exploits)
Second example. You’re implementing a remote execution mechanism with
agents. Like Java’s JINI, you want clients to send pieces of code that
will be executed in the server’s environment and then give the result
back. It’s a bit like the client would send blocks to the server. How
do you avoid the client sending “evil” code that would redefine how the
server would work ?
I’m curious how these issues can be solved. I think _why used
obfuscation for http://tryruby.hobix.com/ but it’s not applicable for
open-source projects. There is also the SAFE variable that limit ruby’s
capabilities. But I think it’s only applicable to the whole code, so
it’s not a solution. Finally, you can taint classes to make the
unmutable but then you loose ruby’s dynamicness.
First example. Imaging you’re building a big web application where
users can submit their templates (eg. blog or wiki hosting) and you’re
using embedded ruby in html. How can you trust that the user won’t
send
an “evil” template without reviewing it ? (disregarding javascript XSS
exploits)
Second example. You’re implementing a remote execution mechanism with
agents. Like Java’s JINI, you want clients to send pieces of code that
will be executed in the server’s environment and then give the result
back. It’s a bit like the client would send blocks to the server. How
do you avoid the client sending “evil” code that would redefine how
the
server would work ?
These problems are one and the same: never, ever, ever trust user
data. (completed web forms, templates, client-side code, etc.)
Would you really not examine the template if it where embedded PHP or
something similar? Is it not possible for client-side code to do
“bad things” in JINI? I argue that this is not the fault of the
language, but problems inherent to the world the application lives in.
It seems to me that you forgot two cases where ruby’s open nature
is an
inconvenient. Due to ruby’s open-class and lack of contraints, it
seems
to me that you can’t trust ruby code right away. You can’t execute an
external code in your application in a specific boundary. You can’t
trust it to be “evil” without reviewing it.
Is this a ‘Ruby’ issue? Isn’t this true of any library/class/etc. that
you might use in any language?
Gary W.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.