Widen NESTING_OVERRIDE guard to all input shapes
fix(GHSA-m4wx-m65x-ghrr): widen NESTING_OVERRIDE guard to all input shapes
Widen NESTING_OVERRIDE guard to all input shapes86ab81-fix-widen-nesting-override-guard-to-all-cve-2026-47137fixwiden nesting override guard input shapes
Committed by patriksimek
commit message
fix(GHSA-m4wx-m65x-ghrr): widen NESTING_OVERRIDE guard to all input shapes
The prior `nesting === true && !requireOpts` check left two bypass classes
that recreate the same NESTING_OVERRIDE-only resolver as the original PoC:
truthy non-`true` `nesting` (the override gate is `nesting && NESTING_OVERRIDE`,
not strict `=== true`) and truthy non-object `require` (primitives/functions
destructure to all-undefined inside `makeResolverFromLegacyOptions`).
Replace with a structural guard mirroring the resolver's actual reachability:
`nesting` truthy and `requireOpts` must be a non-null object or `Resolver`.
Every shape that produces a NESTING_OVERRIDE-only resolver now throws at
construction. The explicit-`require`-config escape hatch is preserved.
See ATTACKS.md Category 25 and test/ghsa/GHSA-m4wx-m65x-ghrr/.Editor assessment
This commit patches CVE-2026-47137. It is a compact follow-up: the earlier rule only caught literal false, so truthy non-true nesting and truthy non-object require still built a NESTING_OVERRIDE-only resolver; the new guard requires nesting to be truthy and requireOpts to be a non-null object or Resolver. It notes the escape hatch survives and points at ATTACKS.md Category 25 and the test directory for the PoC, which is enough for a patch on top of an already-explained fix. No footer ties the advisory formally, and the GHSA ID again occupies the scope slot rather than naming nodevm. Acceptable, if slightly thin on consequence.