Where: packages/safe-bash/src/commands/predicates.ts — the recursive test/[ expression parser has no depth cap; argv is bounded only by the 64 KB cap / maxExpansionFields.
PoC:
test \( \( … ×3000 a \) \) … ×3000; echo rc=$?
Measured: script exit 0, rc=1, stderr test: Maximum call stack size exceeded, 31 ms, no crash.
Impact: (e) — error-contract wart only: a raw RangeError is caught and surfaced as a test failure rather than a classified diagnostic. Analogous to closed #583 (arithmetic).
Fix: depth counter (e.g. 256) → test: too many arguments / syntax error before recursion.
Found in security audit v3 (2026-09-07).
Where:
packages/safe-bash/src/commands/predicates.ts— the recursivetest/[expression parser has no depth cap; argv is bounded only by the 64 KB cap /maxExpansionFields.PoC:
Measured: script exit 0,
rc=1, stderrtest: Maximum call stack size exceeded, 31 ms, no crash.Impact: (e) — error-contract wart only: a raw
RangeErroris caught and surfaced as atestfailure rather than a classified diagnostic. Analogous to closed #583 (arithmetic).Fix: depth counter (e.g. 256) →
test: too many arguments/ syntax error before recursion.Found in security audit v3 (2026-09-07).