fix: Fix security issue in vm2 via minor version upgrade from 3.10.5 to 3.11.2#29772
fix: Fix security issue in vm2 via minor version upgrade from 3.10.5 to 3.11.2#29772aikido-autofix[bot] wants to merge 1 commit intomasterfrom
Conversation
|
Hey @aikido-autofix[bot], Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request. Before we can proceed, please ensure the following: Regarding new nodes: If your node integrates with an AI service that you own or represent, please email nodes@n8n.io and we will be happy to discuss the best approach. About review timelines: Thank you again for contributing to n8n. |
There was a problem hiding this comment.
No issues found across 2 files
Architecture diagram
sequenceDiagram
participant App as n8n Application
participant Pkg as package.json / catalog
participant NPM as npm Registry
participant VM2 as vm2 Sandbox (runtime)
participant Guest as Untrusted Guest Code
participant Host as Host System (Node.js)
Note over App,Host: Dependency Upgrade: vm2 3.10.5 → 3.11.2 (no breaking changes)
App->>Pkg: Read vm2 version constraint
Pkg-->>App: "vm2": "3.11.2"
App->>NPM: Fetch vm2@3.11.2 package
NPM-->>App: Install vm2 3.11.2 (sandbox engine)
Note over VM2,Guest: Sandbox Initialization (unchanged API)
App->>VM2: new NodeVM(options)
VM2->>VM2: Initialize with patched isolation layer
VM2->>Guest: Execute untrusted code in sandbox
alt Guest tries known exploit vectors (3.10.5)
Guest->>VM2: Attempt proxy handler leak (CVE AIKIDO-2026-10718)
VM2-->>Guest: BLOCKED - Proxy handlers now hardened
Guest->>VM2: Try cross-realm symbol extraction (CVE AIKIDO-2026-10719)
VM2-->>Guest: BLOCKED - Symbol isolation enforced
Guest->>VM2: Attempt prototype pollution via write traps (CVE AIKIDO-2026-10721)
VM2-->>Guest: BLOCKED - Host prototypes protected
Guest->>VM2: Try module policy bypass via Module._load (CVE AIKIDO-2026-10722)
VM2-->>Guest: BLOCKED - Module loading policy enforced
Guest->>VM2: Exploit exception handling to leak constructors (CVE AIKIDO-2026-10731)
VM2-->>Guest: BLOCKED - Error objects sanitized
Guest->>VM2: Attempt property descriptor lookup (__lookupGetter__) (CVE AIKIDO-2026-10716)
VM2-->>Guest: BLOCKED - Inspection paths secured
Guest->>VM2: Manipulate inspection surfaces (CVE AIKIDO-2026-10717)
VM2-->>Guest: BLOCKED - Representation leakage fixed
Guest->>VM2: Exploit promise error structures (CVE AIKIDO-2026-10720)
VM2-->>Guest: BLOCKED - Promise handling hardened
Guest->>VM2: Trigger Array.prototype setter via bridge restore (CVE AIKIDO-2026-10730)
VM2-->>Guest: BLOCKED - Saved state restore fixed
Guest->>VM2: Require vm2 builtin when nesting enabled (CVE AIKIDO-2026-10689)
VM2-->>Guest: BLOCKED - Nested access restricted
else Normal guest execution
Guest->>VM2: Run user-provided code
VM2->>VM2: Execute within security boundaries
alt Resource limits enforced
Guest->>VM2: Allocate extremely large Buffer (CVE AIKIDO-2026-10724)
VM2->>VM2: Memory limit triggered, allocation denied
VM2-->>Guest: Error: Sandbox denied allocation
end
VM2-->>Guest: Sandboxed result (no host access)
end
Note over VM2,Host: All exploits that would succeed in 3.10.5 are now blocked
alt Guest attempts symlink path traversal (CVE AIKIDO-2026-10728)
Guest->>VM2: Require module via symlink outside root
VM2->>VM2: Canonicalize path via realpath
alt Path outside allowed root
VM2-->>Guest: BLOCKED - path traversal prevented
else Path inside allowed root
VM2->>Host: Load module (allowed)
Host-->>VM2: Module content
VM2-->>Guest: Module provided
end
end
VM2-->>App: Return sandbox execution result
App->>App: Continue normal processing
Upgrade vm2 to fix critical sandbox escape vulnerabilities including RCE via proxy handler leaks, cross-realm symbol extraction, prototype pollution, module loading policy bypass, and exception handling exploits.
✅ There are no breaking changes
✅ 17 CVEs resolved by this upgrade, including 10 critical 🚨 CVEs
This PR will resolve the following CVEs:
module-family builtins andModule._load, circumventing the curated allowlist. This enables unauthorized access to capabilities that should be denied by the sandbox policy.__lookupGetter__-style paths, breaking sandbox isolation and enabling remote code execution on the host.require.rootrestriction through symlinked entries, enabling sandbox escape and arbitrary code execution. The fix implements path canonicalization usingrealpathto properly enforce directory boundaries.Buffer.allocwith extremely large sizes to exhaust host heap memory, causing denial of service against the embedding process. This bypasses typical timeout protections, as memory allocation is not network-bound..thenhandling and null-prototype edge cases, enabling access to raw host objects that should remain outside guest reach.prepareStackTraceintegration leaks sensitive host information including filesystem paths and deployment environment details to untrusted guest code, resulting in information disclosure about the host system.globalThis, allowing attackers to reference private state and weaken the guest isolation boundary for use in exploit chains.withstatements and unicode-escaped identifiers to access privileged internal state, enabling remote code execution outside the sandbox.🔗 Related Tasks