Skip to content

fix(contrib): bound nesting, sizes and REPL input across contrib modules - #891

Merged
ewhauser merged 8 commits into
mainfrom
claude/fervent-archimedes-2d0c56
Oct 20, 2026
Merged

ewhauser merged 8 commits into
mainfrom
claude/fervent-archimedes-2d0c56

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Fixes the second contrib review findings:

  • python: reject source nested deeper than 200 brackets before monty.New (5,000 parens segfaulted the host); char-device stdin (/dev/zero) no longer starts the REPL; REPL lines capped at 1 MiB with a ctx check per read.
  • awk: reject program text nested deeper than 1000 brackets before goawk parses it; system() gets a separate 5-minute allowance when the request has no deadline.
  • jq: lexer and compiler depth limits tied to gojq.MaxDepth (nested parens and long +/|/suffix chains); setpath checks MaxArrayLength before allocating; --stream stops past 8Mi emitted path elements.
  • yq: array traversal indices are checked against the eval budget before yqlib pads arrays ([1] | .[100000000] = 1).
  • nodejs: interruptible, capped Array.prototype.join; JSON.stringify runs with a guarding replacer (array replacers emulated); JSON.parse, eval, Function and module/inline sources reject nesting over 10000. Note: wrapping eval makes every eval call indirect. unlinkSync/rmdirSync check file type; stat().mode uses POSIX S_IF bits.
  • codingtools: Edit caps file, oldText and newText at 16 MiB.

Array(n).fill stays capped by the existing 16Mi receiver-length limit; a following join is now bounded.

SPEC.md updated in the contrib limits section. Regression tests added per fix; go test ./... and lint pass in each touched module.

@ewhauser
ewhauser enabled auto-merge (squash) October 20, 2026 15:04
@ewhauser
ewhauser merged commit 0f37e75 into main Oct 20, 2026
17 checks passed
@ewhauser
ewhauser deleted the claude/fervent-archimedes-2d0c56 branch October 20, 2026 15:12
@ewhauser ewhauser mentioned this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant