CVE-2022-36067: vm2 vulnerable to Sandbox Escape resulting in Remote Code Execution on host
10
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.99381%
CWE
Published
9/28/2022
Updated
1/30/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
vm2 | npm | < 3.9.11 | 3.9.11 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper isolation of the Error
object in the sandbox environment. The patch in commit d9a7f3c adds 'Error: { value: LocalError }' to the global object descriptors in setup-sandbox.js
(line 71). This indicates the original vulnerability allowed access to the host's Error
prototype through the sandbox's global object. Attackers could overwrite Error.prepareStackTrace
to intercept stack traces and access host environment objects via getThis()
in call sites, ultimately escaping the sandbox. The test case added in the commit demonstrates this attack vector by manipulating global.Error
to access process.mainModule
.