vm2 is an open source vm/sandbox for Node.js. From 3.9.6 to 3.10.5, vm2's bridge exposes mutable proxies for real host-realm intrinsic prototypes and then forwards sandbox writes into the underlying host objects with otherReflectSet() and otherReflectDefineProperty(), which lets attacker-controlled JavaScript running in a default VM or inherited NodeVM mutate shared host Object.prototype, Array.prototype, and Function.prototype from inside the sandbox This vulnerability is fixed in 3.11.0.
The vm2 bridge exposes modifiable proxies pointing to actual host environment prototypes inside the sandbox. When code in the sandbox performs a write operation on such a proxy, vm2 passes this operation directly to the host objects using internal otherReflectSet() and otherReflectDefineProperty() functions. As a result, an attacker can modify global JavaScript host prototypes from the default VM or inheriting NodeVM level, which constitutes a classic prototype pollution attack that breaks out of the sandbox boundaries.
An attacker can modify shared host prototypes (Object.prototype, Array.prototype, Function.prototype), which can lead to application malfunction, unintended code execution in the host context, and compromise of integrity and availability of the entire Node.js process.
vm2 should be updated to version 3.11.0, in which the vulnerability has been fixed. If immediate update is not possible, untrusted code execution within vm2 should be restricted or discontinued entirely until the patch is deployed.
vm2 in versions from 3.9.6 to 3.10.5 (inclusive) for Node.js
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:HVm2 Project Vm2
APPVm2 Project3.9.6 – 3.11.0 (bez)
Related vulnerabilities
vm2 (Node.js): ucieczka z sandbox przez BaseHandler.getPrototypeOf (RCE)
vm2 (Node.js): ucieczka z sandbox przez zagnieżdżony NodeVM (RCE)
Ucieczka z sandboxa w bibliotece vm2 dla Node.js (RCE)
vm2: ominięcie listy dozwolonych modułów i RCE przez builtin 'module'
Ucieczka z sandboxu vm2 poprzez getter na prototypie tablicy