🇰🇷 한글 설명
vm2 3.11.7 이하 버전에서 NodeVM이 호스트의 `util` 모듈을 필터링 없이 샌드박스에 노출하여 발생하는 취약점입니다. Node.js 22.9 이상 환경에서 `util.getCallSites()`를 호출하면 호스트 프로세스의 전체 호출 스택과 절대 파일 경로 등 민감한 정보가 노출될 수 있습니다. 이는 이전의 보안 패치를 우회하여 샌드박스 내부의 격리 기능을 무력화합니다.
💡 쉬운 설명
샌드박스라는 안전한 격리 공간에서 실행 중인 코드가 실제 컴퓨터의 내부 파일 경로와 프로그램 구조를 훔쳐볼 수 있는 보안 구멍입니다. 공격자가 이 정보를 이용해 시스템의 구조를 파악하고 더 큰 공격을 준비할 수 있습니다.
🇺🇸 원문 (English)
vm2 is a sandbox for running untrusted Node.js code. In versions <= 3.11.7, NodeVM exposes the host `util` module to the sandbox as an unfiltered shallow copy (`Object.assign({}, util)` in `defaultBuiltinLoaderUtil`), and the deprecated `sys` builtin (an alias of host `util`) is exposed through the generic builtin loader. On Node.js >= 22.9 this hands sandboxed code `util.getCallSites()`, a programmatic stack-introspection API that returns the host process's full call stack, including absolute file paths, function names, and line numbers for vm2 bridge internals and the embedding application's entrypoint. This bypasses the host-frame redaction introduced for GHSA-v27g-jcqj-v8rw, which only applies to the `Error.prepareStackTrace` formatting channel. The issue is fixed in vm2 3.11.8.
📍 영향받는 시스템
vm2 versions <= 3.11.7 (특히 Node.js >= 22.9 환경에서 위험)
⚔️ 공격 벡터
샌드박스 내에서 노출된 `util.getCallSites()` API를 호출하여 호스트 프로세스의 스택 트레이스 및 파일 경로 탈취
🛡️ 대응 방법
vm2 버전을 3.11.8 이상으로 업데이트
🔧 검증 코드
출력된 버전이 3.11.7 이하이면 취약한 상태이며, 3.11.8 이상이어야 안전합니다.
npm list vm2 | grep -E 'vm2@([0-9]+\.[0-9]+\.[0-9]+)'