Advisory

GHSA-wjwh-qqvp-g4p4

Details, part 2 of 2. The advisory

Details

The PoC uses a default new VM() with no privileged objects exposed; the marker file is only a harmless proof that the sandboxed code recovered host-side capability.

The PoC performs four control checks first:

process access: blocked
require access: blocked
constructor process access: blocked
constructor require(fs): blocked

Then it runs the exploit path and verifies that the recovered process is the actual host process by comparing the recovered pid with the parent process pid.

Expected vulnerable output on Node 26.2.0:

[control] process access             : blocked
[control] require access             : blocked
[control] constructor process access : blocked
[control] constructor require(fs)    : blocked
[exploit] host process reached       : yes
[exploit] host pid                   : <pid>
[exploit] host pid matches parent pid: yes
[exploit] host execPath              : <node executable>
[exploit] host version               : v26.2.0
[exploit] marker file                : created
[result] VULNERABLE

Expected output on Node 24.15.0:

[control] process access             : blocked
[control] require access             : blocked
[control] constructor process access : blocked
[control] constructor require(fs)    : blocked
[exploit] host process reached       : no
[exploit] marker file                : not created
[result] not reproduced on this Node version

The marker file contains only a proof string, the Node version, the pid, and a timestamp.
As a sanity check, I reproduced the Node 26 result from a fresh public clone at commit 7a1f5100b96f48d34e0fe104ab37c0acc5944f92; lib/ was unmodified, and only the PoC file was copied in.

Suggested fix

The minimal fix is to remove the remaining streaming WebAssembly APIs from the sandbox in the same WebAssembly hardening block that already removes the JSPI APIs.

if (typeof WebAssembly.compileStreaming !== 'undefined') {
    localReflectDeleteProperty(WebAssembly, 'compileStreaming');
}
if (typeof WebAssembly.instantiateStreaming !== 'undefined') {
    localReflectDeleteProperty(WebAssembly, 'instantiateStreaming');
}

This patch works against the PoC on Node 26.2.0 and Node 24.15.0. With the patch applied, the streaming APIs are unavailable inside the sandbox, the PoC does not recover the host process, and the marker file is not written.

Two additional defense-in-depth change recommendations:

  1. Add a Promise.prototype.finally hardening path for consistency with the existing Promise hardening. This is not sufficient by itself for this bug, but it removes a known species-sensitive gap for sandbox-realm Promises.
  2. Add a regression/invariant test that checks sandbox-reachable Promise-producing intrinsics do not expose raw host-Promise paths outside the bridge.

The non-streaming WebAssembly Promise APIs was also checked. The end-to-end escape reproduced through compileStreaming and instantiateStreaming, but not through compile or instantiate in my tests. The minimal patch therefore removes the two confirmed exploitable streaming APIs, while the broader invariant remains that sandbox code should not receive raw host-Promise paths.

Regression tests

The regression test should cover both the direct fix and the end-to-end invariant:

  1. WebAssembly.compileStreaming is unavailable or safely wrapped inside new VM().
  2. WebAssembly.instantiateStreaming is unavailable or safely wrapped inside new VM().
  3. The PoC cannot recover host process on Node 26.
  4. Direct access to process, require, and constructor-based process access remains blocked.
  5. The finally + species primitive does not reach host process through any WebAssembly Promise-returning source.

Sources & licences