Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure sandbox security in in Rhino JavaScript engine

I want to interpret html pages scripts, but want to disable any posibility of harming my computer. Is there are any official tutorial or example how to configure such feature? (i dont find it in offcial site)

like image 376
yura Avatar asked Dec 17 '22 19:12

yura


2 Answers

run an initial script like this:

java = undefined;
Packages = undefined;
org = undefined;
...

then it is sandboxed.

like image 88
chacko Avatar answered Dec 19 '22 08:12

chacko


I haven't seen any official example, but see this SO question and particularly this article on sandboxing in Rhino. The article gives a pretty good overview of the things you'll have to set up and guard against.

like image 32
fizban Avatar answered Dec 19 '22 09:12

fizban