Skip to main content

CVE-2026-93603: Improper Control of Generation of Code ('Code Injection') in patriksimek vm2

0
Critical
VulnerabilityCVE-2026-93603cvecve-2026-93603
Published: 09/18/2026 (09/18/2026, 13:20:12 UTC)
Source: CVE Database V5
Vendor/Project: patriksimek
Product: vm2

Description

vm2 through 3.12.0 (fixed in 3.12.1) does not correctly handle a nullish `this` receiver in the apply trap of its bridge (lib/bridge.js): when sandboxed code calls a host-provided non-strict (sloppy-mode) function without a receiver — e.g. `fn()`, a detached method, `fn.call()`, `fn.apply(undefined)`, `Reflect.apply(fn, undefined, [])`, or `fn.bind()()` — the undefined receiver is passed straight through to the host call, and V8 substitutes the host realm's global object for `this`. vm2 then wraps and returns that object to the sandbox, giving sandboxed script a live proxy of the host global. This allows a complete sandbox escape: untrusted script can reach `process` and execute arbitrary code/commands on the host (for example via `process.getBuiltinModule('child_process').execSync`). Exploitation requires that the embedding application expose at least one non-strict host function to the sandbox; strict-mode and ES module host functions are not affected.

CVSS v4.0

Score 10.0critical

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
High
Subsq. Integrity
High
Subsq. Availability
High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

Affected software

patriksimek

vm2

Affected versions
>=0 <3.12.1
vm2
pkg:npm/vm2
Affected versions
>=0 <3.12.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/18/2026, 13:46:53 UTC

Technical Analysis

The vm2 library versions prior to 3.12.1 do not correctly handle calls to host-provided non-strict (sloppy-mode) functions without a receiver within the sandbox. When such functions are invoked with an undefined or null 'this' receiver, V8 substitutes the host realm's global object as 'this'. vm2 then wraps and returns this host global object to the sandbox, effectively granting sandboxed code a live proxy to the host environment. This allows untrusted sandboxed scripts to access sensitive host objects like 'process' and execute arbitrary commands, for example via 'process.getBuiltinModule('child_process').execSync'. Strict-mode and ES module host functions are not vulnerable. Exploitation requires the embedding application to expose at least one non-strict host function to the sandbox.

Potential Impact

Successful exploitation results in a complete sandbox escape, allowing untrusted code running inside the vm2 sandbox to execute arbitrary code and commands on the host system. This compromises the security boundary intended by the sandbox, potentially leading to full system compromise.

Mitigation Recommendations

A fix is available in vm2 version 3.12.1. Users should upgrade to vm2 3.12.1 or later to remediate this vulnerability. Until upgraded, avoid exposing non-strict (sloppy-mode) host functions to the sandbox. No other mitigations are specified.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
VulnCheck
Date Reserved
2026-09-18T11:00:32.756Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6aad3d5d55bf5e2cf5100796

Added to database: 09/18/2026, 13:32:13 UTC

Last enriched: 09/18/2026, 13:46:53 UTC

Last updated: 09/18/2026, 22:12:52 UTC

Views: 9

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses