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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-22686
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 15:29 UTC · Revision 1
Source evidence
Sandbox Escape via Host Error Prototype Chain in enclave-vm
core-osv · Original sourcePublished 13 Jan 2026, 23:11 UTC
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.
osv:CVE-2026-22686
Complete source record
{
"id": "a37e8abc67039bcccd62724a0021b6fa5ae0e85e323fcc89b93760739f27ede9",
"url": "https://osv.dev/vulnerability/CVE-2026-22686",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Sandbox Escape via Host Error Prototype Chain in enclave-vm",
"summary": "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.",
"evidence": "osv:CVE-2026-22686",
"products": [],
"severity": "critical",
"structured": {
"id": "CVE-2026-22686",
"aliases": [
"CVE-2026-22686",
"GHSA-7qm7-455j-5p63"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/agentfront/enclave",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "09f9b53177977469d33f08fe757c802565e2b708"
},
{
"fixed": "ed8bc438b2cd6e6f0b5f2de321e5be6f0169b5a1"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:agentfront:enclave:*:*:*:*:*:node.js:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "2.7.0"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "ed8bc438b2cd6e6f0b5f2de321e5be6f0169b5a1"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"enclave-vm@2.6.0",
"ast-guard@2.3.0",
"vectoriadb@2.0.2",
"enclave-vm@2.5.0",
"ast-guard@2.2.0",
"enclave-vm@2.4.0",
"ast-guard@2.1.0",
"enclave-vm@2.3.0",
"ast-guard@2.0.0",
"enclave-vm@2.2.0",
"ast-guard@1.1.2",
"enclave-vm@2.1.0",
"enclave-vm@2.0.0",
"vectoriadb@2.0.1",
"enclave-vm@1.0.3",
"ast-guard@1.1.1",
"vectoriadb@2.0.0",
"v2.0.0",
"enclave-vm@1.0.2",
"ast-guard@1.1.0",
"v1.1.0",
"v1.0.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-22686.json"
}
}
],
"modified": "2026-10-28T02:30:37.041245276Z",
"provider": "osv",
"references": [
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22686.json",
"https://github.com/agentfront/enclave/security/advisories/GHSA-7qm7-455j-5p63",
"https://nvd.nist.gov/vuln/detail/CVE-2026-22686",
"https://github.com/agentfront/enclave/commit/ed8bc438b2cd6e6f0b5f2de321e5be6f0169b5a1"
],
"provider_metadata": {
"cwe_ids": [
"CWE-693",
"CWE-94"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22686.json"
}
},
"related_cves": [
{
"value": "CVE-2026-22686",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 504131,
"published_at": "2026-01-13T23:11:49.098+00:00"
}