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.runinnewcontext quite useful, safely running untrusted code requires separate process.

if want build untrusted code runner (for example, online node.js console), natural approach:

  1. each session of untrusted code spawn new process using child_process module, killed after amount of time
  2. the child process use runinnewcontext run code

would safe approach? have watch out for?


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -