Kritisch

vm2 exposes host HTTPS credentials and TLS traffic through globalAgent

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

Summary

vm2 3.11.6 exposes the host process's real https.globalAgent when a NodeVM is explicitly allowed to require https. The module is wrapped as read-only, but calls to methods on the shared agent still mutate the host object. Sandbox code can register a free listener and receive host request options and the host TLS socket whenever an unrelated host HTTPS request releases a pooled connection.

In a contained test, sandbox code allowed only the https builtin:

  • read the host request's bearer token from the agent event;
  • attached a data listener to the released host TLS socket and read the next host response body in plaintext;
  • learned the private service host and port;
  • sent an attacker-chosen authenticated POST using the stolen host token; and
  • received confirmation that the service accepted the action.

The host application never passed its credentials, request, response, socket, or destination into the sandbox. They crossed the boundary solely because vm2 exposes the process-global HTTPS agent instead of a sandbox-local network module instance.

Details

The vulnerable boundary is the default builtin loader in lib/builtin.js:

js
builtins.set(key, special ? special : vm => vm.readonly(hostRequire(key)));

The wrapper recursively exposes properties of the actual host module. For ordinary constants, a read-only proxy can be sufficient. It is not sufficient for process-global EventEmitter objects whose methods mutate internal state.

https.globalAgent is the default agent used by host HTTPS requests when the host does not supply a separate agent. The agent is shared by the entire Node.js thread. Its free event supplies both:

  • the TLSSocket that has just completed a request and is available for reuse; and
  • the connection/request options used to place that socket in the pool.

The following sandbox code registers directly on that host singleton:

js
const https = require('https');

https.globalAgent.on('free', (socket, options) => {
  const token = options.headers.Authorization;
  const destination = {host: options.host, port: options.port};

  socket.on('data', chunk => {
    capturedHostTraffic += chunk.toString('utf8');
  });

  const req = https.request({
    hostname: destination.host,
    port: destination.port,
    path: '/sandbox-action',
    method: 'POST',
    headers: {Authorization: token},
    agent: false,
  });
  req.end(attackerChosenBody);
});

Calling .on() is not a property assignment, so the read-only handler forwards it to the real host Agent. When the host later emits free, vm2 invokes the sandbox callback with bridged views of the live options and socket. Reading nested header values succeeds. Calling socket.on() also forwards to the real socket, letting the sandbox observe the decrypted bytes emitted during a later request on that connection.

The complete exploit flow is:

attacker-controlled NodeVM program with https allowed
  -> subscribe to the real host https.globalAgent
  -> unrelated host HTTPS request completes
  -> shared Agent emits live socket and request options into sandbox callback
  -> sandbox reads host Authorization token and private destination
  -> sandbox attaches to the released TLSSocket
  -> next host response is exposed in plaintext
  -> sandbox reuses stolen token for attacker-chosen authenticated request

This is a distinct residual of the same process-wide observability class for which other host builtins are rejected. The current dangerous-builtin filter does not classify https as process-global because the module also has legitimate sandbox network APIs. A safe implementation must avoid exposing the host singleton, such as by providing a sandbox-local module facade and sandbox-local Agent.

PoC

The attached PoC uses only a temporary certificate and a loopback HTTPS server.

  1. Install Node.js and OpenSSL.

  2. In the attached poc directory, run:

    bash
    npm install --ignore-scripts
    node poc.js
  3. A vulnerable result includes all of the following markers:

    • leaked host token: Bearer VM2_HOST_AUTHORIZATION_f7952a;
    • captured host response: VM2_PRIVATE_HOST_RESPONSE_47b2d6;
    • attacker-chosen authenticated action: VM2_SANDBOX_ACTION_8d14c3;
    • server decision: ACTION_ACCEPTED.

The first host request carries the token. After it completes, the sandbox callback receives the token and independently sends the action request. The second host request reuses the pooled TLS connection; the sandbox's listener reads that response from the live socket. The PoC fails unless both confidentiality and integrity effects occur.

Impact

This is cross-boundary exposure and misuse of a process-global authenticated network resource.

An attacker who can submit code to a NodeVM with https allowed can, when the host uses the default HTTPS agent:

  • steal Authorization, Cookie, API-key, proxy-authorization, and other sensitive request options;
  • discover private service hostnames and ports used only by host code;
  • read plaintext response headers and bodies on reused TLS connections;
  • steal client-certificate, private-key, passphrase, CA, or session-related options when the host supplies them through request options;
  • perform authenticated actions using stolen bearer credentials;
  • write to or destroy live host sockets, disrupting or corrupting unrelated traffic;
  • cross tenant boundaries when multiple sandboxes and host workloads share one process.

The sandbox already has the intentional ability to make its own HTTPS requests. It does not intentionally have authority to observe or reuse the host application's credentials and connections. A host that always supplies a separate private Agent for every sensitive request avoids this specific singleton, but that is not the default behavior.

Betroffene Software

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

PlattformPaketAnfällige VersionenBehoben in
npm-Paket vm2 >= 3.11.3, < 3.11.7 3.11.7

Verweise

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

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-h85j-hv3c-qfgq - 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. vm2 exposes host HTTPS credentials and TLS traffic through globalAgent dieser Eintrag
    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. 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
  36. Kritisch · 9.8 CVE-2022-25893 < 3.9.10 3.9.10
  37. Kritisch · 10.0 CVE-2022-36067 < 3.9.11 3.9.11
  38. Hoch · 8.3 CVE-2019-10761 < 3.6.11 3.6.11
  39. Kritisch · 9.8 CVE-2021-23555 < 3.9.6 3.9.6
  40. Kritisch · 9.8 CVE-2021-23449 < 3.9.4 3.9.4

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.