vm2 CVE-2026-44004
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconIdentify vm2 execution endpoint
-
DeliveryCraft Buffer.alloc payload
-
ExploitSend HTTP POST with malicious code
-
InstallBypass timeout mechanism via native call
-
C2Allocate unbounded heap memory
-
ExecuteTrigger OOM condition
-
ImpactCrash host process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource allocation limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | No special conditions-remote unauthenticated exploitation against default configurations of vm2 versions 3.10.5 and earlier. The vulnerability is exploitable in any deployment where untrusted code is passed to vm2's run() or runFile() methods, which is the library's primary use case. No specific vm2 configuration enables the flaw; the default behavior of exposing Buffer without size validation is sufficient. Attack success depends only on network reachability to the vm2-powered application endpoint and the target environment's memory constraints. The POC demonstrates exploitation requires no authentication (PR:N), no user interaction (UI:N), and low attack complexity (AC:L)-a single HTTP POST with a short JSON payload triggers immediate impact. Exploitation is NOT limited by the timeout configuration value (tested with timeout: 5000, attack succeeds identically). The severity multiplier is deployment environment: memory-constrained containers/Lambda functions experience process termination (HIGH impact), while traditional servers with elastic memory experience temporary performance degradation (MEDIUM impact). The attack does not require privileged access to the host system, non-default vm2 configuration options, or chaining with other vulnerabilities. |
| Impact | CVSS 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) accurately reflects the attack surface-network-reachable, low-complexity, no authentication required-but real-world risk is deployment-context dependent. In memory-constrained environments (Docker containers with --memory limits, Kubernetes pods with resource quotas, AWS Lambda with fixed memory allocations), this is a critical availability threat: a single 100-byte HTTP request can trigger immediate OOM process termination with FATAL ERROR: Reached heap limit, confirmed by vendor testing. Attack complexity is genuinely low-the POC requires no special conditions beyond vm2 being deployed with default configuration. However, in unconstrained server environments with elastic memory, impact downgrades to temporary performance degradation as V8 garbage collection reclaims memory post-request. EPSS score unavailable and no CISA KEV listing suggest no widespread exploitation campaigns detected, consistent with the targeted nature of vm2 deployments (sandboxed code execution platforms, serverless function runners, educational coding environments). The vendor coordinated disclosure across 13 simultaneous advisories in v3.11.0, indicating systematic security audit rather than active exploitation discovery. Priority assessment: HIGH for containerized/serverless deployments of vm2, MEDIUM for traditional server deployments with ample memory. The 1,000,000:1 amplification factor (100 bytes request → 100MB allocation) makes this attractive for resource-constrained attacker scenarios. |
| Exploit ScenarioDerived | An attacker identifies a web application using vm2 to provide serverless code execution (common in online coding platforms, webhook processors, or automated testing services). They craft a minimal HTTP POST request containing the payload {"code":"Buffer.alloc(1024*1024*500).length"} targeting the execution endpoint. The application passes this 58-byte string to vm2's run() method with a configured 5-second timeout intended to prevent abuse. Because Buffer.alloc() is a synchronous C++ call, the timeout mechanism never activates-the Node.js process immediately attempts to allocate 500MB on the heap. In a Kubernetes pod with a 512MB memory limit, the allocation exceeds available memory, triggering the Linux OOM killer to terminate the pod with exit code 137. The application becomes unavailable until the orchestrator restarts the pod (typically 10-30 seconds), during which all concurrent user requests fail. The attacker can repeat this with minimal resources-a single t2.micro EC2 instance can send requests faster than most container orchestrators can restart pods, sustaining indefinite service disruption. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 07, 2026
Denial-of-service in vm2 Node.js sandbox allows unauthenticated remote attackers to crash host processes via unbounded Buffer.alloc() calls. The vm2 library's timeout mechanism cannot interrupt synchronous C++ native calls, enabling attackers to bypass configured timeout limits and exhaust host heap memory with a single HTTP request. Version 3.11.0 patches this flaw by introducing bufferAllocLimit controls. Publicly available exploit code exists (GHSA-6785-pvv7-mvg7 includes working POC), and while EPSS data is unavailable and the vulnerability is not listed in CISA KEV, the vendor-confirmed POC demonstrates reliable exploitation against default configurations.
RemediationAI
Vendor-released patch: Upgrade to vm2 version 3.11.0 or later, available at https://github.com/patriksimek/vm2/releases/tag/v3.11.0. The patch introduces a new bufferAllocLimit configuration option that enforces size validation on Buffer.alloc() calls before forwarding to the native layer. After upgrading, configure memory limits appropriate to your use case-for example, new VM({ timeout: 5000, bufferAllocLimit: 10485760 }) restricts allocations to 10MB. If immediate upgrade is not feasible, implement these compensating controls with noted trade-offs: (1) Deploy vm2 processes in memory-limited containers (docker run --memory=512m) to contain blast radius-this converts host-wide OOM into container-level crash, enabling orchestrator restart but still causes request-level DoS; (2) Place rate-limiting and request size validation in front of vm2 execution endpoints-limit concurrent executions per client IP and reject requests exceeding reasonable code size thresholds, though sophisticated attackers can still trigger OOM within rate limits; (3) Monitor process memory usage and implement circuit-breaker patterns that reject new execution requests when memory utilization exceeds 80%-introduces false-positive rejections under legitimate high load. None of these workarounds address the root cause timeout bypass; they only limit impact scope. For production environments executing untrusted code, the vendor explicitly recommends upgrading: 'Embedders running untrusted code should upgrade' per release notes.
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
The vm2 library (pkg:npm/vm2) provides JavaScript sandboxing for Node.js by isolating untrusted code execution. The vulnerability stems from CWE-770 (Allocation of Resources Without Limits or Throttling) in how vm2 exposes Node.js Buffer objects to sandboxed contexts. In lib/vm.js:58, the Buffer constructor is passed through the HOST object bridge to sandboxed code without size validation. When sandboxed code calls Buffer.alloc(N), the request is forwarded to Node.js's native C++ implementation in V8/libuv, which performs a synchronous heap allocation. Unlike pure JavaScript operations that V8 can interrupt via timeout checks at bytecode boundaries, synchronous native calls execute atomically from V8's perspective-the timeout mechanism has no interrupt point. This architectural limitation means vm2's timeout option (designed to prevent infinite loops) cannot stop Buffer.alloc() from consuming arbitrary memory. The attack exploits the semantic gap between JavaScript-level resource controls and native C++ allocation primitives.
Know when Docker 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
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Primary rating from Vendor (https://github.com/patriksimek/vm2).
CVSS VectorVendor: https://github.com/patriksimek/vm2
DescriptionCVE.org
Summary
Sandboxed code can call Buffer.alloc() with an arbitrary size to allocate memory directly on the host heap. Because Buffer.alloc is a synchronous C++ native call, vm2's timeout option cannot interrupt it. A single request can exhaust host memory and crash the process with a FATAL ERROR: Reached heap limit.
Details
In lib/vm.js:58, Buffer is exposed to the sandbox through the HOST object. The bridge proxy (lib/bridge.js) passes Buffer.alloc() calls to the host without any size validation.
Key technical distinction from regular JavaScript memory exhaustion (e.g., while(true) a.push(...)):
- JavaScript loops: V8 can interrupt via timeout - vm2's
timeoutoption works Buffer.alloc(N): Executes as a single synchronous C++ call - V8 timeout has no opportunity to interrupt
This means:
timeout: 5000does NOT protect against this attack- A single call allocates the entire requested size at once
- In memory-constrained environments (Docker, Lambda, Kubernetes pods), this causes immediate OOM crash
Tested amplification factor: ~100 bytes HTTP request - 1,000,000:1 or greater (100 bytes request to 100MB+ host heap allocation).
PoC
Library-level PoC (Node.js script - primary):
const { VM } = require("vm2");
const vm = new VM({ timeout: 5000 });
// Buffer.alloc bypasses timeout - allocates 100MB on host heap
const result = vm.run(`Buffer.alloc(1024*1024*100).length`);
console.log(result); // 104857600 - timeout had no effect
// Control test - JavaScript loop IS caught by timeout
try {
vm.run(`var a=[]; while(true) a.push(1)`);
} catch(e) {
console.log(e.message); // "Script execution timed out after 5000ms"
}HTTP demonstration (OOM crash):
# 1. Confirm server is running
curl -s http://localhost:3000/api/execute \
-X POST -H "Content-Type: application/json" \
-d '{"code":"\"alive\""}'
# => {"result":"\"alive\""}
# 2. Send Buffer.alloc payload - process crashes with OOM
curl -s -X POST http://localhost:3000/api/execute \
-H "Content-Type: application/json" \
-d '{"code":"Buffer.alloc(1024*1024*100).length"}'
# => empty response (process died)
# 3. Check server logs:
# FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
# Control test - JavaScript loop IS caught by timeout:
curl -s -X POST http://localhost:3000/api/execute \
-H "Content-Type: application/json" \
-d '{"code":"var a=[]; while(true) a.push(1)"}'
# => {"errors":["Script execution timed out after 5000ms"]}
# Server stays alive - timeout works for JS, but NOT for Buffer.allocImpact
- DoS: A single HTTP request crashes the host Node.js process via OOM. The
timeoutoption provides no protection. - Environment-dependent severity:
- Memory-constrained environments (Docker with memory limits, Kubernetes pods, Lambda): The allocation exceeds the memory limit, causing immediate process termination via OOM. This is the primary threat scenario -
FATAL ERROR: Reached heap limitwas confirmed in testing. - Unconstrained environments: The allocation succeeds and memory is reclaimed by GC after the request completes, resulting in temporary performance degradation rather than a crash.
- Scope: All applications using vm2. Default configuration is vulnerable. Memory-constrained environments (Docker, Kubernetes, Lambda) are most severely impacted.
Executive ViewAI
CVE-2026-44004 is a denial-of-service vulnerability in the vm2 Node.js sandbox library that allows unauthenticated attackers to crash application host processes through unbounded memory allocation, affecting any organization running vulnerable versions of vm2 in production environments. A single HTTP request can exhaust server memory and disrupt service availability, creating immediate operational risk for applications relying on vm2 for code sandboxing.
Vendor-released patch: vm2 version 3.11.0 introduces bufferAllocLimit controls. If immediate patching is not feasible: (1) Implement strict input validation and request size limits at reverse proxy or API gateway layer, (2) Configure aggressive request rate limiting per source IP, (3) Monitor heap memory consumption and auto-restart applications exceeding thresholds, (4) Run affected services in isolated containers with memory cgroup limits to prevent cascade failure.
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
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Affected Products (CPE)CVE.org
Related Vulnerabilities in vm2 Sandbox Escape Vulnerabilities
View all 11An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac
Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post
Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten
Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build
Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config
Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system
Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per
Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l
Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c
GHSA-6785-pvv7-mvg7
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB