# vm2 allowAsync bypass through Promise thenable assimilation

Source: https://junglewise.ai/threats/duplicate-advisory-allowasync-false-can-be-bypassed-through-promise-9a81cfad  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-17. Updated: 2026-10-05  
License: CC BY 4.0 with a link back

Severity: high · CVSS 7.1 · Published 2026-09-17

vm2 is a JavaScript sandbox that executes untrusted code in isolation. When configured with allowAsync set to false, it is supposed to prevent asynchronous code execution. An attacker can bypass this restriction using Promise methods to invoke code after the sandbox exits and outside any timeout limit, allowing malicious scripts to continue executing after the host application believes execution is complete.

Technologies: [vm2 (npm)](https://junglewise.ai/threats/technologies/vm2), [Vm2](https://junglewise.ai/threats/technologies/x-vm2). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** High severity, with a CVSS score of 7.1, published 17 September 2026.

**Which products and versions are affected?** vm2 (npm) <= 3.11.7; Vm2 <= 3.11.7.

**Is there a fix for This vulnerability?** Yes: fixed in 3.11.8. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run vm2 (npm) or Vm2 at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in 3.11.8

## Technical details

The vulnerability exists in how vm2 enforces the allowAsync: false option. While the implementation blocks direct calls to Promise.prototype.then through a patched handler, it leaves Promise static methods (resolve, all, race, any, allSettled) exposed. These methods still accept attacker-supplied thenable objects and invoke their then methods via microtasks after VM.run() returns, bypassing the async restriction enforcement and executing outside configured timeouts.

## Affected products

- vm2 <= 3.11.7

## Timeline

- 2026-08-27: disclosed
- 2026-08-27: patched: GHSA-f8gf-w286-fmq2 (primary advisory)
- 2026-09-17: advisory
- 2026-10-05: other: This advisory (GHSA-9538-79j2-h62h) withdrawn as duplicate

## References

- [https://github.com/patriksimek/vm2/security/advisories/GHSA-f8gf-w286-fmq2](https://github.com/patriksimek/vm2/security/advisories/GHSA-f8gf-w286-fmq2)

## Related threats

- [vm2 NodeVM path bypass in custom resolution](https://junglewise.ai/threats/duplicate-advisory-vm2-nodevm-custom-resolution-bypasses-external-path-5d3a7272)
- [vm2 NodeVM zlib buffer pool information disclosure](https://junglewise.ai/threats/duplicate-advisory-vm2-nodevm-zlib-buffers-expose-pooled-host-memory-6007c734)
- [vm2 host Promise rejection denial of service in construct trap](https://junglewise.ai/threats/duplicate-advisory-vm2-host-promise-rejection-from-an-exposed-f7aba6ba)
- [vm2 sandbox escape via Buffer backing-store ownership bypass](https://junglewise.ai/threats/cve-2026-100723-vm2-before-3-12-2-does-not-apply-its-buffer-backing-store)
- [vm2 unhandled Promise rejection in construct trap](https://junglewise.ai/threats/cve-2026-100722-vm2-before-3-12-2-does-not-apply-host-side-promise-rejection)
