Version 3.9.19 of the vm2 npm package represents a minor update over its predecessor, version 3.9.18, primarily focusing on internal improvements and potential bug fixes. Both versions share the same core functionality: providing a secure sandbox environment for executing untrusted JavaScript code within Node.js, relying on whitelisting to control access to built-in modules. Developers familiar with vm2 will find the upgrade straightforward, as core dependencies like acorn and acorn-walk for parsing and traversing JavaScript syntax remain consistent. Development dependencies used for testing and linting, such as eslint, eslint-config-integromat, and mocha, are also unchanged, indicating a focus on maintaining code quality throughout the releases.
The key differences lie in the distributed package data. While both versions maintain the same number of files (24) within the tarball, version 3.9.19 boasts a slightly smaller unpacked size (220922 bytes compared to 221272 bytes in 3.9.18). More importantly to end users is the release date with version 3.9.19 being released on '2023-05-16' and version 3.9.18 on '2023-05-15'. This suggests that version 3.9.19 includes recent refinements, possibly addressing edge cases or vulnerabilities discovered shortly after the previous release. For developers prioritizing stability and security in their sandboxing solutions, staying up-to-date with the latest minor versions like 3.9.19 is recommended, as they often incorporate crucial fixes despite the lack of significant feature additions. The MIT license ensures flexibility in integrating vm2 into various projects.
All the vulnerabilities related to the version 3.9.19 of the package
vm2 Sandbox Escape vulnerability
In vm2 for versions up to 3.9.19, Promise
handler sanitization can be bypassed, allowing attackers to escape the sandbox and run arbitrary code.
Remote Code Execution, assuming the attacker has arbitrary code execution primitive inside the context of vm2 sandbox.
None.
None.
PoC - https://gist.github.com/leesh3288/f693061e6523c97274ad5298eb2c74e9
If you have any questions or comments about this advisory:
Thanks to Xion (SeungHyun Lee) of KAIST Hacking Lab for disclosing this vulnerability.
vm2 Sandbox Escape vulnerability
In vm2 for versions up to 3.9.19, Node.js custom inspect function allows attackers to escape the sandbox and run arbitrary code.
Remote Code Execution, assuming the attacker has arbitrary code execution primitive inside the context of vm2 sandbox.
None.
None.
PoC is to be disclosed on or after the 5th of September.
While this advisory might look similar to CVE-2023-37466, it is a completely different way of escaping the sandbox.
If you have any questions or comments about this advisory:
Thanks to Xion (SeungHyun Lee) of KAIST Hacking Lab for disclosing this vulnerability.