I have a Node.JS instance that dynamically inserts Javascript snippets to be executed from a Database where they are stored as strings. My problem is that I need to be able to Sandbox the executed Javascript from getting access to anything that can compromise the actual running Node.JS instance, the Database, or other Javascript being executed.
Is there a way to that I can do this without actually running a separate Instance of Node for each process?
Basically need to put in place security to make sure no rogue javascript is ran
Looks like this might be what you're looking for.
npm install sandbox
However, it hasn't been updated in over a year. So you might be better off using child_process.fork() as described in this posting.