Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-22709: CWE-94: Improper Control of Generation of Code ('Code Injection') in patriksimek vm2

0
Critical
VulnerabilityCVE-2026-22709cvecve-2026-22709cwe-94cwe-913cwe-693
Published: Mon Jan 26 2026 (01/26/2026, 21:32:00 UTC)
Source: CVE Database V5
Vendor/Project: patriksimek
Product: vm2

Description

vm2 is an open source vm/sandbox for Node.js. In vm2 prior to version 3.10.2, `Promise.prototype.then` `Promise.prototype.catch` callback sanitization can be bypassed. This allows attackers to escape the sandbox and run arbitrary code. In lib/setup-sandbox.js, the callback function of `localPromise.prototype.then` is sanitized, but `globalPromise.prototype.then` is not sanitized. The return value of async functions is `globalPromise` object. Version 3.10.2 fixes the issue.

AI-Powered Analysis

AILast updated: 01/27/2026, 19:09:13 UTC

Technical Analysis

The vulnerability CVE-2026-22709 affects vm2, an open-source sandbox library for Node.js designed to safely execute untrusted code. The root cause is improper control over code generation, specifically a code injection flaw (CWE-94). In vm2 versions before 3.10.2, the sanitization mechanism intended to prevent malicious code execution in Promise callbacks is incomplete. The library sanitizes the callback function of localPromise.prototype.then but neglects to sanitize globalPromise.prototype.then. Since async functions return globalPromise objects, attackers can exploit this discrepancy to bypass the sandbox's security controls. This allows arbitrary code execution outside the sandbox environment, potentially compromising the host system. The vulnerability is exploitable remotely without authentication or user interaction, as indicated by the CVSS vector (AV:N/AC:L/PR:N/UI:N). The impact spans confidentiality, integrity, and availability, making it a critical security risk. The fix was introduced in vm2 version 3.10.2, which properly sanitizes all Promise callbacks to close this bypass. No known exploits have been reported yet, but the high severity and ease of exploitation make timely patching imperative.

Potential Impact

For European organizations, this vulnerability poses a significant threat, especially those leveraging vm2 for sandboxing untrusted or third-party JavaScript code in Node.js applications. Successful exploitation can lead to full system compromise, data breaches, and disruption of critical services. Sectors such as finance, healthcare, telecommunications, and government agencies that rely on secure code execution environments are particularly vulnerable. The ability to execute arbitrary code without authentication or user interaction increases the risk of widespread exploitation, potentially affecting cloud services, internal applications, and developer tools. The breach of sandbox isolation can also facilitate lateral movement within networks, exacerbating the impact. Given the critical CVSS score and the nature of the vulnerability, organizations face risks to confidentiality, integrity, and availability of their systems and data.

Mitigation Recommendations

Organizations should immediately upgrade vm2 to version 3.10.2 or later, where the vulnerability is patched. For environments where immediate upgrading is not feasible, consider disabling or restricting the use of vm2 sandboxes, especially in contexts processing untrusted code. Implement strict code review and validation processes for any code executed within vm2. Employ runtime monitoring and anomaly detection to identify suspicious behavior indicative of sandbox escape attempts. Additionally, isolate systems running vm2 sandboxes using network segmentation and least privilege principles to limit potential damage. Regularly audit dependencies and maintain an up-to-date inventory of Node.js packages to quickly identify vulnerable versions. Finally, educate developers and security teams about the risks associated with sandbox bypass vulnerabilities and the importance of timely patching.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-01-08T19:23:09.857Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 69790cec4623b1157c4004b0

Added to database: 1/27/2026, 7:07:24 PM

Last enriched: 1/27/2026, 7:09:13 PM

Last updated: 1/27/2026, 10:13:21 PM

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats