Skip to content

Is there Deno VM like NodeJS.vm ? #11269

Answered by lucacasonato
skaneprime asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@lucacasonato
Comment options

@kitsonk
Comment options

@skaneprime
Comment options

@skaneprime
Comment options

@skaneprime
Comment options

Answer selected by skaneprime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #11267 on July 04, 2021 14:31.