🇰🇷 한글 설명
vm2는 Node.js용 오픈소스 샌드박스로, 3.11.0 이전 버전에서 builtin 화이트리스트 우회 취약점이 존재합니다. Module._load()를 노출하는 builtin 모듈을 통해 호스트 컨텍스트에서 직접 모듈을 로드할 수 있으며, 이를 이용해 child_process 등 제외된 내장 모듈에 접근하여 원격 코드 실행이 가능합니다.
💡 쉬운 설명
vm2는 Node.js 코드를 안전하게 격리시키는 샌드박스 도구입니다. 이 취약점을 통해 악의적인 코드가 샌드박스를 탈출하여 서버에서 임의의 명령을 실행할 수 있습니다.
🇺🇸 원문 (English)
vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.0, NodeVM's builtin allowlist can be bypassed when the module builtin is allowed (including via the '*' wildcard). The module builtin exposes Node's Module._load(), which loads any module by name directly in the host context, completely bypassing vm2's builtin restriction. This allows sandboxed code to load excluded builtins like child_process and achieve remote code execution. This vulnerability is fixed in 3.11.0.
📍 영향받는 시스템
vm2 < 3.11.0 (Node.js 애플리케이션)
⚔️ 공격 벡터
builtin 화이트리스트 활성화 시 Module._load()를 통해 제한된 모듈(child_process 등)을 직접 로드하여 RCE 달성
🛡️ 대응 방법
vm2를 3.11.0 이상으로 즉시 업그레이드
🔧 검증 코드
출력된 버전이 3.11.0 이상이면 안전하고, 3.11.0 미만이면 즉시 업그레이드 필요
npm list vm2 2>/dev/null | grep vm2 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1