3 ms·
I don't have any experience with Rhino, but I did a similar thing with node.js as an experiment once. I didn't go down the route of trying to restrict the user
by satori99 16y ago
I don't have any experience with Rhino, but I did a similar thing with node.js as an experiment once.
I didn't go down the route of trying to restrict the user from creating functions and eval'ing etc.
It was easier to just run 'unsafe' scripts in a seperate sandboxed process with their own own (restricted) globals. I gave the scripts limited time to run before the process was forcibly killed. Doesn't matter about infinite loops and other things so much then.