Remove WebAssembly streaming-compile APIs from the sandbox

fix(GHSA-wjwh-qqvp-g4p4): remove WebAssembly streaming-compile APIs from the sandbox
Remove WebAssembly streaming-compile APIs from the sandboxcb8559-fix-remove-webassembly-streaming-compile-apis-from-the-cve-2026-92956fixremove webassembly streaming compile apis sandbox

Committed by patriksimek-bot

commit message
fix(GHSA-wjwh-qqvp-g4p4): remove WebAssembly streaming-compile APIs from the sandbox

Absorbs the duplicate GHSA-m3pp-qgq7-gwm6 (Promise species).
 
Root cause: on Node 26 `WebAssembly.compileStreaming()` and
`WebAssembly.instantiateStreaming()` return a Promise whose [[Prototype]] chain
reaches the HOST realm's `Promise.prototype`. The sandbox-side
`globalPromise.prototype.then`/`catch` overrides and `resetPromiseSpecies` are
installed on the sandbox prototype, so neither runs on such a promise, and the
bridge never proxies it. Sandbox code could therefore install an attacker
`constructor[Symbol.species]` directly on the promise and call `p.finally()`;
V8's SpeciesConstructor path handed the attacker the result capability's raw
reject closure and delivered the host-realm `TypeError` from the rejected
streaming compile straight into sandbox code, from where
`e.constructor.constructor("return globalThis")()` evaluates in the host realm
and yields host `process`. Reachable from a default `new VM()` with no host
objects exposed.
 
This is the same unsafe object shape as the JSPI path closed by
GHSA-6j2x-vhqr-qr7q, reached through a different source, so it is an incomplete
fix for that class rather than a new one.
 
Fix chokepoint: `lib/setup-sandbox.js` extends the existing WebAssembly
hardening block to delete `compileStreaming` and `instantiateStreaming`
alongside `promising` and `Suspending`, restoring the Defense Invariant that
every sandbox-visible Promise is either sandbox-realm or bridge-proxied. Both
deletions are `typeof`-guarded, so the path is a no-op where the APIs do not
exist. The streaming APIs consume a `Response`/streaming source the sandbox
cannot obtain, so removal has no legitimate-use cost; the non-streaming
`WebAssembly.compile` / `instantiate` / `validate` / `new WebAssembly.Module`
remain available and unchanged.
 
The block's header comment previously asserted JSPI was the only path producing
a cross-realm-prototype Promise. That claim is now false and has been corrected
in place, together with an explicit statement of the block's scope: it removes
sources of such Promises and deliberately does not harden the species channel
itself.
 
Tests: test/ghsa/GHSA-wjwh-qqvp-g4p4/repro.js — asserts both streaming APIs are
absent from a default sandbox while `WebAssembly.compile` survives, and drives
the species+`finally` PoC through both entry points against a frozen host
callback oracle. The escape cases gate on host availability of the streaming
APIs; the absence assertion is ungated.
 
docs/ATTACKS.md: Category 33 (WebAssembly JSPI Cross-Realm Promise) extended
rather than renumbered — same object shape, same mitigation block. The
"Considered Attack Surfaces" entry that cleared the streaming family is marked
corrected. New "How The Bridge Defends" row added.
 
Version unchanged (3.11.6); the release bump is the maintainer's release pass.

Editor assessment

This commit patches CVE-2026-92956. The body explains the cross-realm promise from WebAssembly.compileStreaming, the species/finally capability leak that yielded host process access, and the removal of both streaming APIs while keeping non-streaming compile and instantiate. It also corrects the earlier claim that JSPI was the only such path. Clear and complete; the GHSA-id scope is the only formal violation, capping the score at 3. The scope of the removal - only the streaming entry points, not the whole WebAssembly API - is the reassuring detail a reader needs.

Browse categories

More fix examples · Back to search