Node's vm module and Python's exec are not sandboxes, and in-process isolation fails
A DEV Community post argues that common agent-tool approaches to running model-written code, Node's vm module, vm2, and Python's exec with stripped builtins, do not provide real isolation. Both the Node.js and Python documentation explicitly warn against using these mechanisms for untrusted code. The author demonstrates a Node escape in which code inside a vm context reaches the host's process object through constructor chains, reproduced on Node 24. The post also cites CVE-2023-37466, a vm2 sandbox escape, after which vm2 was discontinued in favor of isolated-vm. It further notes that Python's exec sandboxing can be bypassed by walking object subclasses to recover dangerous functionality.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in