🇰🇷 한글 설명
vm2 3.11.2 이전 버전에서 neutralizeArraySpeciesBatch 메서드의 배열 프로토타입 getter를 악용하여 샌드박스 격리 경계를 우회할 수 있는 취약점입니다. 공격자는 이를 통해 호스트의 Function 객체에 접근하여 샌드박스를 완전히 탈출하고 호스트 시스템에서 임의의 코드를 실행할 수 있습니다.
💡 쉬운 설명
vm2는 위험한 코드를 안전하게 격리시키는 도구인데, 그 격리 벽에 구멍이 있어서 악의적인 코드가 빠져나갈 수 있다는 뜻입니다. 이 구멍을 통해 공격자는 서버의 모든 권한으로 원하는 명령어를 실행할 수 있습니다.
🇺🇸 원문 (English)
vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.2, the new method neutralizeArraySpeciesBatch works with objects from the other side but can call into this side via getter on the array prototype exposing objects of the wrong side into the sandbox. This can be used to get host objects and get the host Function object. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system. This vulnerability is fixed in 3.11.2.
📍 영향받는 시스템
vm2 버전 3.11.2 미만의 모든 버전 (Node.js 환경)
⚔️ 공격 벡터
악의적인 JavaScript 코드를 vm2 환경에 전달하여 배열 프로토타입 getter를 악용해 호스트 Function 객체 접근 및 샌드박스 탈출
🛡️ 대응 방법
npm update vm2 명령으로 3.11.2 이상 버전으로 즉시 업그레이드
🔧 검증 코드
표시된 vm2 버전이 3.11.2 이상이면 안전하고, 3.11.2 미만이면 취약함. 버전이 표시되지 않으면 vm2가 설치되지 않은 상태.
npm ls vm2 --depth=0 2>/dev/null | grep vm2 | grep -oP 'vm2@\K[0-9.]+'