Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit untrusted script to vm2 sandbox
-
DeliveryAllocate pooled Buffer, read .buffer getter
-
ExploitObtain entire 64KiB host pool ArrayBuffer
-
ExecutionBuild full-width view over pool
-
ImpactRead and overwrite neighboring host secrets
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V14 - Data Protection Data exposure prevention
MITRE ATT&CK
2 techniques across 2 tactics: Collection, Discovery The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the embedding application to explicitly expose Node's zlib module to the sandbox via NodeVM's builtin allowlist (require: { builtin: ['zlib'] }) - this is a NON-DEFAULT configuration; a stock vm2 sandbox without zlib exposure is not affected via this vector. It also requires the application to run attacker-controlled/untrusted guest JavaScript in vm2 (vm2's intended use), and for host secrets to be co-resident in Node's shared 64 KiB small-buffer pool at exploitation time. Limiting factors: the vulnerable product must be a pre-3.12.2 vm2 instance, zlib must be allowlisted, and success against specific host secrets depends on pool residency timing. No user interaction beyond running the untrusted script is needed. |
| Impact | The vendor CVSS 4.0 base score is 6.9 (Medium), and the vector is internally telling: it scores the vulnerable system as VC:N/VI:N/VA:N but the subsequent (host) system as SC:H/SI:L - correctly modeling this as a sandbox-to-host escape where the damage lands on the host realm, not the sandbox. AT:P (Attack Requirements: Present) captures the essential non-default gate: exploitation only becomes possible when the embedding application explicitly adds Node's zlib to the NodeVM builtin allowlist (require: { builtin: ['zlib'] }), which is NOT a default configuration. PR:N is accurate in the sense that guest script code is inherently untrusted and unauthenticated within the sandbox threat model - that is vm2's entire purpose. There is NO EPSS score and NO CISA KEV listing in the provided data, so there is no signal of active or widespread exploitation; the reporter is VulnCheck and the advisory (GHSA-489w-w794-jq94 / the code references GHSA-fcqc-726x-5wfc) contains proof-grade mechanics and canonical exploit snippets, so publicly available exploit code effectively exists. This is a real defense-in-depth failure with confirmed patch and clear technical PoC, but real-world priority is tempered by three factors: (1) the non-default zlib exposure requirement, (2) vm2 being officially deprecated (maintainers recommend migration away from it), and (3) no exploitation-in-the-wild signal. Note the CWE tagging: the advisory explicitly cites CWE-200 (disclosure) PLUS CWE-787 (out-of-bounds write / corruption), so labeling this purely 'Information Disclosure' understates the integrity impact - the sandbox can both read AND overwrite neighboring host buffers (secrets, tokens, DB rows). |
| Exploit ScenarioDerived | An application uses vm2 (< 3.12.2) to run untrusted third-party or user-submitted JavaScript and has explicitly exposed Node's zlib module to the sandbox via require: { builtin: ['zlib'] }. Because zlib.deflateSync returns a Buffer backed by Node's shared 64 KiB small-buffer pool, the guest reads result.buffer to obtain the entire pool ArrayBuffer, builds a full-width Buffer.from(pool, 0, 65536) view, and reads/overwrites host secrets (session tokens, DB rows, decrypted material) that happen to share the pool. Canonical exploit code exists in the vendor advisory (VulnCheck / GHSA), including the diagnostic Buffer.from([0]).buffer.byteLength === 65536 leak proof. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 27, 2026
Information disclosure and cross-boundary host memory corruption in vm2 before 3.12.2 let untrusted guest JavaScript read and modify bytes outside the sandbox whenever the embedding application explicitly allowlists Node's zlib builtin via require: { builtin: ['zlib'] }. vm2 fails to apply its Buffer backing-store ownership invariant (byteOffset = 0 && buffer.byteLength = length) to Buffers returned from host builtin modules, so zlib.deflateSync can hand back a pooled buffer whose .buffer getter exposes Node's entire 64 KiB shared small-buffer pool; a guest then builds a full-width view with Buffer.from(result.buffer, 0, result.buffer.byteLength) to disclose secrets (session tokens, decrypted material, DB rows) and corrupt unrelated host buffers sharing that pool. This is not reachable in a default vm2 deployment - it requires a non-default zlib allowlist, attacker-controlled script execution, and host secrets co-resident in the pool at exploitation time - and no public exploit code was identified at time of analysis; the vendor rates it CVSS 4.0 6.9 (Medium) with a vendor-released patch in 3.12.2.
RemediationAI
Upgrade to vm2 3.12.2 or later - vendor-released patch 3.12.2, delivered by commits 4f2508abeb252aa86eb6761c78b3b000248fb089 and 5214b02ef13b82497fcb917b45320dfd014ffd09, which enforce the backing-store ownership invariant (byteOffset = 0 && buffer.byteLength = length) for every pooling factory and copy pool-backed results into standalone non-pooled buffers while preserving the documented Buffer.from(arrayBuffer, byteOffset, length) sharing overload behind a spoof-proof brand test. If immediate upgrading is not possible, the most direct compensating control is to remove 'zlib' (and any other builtin whose methods return Buffers) from the NodeVM builtin allowlist so host-realm Buffers never cross into the sandbox; the trade-off is that in-sandbox compression/decompression stops working, so move deflate/inflate work to the host side and pass already-transformed data, and treat every allowlisted builtin as a potential buffer-leak path. Do not rely on bufferAllocLimit tuning or on generic memory limits - the upstream fix notes this issue is independent of bufferAllocLimit, so those settings neither trigger nor mitigate it. Where the untrusted workload cannot be constrained, isolate the vm2 process so host secrets are not co-resident in the same process heap and shared small-buffer pool, accepting the operational cost of process separation; also review whether legitimate host credentials or session material are created on the same tick as sandboxed execution, since exploitation depends on pool residency timing. Vendor advisory: https://github.com/patriksimek/vm2/security/advisories/GHSA-489w-w794-jq94.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
vm2 is a Node.js sandbox library that runs untrusted guest JavaScript inside a separate V8 realm and bridges host objects and builtins across a Proxy-based membrane. The root cause is CWE-200 (Information Exposure), with the upstream changelog additionally classifying it as CWE-787 (Out-of-bounds Write) because the same primitive is read/write, not read-only. Node.js serves small Buffer.from(...), Buffer.concat(...), Buffer.of(...), Buffer.copyBytesFrom(...) and Buffer.allocUnsafe(...) allocations out of one shared backing ArrayBuffer of Buffer.poolSize bytes (64 KiB on modern Node, 8 KiB on Node 8). A pooled buffer's .buffer getter (Uint8Array.prototype.buffer) returns that whole pool rather than the buffer's own slice, at a non-zero byteOffset and with a much larger byteLength. vm2's invariant normally requires that any Buffer crossing the sandbox boundary be a standalone, non-pooled backing store (byteOffset = 0 and buffer.byteLength = length); the fix notes this was applied to the ordinary pooling factories but not to Buffers produced by host builtin modules reachable through NodeVM's builtin allowlist. When an application opts in with require: { builtin: ['zlib'] }, zlib.deflateSync executes in the host realm and returns a pool-backed Buffer, and the legacy Buffer.from(arrayBuffer, byteOffset, length) sharing overload - legitimately preserved for real ArrayBuffers - becomes the vehicle for a full-width view. The .buffer getter is an ordinary getter on a bridge-proxied Uint8Array, so no capability check intercepts it; the exposed bytes are genuinely part of the sandbox's own ArrayBuffer while simultaneously belonging to every host buffer packed in the same pool. Affected CPE: cpe:2.3:a:patriksimek:vm2. The upstream fix is independent of the bufferAllocLimit DoS control, so tuning that limit does not mitigate this issue. The independent assessment vectors this as CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N - network-reachable but with high attack complexity, scope-changed, unauthenticated (PR:N), with high confidentiality and low integrity impact landing on the host system (SC:H/SI:L) rather than the sandbox itself.
Know when Vm2 gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:L/SA:N
Untrusted sandbox code (PR:N) escapes to the host realm (S:C) for read and write, but AC:H reflects the non-default zlib allowlist gate and pool-residency timing; C:H disclosure, I:L partial corruption, no availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
vm2 before 3.12.2 does not apply its Buffer backing-store ownership invariant (byteOffset = 0 and buffer.byteLength = length) to Buffers returned from host builtin modules. When an application explicitly exposes Node's zlib module through NodeVM's builtin allowlist (require: { builtin: ['zlib'] }), zlib.deflateSync can return a Buffer backed by Node's shared small-buffer pool whose .buffer is the entire pool. Untrusted guest code can construct a full-width view of that ArrayBuffer (Buffer.from(result.buffer, 0, result.buffer.byteLength)) to read and modify bytes belonging to unrelated host buffers, disclosing and corrupting host-realm memory across the sandbox boundary.
Blast Radius
ecosystem impact- 4,327 npm packages depend on vm2 (1,159 direct, 3,200 indirect)
Ecosystem-wide dependent count for version 3.12.2.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Related Vulnerabilities in vm2 Sandbox Escape and Authorization Bypass
View all 3vm2 is an advanced vm/sandbox for Node.js. Rated critical severity (CVSS 10.0), this vulnerability is remotely exploitab
vm2 is a sandbox that can run untrusted code with Node's built-in modules. Rated critical severity (CVSS 10.0), this vul
vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Rated critical severity (CVSS 10.
There exists a vulnerability in source code transformer (exception sanitization logic) of vm2 for versions up to 3.9.15,
vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Rated critical severity (CVSS 10.
This affects the package vm2 before 3.9.4 via a Prototype Pollution attack vector, which can lead to execution of arbitr
Full sandbox escape with arbitrary code execution allows remote attackers to break out of vm2's Node.js sandbox environm
Sandbox escape in vm2 for Node.js allows remote unauthenticated attackers to execute arbitrary commands on the host syst
Sandbox escape in vm2 (patriksimek/vm2) versions prior to 3.11.3 enables remote code execution on the host Node.js proce
Sandbox escape in vm2 Node.js sandbox before 3.10.2 via Promise.prototype.then/catch callback sanitization bypass. PoC a
vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules. Rated critical severity (CVSS 9.8
The package vm2 before 3.9.10 are vulnerable to Arbitrary Code Execution due to the usage of prototype lookup for the We
EUVD-2026-87856
GHSA-43rv-jrfh-9mrr
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB