<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Vm2 (&lt;= 3.10.4) — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/vm2--3.10.4/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/vm2--3.10.4/feed.xml" rel="self" type="application/rss+xml"/><item><title>VM2 Sandbox Escape via __lookupGetter__ Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-vm2-sandbox-breakout/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-vm2-sandbox-breakout/</guid><description>VM2 is vulnerable to a sandbox breakout via the `__lookupGetter__` method, enabling attackers to execute arbitrary commands on the host system by exploiting context switching and property descriptor manipulation, leading to remote code execution.</description><content:encoded><![CDATA[<p>The vm2 library, a popular Node.js sandbox environment, is susceptible to a critical sandbox breakout vulnerability. This flaw allows malicious code executed within the vm2 sandbox to escape its confines and execute arbitrary commands on the host operating system. The vulnerability leverages the <code>__lookupGetter__</code> method to bypass context isolation and gain access to host-level functions and objects. Previous attempts to mitigate similar issues were circumvented using <code>Object.getOwnPropertyDescriptor</code> to access the constructor property. The vulnerability affects vm2 versions 3.10.4 and earlier. Exploitation allows an attacker to achieve remote code execution with the privileges of the Node.js process running the vm2 sandbox, which could lead to significant system compromise.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker injects malicious JavaScript code into the vm2 sandbox.</li>
<li>The injected code retrieves the <code>__lookupGetter__</code> method, which is used to access the getter of an object.</li>
<li>The malicious code obtains the <code>apply</code> method from the <code>Buffer</code> object within the sandbox.</li>
<li>The <code>apply</code> method is used to invoke the host version of <code>__lookupGetter__</code> with <code>Buffer</code> and <code>__proto__</code> as arguments, gaining access to the host&rsquo;s prototype lookup method.</li>
<li>The host&rsquo;s <code>Function.prototype</code> object is retrieved using the prototype lookup method.</li>
<li>The <code>constructor</code> property of the <code>Function.prototype</code> object is accessed using <code>Object.getOwnPropertyDescriptor</code> to bypass previous mitigation attempts.</li>
<li>The host <code>Function</code> constructor is used to create a new function that returns the <code>process</code> object, granting access to Node.js runtime functions on the host.</li>
<li>The code then uses <code>child_process.execSync</code> to execute arbitrary commands on the host system (e.g., <code>touch pwned</code>).</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows attackers to execute arbitrary code on the host system. Given the critical nature of many applications that employ sandboxing, this can lead to complete system compromise, data exfiltration, and denial of service. The vulnerability affects vm2 versions up to and including 3.10.4. The impact includes remote code execution, potentially leading to sensitive data exposure, system takeover, or further lateral movement within a network.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to a patched version of vm2 greater than 3.10.4 to remediate CVE-2026-24118.</li>
<li>Implement strict input validation and sanitization to minimize the risk of malicious code injection into the vm2 sandbox.</li>
<li>Monitor process creation events on the host system for suspicious activity originating from Node.js processes, which may indicate a sandbox escape (see the process_creation Sigma rule below).</li>
<li>Monitor for the execution of commands such as <code>child_process.execSync</code> called from within vm2 sandboxes to detect potential exploitation attempts (see the <code>nodejs_child_process_exec</code> Sigma rule).</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>sandbox-escape</category><category>rce</category><category>vm2</category></item></channel></rss>