I’d like to run user supplied ruby code in server, what are the potentially nasty things that can happen? I mean things like deleting files etc. Can you give me more examples?
Thanks in advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ruby allows you to set a
$SAFEglobal variable that will determine exactly what tainted code is allowed to do. Read up more about this in Locking Ruby in the Safe.To paraphrase, here’s the table on the effects of
$SAFE:This is the content from the table at the bottom of the linked page, which explains what tainted objects are allowed to do at each
$SAFElevel. From this, you can easily infer what bad things Ruby code would be able to do.