Skip to main content

vm2 CVE-2026-44004

HIGH
Allocation of Resources Without Limits or Throttling (CWE-770)
2026-05-07 https://github.com/patriksimek/vm2 GHSA-6785-pvv7-mvg7
7.5
CVSS 3.1 · Vendor: https://github.com/patriksimek/vm2
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Identify vm2 execution endpoint
  2. Delivery
    Craft Buffer.alloc payload
  3. Exploit
    Send HTTP POST with malicious code
  4. Install
    Bypass timeout mechanism via native call
  5. C2
    Allocate unbounded heap memory
  6. Execute
    Trigger OOM condition
  7. Impact
    Crash 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

npm vm2 fix: 3.11.0

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

Vendor (https://github.com/patriksimek/vm2) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat 8.6 HIGH

Primary rating from Vendor (https://github.com/patriksimek/vm2).

CVSS VectorVendor: https://github.com/patriksimek/vm2

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

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 timeout option works
  • Buffer.alloc(N): Executes as a single synchronous C++ call - V8 timeout has no opportunity to interrupt

This means:

  1. timeout: 5000 does NOT protect against this attack
  2. A single call allocates the entire requested size at once
  3. 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):

javascript
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):

bash
# 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.alloc

Impact

  • DoS: A single HTTP request crashes the host Node.js process via OOM. The timeout option 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 limit was 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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.0%
Top 88% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:npm/vm2

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2026-66384 MEDIUM POC
5.3 Aug 12

Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-52806 CRITICAL POC
9.9 Jun 23

Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config

CVE-2025-14707 HIGH POC
8.9 Dec 15

Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system

CVE-2026-56274 HIGH POC
8.7 Jun 23

Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy