Block Array species self-return sandbox escape
Committed by patriksimek
fix(GHSA-grj5-jjm8-h35p): block Array species self-return sandbox escape
V8's ArraySpeciesCreate reads `this.constructor[Symbol.species]` directly
on raw objects, bypassing the bridge proxy. Two-layer defense in
lib/bridge.js: (1) the proxy `get` trap for `constructor` on host arrays
returns a cached Array reference captured at module load
(prototype-pollution-proof); (2) the `apply`/`construct` traps neutralise
every host array reachable as context or argument by shadowing
`constructor = undefined` before the host call and restoring in `finally`.
Non-configurable or non-extensible arrays with attacker state are rejected
with VMError. See test/ghsa/GHSA-grj5-jjm8-h35p/ for repros.Editor assessment
This commit patches CVE-2026-24118. The explanation is strong: it documents that V8's ArraySpeciesCreate reads Symbol.species directly on raw objects, bypassing the bridge proxy, and then enumerates the two-layer defense—returning a cached Array reference from the get trap and shadowing constructor around host calls, restoring in finally. It names the intermediate rejection (VMError for non-configurable arrays) and points at the repro directory. What holds it back is the header: the GHSA identifier occupies the scope slot where a module name like bridge belongs, and the subject trails into a 'sandbox escape' description that would read better as the body's opening. Acceptable, though the prose deserves a cleaner frame.