Details
Suggested Fix
Before any host-builtin return value is exposed to the guest, apply depoolBuffer or an equivalent owned-copy wrapper to every returned Buffer. The delivered buffer should satisfy byteOffset === 0 and buffer.byteLength === length; intentionally supported ArrayBuffer sharing overloads should remain separately identified so they are not confused with host-created pooled buffers.
Add a regression test that allowlists zlib, calls deflateSync, asserts exact backing-store ownership, and verifies that a full-width view cannot read or change markers in unrelated host buffers. Retain the sandbox-local exact-size control so the regression test also detects a failure in its own oracle.
Affected Package/Versions
- Package:
vm2from npm. - Tested affected source revision:
91034466bfb7f56b95fd48083ec6ca36d058f164. - Package metadata at that revision: 3.11.8.
- Version scope: the report is limited to the exact tested source revision above; no broader release line or range is established here.
- Affected range: only the exact tested revision is asserted; no broader release range is established here.
Advisory History
The public GHSA-fcqc-726x-5wfc advisory documents shared small-buffer-pool exposure through sandbox-facing Buffer factories. The checked public fix is commit `4f2508abeb252aa86eb6761c78b3b000248fb089`, titled fix(GHSA-fcqc-726x-5wfc): isolate sandbox buffers from Node's shared pool; its change applies the backing-store ownership rule to those factories, not to the zlib host-builtin return path demonstrated here.
The exact GHSA-fcqc-726x-5wfc commit search also returned `5214b02ef13b82497fcb917b45320dfd014ffd09`, whose release message is only an automated advisory inventory and is not an independent report of this issue. The current repository search for `zlib Buffer pool` issues returned no independent match, and the corresponding `zlib Buffer pool` pull-request search also returned no independent match.
Prior submitted, ready-for-review, and completed-but-unsubmitted reports were checked; none covers this zlib host-builtin backing-store path. Its distinct fix surface is the zlib host-builtin return path and the missing backing-store ownership step, separate from sandbox-facing Buffer factories.
This finding is therefore distinct in fix surface: zlib is the producer, the generic host-builtin return path is the sink, and backing-store ownership is the missing correction. That surface is separate from Buffer-factory hardening, custom resolution, Promise/Reflect.apply handling, and process-global FIPS state.