javascript - node.js runInNewContext with untrusted code -
according node.js vm module docs:
note running untrusted code tricky business requiring great care. prevent accidental global variable leakage,
vm.runinnewcontextquite useful, safely running untrusted code requires separate process.
if want build untrusted code runner (for example, online node.js console), natural approach:
- each session of untrusted code spawn new process using
child_processmodule, killed after amount of time - the child process use runinnewcontext run code
would safe approach? have watch out for?
Comments
Post a Comment