CVE-2023-32313 Inspect method manipulation in vm2
Attackers can manipulate the inspect method in vm2 to modify console.log options, potentially leading to code execution within the sandbox.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-32313?
CVE-2023-32313 is a medium-severity code injection vulnerability in patriksimek vm2, published on 15 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
vm2 is a sandbox that can run untrusted code with Node's built-in modules. In versions 3.9.17 and lower of vm2 it was possible to get a read-write reference to the node `inspect` method and edit options for `console.log`. As a result a threat actor can edit options for the `console.log` command. This vulnerability was patched in the release of version `3.9.18` of `vm2`. Users are advised to upgrade. Users unable to upgrade may make the `inspect` method readonly with `vm.readonly(inspect)` after creating a vm.
Weakness: CWE-74
Which versions are affected by CVE-2023-32313?
2 open source packages ship an affected version, including vm2. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
vm2 npm | All versions | 3.9.18 |
vm2 npm | All versions | 3.9.18 |
Products include Vm2 Project Vm2.
How do I fix CVE-2023-32313?
Upgrade vm2 to 3.9.18 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2023-32313 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-32313 exists.
Other vulnerabilities in patriksimek vm2
Sources
Also known as GHSA-p5gc-c584-jj6v, ROOT-APP-NPM-CVE-2023-32313.