🇰🇷 한글 설명
vm2 3.10.5의 NodeVM은 파일시스템 심볼릭 링크를 이용하여 require.root 경로 제한을 우회할 수 있습니다. 경로 검증은 symlink를 역참조하지 않는 path.resolve()를 사용하지만, 모듈 로딩은 Node의 native require()를 사용하므로 공격자가 허용된 루트 디렉토리 외부의 임의 모듈을 로드하고 원격 코드 실행을 달성할 수 있습니다.
💡 쉬운 설명
vm2 샌드박스가 심볼릭 링크를 통해 우회되어 악의적인 코드가 제한된 영역 밖의 파일에 접근할 수 있습니다. 공격자가 시스템에서 임의의 프로그램을 실행할 수 있게 됩니다.
🇺🇸 원문 (English)
vm2 is an open source vm/sandbox for Node.js. In 3.10.5, NodeVM's require.root path restriction can be bypassed using filesystem symlinks, allowing sandboxed code to load modules from outside the allowed root directory in host context. Because path validation uses path.resolve() (which does not dereference symlinks) but module loading uses Node's native require() (which does), an attacker can load arbitrary host-realm modules and achieve remote code execution. This vulnerability is fixed in 3.11.0.
📍 영향받는 시스템
vm2 3.10.5 이하 버전 (Node.js npm 패키지)
⚔️ 공격 벡터
require.root 경로 제한을 우회하는 심볼릭 링크 생성 후 샌드박스 외부 모듈 로드
🛡️ 대응 방법
vm2를 3.11.0 이상으로 업데이트 (npm install vm2@latest)
🔧 검증 코드
출력된 버전이 3.11.0 이상이면 안전, 3.10.5 이하면 즉시 업데이트 필요
npm ls vm2 --depth=0 2>/dev/null | grep -oE 'vm2@[0-9]+\.[0-9]+\.[0-9]+'