Protect host binary-data & iterator intrinsic prototypes

fix(GHSA-3vgf-8m4q-q4qr): protect host binary-data & iterator intrinsic prototypes
Protect host binary-data & iterator intrinsic prototypes92a10f-fix-protect-host-binary-data-iterator-intrinsic-prototypes-cve-2026-92953fixprotect host binary data iterator intrinsic

Committed by patriksimek-bot

commit message
fix(GHSA-3vgf-8m4q-q4qr): protect host binary-data & iterator intrinsic prototypes

The default VM's protected-host-object inventory was populated only from
`globalsList`, which listed `Number`/`String`/`Boolean`/`Date`/`RegExp`/`Map`/
`WeakMap`/`Set`/`WeakSet`/`Promise`/`Function` (plus `Object`/`Array`/errors).
It omitted the entire binary-data family (`ArrayBuffer`, `SharedArrayBuffer`,
`DataView`, every `TypedArray`, the abstract `%TypedArray%.prototype`) and the
iterator family (`ArrayIterator.prototype`, the String/Map/Set/RegExpString
iterator prototypes, and the shared `%IteratorPrototype%`). Because `Buffer`
extends `Uint8Array`, the Category 20 prototype-walk from a host `Buffer`
reached those unprotected host prototypes, and the bridge write traps forwarded
a sandbox `Reflect.defineProperty` straight onto the raw host intrinsic —
polluting every host-realm typed array and iterator globally (overwriting
`ArrayIterator.prototype.next` corrupts all host iteration).
 
`lib/bridge.js` now lists the named binary-data globals in `globalsList` and
resolves the abstract, unnamed intrinsics (`%TypedArray%`, `%IteratorPrototype%`
and the concrete iterator prototypes) structurally into `thisGlobalPrototypes`
(mirroring the AsyncFunction/GeneratorFunction handling). All flow into
`protectedHostObjects`, the proto-mapping table, and the GHSA-47x8 identity map,
so the `set`/`defineProperty` write traps refuse sandbox writes to them exactly
as for `Array.prototype`/`Object.prototype`. Restores the Category 20 protected-
inventory invariant for the binary-data and iterator intrinsic families.
 
Also closes GHSA-59g5-pmg6-5gr4 (iterator-intrinsic variant — same
incomplete-inventory root cause, same fix).
 
Tests: test/ghsa/GHSA-3vgf-8m4q-q4qr/repro.js (host-side pollution oracle for
Uint8Array/%TypedArray%/ArrayBuffer/DataView/SharedArrayBuffer and the iterator
prototypes, plus a legitimate-use regression case). docs/ATTACKS.md Category 20
extended with a binary-data & iterator augmentation note and a "How The Bridge
Defends" row. No version bump.
 
Co-Authored-By: Claude Opus 4.8 <[email protected]>

Editor assessment

This commit patches CVE-2026-92953. The body is precise: the protected-host-object inventory omitted the binary-data and iterator intrinsics, so a prototype walk from a host Buffer reached them, and the fix resolves the named globals plus the abstract %TypedArray% and %IteratorPrototype% into protectedHostObjects. The explanation is tested and complete. The GHSA-id scope is the one formal flaw, and under CCv1 scope semantics it caps the score at 3. The structural resolution of abstract intrinsics is technically the hardest part; a note on why names alone were insufficient would help.

Browse categories

More fix examples · Back to search