Miggo Logo

CVE-2023-32314:
vm2 Sandbox Escape vulnerability

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.98481%
Published
5/15/2023
Updated
11/5/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
vm2npm< 3.9.183.9.18

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from how Proxy handler arguments were handled pre-patch. The PoC demonstrates that when a Proxy's apply trap is invoked, V8 passes arguments as a host-created array (argArray). In vulnerable versions, vm2 failed to properly wrap these host-originating arguments arrays, allowing access to the host's Function constructor through arguments.constructor.constructor. The commit adds wrapping logic (wrapProxyHandler, makeSafeHandlerArgs) to sanitize handler arguments, confirming the vulnerability existed in the original Proxy handling implementation.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

* s*n**ox *s**p* vuln*r**ility *xists in vm* *or v*rsions up to *.*.**. It **us*s *n un*xp**t** *r**tion o* * *ost o*j**t **s** on t** sp**i*i**tion o* `Proxy`. ### Imp**t * t*r**t **tor **n *yp*ss t** s*n**ox prot**tions to **in r*mot* *o** *x**uti

Reasoning

T** vuln*r**ility st*ms *rom *ow Proxy **n*l*r *r*um*nts w*r* **n*l** pr*-p*t**. T** Po* **monstr*t*s t**t w**n * Proxy's *pply tr*p is invok**, V* p*ss*s *r*um*nts *s * *ost-*r**t** *rr*y (*r**rr*y). In vuln*r**l* v*rsions, `vm*` **il** to prop*rly