CVE-2023-30547 Sandbox Escape in vm2

Critical 9.8 Published Updated

Attackers can escape the vm2 sandbox and execute arbitrary code on the host system by exploiting an exception sanitization flaw.

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-30547?

CVE-2023-30547 is a critical code injection vulnerability in patriksimek vm2, published on 17 Apr 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 whitelisted Node's built-in modules. There exists a vulnerability in exception sanitization of vm2 for versions up to 3.9.16, allowing attackers to raise an unsanitized host exception inside `handleException()` which can be used to escape the sandbox and run arbitrary code in host context. This vulnerability was patched in the release of version `3.9.17` of `vm2`. There are no known workarounds for this vulnerability. Users are advised to upgrade.

Weakness: CWE-74

Which versions are affected by CVE-2023-30547?

2 open source packages ship an affected version, including vm2. It affects 1 product.

PackageAffectedFixed in
vm2 npmAll versions3.9.17
vm2 npmAll versions3.9.17

Products include Vm2 Project Vm2.

How do I fix CVE-2023-30547?

Upgrade vm2 to 3.9.17 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2023-30547 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-30547 exists.

Public exploit code: 5 proofs of concept on GitHub.

Sources

Also known as GHSA-ch3r-j5x3-6q2m, ROOT-APP-NPM-CVE-2023-30547.

Is CVE-2023-30547 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free