# enclave-vm 主机错误原型链沙箱逃逸漏洞
## 概述
Enclave 是一个用于安全执行 AI 代理代码的 JavaScript 沙箱环境。在版本 2.7.0 之前,其核心组件 enclave-vm 存在一个严重的沙箱逃逸漏洞。
## 影响版本
2.7.0 之前的所有版本。
## 细节
当工具调用失败时,enclave-vm 会将宿主 Node.js 环境中的 Error 对象暴露给沙箱内的未信任代码。该 Error 对象保留了宿主环境的原型链,攻击者可通过遍历该原型链访问宿主的 Function 构造函数。利用此构造函数,可在宿主上下文中动态编译并执行任意 JavaScript 代码。
## 影响
攻击者可借此完全绕过沙箱隔离机制,执行任意系统命令,访问敏感资源(如 `process.env`、文件系统和网络),破坏 enclave-vm 的核心安全保证。
是否为 Web 类漏洞: 未知
判断理由:
| # | POC 描述 | 源链接 | 神龙链接 |
|---|---|---|---|
| 1 | None | https://github.com/amusedx/CVE-2026-22686 | POC详情 |
标题: Sandbox Escape via Host Error Prototype Chain in enclave-vm · Advisory · agentfront/enclave · GitHub -- 🔗来源链接
标签:x_refsource_CONFIRM
神龙速读:
### 关键信息
#### 漏洞概述
- **漏洞名称**: Sandbox Escape via Host Error Prototype Chain in enclave-vm
- **CVE ID**: CVE-2026-22686
- **GHSA ID**: GHSA-7qm7-455j-5p63
#### 影响版本与修复版本
- **受影响版本**: <2.6.0
- **修复版本**: 2.7.0
#### 漏洞描述
- **严重性**: Critical (10.0/10)
- **CVSS v3.1**: AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
#### 漏洞细节
- A critical sandbox escape vulnerability exists in **enclave-vm** that allows untrusted, sandboxed JavaScript to execute arbitrary code in the host Node.js runtime.
- The vulnerability exposes a host-side **Error object** to sandboxed code, breaking the sandbox boundary and potentially granting access to sensitive resources like `process.env`, filesystem, and network.
#### 生态系统影响
- **FrontMCP / CodeCall**: Treat this as an urgent upgrade and ensure your runtime is on a patched enclave-vm version.
#### 时间线
- **修复发布**: Jan 9, 2026 (enclave-vm@2.7.0)
- **公告发布**: Jan 13, 2026
#### 缓解措施
- **立即行动**: 升级 **enclave-vm** to 2.7.0+
- **纵深防御建议**:
- Re-create all Error objects crossing the sandbox boundary inside the sandbox realm
- Strip / freeze prototype chains of host objects
- Prevent access to host `Function` constructors
- Harden tool error handling to avoid leaking host-native objects
#### 参考资料
- [GitHub Security Advisory](https://www.github.com/security/advisories/GHSA-7qm7-455j-5p63)
- [npm package](https://www.npmjs.com/package/enclave-vm)
- [Enclave repo](https://github.com/agentfront/enclave)
- [FrontMCP docs](https://agentfront.dev/docs)
- [CodeCall plugin overview](https://agentfront.dev/docs/plugins/overview)
- [EnclaveVM Playground](https://enclave.agentfront.dev/)
标题: fix: enhance security by implementing safe error handling (#29) · agentfront/enclave@ed8bc43 · GitHub -- 🔗来源链接
标签:x_refsource_MISC
Zaproxy alias impedit expedita quisquam pariatur exercitationem. Nemo rerum eveniet dolores rem quia dignissimos.