CVE-2026-47131
Deferred Deferred - Pending Action
Prototype Pollution in vm2 Sandbox Escape

Publication date: 2026-06-12

Last updated on: 2026-06-12

Assigner: GitHub, Inc.

Description
vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, by combining Buffer.call.call({}.__lookupGetter__, Buffer, "__proto__"), Buffer.call.call({}.__lookupSetter__, Buffer, "__proto__"), and Node.js's ERR_INVALID_ARG_TYPE Error, the host's TypeError constructor can be obtained, which allows the escape from the sandbox. This allows attackers to run arbitrary code. This issue has been patched in version 3.11.4.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-06-12
Last Modified
2026-06-12
Generated
2026-06-12
AI Q&A
2026-06-12
EPSS Evaluated
N/A
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
patriksimek vm2 to 3.11.4 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-913 The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

CVE-2026-47131 is a security vulnerability in the vm2 library, which is a sandbox for Node.js. The vulnerability allows sandboxed code to escape the sandbox by manipulating the prototype chain of host objects. Specifically, attackers exploit the apply trap in the bridge that lets sandbox code call host functions with a host object as the 'this' context. By using prototype-mutating functions like the '__proto__' setter or 'Object.setPrototypeOf', attackers can break the bridge's prototype-walking helpers, causing host objects to be returned unwrapped to the sandbox.

Once the host object is accessible, attackers can use 'e.constructor.constructor' to reach the host's Function object and execute arbitrary code, such as spawning a shell. The vulnerability was demonstrated using a Proof-of-Concept involving Buffer and triggering a host TypeError.

The issue was fixed in vm2 version 3.11.4 by implementing a two-layer defense: blocking sandbox calls to prototype-mutating functions and ensuring wrapped host objects are returned to prevent unwrapped host objects from reaching the sandbox.

Impact Analysis

This vulnerability can have severe impacts as it allows attackers to escape the vm2 sandbox and execute arbitrary code on the host system. This means an attacker could run malicious commands, spawn shells, or take full control of the environment running the vulnerable vm2 version.

Because the CVSS base score is 10.0, it indicates a critical severity with network attack vector, no privileges required, no user interaction, and high impact on confidentiality, integrity, and availability.

Detection Guidance

This vulnerability can be detected by checking if your system is running a vulnerable version of the vm2 library prior to 3.11.4.

Since the exploit involves sandboxed code manipulating prototype chains and invoking host functions, detection involves verifying the vm2 version and monitoring for suspicious usage of prototype-mutating functions such as Object.prototype.__proto__ setter or Object.setPrototypeOf within sandboxed environments.

You can check the installed vm2 version by running the following command in your project directory:

  • npm list vm2

If you find a vulnerable version, you should also audit your logs or runtime behavior for unusual calls to prototype-mutating functions or unexpected errors related to Node.js ERR_INVALID_ARG_TYPE, which might indicate exploitation attempts.

Mitigation Strategies

The immediate step to mitigate this vulnerability is to upgrade the vm2 library to version 3.11.4 or later, where the issue has been patched.

The patch implements a two-layer defense that blocks sandbox-initiated calls to dangerous prototype-mutating functions and prevents unwrapped host objects from reaching the sandbox.

Additionally, review your sandbox usage to ensure that no untrusted code can invoke host functions or manipulate prototype chains.

Compliance Impact

The vulnerability in vm2 allows attackers to escape the sandbox and execute arbitrary code on the host system. This can lead to unauthorized access, modification, or exfiltration of sensitive data.

Such unauthorized access and potential data breaches can impact compliance with common standards and regulations like GDPR and HIPAA, which require strict controls over data confidentiality, integrity, and access.

If exploited, this vulnerability could result in violations of these regulations due to compromised data security and privacy.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-47131. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart