Is there Deno VM like NodeJS.vm ? #11269
-
Hi! In NodeJS there was module "vm" which allowed you to run untrusted code in new context But I didn't find any of that in Deno. Is there a way to run untrusted TYPESCRIPT code in Deno with a context? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
The "vm" module in Node can not be used to run untrusted code. It is not a security mechanism! Let me repeat, The "vm" module in Node is NOT a security mechanism! Do not use it to run untrusted code! If you do this in production, shut down the server right now.Read the first line in the Node.js docs: https://nodejs.org/api/vm.html#vm_vm_executing_javascript Deno can run untrusted code in web workers if you constrain their permissions. They make for a more adequate sandbox. With just web workers you might be vulnerable to in process timing attacks. To prevent this, use deno subprocesses instead of workers. |
Beta Was this translation helpful? Give feedback.
The "vm" module in Node can not be used to run untrusted code. It is not a security mechanism! Let me repeat,
The "vm" module in Node is NOT a security mechanism! Do not use it to run untrusted code! If you do this in production, shut down the server right now.
Read the first line in the Node.js docs: https://nodejs.org/api/vm.html#vm_vm_executing_javascript
Deno can run untrusted code in web workers if you constrain their permissions. They make for a more adequate sandbox. With just web workers you might be vulnerable to in process timing attacks. To prevent this, use deno subprocesses instead of workers.