Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm building a public website where users share data and scripts to run over some data. The scripts are run serverside in some sort of sandbox without other interaction this cycle: my Perl program reads from a database a User made script, adds the data to be processed into the script ( ie: a JSON document) then calls the interpreter, it returns the response( a JSON document or plain text), i save it to the database with my perl script. The script should be able to have some access to built in functions added to the scripting language by myself, but nothing more.

So i've stumbled upon node.js as a javascript interpreter, and and hour or so ago with Google's V8(does v8 makes sense for this kind of thing?). CoffeeScript also came to my mind, since it looks nice and it's still Javascript.

I think javascript is widespread enough and more "sandboxeable" since it doesn't have OS calls or anything remotely insecure ( i think ).

by the way, i'm writing the system on Perl and Php for the front end.

To improve the question: I'm choosing Javascript because i think is secure and simple enough to implement with node.js, but what other alternatives are for achieving this kind of task? Lua? Python? I just can't find information on how to run a sandboxed interpreter in a proper way.

share|improve this question
    
It's not clear what you're asking. Is it possible? Sure, it's possible. –  Robert Harvey Mar 4 '12 at 16:51
add comment

1 Answer 1

my first thought was node.js - as you mentiond above it's a javascript-interpreter. And that's exactly the thing you need, if you want to sandbox the scripts in a really secure way.

Another way could be, that you check every command in a script, if it's valid or not. But I don't think that you will get a secure sandbox.

Greetings

share|improve this answer
    
Is there any sandboxing suport i NodeJS or available with NodeJS? –  ysdx Mar 4 '12 at 21:07
2  
Found this: gf3.github.com/sandbox –  ysdx Mar 4 '12 at 21:12
    
+1 for the great link to the "NIFTY JAVASCRIPT SANDBOX FOR NODE.JS". –  ClintNash Jun 26 '12 at 18:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.