vm2 has Memory Exhaustion DoS via bufferAllocLimit Bypass
The vm2 sandbox module has a vulnerability in its buffer allocation limit defense that can be bypassed using ArrayBuffer, SharedArrayBuffer, or TypedArray constructors. These constructors allocate host memory through the same underlying C++ path as Buffer.alloc but are not subject to the bufferAllocLimit cap. This allows an attacker to exhaust host memory synchronously, causing a denial of service by out-of-memory kills in constrained environments such as Docker, Kubernetes, or AWS Lambda. The vulnerability affects vm2 versions prior to 3.11.6 and all Node.js versions. A patch is available.
AI Analysis
Technical Summary
The bufferAllocLimit option in vm2 (version 3.11.0 and later) is designed to cap memory allocations via Buffer.alloc and related Buffer constructors to prevent excessive memory use. However, this defense is bypassed because ArrayBuffer, SharedArrayBuffer, and all TypedArray constructors allocate memory through the same V8/libuv C++ allocation path but are not intercepted by the bufferAllocLimit check. This allows an attacker to allocate large amounts of memory synchronously, which cannot be interrupted by V8's timeout mechanism, leading to host process memory exhaustion and denial of service. The vulnerability affects vm2 versions before 3.11.6 and is exploitable in any Node.js environment. The attack complexity is low, and the impact is a complete availability loss due to out-of-memory kills in memory-constrained environments.
Potential Impact
This vulnerability enables an attacker to cause a denial of service by exhausting the host system's memory through large synchronous allocations using ArrayBuffer or TypedArray constructors inside the vm2 sandbox. The host process can be killed by the operating system's out-of-memory (OOM) killer, especially in environments with strict memory limits such as Docker containers, Kubernetes pods, or AWS Lambda functions. The attack requires no privileges or user interaction and bypasses the intended bufferAllocLimit protection, resulting in a high availability impact.
Mitigation Recommendations
A patch is available for vm2 that addresses this vulnerability. Operators should upgrade to vm2 version 3.11.6 or later to ensure the bufferAllocLimit defense properly covers all memory allocation paths including ArrayBuffer and TypedArray constructors. Until patched, relying solely on bufferAllocLimit does not prevent memory exhaustion via these bypass methods.
vm2 has Memory Exhaustion DoS via bufferAllocLimit Bypass
Description
The vm2 sandbox module has a vulnerability in its buffer allocation limit defense that can be bypassed using ArrayBuffer, SharedArrayBuffer, or TypedArray constructors. These constructors allocate host memory through the same underlying C++ path as Buffer.alloc but are not subject to the bufferAllocLimit cap. This allows an attacker to exhaust host memory synchronously, causing a denial of service by out-of-memory kills in constrained environments such as Docker, Kubernetes, or AWS Lambda. The vulnerability affects vm2 versions prior to 3.11.6 and all Node.js versions. A patch is available.
CVSS v3.1
Score 7.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The bufferAllocLimit option in vm2 (version 3.11.0 and later) is designed to cap memory allocations via Buffer.alloc and related Buffer constructors to prevent excessive memory use. However, this defense is bypassed because ArrayBuffer, SharedArrayBuffer, and all TypedArray constructors allocate memory through the same V8/libuv C++ allocation path but are not intercepted by the bufferAllocLimit check. This allows an attacker to allocate large amounts of memory synchronously, which cannot be interrupted by V8's timeout mechanism, leading to host process memory exhaustion and denial of service. The vulnerability affects vm2 versions before 3.11.6 and is exploitable in any Node.js environment. The attack complexity is low, and the impact is a complete availability loss due to out-of-memory kills in memory-constrained environments.
Potential Impact
This vulnerability enables an attacker to cause a denial of service by exhausting the host system's memory through large synchronous allocations using ArrayBuffer or TypedArray constructors inside the vm2 sandbox. The host process can be killed by the operating system's out-of-memory (OOM) killer, especially in environments with strict memory limits such as Docker containers, Kubernetes pods, or AWS Lambda functions. The attack requires no privileges or user interaction and bypasses the intended bufferAllocLimit protection, resulting in a high availability impact.
Mitigation Recommendations
A patch is available for vm2 that addresses this vulnerability. Operators should upgrade to vm2 version 3.11.6 or later to ensure the bufferAllocLimit defense properly covers all memory allocation paths including ArrayBuffer and TypedArray constructors. Until patched, relying solely on bufferAllocLimit does not prevent memory exhaustion via these bypass methods.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-v836-6xw4-9cx3
- Osv Schema Version
- 1.4.0
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a838cd9bf8831d539b5ef20
Added to database: 08/17/2026, 22:36:09 UTC
Last enriched: 08/17/2026, 22:41:19 UTC
Last updated: 08/17/2026, 23:05:16 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.