Add the missing regression tests

test(GHSA-qcp4-v2jj-fjx8): add the missing regression tests
Add the missing regression testsb8ebb4-test-add-the-missing-regression-tests-cve-2026-44006testadd missing regression tests ghsa qcp4

Committed by patriksimek

commit message
test(GHSA-qcp4-v2jj-fjx8): add the missing regression tests

Earlier cherry-pick of the fix only carried `lib/bridge.js`; the
regression tests were never landed on this branch (empty
`test/ghsa/GHSA-qcp4-v2jj-fjx8/` directory).
 
Adds three tests:
 1. Canonical PoC — `obj.slice + util.inspect(showProxy)` leak vector,
    `handler.getPrototypeOf` walks host prototypes to extract the
    cross-realm `nodejs.util.inspect.custom` symbol. Runtime-gated on
    whether the leak vector still fires (Node ≤ 22 only; Node 23+
    closed it via tighter slice-arg validation).
 2. Forged-target variant — `handler.set` with `Buffer` as the target,
    same gate.
 3. Forged-receiver smoke — `Object.setPrototypeOf({}, BaseHandler.prototype)`
    must not reach trap behaviour. Always runs.

Editor assessment

This commit patches CVE-2026-44006. The body explains why the tests matter—an earlier cherry-pick carried only lib/bridge.js, leaving an empty test/ghsa directory—and then describes three distinct cases: the slice plus util.inspect leak vector, a forged-target variant, and an always-running forged-receiver smoke test, with the Node 22 version gate called out. That is unusually concrete for a test commit. The header, however, uses GHSA-qcp4-v2jj-fjx8 as its scope and a vague 'add the missing regression tests' description, so the subject says little until the body is read. Framing is weak; content is solid.

Browse categories

More test examples · Back to search