Описание
Sandbox escape via infinite recursion and error objects
Note: The npm package has moved to @enclave-vm/core (formerly enclave-vm).
All fixed versions and guidance refer to @enclave-vm/core.
Summary
The existing layers of security in enclave-vm are insufficient: The AST sanitization can be bypassed with dynamic property accesses, the hardening of the error objects does not cover the peculiar behavior or the vm module and the function constructor access prevention can be side-stepped by leveraging host object references.
Details
There is a bug in Node.js (https://www.staicu.org/publications/usenixSec2023-SandDriller.pdf) that makes the vm module leak host references inside the vm module in case of infinite recursion. An attacker can exploit these to escape the sandbox.
PoC
The following on was tested on Node.js v24.12.0 and enclave-vm 2.7.0.
Impact
Sandbox escape and potential other escalations on FrontMCP/AgentFront/other Frontegg products.
Пакеты
enclave-vm
<= 2.7.0
Отсутствует
@enclave-vm/core
< 2.10.1
2.10.1