How to configure sandbox protection in the Rhino JavaScript engine

I want to interpret scripts of html pages, but I want to disable any possibility to damage my computer. Is there any official tutorial or example on how to configure such a feature? (I do not find it in the official site)

+3
source share
3 answers

I have not seen an official example, but see this SO question and especially this article about the sandbox in Rhino . The article gives a pretty good overview of what you will need to configure and protect.

+4
source

run the initial script as follows:

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

.

+6

"out.println('outclass' + out.getClass(). forName ('java.io.File'));

There are a lot of pitfalls in this deal. The previous answer is not good enough.

+1
source

Source: https://habr.com/ru/post/1777667/


All Articles