🇰🇷 한글 설명
vm2 3.11.6 버전에서 샌드박스 탈출을 통해 호스트 Node.js 프로세스에서 원격 코드 실행이 가능한 취약점이 발견되었습니다. Function.prototype.call 또는 .apply를 이용한 간접 호출 방식을 사용할 경우, Promise 거부 핸들러의 검증 로직을 우회하여 호스트 객체에 대한 권한을 획득할 수 있습니다.
💡 쉬운 설명
격리된 환경(샌드박스)에서 실행되는 코드가 보안 검사를 우회하여 컴퓨터 전체를 제어할 수 있는 심각한 결함입니다. 공격자가 특수한 방식으로 함수를 호출하면 보안 벽을 뚫고 시스템 명령을 실행할 수 있습니다.
🇺🇸 원문 (English)
vm2 3.11.6 is vulnerable to a sandbox escape leading to remote code execution in the host Node.js process. The fix for GHSA-m283-3h24-438v is incomplete: the bridge gate at lib/bridge.js:1624 identity-checks only the direct call target when deciding whether to rebuild/sanitise a rejected host Promise value. Registering the rejection handler through Function.prototype.call or .apply indirection (e.g., p.then.call(p, undefined, cb)) makes the intercepted target host Function.prototype.call, so the sanitiser never runs and the raw host error reaches sandbox code with its own properties intact. If an embedder exposes a host-realm Promise to the sandbox (an async host function bridged via the sandbox option, or a NodeVM external module's async method) and that Promise rejects with an Error carrying a non-primitive own property referencing a host object (for example err.detail = process), untrusted code in the sandbox obtains a fully functional proxy to that host object and can execute arbitrary commands with the privileges of the host process (e.g., e.detail.mainModule.require('child_process').execSync(...)). The direct p.then(undefined, cb), bind, and Reflect.apply forms are correctly sanitised. Fixed in vm2 3.11.7.
📍 영향받는 시스템
vm2 version 3.11.6 and below
⚔️ 공격 벡터
Function.prototype.call 또는 .apply를 이용한 Promise 거부 핸들러 우회 및 호스트 객체 참조 탈취
🛡️ 대응 방법
vm2 버전을 3.11.7 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 결과에서 vm2의 버전이 3.11.7 미만인지 확인하십시오.