🇰🇷 한글 설명
vm2의 코드 변환기가 catch, import, async 키워드 없는 코드는 AST 검사를 건너뛰는 최적화로 인해, 공격자가 내부 VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL 변수에 직접 접근할 수 있습니다. 이를 통해 handleException, wrapWith, import 같은 내부 보안 함수가 노출되어 샌드박스 우회가 가능합니다.
💡 쉬운 설명
vm2는 Node.js에서 신뢰할 수 없는 코드를 안전하게 실행하는 도구인데, 특정 코드는 보안 검사를 건너뛰어 실행됩니다. 이 버그를 악용하면 샌드박스에서 벗어나 전체 시스템 권한으로 코드를 실행할 수 있습니다.
🇺🇸 원문 (English)
vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.0, vm2's code transformer has a performance optimization that skips AST analysis when the code does not contain catch, import, or async keywords. This fast-path bypass allows sandboxed code to directly access the internal VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL variable, which exposes internal security functions (handleException, wrapWith, import). This vulnerability is fixed in 3.11.0.
📍 영향받는 시스템
vm2 3.11.0 이전 모든 버전
⚔️ 공격 벡터
catch, import, async 키워드 없는 페이로드를 전달하여 내부 상태 변수 접근 및 보안 함수 호출
🛡️ 대응 방법
npm install vm2@>=3.11.0 실행하여 최신 버전으로 업그레이드
🔧 검증 코드
표시된 버전이 3.11.0 이상이면 안전, 3.10.x 이하면 즉시 업그레이드 필요
npm list vm2 --depth=0 2>/dev/null | grep -oP 'vm2@\K[\d.]+'